/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.138.0
 *
 * Copyright 2011-2022 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/main/LICENSE.md for full licensing details.
 */

var Cesium=(()=>{var cRe=Object.create;var sD=Object.defineProperty;var lRe=Object.getOwnPropertyDescriptor;var dRe=Object.getOwnPropertyNames;var uRe=Object.getPrototypeOf,mRe=Object.prototype.hasOwnProperty;var aD=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var vu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hRe=(e,t)=>{for(var n in t)sD(e,n,{get:t[n],enumerable:!0})},gte=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of dRe(t))!mRe.call(e,o)&&o!==n&&sD(e,o,{get:()=>t[o],enumerable:!(i=lRe(t,o))||i.enumerable});return e};var y=(e,t,n)=>(n=e!=null?cRe(uRe(e)):{},gte(t||!e||!e.__esModule?sD(n,"default",{value:e,enumerable:!0}):n,e)),fRe=e=>gte(sD({},"__esModule",{value:!0}),e);var x=vu(()=>{globalThis.CESIUM_WORKERS=atob("[encoded data, 1224296 characters]")});var cD=vu((rFt,bte)=>{var sFt=y(x()),lA=function(e){e==null&&(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,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};lA.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};lA.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};lA.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];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[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};lA.prototype.random_int31=function(){return this.random_int()>>>1};lA.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};lA.prototype.random=function(){return this.random_int()*(1/4294967296)};lA.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};lA.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};bte.exports=lA});var Dte=vu((DT,vT)=>{var Y2t=y(x());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof DT=="object"&&DT&&!DT.nodeType&&DT,n=typeof vT=="object"&&vT&&!vT.nodeType&&vT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,d=38,u=700,h=72,p=128,g="-",f=/^xn--/,b=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=s-a,S=Math.floor,_=String.fromCharCode,R;function L(U){throw new RangeError(E[U])}function W(U,k){for(var P=U.length,O=[];P--;)O[P]=k(U[P]);return O}function B(U,k){var P=U.split("@"),O="";P.length>1&&(O=P[0]+"@",U=P[1]),U=U.replace(C,".");var H=U.split("."),ee=W(H,k).join(".");return O+ee}function Y(U){for(var k=[],P=0,O=U.length,H,ee;P<O;)H=U.charCodeAt(P++),H>=55296&&H<=56319&&P<O?(ee=U.charCodeAt(P++),(ee&64512)==56320?k.push(((H&1023)<<10)+(ee&1023)+65536):(k.push(H),P--)):k.push(H);return k}function N(U){return W(U,function(k){var P="";return k>65535&&(k-=65536,P+=_(k>>>10&1023|55296),k=56320|k&1023),P+=_(k),P}).join("")}function A(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:s}function I(U,k){return U+22+75*(U<26)-((k!=0)<<5)}function Z(U,k,P){var O=0;for(U=P?S(U/u):U>>1,U+=S(U/k);U>T*c>>1;O+=s)U=S(U/T);return S(O+(T+1)*U/(U+d))}function G(U){var k=[],P=U.length,O,H=0,ee=p,z=h,te,q,me,ye,oe,xe,Ee,Le,Se;for(te=U.lastIndexOf(g),te<0&&(te=0),q=0;q<te;++q)U.charCodeAt(q)>=128&&L("not-basic"),k.push(U.charCodeAt(q));for(me=te>0?te+1:0;me<P;){for(ye=H,oe=1,xe=s;me>=P&&L("invalid-input"),Ee=A(U.charCodeAt(me++)),(Ee>=s||Ee>S((r-H)/oe))&&L("overflow"),H+=Ee*oe,Le=xe<=z?a:xe>=z+c?c:xe-z,!(Ee<Le);xe+=s)Se=s-Le,oe>S(r/Se)&&L("overflow"),oe*=Se;O=k.length+1,z=Z(H-ye,O,ye==0),S(H/O)>r-ee&&L("overflow"),ee+=S(H/O),H%=O,k.splice(H++,0,ee)}return N(k)}function w(U){var k,P,O,H,ee,z,te,q,me,ye,oe,xe=[],Ee,Le,Se,Fe;for(U=Y(U),Ee=U.length,k=p,P=0,ee=h,z=0;z<Ee;++z)oe=U[z],oe<128&&xe.push(_(oe));for(O=H=xe.length,H&&xe.push(g);O<Ee;){for(te=r,z=0;z<Ee;++z)oe=U[z],oe>=k&&oe<te&&(te=oe);for(Le=O+1,te-k>S((r-P)/Le)&&L("overflow"),P+=(te-k)*Le,k=te,z=0;z<Ee;++z)if(oe=U[z],oe<k&&++P>r&&L("overflow"),oe==k){for(q=P,me=s;ye=me<=ee?a:me>=ee+c?c:me-ee,!(q<ye);me+=s)Fe=q-ye,Se=s-ye,xe.push(_(I(ye+Fe%Se,0))),q=S(Fe/Se);xe.push(_(I(q,0))),ee=Z(P,Le,O==H),P=0,++O}++P,++k}return xe.join("")}function X(U){return B(U,function(k){return f.test(k)?G(k.slice(4).toLowerCase()):k})}function v(U){return B(U,function(k){return b.test(k)?"xn--"+w(k):k})}if(o={version:"1.3.2",ucs2:{decode:Y,encode:N},decode:G,encode:w,toASCII:v,toUnicode:X},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(vT.exports==t)n.exports=o;else for(R in o)o.hasOwnProperty(R)&&(t[R]=o[R]);else e.punycode=o})(DT)});var kte=vu((vte,ZD)=>{var N2t=y(x());/*!
 * URI.js - Mutating URLs
 * IPv6 Support
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */(function(e,t){"use strict";typeof ZD=="object"&&ZD.exports?ZD.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(vte,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var d;for(d=0;d<a&&s[d]!=="";d++);if(d<c)for(s.splice(d,1,"0000");s.length<c;)s.splice(d,0,"0000");for(var u,h=0;h<c;h++){u=s[h].split("");for(var p=0;p<3&&(u[0]==="0"&&u.length>1);p++)u.splice(0,1);s[h]=u.join("")}var g=-1,f=0,b=0,C=-1,E=!1;for(h=0;h<c;h++)E?s[h]==="0"?b+=1:(E=!1,b>f&&(g=C,f=b)):s[h]==="0"&&(E=!0,C=h,b=1);b>f&&(g=C,f=b),f>1&&s.splice(g,f,""),a=s.length;var T="";for(s[0]===""&&(T=":"),h=0;h<a&&(T+=s[h],h!==a-1);h++)T+=":";return s[a-1]===""&&(T+=":"),T}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var Ote=vu((Qte,RD)=>{var X2t=y(x());/*!
 * URI.js - Mutating URLs
 * Second Level Domain (SLD) Support
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */(function(e,t){"use strict";typeof RD=="object"&&RD.exports?RD.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Qte,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Md=vu((zte,GD)=>{var P2t=y(x());/*!
 * URI.js - Mutating URLs
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */(function(e,t){"use strict";typeof GD=="object"&&GD.exports?GD.exports=t(Dte(),kte(),Ote()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(zte,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(I,Z){var G=arguments.length>=1,w=arguments.length>=2;if(!(this instanceof r))return G?w?new r(I,Z):new r(I):new r;if(I===void 0){if(G)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?I=location.href+"":I=""}if(I===null&&G)throw new TypeError("null is not a valid argument for URI");return this.href(I),Z!==void 0?this.absoluteTo(Z):this}function s(I){return/^[0-9]+$/.test(I)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(I){return I.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(I){return I===void 0?"Undefined":String(Object.prototype.toString.call(I)).slice(8,-1)}function h(I){return u(I)==="Array"}function p(I,Z){var G={},w,X;if(u(Z)==="RegExp")G=null;else if(h(Z))for(w=0,X=Z.length;w<X;w++)G[Z[w]]=!0;else G[Z]=!0;for(w=0,X=I.length;w<X;w++){var v=G&&G[I[w]]!==void 0||!G&&Z.test(I[w]);v&&(I.splice(w,1),X--,w--)}return I}function g(I,Z){var G,w;if(h(Z)){for(G=0,w=Z.length;G<w;G++)if(!g(I,Z[G]))return!1;return!0}var X=u(Z);for(G=0,w=I.length;G<w;G++)if(X==="RegExp"){if(typeof I[G]=="string"&&I[G].match(Z))return!0}else if(I[G]===Z)return!0;return!1}function f(I,Z){if(!h(I)||!h(Z)||I.length!==Z.length)return!1;I.sort(),Z.sort();for(var G=0,w=I.length;G<w;G++)if(I[G]!==Z[G])return!1;return!0}function b(I){var Z=/^\/+|\/+$/g;return I.replace(Z,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(I){if(!(!I||!I.nodeName)){var Z=I.nodeName.toLowerCase();if(!(Z==="input"&&I.type!=="image"))return r.domAttributes[Z]}};function C(I){return escape(I)}function E(I){return encodeURIComponent(I).replace(/[!'()*]/g,C).replace(/\*/g,"%2A")}r.encode=E,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=E,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(I,Z){var G=r.encode(I+"");return Z===void 0&&(Z=r.escapeQuerySpace),Z?G.replace(/%20/g,"+"):G},r.decodeQuery=function(I,Z){I+="",Z===void 0&&(Z=r.escapeQuerySpace);try{return r.decode(Z?I.replace(/\+/g,"%20"):I)}catch{return I}};var T={encode:"encode",decode:"decode"},S,_=function(I,Z){return function(G){try{return r[Z](G+"").replace(r.characters[I][Z].expression,function(w){return r.characters[I][Z].map[w]})}catch{return G}}};for(S in T)r[S+"PathSegment"]=_("pathname",T[S]),r[S+"UrnPathSegment"]=_("urnpath",T[S]);var R=function(I,Z,G){return function(w){var X;G?X=function(P){return r[Z](r[G](P))}:X=r[Z];for(var v=(w+"").split(I),U=0,k=v.length;U<k;U++)v[U]=X(v[U]);return v.join(I)}};r.decodePath=R("/","decodePathSegment"),r.decodeUrnPath=R(":","decodeUrnPathSegment"),r.recodePath=R("/","encodePathSegment","decode"),r.recodeUrnPath=R(":","encodeUrnPathSegment","decode"),r.encodeReserved=_("reserved","encode"),r.parse=function(I,Z){var G;return Z||(Z={preventInvalidHostname:r.preventInvalidHostname}),I=I.replace(r.leading_whitespace_expression,""),I=I.replace(r.ascii_tab_whitespace,""),G=I.indexOf("#"),G>-1&&(Z.fragment=I.substring(G+1)||null,I=I.substring(0,G)),G=I.indexOf("?"),G>-1&&(Z.query=I.substring(G+1)||null,I=I.substring(0,G)),I=I.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),I=I.replace(/^[/\\]{2,}/i,"//"),I.substring(0,2)==="//"?(Z.protocol=null,I=I.substring(2),I=r.parseAuthority(I,Z)):(G=I.indexOf(":"),G>-1&&(Z.protocol=I.substring(0,G)||null,Z.protocol&&!Z.protocol.match(r.protocol_expression)?Z.protocol=void 0:I.substring(G+1,G+3).replace(/\\/g,"/")==="//"?(I=I.substring(G+3),I=r.parseAuthority(I,Z)):(I=I.substring(G+1),Z.urn=!0))),Z.path=I,Z},r.parseHost=function(I,Z){I||(I=""),I=I.replace(/\\/g,"/");var G=I.indexOf("/"),w,X;if(G===-1&&(G=I.length),I.charAt(0)==="[")w=I.indexOf("]"),Z.hostname=I.substring(1,w)||null,Z.port=I.substring(w+2,G)||null,Z.port==="/"&&(Z.port=null);else{var v=I.indexOf(":"),U=I.indexOf("/"),k=I.indexOf(":",v+1);k!==-1&&(U===-1||k<U)?(Z.hostname=I.substring(0,G)||null,Z.port=null):(X=I.substring(0,G).split(":"),Z.hostname=X[0]||null,Z.port=X[1]||null)}return Z.hostname&&I.substring(G).charAt(0)!=="/"&&(G++,I="/"+I),Z.preventInvalidHostname&&r.ensureValidHostname(Z.hostname,Z.protocol),Z.port&&r.ensureValidPort(Z.port),I.substring(G)||"/"},r.parseAuthority=function(I,Z){return I=r.parseUserinfo(I,Z),r.parseHost(I,Z)},r.parseUserinfo=function(I,Z){var G=I,w=I.indexOf("\\");w!==-1&&(I=I.replace(/\\/g,"/"));var X=I.indexOf("/"),v=I.lastIndexOf("@",X>-1?X:I.length-1),U;return v>-1&&(X===-1||v<X)?(U=I.substring(0,v).split(":"),Z.username=U[0]?r.decode(U[0]):null,U.shift(),Z.password=U[0]?r.decode(U.join(":")):null,I=G.substring(v+1)):(Z.username=null,Z.password=null),I},r.parseQuery=function(I,Z){if(!I)return{};if(I=I.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!I)return{};for(var G={},w=I.split("&"),X=w.length,v,U,k,P=0;P<X;P++)v=w[P].split("="),U=r.decodeQuery(v.shift(),Z),k=v.length?r.decodeQuery(v.join("="),Z):null,U!=="__proto__"&&(c.call(G,U)?((typeof G[U]=="string"||G[U]===null)&&(G[U]=[G[U]]),G[U].push(k)):G[U]=k);return G},r.build=function(I){var Z="",G=!1;return I.protocol&&(Z+=I.protocol+":"),!I.urn&&(Z||I.hostname)&&(Z+="//",G=!0),Z+=r.buildAuthority(I)||"",typeof I.path=="string"&&(I.path.charAt(0)!=="/"&&G&&(Z+="/"),Z+=I.path),typeof I.query=="string"&&I.query&&(Z+="?"+I.query),typeof I.fragment=="string"&&I.fragment&&(Z+="#"+I.fragment),Z},r.buildHost=function(I){var Z="";if(I.hostname)r.ip6_expression.test(I.hostname)?Z+="["+I.hostname+"]":Z+=I.hostname;else return"";return I.port&&(Z+=":"+I.port),Z},r.buildAuthority=function(I){return r.buildUserinfo(I)+r.buildHost(I)},r.buildUserinfo=function(I){var Z="";return I.username&&(Z+=r.encode(I.username)),I.password&&(Z+=":"+r.encode(I.password)),Z&&(Z+="@"),Z},r.buildQuery=function(I,Z,G){var w="",X,v,U,k;for(v in I)if(v!=="__proto__"&&c.call(I,v))if(h(I[v]))for(X={},U=0,k=I[v].length;U<k;U++)I[v][U]!==void 0&&X[I[v][U]+""]===void 0&&(w+="&"+r.buildQueryParameter(v,I[v][U],G),Z!==!0&&(X[I[v][U]+""]=!0));else I[v]!==void 0&&(w+="&"+r.buildQueryParameter(v,I[v],G));return w.substring(1)},r.buildQueryParameter=function(I,Z,G){return r.encodeQuery(I,G)+(Z!==null?"="+r.encodeQuery(Z,G):"")},r.addQuery=function(I,Z,G){if(typeof Z=="object")for(var w in Z)c.call(Z,w)&&r.addQuery(I,w,Z[w]);else if(typeof Z=="string"){if(I[Z]===void 0){I[Z]=G;return}else typeof I[Z]=="string"&&(I[Z]=[I[Z]]);h(G)||(G=[G]),I[Z]=(I[Z]||[]).concat(G)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(I,Z,G){if(typeof Z=="object")for(var w in Z)c.call(Z,w)&&r.setQuery(I,w,Z[w]);else if(typeof Z=="string")I[Z]=G===void 0?null:G;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(I,Z,G){var w,X,v;if(h(Z))for(w=0,X=Z.length;w<X;w++)I[Z[w]]=void 0;else if(u(Z)==="RegExp")for(v in I)Z.test(v)&&(I[v]=void 0);else if(typeof Z=="object")for(v in Z)c.call(Z,v)&&r.removeQuery(I,v,Z[v]);else if(typeof Z=="string")G!==void 0?u(G)==="RegExp"?!h(I[Z])&&G.test(I[Z])?I[Z]=void 0:I[Z]=p(I[Z],G):I[Z]===String(G)&&(!h(G)||G.length===1)?I[Z]=void 0:h(I[Z])&&(I[Z]=p(I[Z],G)):I[Z]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(I,Z,G,w){switch(u(Z)){case"String":break;case"RegExp":for(var X in I)if(c.call(I,X)&&Z.test(X)&&(G===void 0||r.hasQuery(I,X,G)))return!0;return!1;case"Object":for(var v in Z)if(c.call(Z,v)&&!r.hasQuery(I,v,Z[v]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(G)){case"Undefined":return Z in I;case"Boolean":var U=!!(h(I[Z])?I[Z].length:I[Z]);return G===U;case"Function":return!!G(I[Z],Z,I);case"Array":if(!h(I[Z]))return!1;var k=w?g:f;return k(I[Z],G);case"RegExp":return h(I[Z])?w?g(I[Z],G):!1:!!(I[Z]&&I[Z].match(G));case"Number":G=String(G);case"String":return h(I[Z])?w?g(I[Z],G):!1:I[Z]===G;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var I=[],Z=[],G=0,w=0;w<arguments.length;w++){var X=new r(arguments[w]);I.push(X);for(var v=X.segment(),U=0;U<v.length;U++)typeof v[U]=="string"&&Z.push(v[U]),v[U]&&G++}if(!Z.length||!G)return new r("");var k=new r("").segment(Z);return(I[0].path()===""||I[0].path().slice(0,1)==="/")&&k.path("/"+k.path()),k.normalize()},r.commonPath=function(I,Z){var G=Math.min(I.length,Z.length),w;for(w=0;w<G;w++)if(I.charAt(w)!==Z.charAt(w)){w--;break}return w<1?I.charAt(0)===Z.charAt(0)&&I.charAt(0)==="/"?"/":"":((I.charAt(w)!=="/"||Z.charAt(w)!=="/")&&(w=I.substring(0,w).lastIndexOf("/")),I.substring(0,w+1))},r.withinString=function(I,Z,G){G||(G={});var w=G.start||r.findUri.start,X=G.end||r.findUri.end,v=G.trim||r.findUri.trim,U=G.parens||r.findUri.parens,k=/[a-z0-9-]=["']?$/i;for(w.lastIndex=0;;){var P=w.exec(I);if(!P)break;var O=P.index;if(G.ignoreHtml){var H=I.slice(Math.max(O-3,0),O);if(H&&k.test(H))continue}for(var ee=O+I.slice(O).search(X),z=I.slice(O,ee),te=-1;;){var q=U.exec(z);if(!q)break;var me=q.index+q[0].length;te=Math.max(te,me)}if(te>-1?z=z.slice(0,te)+z.slice(te).replace(v,""):z=z.replace(v,""),!(z.length<=P[0].length)&&!(G.ignore&&G.ignore.test(z))){ee=O+z.length;var ye=Z(z,O,ee,I);if(ye===void 0){w.lastIndex=ee;continue}ye=String(ye),I=I.slice(0,O)+ye+I.slice(ee),w.lastIndex=O+ye.length}}return w.lastIndex=0,I},r.ensureValidHostname=function(I,Z){var G=!!I,w=!!Z,X=!1;if(w&&(X=g(r.hostProtocols,Z)),X&&!G)throw new TypeError("Hostname cannot be empty, if protocol is "+Z);if(I&&I.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(I).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(I){if(I){var Z=Number(I);if(!(s(Z)&&Z>0&&Z<65536))throw new TypeError('Port "'+I+'" is not a valid port')}},r.noConflict=function(I){if(I){var Z={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(Z.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(Z.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(Z.SecondLevelDomains=i.SecondLevelDomains.noConflict()),Z}else i.URI===this&&(i.URI=o);return this},a.build=function(I){return I===!0?this._deferred_build=!0:(I===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function L(I){return function(Z,G){return Z===void 0?this._parts[I]||"":(this._parts[I]=Z||null,this.build(!G),this)}}function W(I,Z){return function(G,w){return G===void 0?this._parts[I]||"":(G!==null&&(G=G+"",G.charAt(0)===Z&&(G=G.substring(1))),this._parts[I]=G,this.build(!w),this)}}a.protocol=L("protocol"),a.username=L("username"),a.password=L("password"),a.hostname=L("hostname"),a.port=L("port"),a.query=W("query","?"),a.fragment=W("fragment","#"),a.search=function(I,Z){var G=this.query(I,Z);return typeof G=="string"&&G.length?"?"+G:G},a.hash=function(I,Z){var G=this.fragment(I,Z);return typeof G=="string"&&G.length?"#"+G:G},a.pathname=function(I,Z){if(I===void 0||I===!0){var G=this._parts.path||(this._parts.hostname?"/":"");return I?(this._parts.urn?r.decodeUrnPath:r.decodePath)(G):G}else return this._parts.urn?this._parts.path=I?r.recodeUrnPath(I):"":this._parts.path=I?r.recodePath(I):"/",this.build(!Z),this},a.path=a.pathname,a.href=function(I,Z){var G;if(I===void 0)return this.toString();this._string="",this._parts=r._parts();var w=I instanceof r,X=typeof I=="object"&&(I.hostname||I.path||I.pathname);if(I.nodeName){var v=r.getDomAttribute(I);I=I[v]||"",X=!1}if(!w&&X&&I.pathname!==void 0&&(I=I.toString()),typeof I=="string"||I instanceof String)this._parts=r.parse(String(I),this._parts);else if(w||X){var U=w?I._parts:I;for(G in U)G!=="query"&&c.call(this._parts,G)&&(this._parts[G]=U[G]);U.query&&this.query(U.query,!1)}else throw new TypeError("invalid input");return this.build(!Z),this},a.is=function(I){var Z=!1,G=!1,w=!1,X=!1,v=!1,U=!1,k=!1,P=!this._parts.urn;switch(this._parts.hostname&&(P=!1,G=r.ip4_expression.test(this._parts.hostname),w=r.ip6_expression.test(this._parts.hostname),Z=G||w,X=!Z,v=X&&n&&n.has(this._parts.hostname),U=X&&r.idn_expression.test(this._parts.hostname),k=X&&r.punycode_expression.test(this._parts.hostname)),I.toLowerCase()){case"relative":return P;case"absolute":return!P;case"domain":case"name":return X;case"sld":return v;case"ip":return Z;case"ip4":case"ipv4":case"inet4":return G;case"ip6":case"ipv6":case"inet6":return w;case"idn":return U;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return k}return null};var B=a.protocol,Y=a.port,N=a.hostname;a.protocol=function(I,Z){if(I&&(I=I.replace(/:(\/\/)?$/,""),!I.match(r.protocol_expression)))throw new TypeError('Protocol "'+I+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return B.call(this,I,Z)},a.scheme=a.protocol,a.port=function(I,Z){return this._parts.urn?I===void 0?"":this:(I!==void 0&&(I===0&&(I=null),I&&(I+="",I.charAt(0)===":"&&(I=I.substring(1)),r.ensureValidPort(I))),Y.call(this,I,Z))},a.hostname=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(I!==void 0){var G={preventInvalidHostname:this._parts.preventInvalidHostname},w=r.parseHost(I,G);if(w!=="/")throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-]');I=G.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(I,this._parts.protocol)}return N.call(this,I,Z)},a.origin=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(I===void 0){var G=this.protocol(),w=this.authority();return w?(G?G+"://":"")+this.authority():""}else{var X=r(I);return this.protocol(X.protocol()).authority(X.authority()).build(!Z),this}},a.host=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(I===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var G=r.parseHost(I,this._parts);if(G!=="/")throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-]');return this.build(!Z),this},a.authority=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(I===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var G=r.parseAuthority(I,this._parts);if(G!=="/")throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-]');return this.build(!Z),this},a.userinfo=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(I===void 0){var G=r.buildUserinfo(this._parts);return G&&G.substring(0,G.length-1)}else return I[I.length-1]!=="@"&&(I+="@"),r.parseUserinfo(I,this._parts),this.build(!Z),this},a.resource=function(I,Z){var G;return I===void 0?this.path()+this.search()+this.hash():(G=r.parse(I),this._parts.path=G.path,this._parts.query=G.query,this._parts.fragment=G.fragment,this.build(!Z),this)},a.subdomain=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(I===void 0){if(!this._parts.hostname||this.is("IP"))return"";var G=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,G)||""}else{var w=this._parts.hostname.length-this.domain().length,X=this._parts.hostname.substring(0,w),v=new RegExp("^"+d(X));if(I&&I.charAt(I.length-1)!=="."&&(I+="."),I.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return I&&r.ensureValidHostname(I,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(v,I),this.build(!Z),this}},a.domain=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(typeof I=="boolean"&&(Z=I,I=void 0),I===void 0){if(!this._parts.hostname||this.is("IP"))return"";var G=this._parts.hostname.match(/\./g);if(G&&G.length<2)return this._parts.hostname;var w=this._parts.hostname.length-this.tld(Z).length-1;return w=this._parts.hostname.lastIndexOf(".",w-1)+1,this._parts.hostname.substring(w)||""}else{if(!I)throw new TypeError("cannot set domain empty");if(I.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(I,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=I;else{var X=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(X,I)}return this.build(!Z),this}},a.tld=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(typeof I=="boolean"&&(Z=I,I=void 0),I===void 0){if(!this._parts.hostname||this.is("IP"))return"";var G=this._parts.hostname.lastIndexOf("."),w=this._parts.hostname.substring(G+1);return Z!==!0&&n&&n.list[w.toLowerCase()]&&n.get(this._parts.hostname)||w}else{var X;if(I)if(I.match(/[^a-zA-Z0-9-]/))if(n&&n.is(I))X=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(X,I);else throw new TypeError('TLD "'+I+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");X=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(X,I)}else throw new TypeError("cannot set TLD empty");return this.build(!Z),this}},a.directory=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(I===void 0||I===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var G=this._parts.path.length-this.filename().length-1,w=this._parts.path.substring(0,G)||(this._parts.hostname?"/":"");return I?r.decodePath(w):w}else{var X=this._parts.path.length-this.filename().length,v=this._parts.path.substring(0,X),U=new RegExp("^"+d(v));return this.is("relative")||(I||(I="/"),I.charAt(0)!=="/"&&(I="/"+I)),I&&I.charAt(I.length-1)!=="/"&&(I+="/"),I=r.recodePath(I),this._parts.path=this._parts.path.replace(U,I),this.build(!Z),this}},a.filename=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(typeof I!="string"){if(!this._parts.path||this._parts.path==="/")return"";var G=this._parts.path.lastIndexOf("/"),w=this._parts.path.substring(G+1);return I?r.decodePathSegment(w):w}else{var X=!1;I.charAt(0)==="/"&&(I=I.substring(1)),I.match(/\.?\//)&&(X=!0);var v=new RegExp(d(this.filename())+"$");return I=r.recodePath(I),this._parts.path=this._parts.path.replace(v,I),X?this.normalizePath(Z):this.build(!Z),this}},a.suffix=function(I,Z){if(this._parts.urn)return I===void 0?"":this;if(I===void 0||I===!0){if(!this._parts.path||this._parts.path==="/")return"";var G=this.filename(),w=G.lastIndexOf("."),X,v;return w===-1?"":(X=G.substring(w+1),v=/^[a-z0-9%]+$/i.test(X)?X:"",I?r.decodePathSegment(v):v)}else{I.charAt(0)==="."&&(I=I.substring(1));var U=this.suffix(),k;if(U)I?k=new RegExp(d(U)+"$"):k=new RegExp(d("."+U)+"$");else{if(!I)return this;this._parts.path+="."+r.recodePath(I)}return k&&(I=r.recodePath(I),this._parts.path=this._parts.path.replace(k,I)),this.build(!Z),this}},a.segment=function(I,Z,G){var w=this._parts.urn?":":"/",X=this.path(),v=X.substring(0,1)==="/",U=X.split(w);if(I!==void 0&&typeof I!="number"&&(G=Z,Z=I,I=void 0),I!==void 0&&typeof I!="number")throw new Error('Bad segment "'+I+'", must be 0-based integer');if(v&&U.shift(),I<0&&(I=Math.max(U.length+I,0)),Z===void 0)return I===void 0?U:U[I];if(I===null||U[I]===void 0)if(h(Z)){U=[];for(var k=0,P=Z.length;k<P;k++)!Z[k].length&&(!U.length||!U[U.length-1].length)||(U.length&&!U[U.length-1].length&&U.pop(),U.push(b(Z[k])))}else(Z||typeof Z=="string")&&(Z=b(Z),U[U.length-1]===""?U[U.length-1]=Z:U.push(Z));else Z?U[I]=b(Z):U.splice(I,1);return v&&U.unshift(""),this.path(U.join(w),G)},a.segmentCoded=function(I,Z,G){var w,X,v;if(typeof I!="number"&&(G=Z,Z=I,I=void 0),Z===void 0){if(w=this.segment(I,Z,G),!h(w))w=w!==void 0?r.decode(w):void 0;else for(X=0,v=w.length;X<v;X++)w[X]=r.decode(w[X]);return w}if(!h(Z))Z=typeof Z=="string"||Z instanceof String?r.encode(Z):Z;else for(X=0,v=Z.length;X<v;X++)Z[X]=r.encode(Z[X]);return this.segment(I,Z,G)};var A=a.query;return a.query=function(I,Z){if(I===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof I=="function"){var G=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),w=I.call(this,G);return this._parts.query=r.buildQuery(w||G,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!Z),this}else return I!==void 0&&typeof I!="string"?(this._parts.query=r.buildQuery(I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!Z),this):A.call(this,I,Z)},a.setQuery=function(I,Z,G){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof I=="string"||I instanceof String)w[I]=Z!==void 0?Z:null;else if(typeof I=="object")for(var X in I)c.call(I,X)&&(w[X]=I[X]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof I!="string"&&(G=Z),this.build(!G),this},a.addQuery=function(I,Z,G){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(w,I,Z===void 0?null:Z),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof I!="string"&&(G=Z),this.build(!G),this},a.removeQuery=function(I,Z,G){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(w,I,Z),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof I!="string"&&(G=Z),this.build(!G),this},a.hasQuery=function(I,Z,G){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(w,I,Z,G)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(I){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!I)),this},a.normalizeHostname=function(I){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!I)),this},a.normalizePort=function(I){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!I)),this},a.normalizePath=function(I){var Z=this._parts.path;if(!Z)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!I),this;if(this._parts.path==="/")return this;Z=r.recodePath(Z);var G,w="",X,v;for(Z.charAt(0)!=="/"&&(G=!0,Z="/"+Z),(Z.slice(-3)==="/.."||Z.slice(-2)==="/.")&&(Z+="/"),Z=Z.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),G&&(w=Z.substring(1).match(/^(\.\.\/)+/)||"",w&&(w=w[0]));X=Z.search(/\/\.\.(\/|$)/),X!==-1;){if(X===0){Z=Z.substring(3);continue}v=Z.substring(0,X).lastIndexOf("/"),v===-1&&(v=X),Z=Z.substring(0,v)+Z.substring(X+3)}return G&&this.is("relative")&&(Z=w+Z.substring(1)),this._parts.path=Z,this.build(!I),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(I){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!I)),this},a.normalizeFragment=function(I){return this._parts.fragment||(this._parts.fragment=null,this.build(!I)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var I=r.encode,Z=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=I,r.decode=Z}return this},a.unicode=function(){var I=r.encode,Z=r.decode;r.encode=E,r.decode=unescape;try{this.normalize()}finally{r.encode=I,r.decode=Z}return this},a.readable=function(){var I=this.clone();I.username("").password("").normalize();var Z="";if(I._parts.protocol&&(Z+=I._parts.protocol+"://"),I._parts.hostname&&(I.is("punycode")&&e?(Z+=e.toUnicode(I._parts.hostname),I._parts.port&&(Z+=":"+I._parts.port)):Z+=I.host()),I._parts.hostname&&I._parts.path&&I._parts.path.charAt(0)!=="/"&&(Z+="/"),Z+=I.path(!0),I._parts.query){for(var G="",w=0,X=I._parts.query.split("&"),v=X.length;w<v;w++){var U=(X[w]||"").split("=");G+="&"+r.decodeQuery(U[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),U[1]!==void 0&&(G+="="+r.decodeQuery(U[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}Z+="?"+G.substring(1)}return Z+=r.decodeQuery(I.hash(),!0),Z},a.absoluteTo=function(I){var Z=this.clone(),G=["protocol","username","password","hostname","port"],w,X,v;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(I instanceof r||(I=new r(I)),Z._parts.protocol||(Z._parts.protocol=I._parts.protocol,this._parts.hostname))return Z;for(X=0;v=G[X];X++)Z._parts[v]=I._parts[v];return Z._parts.path?(Z._parts.path.substring(-2)===".."&&(Z._parts.path+="/"),Z.path().charAt(0)!=="/"&&(w=I.directory(),w=w||(I.path().indexOf("/")===0?"/":""),Z._parts.path=(w?w+"/":"")+Z._parts.path,Z.normalizePath())):(Z._parts.path=I._parts.path,Z._parts.query||(Z._parts.query=I._parts.query)),Z.build(),Z},a.relativeTo=function(I){var Z=this.clone().normalize(),G,w,X,v,U;if(Z._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(I=new r(I).normalize(),G=Z._parts,w=I._parts,v=Z.path(),U=I.path(),v.charAt(0)!=="/")throw new Error("URI is already relative");if(U.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(G.protocol===w.protocol&&(G.protocol=null),G.username!==w.username||G.password!==w.password||G.protocol!==null||G.username!==null||G.password!==null)return Z.build();if(G.hostname===w.hostname&&G.port===w.port)G.hostname=null,G.port=null;else return Z.build();if(v===U)return G.path="",Z.build();if(X=r.commonPath(v,U),!X)return Z.build();var k=w.path.substring(X.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return G.path=k+G.path.substring(X.length)||"./",Z.build()},a.equals=function(I){var Z=this.clone(),G=new r(I),w={},X={},v={},U,k,P;if(Z.normalize(),G.normalize(),Z.toString()===G.toString())return!0;if(U=Z.query(),k=G.query(),Z.query(""),G.query(""),Z.toString()!==G.toString()||U.length!==k.length)return!1;w=r.parseQuery(U,this._parts.escapeQuerySpace),X=r.parseQuery(k,this._parts.escapeQuerySpace);for(P in w)if(c.call(w,P)){if(h(w[P])){if(!f(w[P],X[P]))return!1}else if(w[P]!==X[P])return!1;v[P]=!0}for(P in X)if(c.call(X,P)&&!v[P])return!1;return!0},a.preventInvalidHostname=function(I){return this._parts.preventInvalidHostname=!!I,this},a.duplicateQueryParameters=function(I){return this._parts.duplicateQueryParameters=!!I,this},a.escapeQuerySpace=function(I){return this._parts.escapeQuerySpace=!!I,this},r})});var Dme=vu((UKn,Ume)=>{"use strict";var DKn=y(x());Ume.exports=Z7e;var Z2=1e20;function Z7e(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,d,u,h,p,g,f,b;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");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(d=c,c=Array(r*s),f=0,b=Math.floor(d.length/u);f<b;f++)c[f]=d[f*u+o]/255;else if(u!==1)throw Error("Raw data can have only 1 value per pixel");var C=Array(r*s),E=Array(r*s),T=Array(a),S=Array(a),_=Array(a+1),R=Array(a);for(f=0,b=r*s;f<b;f++){var L=c[f];C[f]=L===1?0:L===0?Z2:Math.pow(Math.max(0,.5-L),2),E[f]=L===1?Z2:L===0?0:Math.pow(Math.max(0,L-.5),2)}Pme(C,r,s,T,S,R,_),Pme(E,r,s,T,S,R,_);var W=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(f=0,b=r*s;f<b;f++)W[f]=Math.min(Math.max(1-((C[f]-E[f])/i+n),0),1);return W}function Pme(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Mme(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Mme(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Mme(e,t,n,i,o){n[0]=0,i[0]=-Z2,i[1]=+Z2;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+Z2}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var zme=vu((aJn,Vk)=>{var cJn=y(x());function X7e(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,h=11,p=12,g=13,f=14,b=15,C=16,E=17,T=0,S=1,_=2,R=3,L=4;function W(A,I){return 55296<=A.charCodeAt(I)&&A.charCodeAt(I)<=56319&&56320<=A.charCodeAt(I+1)&&A.charCodeAt(I+1)<=57343}function B(A,I){I===void 0&&(I=0);var Z=A.charCodeAt(I);if(55296<=Z&&Z<=56319&&I<A.length-1){var G=Z,w=A.charCodeAt(I+1);return 56320<=w&&w<=57343?(G-55296)*1024+(w-56320)+65536:G}if(56320<=Z&&Z<=57343&&I>=1){var G=A.charCodeAt(I-1),w=Z;return 55296<=G&&G<=56319?(G-55296)*1024+(w-56320)+65536:w}return Z}function Y(A,I,Z){var G=[A].concat(I).concat([Z]),w=G[G.length-2],X=Z,v=G.lastIndexOf(f);if(v>1&&G.slice(1,v).every(function(P){return P==i})&&[i,g,E].indexOf(A)==-1)return _;var U=G.lastIndexOf(o);if(U>0&&G.slice(1,U).every(function(P){return P==o})&&[p,o].indexOf(w)==-1)return G.filter(function(P){return P==o}).length%2==1?R:L;if(w==e&&X==t)return T;if(w==n||w==e||w==t)return X==f&&I.every(function(P){return P==i})?_:S;if(X==n||X==e||X==t)return S;if(w==s&&(X==s||X==a||X==d||X==u))return T;if((w==d||w==a)&&(X==a||X==c))return T;if((w==u||w==c)&&X==c)return T;if(X==i||X==b)return T;if(X==r)return T;if(w==p)return T;var k=G.indexOf(i)!=-1?G.lastIndexOf(i)-1:G.length-2;return[g,E].indexOf(G[k])!=-1&&G.slice(k+1,-1).every(function(P){return P==i})&&X==f||w==b&&[C,E].indexOf(X)!=-1?T:I.indexOf(o)!=-1?_:w==o&&X==o?T:S}this.nextBreak=function(A,I){if(I===void 0&&(I=0),I<0)return 0;if(I>=A.length-1)return A.length;for(var Z=N(B(A,I)),G=[],w=I+1;w<A.length;w++)if(!W(A,w-1)){var X=N(B(A,w));if(Y(Z,G,X))return w;G.push(X)}return A.length},this.splitGraphemes=function(A){for(var I=[],Z=0,G;(G=this.nextBreak(A,Z))<A.length;)I.push(A.slice(Z,G)),Z=G;return Z<A.length&&I.push(A.slice(Z)),I},this.iterateGraphemes=function(A){var I=0,Z={next:(function(){var G,w;return(w=this.nextBreak(A,I))<A.length?(G=A.slice(I,w),I=w,{value:G,done:!1}):I<A.length?(G=A.slice(I),I=A.length,{value:G,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(Z[Symbol.iterator]=function(){return Z}),Z},this.countGraphemes=function(A){for(var I=0,Z=0,G;(G=this.nextBreak(A,Z))<A.length;)Z=G,I++;return Z<A.length&&I++,I};function N(A){return 1536<=A&&A<=1541||A==1757||A==1807||A==2274||A==3406||A==69821||70082<=A&&A<=70083||A==72250||72326<=A&&A<=72329||A==73030?p:A==13?e:A==10?t:0<=A&&A<=9||11<=A&&A<=12||14<=A&&A<=31||127<=A&&A<=159||A==173||A==1564||A==6158||A==8203||8206<=A&&A<=8207||A==8232||A==8233||8234<=A&&A<=8238||8288<=A&&A<=8292||A==8293||8294<=A&&A<=8303||55296<=A&&A<=57343||A==65279||65520<=A&&A<=65528||65529<=A&&A<=65531||113824<=A&&A<=113827||119155<=A&&A<=119162||A==917504||A==917505||917506<=A&&A<=917535||917632<=A&&A<=917759||918e3<=A&&A<=921599?n:768<=A&&A<=879||1155<=A&&A<=1159||1160<=A&&A<=1161||1425<=A&&A<=1469||A==1471||1473<=A&&A<=1474||1476<=A&&A<=1477||A==1479||1552<=A&&A<=1562||1611<=A&&A<=1631||A==1648||1750<=A&&A<=1756||1759<=A&&A<=1764||1767<=A&&A<=1768||1770<=A&&A<=1773||A==1809||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||A==2362||A==2364||2369<=A&&A<=2376||A==2381||2385<=A&&A<=2391||2402<=A&&A<=2403||A==2433||A==2492||A==2494||2497<=A&&A<=2500||A==2509||A==2519||2530<=A&&A<=2531||2561<=A&&A<=2562||A==2620||2625<=A&&A<=2626||2631<=A&&A<=2632||2635<=A&&A<=2637||A==2641||2672<=A&&A<=2673||A==2677||2689<=A&&A<=2690||A==2748||2753<=A&&A<=2757||2759<=A&&A<=2760||A==2765||2786<=A&&A<=2787||2810<=A&&A<=2815||A==2817||A==2876||A==2878||A==2879||2881<=A&&A<=2884||A==2893||A==2902||A==2903||2914<=A&&A<=2915||A==2946||A==3006||A==3008||A==3021||A==3031||A==3072||3134<=A&&A<=3136||3142<=A&&A<=3144||3146<=A&&A<=3149||3157<=A&&A<=3158||3170<=A&&A<=3171||A==3201||A==3260||A==3263||A==3266||A==3270||3276<=A&&A<=3277||3285<=A&&A<=3286||3298<=A&&A<=3299||3328<=A&&A<=3329||3387<=A&&A<=3388||A==3390||3393<=A&&A<=3396||A==3405||A==3415||3426<=A&&A<=3427||A==3530||A==3535||3538<=A&&A<=3540||A==3542||A==3551||A==3633||3636<=A&&A<=3642||3655<=A&&A<=3662||A==3761||3764<=A&&A<=3769||3771<=A&&A<=3772||3784<=A&&A<=3789||3864<=A&&A<=3865||A==3893||A==3895||A==3897||3953<=A&&A<=3966||3968<=A&&A<=3972||3974<=A&&A<=3975||3981<=A&&A<=3991||3993<=A&&A<=4028||A==4038||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||A==4226||4229<=A&&A<=4230||A==4237||A==4253||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||A==6086||6089<=A&&A<=6099||A==6109||6155<=A&&A<=6157||6277<=A&&A<=6278||A==6313||6432<=A&&A<=6434||6439<=A&&A<=6440||A==6450||6457<=A&&A<=6459||6679<=A&&A<=6680||A==6683||A==6742||6744<=A&&A<=6750||A==6752||A==6754||6757<=A&&A<=6764||6771<=A&&A<=6780||A==6783||6832<=A&&A<=6845||A==6846||6912<=A&&A<=6915||A==6964||6966<=A&&A<=6970||A==6972||A==6978||7019<=A&&A<=7027||7040<=A&&A<=7041||7074<=A&&A<=7077||7080<=A&&A<=7081||7083<=A&&A<=7085||A==7142||7144<=A&&A<=7145||A==7149||7151<=A&&A<=7153||7212<=A&&A<=7219||7222<=A&&A<=7223||7376<=A&&A<=7378||7380<=A&&A<=7392||7394<=A&&A<=7400||A==7405||A==7412||7416<=A&&A<=7417||7616<=A&&A<=7673||7675<=A&&A<=7679||A==8204||8400<=A&&A<=8412||8413<=A&&A<=8416||A==8417||8418<=A&&A<=8420||8421<=A&&A<=8432||11503<=A&&A<=11505||A==11647||11744<=A&&A<=11775||12330<=A&&A<=12333||12334<=A&&A<=12335||12441<=A&&A<=12442||A==42607||42608<=A&&A<=42610||42612<=A&&A<=42621||42654<=A&&A<=42655||42736<=A&&A<=42737||A==43010||A==43014||A==43019||43045<=A&&A<=43046||43204<=A&&A<=43205||43232<=A&&A<=43249||43302<=A&&A<=43309||43335<=A&&A<=43345||43392<=A&&A<=43394||A==43443||43446<=A&&A<=43449||A==43452||A==43493||43561<=A&&A<=43566||43569<=A&&A<=43570||43573<=A&&A<=43574||A==43587||A==43596||A==43644||A==43696||43698<=A&&A<=43700||43703<=A&&A<=43704||43710<=A&&A<=43711||A==43713||43756<=A&&A<=43757||A==43766||A==44005||A==44008||A==44013||A==64286||65024<=A&&A<=65039||65056<=A&&A<=65071||65438<=A&&A<=65439||A==66045||A==66272||66422<=A&&A<=66426||68097<=A&&A<=68099||68101<=A&&A<=68102||68108<=A&&A<=68111||68152<=A&&A<=68154||A==68159||68325<=A&&A<=68326||A==69633||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||A==70003||70016<=A&&A<=70017||70070<=A&&A<=70078||70090<=A&&A<=70092||70191<=A&&A<=70193||A==70196||70198<=A&&A<=70199||A==70206||A==70367||70371<=A&&A<=70378||70400<=A&&A<=70401||A==70460||A==70462||A==70464||A==70487||70502<=A&&A<=70508||70512<=A&&A<=70516||70712<=A&&A<=70719||70722<=A&&A<=70724||A==70726||A==70832||70835<=A&&A<=70840||A==70842||A==70845||70847<=A&&A<=70848||70850<=A&&A<=70851||A==71087||71090<=A&&A<=71093||71100<=A&&A<=71101||71103<=A&&A<=71104||71132<=A&&A<=71133||71219<=A&&A<=71226||A==71229||71231<=A&&A<=71232||A==71339||A==71341||71344<=A&&A<=71349||A==71351||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||A==72263||72273<=A&&A<=72278||72281<=A&&A<=72283||72330<=A&&A<=72342||72344<=A&&A<=72345||72752<=A&&A<=72758||72760<=A&&A<=72765||A==72767||72850<=A&&A<=72871||72874<=A&&A<=72880||72882<=A&&A<=72883||72885<=A&&A<=72886||73009<=A&&A<=73014||A==73018||73020<=A&&A<=73021||73023<=A&&A<=73029||A==73031||92912<=A&&A<=92916||92976<=A&&A<=92982||94095<=A&&A<=94098||113821<=A&&A<=113822||A==119141||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||A==121461||A==121476||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?i:127462<=A&&A<=127487?o:A==2307||A==2363||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||A==2563||2622<=A&&A<=2624||A==2691||2750<=A&&A<=2752||A==2761||2763<=A&&A<=2764||2818<=A&&A<=2819||A==2880||2887<=A&&A<=2888||2891<=A&&A<=2892||A==3007||3009<=A&&A<=3010||3014<=A&&A<=3016||3018<=A&&A<=3020||3073<=A&&A<=3075||3137<=A&&A<=3140||3202<=A&&A<=3203||A==3262||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||A==3635||A==3763||3902<=A&&A<=3903||A==3967||A==4145||4155<=A&&A<=4156||4182<=A&&A<=4183||A==4228||A==6070||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||A==6741||A==6743||6765<=A&&A<=6770||A==6916||A==6965||A==6971||6973<=A&&A<=6977||6979<=A&&A<=6980||A==7042||A==7073||7078<=A&&A<=7079||A==7082||A==7143||7146<=A&&A<=7148||A==7150||7154<=A&&A<=7155||7204<=A&&A<=7211||7220<=A&&A<=7221||A==7393||7410<=A&&A<=7411||A==7415||43043<=A&&A<=43044||A==43047||43136<=A&&A<=43137||43188<=A&&A<=43203||43346<=A&&A<=43347||A==43395||43444<=A&&A<=43445||43450<=A&&A<=43451||43453<=A&&A<=43456||43567<=A&&A<=43568||43571<=A&&A<=43572||A==43597||A==43755||43758<=A&&A<=43759||A==43765||44003<=A&&A<=44004||44006<=A&&A<=44007||44009<=A&&A<=44010||A==44012||A==69632||A==69634||A==69762||69808<=A&&A<=69810||69815<=A&&A<=69816||A==69932||A==70018||70067<=A&&A<=70069||70079<=A&&A<=70080||70188<=A&&A<=70190||70194<=A&&A<=70195||A==70197||70368<=A&&A<=70370||70402<=A&&A<=70403||A==70463||70465<=A&&A<=70468||70471<=A&&A<=70472||70475<=A&&A<=70477||70498<=A&&A<=70499||70709<=A&&A<=70711||70720<=A&&A<=70721||A==70725||70833<=A&&A<=70834||A==70841||70843<=A&&A<=70844||A==70846||A==70849||71088<=A&&A<=71089||71096<=A&&A<=71099||A==71102||71216<=A&&A<=71218||71227<=A&&A<=71228||A==71230||A==71340||71342<=A&&A<=71343||A==71350||71456<=A&&A<=71457||A==71462||72199<=A&&A<=72200||A==72249||72279<=A&&A<=72280||A==72343||A==72751||A==72766||A==72873||A==72881||A==72884||94033<=A&&A<=94078||A==119142||A==119149?r:4352<=A&&A<=4447||43360<=A&&A<=43388?s:4448<=A&&A<=4519||55216<=A&&A<=55238?a:4520<=A&&A<=4607||55243<=A&&A<=55291?c:A==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?d: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?u:A==9757||A==9977||9994<=A&&A<=9997||A==127877||127938<=A&&A<=127940||A==127943||127946<=A&&A<=127948||128066<=A&&A<=128067||128070<=A&&A<=128080||A==128110||128112<=A&&A<=128120||A==128124||128129<=A&&A<=128131||128133<=A&&A<=128135||A==128170||128372<=A&&A<=128373||A==128378||A==128400||128405<=A&&A<=128406||128581<=A&&A<=128583||128587<=A&&A<=128591||A==128675||128692<=A&&A<=128694||A==128704||A==128716||129304<=A&&A<=129308||129310<=A&&A<=129311||A==129318||129328<=A&&A<=129337||129341<=A&&A<=129342||129489<=A&&A<=129501?g:127995<=A&&A<=127999?f:A==8205?b:A==9792||A==9794||9877<=A&&A<=9878||A==9992||A==10084||A==127752||A==127806||A==127859||A==127891||A==127908||A==127912||A==127979||A==127981||A==128139||128187<=A&&A<=128188||A==128295||A==128300||A==128488||A==128640||A==128658?C:128102<=A&&A<=128105?E:h}return this}typeof Vk<"u"&&Vk.exports&&(Vk.exports=X7e)});var y6=vu((exports,module)=>{var $Ui=y(x());/*!
 * protobuf.js v8.0.0 (c) 2016, daniel wirtz
 * compiled tue, 16 dec 2025 22:00:06 utc
 * licensed under the bsd-3-clause license
 * see: https://github.com/dcodeio/protobuf.js for details
 */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,d=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(h,p){s[a]=function(f){if(d)if(d=!1,f)p(f);else{for(var b=new Array(arguments.length-1),C=0;C<b.length;)b[C++]=arguments[C];h.apply(null,b)}};try{o.apply(r||null,s)}catch(g){d&&(d=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(d){var u=d.length;if(!u)return 0;for(var h=0;--u%4>1&&d.charAt(u)==="=";)++h;return Math.ceil(d.length*3)/4-h};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(d,u,h){for(var p=null,g=[],f=0,b=0,C;u<h;){var E=d[u++];switch(b){case 0:g[f++]=o[E>>2],C=(E&3)<<4,b=1;break;case 1:g[f++]=o[C|E>>4],C=(E&15)<<2,b=2;break;case 2:g[f++]=o[C|E>>6],g[f++]=o[E&63],b=0;break}f>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),f=0)}return b&&(g[f++]=o[C],g[f++]=61,b===1&&(g[f++]=61)),p?(f&&p.push(String.fromCharCode.apply(String,g.slice(0,f))),p.join("")):String.fromCharCode.apply(String,g.slice(0,f))};var a="invalid encoding";i.decode=function(d,u,h){for(var p=h,g=0,f,b=0;b<d.length;){var C=d.charCodeAt(b++);if(C===61&&g>1)break;if((C=r[C])===undefined)throw Error(a);switch(g){case 0:f=C,g=1;break;case 1:u[h++]=f<<2|(C&48)>>4,f=C,g=2;break;case 2:u[h++]=(f&15)<<4|(C&60)>>2,f=C,g=3;break;case 3:u[h++]=(f&3)<<6|C,g=0;break}}if(g===1)throw Error(a);return h-p},i.test=function(d){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(d)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?(function(){var d=new Float32Array([-0]),u=new Uint8Array(d.buffer),h=u[3]===128;function p(C,E,T){d[0]=C,E[T]=u[0],E[T+1]=u[1],E[T+2]=u[2],E[T+3]=u[3]}function g(C,E,T){d[0]=C,E[T]=u[3],E[T+1]=u[2],E[T+2]=u[1],E[T+3]=u[0]}c.writeFloatLE=h?p:g,c.writeFloatBE=h?g:p;function f(C,E){return u[0]=C[E],u[1]=C[E+1],u[2]=C[E+2],u[3]=C[E+3],d[0]}function b(C,E){return u[3]=C[E],u[2]=C[E+1],u[1]=C[E+2],u[0]=C[E+3],d[0]}c.readFloatLE=h?f:b,c.readFloatBE=h?b:f})():(function(){function d(h,p,g,f){var b=p<0?1:0;if(b&&(p=-p),p===0)h(1/p>0?0:2147483648,g,f);else if(isNaN(p))h(2143289344,g,f);else if(p>34028234663852886e22)h((b<<31|2139095040)>>>0,g,f);else if(p<11754943508222875e-54)h((b<<31|Math.round(p/1401298464324817e-60))>>>0,g,f);else{var C=Math.floor(Math.log(p)/Math.LN2),E=Math.round(p*Math.pow(2,-C)*8388608)&8388607;h((b<<31|C+127<<23|E)>>>0,g,f)}}c.writeFloatLE=d.bind(null,o),c.writeFloatBE=d.bind(null,r);function u(h,p,g){var f=h(p,g),b=(f>>31)*2+1,C=f>>>23&255,E=f&8388607;return C===255?E?NaN:b*(1/0):C===0?b*1401298464324817e-60*E:b*Math.pow(2,C-150)*(E+8388608)}c.readFloatLE=u.bind(null,s),c.readFloatBE=u.bind(null,a)})(),typeof Float64Array<"u"?(function(){var d=new Float64Array([-0]),u=new Uint8Array(d.buffer),h=u[7]===128;function p(C,E,T){d[0]=C,E[T]=u[0],E[T+1]=u[1],E[T+2]=u[2],E[T+3]=u[3],E[T+4]=u[4],E[T+5]=u[5],E[T+6]=u[6],E[T+7]=u[7]}function g(C,E,T){d[0]=C,E[T]=u[7],E[T+1]=u[6],E[T+2]=u[5],E[T+3]=u[4],E[T+4]=u[3],E[T+5]=u[2],E[T+6]=u[1],E[T+7]=u[0]}c.writeDoubleLE=h?p:g,c.writeDoubleBE=h?g:p;function f(C,E){return u[0]=C[E],u[1]=C[E+1],u[2]=C[E+2],u[3]=C[E+3],u[4]=C[E+4],u[5]=C[E+5],u[6]=C[E+6],u[7]=C[E+7],d[0]}function b(C,E){return u[7]=C[E],u[6]=C[E+1],u[5]=C[E+2],u[4]=C[E+3],u[3]=C[E+4],u[2]=C[E+5],u[1]=C[E+6],u[0]=C[E+7],d[0]}c.readDoubleLE=h?f:b,c.readDoubleBE=h?b:f})():(function(){function d(h,p,g,f,b,C){var E=f<0?1:0;if(E&&(f=-f),f===0)h(0,b,C+p),h(1/f>0?0:2147483648,b,C+g);else if(isNaN(f))h(0,b,C+p),h(2146959360,b,C+g);else if(f>17976931348623157e292)h(0,b,C+p),h((E<<31|2146435072)>>>0,b,C+g);else{var T;if(f<22250738585072014e-324)T=f/5e-324,h(T>>>0,b,C+p),h((E<<31|T/4294967296)>>>0,b,C+g);else{var S=Math.floor(Math.log(f)/Math.LN2);S===1024&&(S=1023),T=f*Math.pow(2,-S),h(T*4503599627370496>>>0,b,C+p),h((E<<31|S+1023<<20|T*1048576&1048575)>>>0,b,C+g)}}}c.writeDoubleLE=d.bind(null,o,0,4),c.writeDoubleBE=d.bind(null,r,4,0);function u(h,p,g,f,b){var C=h(f,b+p),E=h(f,b+g),T=(E>>31)*2+1,S=E>>>20&2047,_=4294967296*(E&1048575)+C;return S===2047?_?NaN:T*(1/0):S===0?T*5e-324*_:T*Math.pow(2,S-1075)*(_+4503599627370496)}c.readDoubleLE=u.bind(null,s,0,4),c.readDoubleBE=u.bind(null,a,4,0)})(),c}function o(c,d,u){d[u]=c&255,d[u+1]=c>>>8&255,d[u+2]=c>>>16&255,d[u+3]=c>>>24}function r(c,d,u){d[u]=c>>>24,d[u+1]=c>>>16&255,d[u+2]=c>>>8&255,d[u+3]=c&255}function s(c,d){return(c[d]|c[d+1]<<8|c[d+2]<<16|c[d+3]<<24)>>>0}function a(c,d){return(c[d]<<24|c[d+1]<<16|c[d+2]<<8|c[d+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;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}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,d=null,u=a;return function(p){if(p<1||p>c)return o(p);u+p>a&&(d=o(a),u=0);var g=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var d=null,u=[],h=0,p;s<a;)p=r[s++],p<128?u[h++]=p:p>191&&p<224?u[h++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,u[h++]=55296+(p>>10),u[h++]=56320+(p&1023)):u[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,u)),h=0);return d?(h&&d.push(String.fromCharCode.apply(String,u.slice(0,h))),d.join("")):String.fromCharCode.apply(String,u.slice(0,h))},i.write=function(r,s,a){for(var c=a,d,u,h=0;h<r.length;++h)d=r.charCodeAt(h),d<128?s[a++]=d:d<2048?(s[a++]=d>>6|192,s[a++]=d&63|128):(d&64512)===55296&&((u=r.charCodeAt(h+1))&64512)===56320?(d=65536+((d&1023)<<10)+(u&1023),++h,s[a++]=d>>18|240,s[a++]=d>>12&63|128,s[a++]=d>>6&63|128,s[a++]=d&63|128):(s[a++]=d>>12|224,s[a++]=d>>6&63|128,s[a++]=d&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(f,b){return RangeError("index out of range: "+f.pos+" + "+(b||1)+" > "+f.len)}function c(f){this.buf=f,this.pos=0,this.len=f.length}var d=typeof Uint8Array<"u"?function(b){if(b instanceof Uint8Array||Array.isArray(b))return new c(b);throw Error("illegal buffer")}:function(b){if(Array.isArray(b))return new c(b);throw Error("illegal buffer")},u=function(){return i.Buffer?function(C){return(c.create=function(T){return i.Buffer.isBuffer(T)?new o(T):d(T)})(C)}:d};c.create=u(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(function(){var b=4294967295;return function(){if(b=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(b=(b|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(b=(b|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(b=(b|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(b=(b|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return b;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return b}})(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var b=this.uint32();return b>>>1^-(b&1)|0};function h(){var f=new r(0,0),b=0;if(this.len-this.pos>4){for(;b<4;++b)if(f.lo=(f.lo|(this.buf[this.pos]&127)<<b*7)>>>0,this.buf[this.pos++]<128)return f;if(f.lo=(f.lo|(this.buf[this.pos]&127)<<28)>>>0,f.hi=(f.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return f;b=0}else{for(;b<3;++b){if(this.pos>=this.len)throw a(this);if(f.lo=(f.lo|(this.buf[this.pos]&127)<<b*7)>>>0,this.buf[this.pos++]<128)return f}return f.lo=(f.lo|(this.buf[this.pos++]&127)<<b*7)>>>0,f}if(this.len-this.pos>4){for(;b<5;++b)if(f.hi=(f.hi|(this.buf[this.pos]&127)<<b*7+3)>>>0,this.buf[this.pos++]<128)return f}else for(;b<5;++b){if(this.pos>=this.len)throw a(this);if(f.hi=(f.hi|(this.buf[this.pos]&127)<<b*7+3)>>>0,this.buf[this.pos++]<128)return f}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(f,b){return(f[b-4]|f[b-3]<<8|f[b-2]<<16|f[b-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var b=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,b},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var b=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,b},c.prototype.bytes=function(){var b=this.uint32(),C=this.pos,E=this.pos+b;if(E>this.len)throw a(this,b);if(this.pos+=b,Array.isArray(this.buf))return this.buf.slice(C,E);if(C===E){var T=i.Buffer;return T?T.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,C,E)},c.prototype.string=function(){var b=this.bytes();return s.read(b,0,b.length)},c.prototype.skip=function(b){if(typeof b=="number"){if(this.pos+b>this.len)throw a(this,b);this.pos+=b}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(f){switch(f){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(f=this.uint32()&7)!==4;)this.skipType(f);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+f+" at offset "+this.pos)}return this},c._configure=function(f){o=f,c.create=u(),o._configure();var b=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[b](!1)},uint64:function(){return h.call(this)[b](!0)},sint64:function(){return h.call(this).zzDecode()[b](!1)},fixed64:function(){return g.call(this)[b](!0)},sfixed64:function(){return g.call(this)[b](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,d,u){if(!d)throw TypeError("request must be specified");var h=this;if(!u)return i.asPromise(r,h,s,a,c,d);if(!h.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(g,f){if(g)return h.emit("error",g,s),u(g);if(f===null)return h.end(!0),undefined;if(!(f instanceof c))try{f=c[h.responseDelimited?"decodeDelimited":"decode"](f)}catch(b){return h.emit("error",b,s),u(b)}return h.emit("data",f,s),u(null,f)})}catch(p){return h.emit("error",p,s),setTimeout(function(){u(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,d){this.lo=c>>>0,this.hi=d>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(d){if(d===0)return r;var u=d<0;u&&(d=-d);var h=d>>>0,p=(d-h)/4294967296>>>0;return u&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(d){if(typeof d=="number")return o.fromNumber(d);if(i.isString(d))if(i.Long)d=i.Long.fromString(d);else return o.fromNumber(parseInt(d,10));return d.low||d.high?new o(d.low>>>0,d.high>>>0):r},o.prototype.toNumber=function(d){if(!d&&this.hi>>>31){var u=~this.lo+1>>>0,h=~this.hi>>>0;return u||(h=h+1>>>0),-(u+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(d){return i.Long?new i.Long(this.lo|0,this.hi|0,!!d):{low:this.lo|0,high:this.hi|0,unsigned:!!d}};var a=String.prototype.charCodeAt;o.fromHash=function(d){return d===s?r:new o((a.call(d,0)|a.call(d,1)<<8|a.call(d,2)<<16|a.call(d,3)<<24)>>>0,(a.call(d,4)|a.call(d,5)<<8|a.call(d,6)<<16|a.call(d,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var d=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^d)>>>0,this.lo=(this.lo<<1^d)>>>0,this},o.prototype.zzDecode=function(){var d=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^d)>>>0,this.hi=(this.hi>>>1^d)>>>0,this},o.prototype.length=function(){var d=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?u===0?d<16384?d<128?1:2:d<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:h<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var d=a[c];return d!=null&&a.hasOwnProperty(c)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},i.Buffer=(function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}})(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var d=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(d.lo,d.hi,c):d.toNumber(!!c)};function o(s,a,c){for(var d=Object.keys(a),u=0;u<d.length;++u)(s[d[u]]===undefined||!c)&&(s[d[u]]=a[d[u]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,d){if(!(this instanceof a))return new a(c,d);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&o(this,d)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},d=0;d<a.length;++d)c[a[d]]=1;return function(){for(var u=Object.keys(this),h=u.length-1;h>-1;--h)if(c[u[h]]===1&&this[u[h]]!==undefined&&this[u[h]]!==null)return u[h]}},i.oneOfSetter=function(a){return function(c){for(var d=0;d<a.length;++d)a[d]!==c&&delete this[a[d]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,d){return new s(c,d)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=h;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(S,_,R){this.fn=S,this.len=_,this.next=undefined,this.val=R}function d(){}function u(S){this.head=S.head,this.tail=S.tail,this.len=S.len,this.next=S.states}function h(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(h.create=function(){return new o})()}:function(){return new h}};h.create=p(),h.alloc=function(_){return new i.Array(_)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(_,R,L){return this.tail=this.tail.next=new c(_,R,L),this.len+=R,this};function g(S,_,R){_[R]=S&255}function f(S,_,R){for(;S>127;)_[R++]=S&127|128,S>>>=7;_[R]=S}function b(S,_){this.len=S,this.next=undefined,this.val=_}b.prototype=Object.create(c.prototype),b.prototype.fn=f,h.prototype.uint32=function(_){return this.len+=(this.tail=this.tail.next=new b((_=_>>>0)<128?1:_<16384?2:_<2097152?3:_<268435456?4:5,_)).len,this},h.prototype.int32=function(_){return _<0?this._push(C,10,r.fromNumber(_)):this.uint32(_)},h.prototype.sint32=function(_){return this.uint32((_<<1^_>>31)>>>0)};function C(S,_,R){for(;S.hi;)_[R++]=S.lo&127|128,S.lo=(S.lo>>>7|S.hi<<25)>>>0,S.hi>>>=7;for(;S.lo>127;)_[R++]=S.lo&127|128,S.lo=S.lo>>>7;_[R++]=S.lo}h.prototype.uint64=function(_){var R=r.from(_);return this._push(C,R.length(),R)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(_){var R=r.from(_).zzEncode();return this._push(C,R.length(),R)},h.prototype.bool=function(_){return this._push(g,1,_?1:0)};function E(S,_,R){_[R]=S&255,_[R+1]=S>>>8&255,_[R+2]=S>>>16&255,_[R+3]=S>>>24}h.prototype.fixed32=function(_){return this._push(E,4,_>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(_){var R=r.from(_);return this._push(E,4,R.lo)._push(E,4,R.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(_){return this._push(i.float.writeFloatLE,4,_)},h.prototype.double=function(_){return this._push(i.float.writeDoubleLE,8,_)};var T=i.Array.prototype.set?function(_,R,L){R.set(_,L)}:function(_,R,L){for(var W=0;W<_.length;++W)R[L+W]=_[W]};h.prototype.bytes=function(_){var R=_.length>>>0;if(!R)return this._push(g,1,0);if(i.isString(_)){var L=h.alloc(R=s.length(_));s.decode(_,L,0),_=L}return this.uint32(R)._push(T,R,_)},h.prototype.string=function(_){var R=a.length(_);return R?this.uint32(R)._push(a.write,R,_):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,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 c(d,0,0),this.len=0),this},h.prototype.ldelim=function(){var _=this.head,R=this.tail,L=this.len;return this.reset().uint32(L),L&&(this.tail.next=_.next,this.tail=R,this.len+=L),this},h.prototype.finish=function(){for(var _=this.head.next,R=this.constructor.alloc(this.len),L=0;_;)_.fn(_.val,R,L),L+=_.len,_=_.next;return R},h._configure=function(S){o=S,h.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,d,u){d.set(c,u)}:function(c,d,u){if(c.copy)c.copy(d,u,0,c.length);else for(var h=0;h<c.length;)d[u++]=c[h++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var d=c.length>>>0;return this.uint32(d),d&&this._push(r.writeBytesBuffer,d,c),this};function s(a,c,d){a.length<40?o.utf8.write(a,c,d):c.utf8Write?c.utf8Write(a,d):c.write(a,d)}r.prototype.string=function(c){var d=o.Buffer.byteLength(c);return this.uint32(d),d&&this._push(s,d,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var sZe=vu((IAo,_O)=>{var _Ao=y(x());/* Copyright 2015-2018 Esri. 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 @preserve */(function(){var e=(function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,g=c(u,h.inputOffset||0,p),f=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,b=r(g,h.pixelType||Float32Array,h.encodedMaskData,f,h.returnMask),C={width:g.width,height:g.height,pixelData:b.resultPixels,minValue:b.minValue,maxValue:g.pixels.maxValue,noDataValue:f};return b.resultMask&&(C.maskData=b.resultMask),h.returnEncodedMask&&g.mask&&(C.encodedMaskData=g.mask.bitset?g.mask.bitset:null),h.returnFileInfo&&(C.fileInfo=s(g),h.computeUsedBitDepths&&(C.fileInfo.bitDepths=a(g))),C};var r=function(u,h,p,g,f){var b=0,C=u.pixels.numBlocksX,E=u.pixels.numBlocksY,T=Math.floor(u.width/C),S=Math.floor(u.height/E),_=2*u.maxZError,R=Number.MAX_VALUE,L;p=p||(u.mask?u.mask.bitset:null);var W,B;W=new h(u.width*u.height),f&&p&&(B=new Uint8Array(u.width*u.height));for(var Y=new Float32Array(T*S),N,A,I=0;I<=E;I++){var Z=I!==E?S:u.height%E;if(Z!==0)for(var G=0;G<=C;G++){var w=G!==C?T:u.width%C;if(w!==0){var X=I*u.width*S+G*T,v=u.width-w,U=u.pixels.blocks[b],k,P,O;U.encoding<2?(U.encoding===0?k=U.rawData:(d(U.stuffedData,U.bitsPerPixel,U.numValidPixels,U.offset,_,Y,u.pixels.maxValue),k=Y),P=0):U.encoding===2?O=0:O=U.offset;var H;if(p)for(A=0;A<Z;A++){for(X&7&&(H=p[X>>3],H<<=X&7),N=0;N<w;N++)X&7||(H=p[X>>3]),H&128?(B&&(B[X]=1),L=U.encoding<2?k[P++]:O,R=R>L?L:R,W[X++]=L):(B&&(B[X]=0),W[X++]=g),H<<=1;X+=v}else if(U.encoding<2)for(A=0;A<Z;A++){for(N=0;N<w;N++)L=k[P++],R=R>L?L:R,W[X++]=L;X+=v}else for(R=R>O?O:R,A=0;A<Z;A++){for(N=0;N<w;N++)W[X++]=O;X+=v}if(U.encoding===1&&P!==U.numValidPixels)throw"Block and Mask do not match";b++}}}return{resultPixels:W,resultMask:B,minValue:R}},s=function(u){return{fileIdentifierString:u.fileIdentifierString,fileVersion:u.fileVersion,imageType:u.imageType,height:u.height,width:u.width,maxZError:u.maxZError,eofOffset:u.eofOffset,mask:u.mask?{numBlocksX:u.mask.numBlocksX,numBlocksY:u.mask.numBlocksY,numBytes:u.mask.numBytes,maxValue:u.mask.maxValue}:null,pixels:{numBlocksX:u.pixels.numBlocksX,numBlocksY:u.pixels.numBlocksY,numBytes:u.pixels.numBytes,maxValue:u.pixels.maxValue,noDataValue:u.noDataValue}}},a=function(u){for(var h=u.pixels.numBlocksX*u.pixels.numBlocksY,p={},g=0;g<h;g++){var f=u.pixels.blocks[g];f.encoding===0?p.float32=!0:f.encoding===1?p[f.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(u,h,p){var g={},f=new Uint8Array(u,h,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,f),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;h+=10;var b=new DataView(u,h,24);if(g.fileVersion=b.getInt32(0,!0),g.imageType=b.getInt32(4,!0),g.height=b.getUint32(8,!0),g.width=b.getUint32(12,!0),g.maxZError=b.getFloat64(16,!0),h+=24,!p)if(b=new DataView(u,h,16),g.mask={},g.mask.numBlocksY=b.getUint32(0,!0),g.mask.numBlocksX=b.getUint32(4,!0),g.mask.numBytes=b.getUint32(8,!0),g.mask.maxValue=b.getFloat32(12,!0),h+=16,g.mask.numBytes>0){var C=new Uint8Array(Math.ceil(g.width*g.height/8));b=new DataView(u,h,g.mask.numBytes);var E=b.getInt16(0,!0),T=2,S=0;do{if(E>0)for(;E--;)C[S++]=b.getUint8(T++);else{var _=b.getUint8(T++);for(E=-E;E--;)C[S++]=_}E=b.getInt16(T,!0),T+=2}while(T<g.mask.numBytes);if(E!==-32768||S<C.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=C,h+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));b=new DataView(u,h,16),g.pixels={},g.pixels.numBlocksY=b.getUint32(0,!0),g.pixels.numBlocksX=b.getUint32(4,!0),g.pixels.numBytes=b.getUint32(8,!0),g.pixels.maxValue=b.getFloat32(12,!0),h+=16;var R=g.pixels.numBlocksX,L=g.pixels.numBlocksY,W=R+(g.width%R>0?1:0),B=L+(g.height%L>0?1:0);g.pixels.blocks=new Array(W*B);for(var Y=0,N=0;N<B;N++)for(var A=0;A<W;A++){var I=0,Z=u.byteLength-h;b=new DataView(u,h,Math.min(10,Z));var G={};g.pixels.blocks[Y++]=G;var w=b.getUint8(0);if(I++,G.encoding=w&63,G.encoding>3)throw"Invalid block encoding ("+G.encoding+")";if(G.encoding===2){h++;continue}if(w!==0&&w!==2){if(w>>=6,G.offsetType=w,w===2)G.offset=b.getInt8(1),I++;else if(w===1)G.offset=b.getInt16(1,!0),I+=2;else if(w===0)G.offset=b.getFloat32(1,!0),I+=4;else throw"Invalid block offset type";if(G.encoding===1)if(w=b.getUint8(I),I++,G.bitsPerPixel=w&63,w>>=6,G.numValidPixelsType=w,w===2)G.numValidPixels=b.getUint8(I),I++;else if(w===1)G.numValidPixels=b.getUint16(I,!0),I+=2;else if(w===0)G.numValidPixels=b.getUint32(I,!0),I+=4;else throw"Invalid valid pixel count type"}if(h+=I,G.encoding!==3){var X,v;if(G.encoding===0){var U=(g.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";X=new ArrayBuffer(U*4),v=new Uint8Array(X),v.set(new Uint8Array(u,h,U*4));var k=new Float32Array(X);G.rawData=k,h+=U*4}else if(G.encoding===1){var P=Math.ceil(G.numValidPixels*G.bitsPerPixel/8),O=Math.ceil(P/4);X=new ArrayBuffer(O*4),v=new Uint8Array(X),v.set(new Uint8Array(u,h,P)),G.stuffedData=new Uint32Array(X),h+=P}}}return g.eofOffset=h,g},d=function(u,h,p,g,f,b,C){var E=(1<<h)-1,T=0,S,_=0,R,L,W=Math.ceil((C-g)/f),B=u.length*4-Math.ceil(h*p/8);for(u[u.length-1]<<=8*B,S=0;S<p;S++){if(_===0&&(L=u[T++],_=32),_>=h)R=L>>>_-h&E,_-=h;else{var Y=h-_;R=(L&E)<<Y&E,L=u[T++],_=32-Y,R+=L>>>_}b[S]=R<W?g+R*f:C}return b};return o})(),t=(function(){"use strict";var o={unstuff:function(c,d,u,h,p,g,f,b){var C=(1<<u)-1,E=0,T,S=0,_,R,L,W,B=c.length*4-Math.ceil(u*h/8);if(c[c.length-1]<<=8*B,p)for(T=0;T<h;T++)S===0&&(R=c[E++],S=32),S>=u?(_=R>>>S-u&C,S-=u):(L=u-S,_=(R&C)<<L&C,R=c[E++],S=32-L,_+=R>>>S),d[T]=p[_];else for(W=Math.ceil((b-g)/f),T=0;T<h;T++)S===0&&(R=c[E++],S=32),S>=u?(_=R>>>S-u&C,S-=u):(L=u-S,_=(R&C)<<L&C,R=c[E++],S=32-L,_+=R>>>S),d[T]=_<W?g+_*f:b},unstuffLUT:function(c,d,u,h,p,g){var f=(1<<d)-1,b=0,C=0,E=0,T=0,S=0,_,R=[],L=c.length*4-Math.ceil(d*u/8);c[c.length-1]<<=8*L;var W=Math.ceil((g-h)/p);for(C=0;C<u;C++)T===0&&(_=c[b++],T=32),T>=d?(S=_>>>T-d&f,T-=d):(E=d-T,S=(_&f)<<E&f,_=c[b++],T=32-E,S+=_>>>T),R[C]=S<W?h+S*p:g;return R.unshift(h),R},unstuff2:function(c,d,u,h,p,g,f,b){var C=(1<<u)-1,E=0,T,S=0,_=0,R,L,W;if(p)for(T=0;T<h;T++)S===0&&(L=c[E++],S=32,_=0),S>=u?(R=L>>>_&C,S-=u,_+=u):(W=u-S,R=L>>>_&C,L=c[E++],S=32-W,R|=(L&(1<<W)-1)<<u-W,_=W),d[T]=p[R];else{var B=Math.ceil((b-g)/f);for(T=0;T<h;T++)S===0&&(L=c[E++],S=32,_=0),S>=u?(R=L>>>_&C,S-=u,_+=u):(W=u-S,R=L>>>_&C,L=c[E++],S=32-W,R|=(L&(1<<W)-1)<<u-W,_=W),d[T]=R<B?g+R*f:b}return d},unstuffLUT2:function(c,d,u,h,p,g){var f=(1<<d)-1,b=0,C=0,E=0,T=0,S=0,_=0,R,L=[],W=Math.ceil((g-h)/p);for(C=0;C<u;C++)T===0&&(R=c[b++],T=32,_=0),T>=d?(S=R>>>_&f,T-=d,_+=d):(E=d-T,S=R>>>_&f,R=c[b++],T=32-E,S|=(R&(1<<E)-1)<<d-E,_=E),L[C]=S<W?h+S*p:g;return L.unshift(h),L},originalUnstuff:function(c,d,u,h){var p=(1<<u)-1,g=0,f,b=0,C,E,T,S=c.length*4-Math.ceil(u*h/8);for(c[c.length-1]<<=8*S,f=0;f<h;f++)b===0&&(E=c[g++],b=32),b>=u?(C=E>>>b-u&p,b-=u):(T=u-b,C=(E&p)<<T&p,E=c[g++],b=32-T,C+=E>>>b),d[f]=C;return d},originalUnstuff2:function(c,d,u,h){var p=(1<<u)-1,g=0,f,b=0,C=0,E,T,S;for(f=0;f<h;f++)b===0&&(T=c[g++],b=32,C=0),b>=u?(E=T>>>C&p,b-=u,C+=u):(S=u-b,E=T>>>C&p,T=c[g++],b=32-S,E|=(T&(1<<S)-1)<<u-S,C=S),d[f]=E;return d}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var d=65535,u=65535,h=c.length,p=Math.floor(h/2),g=0;p;){var f=p>=359?359:p;p-=f;do d+=c[g++]<<8,u+=d+=c[g++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return h&1&&(u+=d+=c[g]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,h=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var g=new DataView(c,u,8),f=g.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=g.getUint32(4,!0),u+=4),g=new DataView(c,u,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),u+=8,f>=4?(p.numDims=g.getUint32(8,!0),u+=4):p.numDims=1,g=new DataView(c,u,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var b,C;if(f>=3&&(C=f>=4?52:48,b=this.computeChecksumFletcher32(new Uint8Array(c,u-C,p.blobSize-14)),b!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,h=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),g=this.readSubArray(c,d.ptr,h,p),f=this.readSubArray(c,d.ptr+p,h,p);d.ptr+=2*p;var b,C=!0;for(b=0;b<u.numDims;b++)if(g[b]!==f[b]){C=!1;break}return u.minValues=g,u.maxValues=f,C},readSubArray:function(c,d,u,h){var p;if(u===Uint8Array)p=new Uint8Array(c,d,h);else{var g=new ArrayBuffer(h),f=new Uint8Array(g);f.set(new Uint8Array(c,d,h)),p=new u(g)}return p},readMask:function(c,d){var u=d.ptr,h=d.headerInfo,p=h.width*h.height,g=h.numValidPixel,f=new DataView(c,u,4),b={};if(b.numBytes=f.getUint32(0,!0),u+=4,(g===0||p===g)&&b.numBytes!==0)throw"invalid mask";var C,E;if(g===0)C=new Uint8Array(Math.ceil(p/8)),b.bitset=C,E=new Uint8Array(p),d.pixels.resultMask=E,u+=b.numBytes;else if(b.numBytes>0){C=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,b.numBytes);var T=f.getInt16(0,!0),S=2,_=0,R=0;do{if(T>0)for(;T--;)C[_++]=f.getUint8(S++);else for(R=f.getUint8(S++),T=-T;T--;)C[_++]=R;T=f.getInt16(S,!0),S+=2}while(S<b.numBytes);if(T!==-32768||_<C.length)throw"Unexpected end of mask RLE encoding";E=new Uint8Array(p);var L=0,W=0;for(W=0;W<p;W++)W&7?(L=C[W>>3],L<<=W&7):L=C[W>>3],L&128&&(E[W]=1);d.pixels.resultMask=E,b.bitset=C,u+=b.numBytes}return d.ptr=u,d.mask=b,!0},readDataOneSweep:function(c,d,u){var h=d.ptr,p=d.headerInfo,g=p.numDims,f=p.width*p.height,b=p.imageType,C=p.numValidPixel*r.getDataTypeSize(b)*g,E,T=d.pixels.resultMask;if(u===Uint8Array)E=new Uint8Array(c,h,C);else{var S=new ArrayBuffer(C),_=new Uint8Array(S);_.set(new Uint8Array(c,h,C)),E=new u(S)}if(E.length===f*g)d.pixels.resultPixels=E;else{d.pixels.resultPixels=new u(f*g);var R=0,L=0,W=0,B=0;if(g>1)for(W=0;W<g;W++)for(B=W*f,L=0;L<f;L++)T[L]&&(d.pixels.resultPixels[B+L]=E[R++]);else for(L=0;L<f;L++)T[L]&&(d.pixels.resultPixels[L]=E[R++])}return h+=C,d.ptr=h,!0},readHuffmanTree:function(c,d){var u=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(c,d.ptr,16);d.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=h.getInt32(4,!0),f=h.getInt32(8,!0),b=h.getInt32(12,!0);if(f>=b)return!1;var C=new Uint32Array(b-f);r.decodeBits(c,d,C);var E=[],T,S,_,R;for(T=f;T<b;T++)S=T-(T<g?0:g),E[S]={first:C[T-f],second:null};var L=c.byteLength-d.ptr,W=Math.ceil(L/4),B=new ArrayBuffer(W*4),Y=new Uint8Array(B);Y.set(new Uint8Array(c,d.ptr,L));var N=new Uint32Array(B),A=0,I,Z=0;for(I=N[0],T=f;T<b;T++)S=T-(T<g?0:g),R=E[S].first,R>0&&(E[S].second=I<<A>>>32-R,32-A>=R?(A+=R,A===32&&(A=0,Z++,I=N[Z])):(A+=R-32,Z++,I=N[Z],E[S].second|=I>>>32-A));var G=0,w=0,X=new s;for(T=0;T<E.length;T++)E[T]!==void 0&&(G=Math.max(G,E[T].first));G>=u?w=u:w=G,G>=30&&console.log("WARning, large NUM LUT BITS IS "+G);var v=[],U,k,P,O,H,ee;for(T=f;T<b;T++)if(S=T-(T<g?0:g),R=E[S].first,R>0)if(U=[R,S],R<=w)for(k=E[S].second<<w-R,P=1<<w-R,_=0;_<P;_++)v[k|_]=U;else for(k=E[S].second,ee=X,O=R-1;O>=0;O--)H=k>>>O&1,H?(ee.right||(ee.right=new s),ee=ee.right):(ee.left||(ee.left=new s),ee=ee.left),O===0&&!ee.val&&(ee.val=U[1]);return{decodeLut:v,numBitsLUTQick:w,numBitsLUT:G,tree:X,stuffedData:N,srcPtr:Z,bitPos:A}},readHuffman:function(c,d,u){var h=d.headerInfo,p=h.numDims,g=d.headerInfo.height,f=d.headerInfo.width,b=f*g,C=this.readHuffmanTree(c,d),E=C.decodeLut,T=C.tree,S=C.stuffedData,_=C.srcPtr,R=C.bitPos,L=C.numBitsLUTQick,W=C.numBitsLUT,B=d.headerInfo.imageType===0?128:0,Y,N,A,I=d.pixels.resultMask,Z,G,w,X,v,U,k,P=0;R>0&&(_++,R=0);var O=S[_],H=d.encodeMode===1,ee=new u(b*p),z=ee,te;for(te=0;te<h.numDims;te++){if(p>1&&(z=new u(ee.buffer,b*te,b),P=0),d.headerInfo.numValidPixel===f*g)for(U=0,X=0;X<g;X++)for(v=0;v<f;v++,U++){if(N=0,Z=O<<R>>>32-L,G=Z,32-R<L&&(Z|=S[_+1]>>>64-R-L,G=Z),E[G])N=E[G][1],R+=E[G][0];else for(Z=O<<R>>>32-W,G=Z,32-R<W&&(Z|=S[_+1]>>>64-R-W,G=Z),Y=T,k=0;k<W;k++)if(w=Z>>>W-k-1&1,Y=w?Y.right:Y.left,!(Y.left||Y.right)){N=Y.val,R=R+k+1;break}R>=32&&(R-=32,_++,O=S[_]),A=N-B,H?(v>0?A+=P:X>0?A+=z[U-f]:A+=P,A&=255,z[U]=A,P=A):z[U]=A}else for(U=0,X=0;X<g;X++)for(v=0;v<f;v++,U++)if(I[U]){if(N=0,Z=O<<R>>>32-L,G=Z,32-R<L&&(Z|=S[_+1]>>>64-R-L,G=Z),E[G])N=E[G][1],R+=E[G][0];else for(Z=O<<R>>>32-W,G=Z,32-R<W&&(Z|=S[_+1]>>>64-R-W,G=Z),Y=T,k=0;k<W;k++)if(w=Z>>>W-k-1&1,Y=w?Y.right:Y.left,!(Y.left||Y.right)){N=Y.val,R=R+k+1;break}R>=32&&(R-=32,_++,O=S[_]),A=N-B,H?(v>0&&I[U-1]?A+=P:X>0&&I[U-f]?A+=z[U-f]:A+=P,A&=255,z[U]=A,P=A):z[U]=A}d.ptr=d.ptr+(_+1)*4+(R>0?4:0)}d.pixels.resultPixels=ee},decodeBits:function(c,d,u,h,p){{var g=d.headerInfo,f=g.fileVersion,b=0,C=new DataView(c,d.ptr,5),E=C.getUint8(0);b++;var T=E>>6,S=T===0?4:3-T,_=(E&32)>0,R=E&31,L=0;if(S===1)L=C.getUint8(b),b++;else if(S===2)L=C.getUint16(b,!0),b+=2;else if(S===4)L=C.getUint32(b,!0),b+=4;else throw"Invalid valid pixel count type";var W=2*g.maxZError,B,Y,N,A,I,Z,G,w,X,v,U=g.numDims>1?g.maxValues[p]:g.zMax;if(_){for(d.counter.lut++,w=C.getUint8(b),X=R,b++,A=Math.ceil((w-1)*R/8),I=Math.ceil(A/4),Y=new ArrayBuffer(I*4),N=new Uint8Array(Y),d.ptr+=b,N.set(new Uint8Array(c,d.ptr,A)),G=new Uint32Array(Y),d.ptr+=A,v=0;w-1>>>v;)v++;A=Math.ceil(L*v/8),I=Math.ceil(A/4),Y=new ArrayBuffer(I*4),N=new Uint8Array(Y),N.set(new Uint8Array(c,d.ptr,A)),B=new Uint32Array(Y),d.ptr+=A,f>=3?Z=o.unstuffLUT2(G,R,w-1,h,W,U):Z=o.unstuffLUT(G,R,w-1,h,W,U),f>=3?o.unstuff2(B,u,v,L,Z):o.unstuff(B,u,v,L,Z)}else d.counter.bitstuffer++,v=R,d.ptr+=b,v>0&&(A=Math.ceil(L*v/8),I=Math.ceil(A/4),Y=new ArrayBuffer(I*4),N=new Uint8Array(Y),N.set(new Uint8Array(c,d.ptr,A)),B=new Uint32Array(Y),d.ptr+=A,f>=3?h==null?o.originalUnstuff2(B,u,v,L):o.unstuff2(B,u,v,L,!1,h,W,U):h==null?o.originalUnstuff(B,u,v,L):o.unstuff(B,u,v,L,!1,h,W,U))}},readTiles:function(c,d,u){var h=d.headerInfo,p=h.width,g=h.height,f=h.microBlockSize,b=h.imageType,C=r.getDataTypeSize(b),E=Math.ceil(p/f),T=Math.ceil(g/f);d.pixels.numBlocksY=T,d.pixels.numBlocksX=E,d.pixels.ptr=0;var S=0,_=0,R=0,L=0,W=0,B=0,Y=0,N=0,A=0,I=0,Z=0,G=0,w=0,X=0,v=0,U=0,k,P,O,H,ee,z,te=new u(f*f),q=g%f||f,me=p%f||f,ye,oe,xe=h.numDims,Ee,Le=d.pixels.resultMask,Se=d.pixels.resultPixels;for(R=0;R<T;R++)for(W=R!==T-1?f:q,L=0;L<E;L++)for(B=L!==E-1?f:me,Z=R*p*f+L*f,G=p-B,Ee=0;Ee<xe;Ee++){if(xe>1&&(Se=new u(d.pixels.resultPixels.buffer,p*g*Ee*C,p*g)),Y=c.byteLength-d.ptr,k=new DataView(c,d.ptr,Math.min(10,Y)),P={},U=0,N=k.getUint8(0),U++,A=N>>6&255,I=N>>2&15,I!==(L*f>>3&15))throw"integrity issue";if(z=N&3,z>3)throw d.ptr+=U,"Invalid block encoding ("+z+")";if(z===2){d.counter.constant++,d.ptr+=U;continue}else if(z===0){if(d.counter.uncompressed++,d.ptr+=U,w=W*B*C,X=c.byteLength-d.ptr,w=w<X?w:X,O=new ArrayBuffer(w%C===0?w:w+C-w%C),H=new Uint8Array(O),H.set(new Uint8Array(c,d.ptr,w)),ee=new u(O),v=0,Le)for(S=0;S<W;S++){for(_=0;_<B;_++)Le[Z]&&(Se[Z]=ee[v++]),Z++;Z+=G}else for(S=0;S<W;S++){for(_=0;_<B;_++)Se[Z++]=ee[v++];Z+=G}d.ptr+=v*C}else if(ye=r.getDataTypeUsed(b,A),oe=r.getOnePixel(P,U,ye,k),U+=r.getDataTypeSize(ye),z===3)if(d.ptr+=U,d.counter.constantoffset++,Le)for(S=0;S<W;S++){for(_=0;_<B;_++)Le[Z]&&(Se[Z]=oe),Z++;Z+=G}else for(S=0;S<W;S++){for(_=0;_<B;_++)Se[Z++]=oe;Z+=G}else if(d.ptr+=U,r.decodeBits(c,d,te,oe,Ee),U=0,Le)for(S=0;S<W;S++){for(_=0;_<B;_++)Le[Z]&&(Se[Z]=te[U++]),Z++;Z+=G}else for(S=0;S<W;S++){for(_=0;_<B;_++)Se[Z++]=te[U++];Z+=G}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var d=c.headerInfo.zMax,u=c.headerInfo.numDims,h=c.headerInfo.height*c.headerInfo.width,p=h*u,g=0,f=0,b=0,C=c.pixels.resultMask;if(C)if(u>1)for(g=0;g<u;g++)for(b=g*h,f=0;f<h;f++)C[f]&&(c.pixels.resultPixels[b+f]=d);else for(f=0;f<h;f++)C[f]&&(c.pixels.resultPixels[f]=d);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(d);else for(f=0;f<p;f++)c.pixels.resultPixels[f]=d},getDataTypeArray:function(c){var d;switch(c){case 0:d=Int8Array;break;case 1:d=Uint8Array;break;case 2:d=Int16Array;break;case 3:d=Uint16Array;break;case 4:d=Int32Array;break;case 5:d=Uint32Array;break;case 6:d=Float32Array;break;case 7:d=Float64Array;break;default:d=Float32Array}return d},getPixelType:function(c){var d;switch(c){case 0:d="S8";break;case 1:d="U8";break;case 2:d="S16";break;case 3:d="U16";break;case 4:d="S32";break;case 5:d="U32";break;case 6:d="F32";break;case 7:d="F64";break;default:d="F32"}return d},isValidPixelValue:function(c,d){if(d==null)return!1;var u;switch(c){case 0:u=d>=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var d=0;switch(c){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=c}return d},getDataTypeUsed:function(c,d){var u=c;switch(c){case 2:case 4:u=c-d;break;case 3:case 5:u=c-2*d;break;case 6:d===0?u=c:d===1?u=2:u=1;break;case 7:d===0?u=c:u=c-2*d+1;break;default:u=c;break}return u},getOnePixel:function(c,d,u,h){var p=0;switch(u){case 0:p=h.getInt8(d);break;case 1:p=h.getUint8(d);break;case 2:p=h.getInt16(d,!0);break;case 3:p=h.getUint16(d,!0);break;case 4:p=h.getInt32(d,!0);break;case 5:p=h.getUInt32(d,!0);break;case 6:p=h.getFloat32(d,!0);break;case 7:p=h.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,d,u){this.val=c,this.left=d,this.right=u},a={decode:function(c,d){d=d||{};var u=d.noDataValue,h=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,f=g.fileVersion,b=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var C=g.width*g.height;if(p.pixels.resultPixels=new b(C*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var E=new DataView(c,p.ptr,2),T=E.getUint8(0);if(p.ptr++,T)r.readDataOneSweep(c,p,b);else if(f>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var S=E.getUint8(1);if(p.ptr++,p.encodeMode=S,S>2||f<4&&S>1)throw"Invalid Huffman flag "+S;S?r.readHuffman(c,p,b):r.readTiles(c,p,b)}else r.readTiles(c,p,b)}p.eofOffset=p.ptr;var _;d.inputOffset?(_=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(_)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(_=p.headerInfo.blobSize-p.ptr,Math.abs(_)>=1&&(p.eofOffset=p.headerInfo.blobSize));var R={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,u)){var L=p.pixels.resultMask;for(h=0;h<C;h++)L[h]||(R.pixelData[h]=u);R.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(R.fileInfo=r.formatFileInfo(p)),R}},getBandCount:function(c){var d=0,u=0,h={};for(h.ptr=0,h.pixels={};u<c.byteLength-58;)r.readHeaderInfo(c,h),u+=h.headerInfo.blobSize,d++,h.ptr=u;return d}};return a})(),n=(function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1})(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),d,u;if(c.trim()==="CntZImage")d=e,u=1;else if(c.substring(0,5)==="Lerc2")d=t,u=2;else throw"Unexpected file identifier string: "+c;for(var h=0,p=o.byteLength-10,g,f=[],b,C,E={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var T=d.decode(o,{inputOffset:s,encodedMaskData:g,maskData:C,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=T.fileInfo.eofOffset,h===0&&(g=T.encodedMaskData,C=T.maskData,E.width=T.width,E.height=T.height,E.dimCount=T.dimCount||1,E.pixelType=T.pixelType||T.fileInfo.pixelType,E.mask=T.maskData),u>1&&T.fileInfo.mask&&T.fileInfo.mask.numBytes>0&&f.push(T.maskData),h++,E.pixels.push(T.pixelData),E.statistics.push({minValue:T.minValue,maxValue:T.maxValue,noDataValue:T.noDataValue,dimStats:T.dimStats})}var S,_,R;if(u>1&&f.length>1){for(R=E.width*E.height,E.bandMasks=f,C=new Uint8Array(R),C.set(f[0]),S=1;S<f.length;S++)for(b=f[S],_=0;_<R;_++)C[_]=C[_]&b[_];E.maskData=C}return E}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof _O<"u"&&_O.exports?_O.exports=i:this.Lerc=i})()});var KZe=vu((Jvo,HZe)=>{var jvo=y(x());HZe.exports={webm:"data:video/webm;base64,[encoded data, 7436 characters]",mp4:"data:video/mp4;base64,[encoded data, 5004 characters]"}});var jZe=vu((qvo,JZe)=>{var $vo=y(x()),{webm:EWt,mp4:TWt}=KZe(),nte=()=>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,ite=()=>"wakeLock"in navigator,ote=class{constructor(){if(this.enabled=!1,ite()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else nte()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",EWt),this._addSourceToVideo(this.noSleepVideo,"mp4",TWt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return ite()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):nte()?(this.disable(),console.warn(`
        NoSleep enabled for older iOS devices. This can interrupt
        active or long-running network requests from completing successfully.
        See https://github.com/richtr/NoSleep.js/issues/15 for more details.
      `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){ite()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):nte()?this.noSleepTimer&&(console.warn(`
          NoSleep now disabled for older iOS devices.
        `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};JZe.exports=ote});var OWt={};hRe(OWt,{AlphaMode:()=>op,AlphaPipelineStage:()=>vF,AnchorPointDirect:()=>OW,AnchorPointIndirect:()=>zW,Animation:()=>EU,AnimationViewModel:()=>TU,Appearance:()=>Co,ApproximateTerrainHeights:()=>Zi,ArcGISTiledElevationTerrainProvider:()=>z7,ArcGisBaseMapType:()=>Mh,ArcGisMapServerImageryProvider:()=>ug,ArcGisMapService:()=>tu,ArcType:()=>ln,ArticulationStageType:()=>vc,AssociativeArray:()=>Ft,Atmosphere:()=>AC,AtmospherePipelineStage:()=>TF,AttributeCompression:()=>_n,AttributeType:()=>Ut,AutoExposure:()=>IP,AutomaticUniforms:()=>dA,Axis:()=>to,AxisAlignedBoundingBox:()=>Od,Azure2DImageryProvider:()=>IB,B3dmLoader:()=>aF,B3dmParser:()=>oF,BaseLayerPicker:()=>gU,BaseLayerPickerViewModel:()=>AU,BatchTable:()=>Rx,BatchTableHierarchy:()=>jx,BatchTexture:()=>_l,BatchTexturePipelineStage:()=>kF,Billboard:()=>Zo,BillboardCollection:()=>ru,BillboardGraphics:()=>wc,BillboardLoadState:()=>Ws,BillboardTexture:()=>pg,BillboardVisualizer:()=>V1,BingMapsGeocoderService:()=>K7,BingMapsImageryProvider:()=>fB,BingMapsStyle:()=>cI,BlendEquation:()=>pc,BlendFunction:()=>zo,BlendOption:()=>Jo,BlendingState:()=>fn,BoundingRectangle:()=>$e,BoundingSphere:()=>ue,BoundingSphereState:()=>gt,BoundingVolumeSemantics:()=>A0,BoxEmitter:()=>k$,BoxGeometry:()=>hc,BoxGeometryUpdater:()=>DL,BoxGraphics:()=>Yx,BoxOutlineGeometry:()=>gh,BrdfLutGenerator:()=>_X,Buffer:()=>mt,BufferLoader:()=>iC,BufferUsage:()=>Xe,CPUStylingPipelineStage:()=>HF,CallbackPositionProperty:()=>vL,CallbackProperty:()=>Th,Camera:()=>So,CameraEventAggregator:()=>LP,CameraEventType:()=>qi,CameraFlightPath:()=>RX,Cartesian2:()=>M,Cartesian3:()=>m,Cartesian4:()=>ce,CartesianRectangle:()=>yI,Cartographic:()=>pe,CartographicGeocoderService:()=>j7,CatmullRomSpline:()=>q7,Cesium3DContentGroup:()=>Jx,Cesium3DTile:()=>Rm,Cesium3DTileBatchTable:()=>Rh,Cesium3DTileColorBlendMode:()=>ld,Cesium3DTileContent:()=>Q$,Cesium3DTileContentFactory:()=>PC,Cesium3DTileContentState:()=>lr,Cesium3DTileContentType:()=>sa,Cesium3DTileFeature:()=>Ea,Cesium3DTileFeatureTable:()=>Yh,Cesium3DTileOptimizationHint:()=>Tm,Cesium3DTileOptimizations:()=>sw,Cesium3DTilePass:()=>nr,Cesium3DTilePassState:()=>Hm,Cesium3DTilePointFeature:()=>Ag,Cesium3DTileRefine:()=>ar,Cesium3DTileStyle:()=>IT,Cesium3DTileStyleEngine:()=>mw,Cesium3DTilesInspector:()=>ZU,Cesium3DTilesInspectorViewModel:()=>_U,Cesium3DTilesTerrainData:()=>DN,Cesium3DTilesTerrainGeometryProcessor:()=>lZ,Cesium3DTilesTerrainProvider:()=>r6,Cesium3DTilesVoxelProvider:()=>O$,Cesium3DTileset:()=>ks,Cesium3DTilesetBaseTraversal:()=>bw,Cesium3DTilesetCache:()=>lw,Cesium3DTilesetGraphics:()=>vx,Cesium3DTilesetHeatmap:()=>dw,Cesium3DTilesetMetadata:()=>KC,Cesium3DTilesetMostDetailedTraversal:()=>pw,Cesium3DTilesetSkipTraversal:()=>Cw,Cesium3DTilesetStatistics:()=>jh,Cesium3DTilesetTraversal:()=>Ra,Cesium3DTilesetVisualizer:()=>Ew,CesiumInspector:()=>VU,CesiumInspectorViewModel:()=>GU,CesiumTerrainProvider:()=>NE,CesiumWidget:()=>BM,Check:()=>Xo,CheckerboardMaterialProperty:()=>vI,CircleEmitter:()=>kM,CircleGeometry:()=>u6,CircleOutlineGeometry:()=>m6,ClassificationModelDrawCommand:()=>l2,ClassificationPipelineStage:()=>QF,ClassificationPrimitive:()=>mS,ClassificationType:()=>qn,ClearCommand:()=>li,ClippingPlane:()=>Us,ClippingPlaneCollection:()=>ss,ClippingPolygon:()=>DS,ClippingPolygonCollection:()=>Wh,Clock:()=>of,ClockRange:()=>As,ClockStep:()=>wo,ClockViewModel:()=>pU,CloudCollection:()=>q$,CloudType:()=>QZ,Color:()=>D,ColorBlendMode:()=>Dc,ColorGeometryInstanceAttribute:()=>qt,ColorMaterialProperty:()=>Kt,Command:()=>Dee,ComponentDatatype:()=>J,Composite3DTileContent:()=>qL,CompositeEntityCollection:()=>xj,CompositeMaterialProperty:()=>QI,CompositePositionProperty:()=>qa,CompositeProperty:()=>Kc,CompressedTextureBuffer:()=>_R,ComputeCommand:()=>ll,ComputeEngine:()=>IR,ConditionsExpression:()=>MM,ConeEmitter:()=>eee,ConstantPositionProperty:()=>gl,ConstantProperty:()=>mi,ConstantSpline:()=>uF,ContentMetadata:()=>j2,Context:()=>xx,ContextLimits:()=>Yt,CoplanarPolygonGeometry:()=>sY,CoplanarPolygonGeometryLibrary:()=>Ig,CoplanarPolygonOutlineGeometry:()=>Zm,CornerType:()=>Hi,CorrelationGroup:()=>HW,CorridorGeometry:()=>eE,CorridorGeometryLibrary:()=>oo,CorridorGeometryUpdater:()=>Lw,CorridorGraphics:()=>Xx,CorridorOutlineGeometry:()=>Vw,Credit:()=>bt,CreditDisplay:()=>WX,CubeMap:()=>zr,CubeMapFace:()=>YR,CubicRealPolynomial:()=>mx,CullFace:()=>wi,CullingVolume:()=>Ps,CumulusCloud:()=>Pu,CustomDataSource:()=>Nw,CustomHeightmapTerrainProvider:()=>h6,CustomShader:()=>AT,CustomShaderMode:()=>lg,CustomShaderPipelineStage:()=>tB,CustomShaderTranslucencyMode:()=>L0,CylinderGeometry:()=>Xw,CylinderGeometryLibrary:()=>tE,CylinderGeometryUpdater:()=>Mw,CylinderGraphics:()=>Px,CylinderOutlineGeometry:()=>Pw,CzmlDataSource:()=>Jw,DataSource:()=>ps,DataSourceClock:()=>rf,DataSourceCollection:()=>jw,DataSourceDisplay:()=>PY,DebugAppearance:()=>tee,DebugCameraPrimitive:()=>Hp,DebugInspector:()=>PP,DebugModelMatrixPrimitive:()=>OM,DefaultProxy:()=>f6,DepthFunction:()=>ka,DepthPlane:()=>NX,DequantizationPipelineStage:()=>iB,DerivedCommand:()=>Kp,DeveloperError:()=>Ae,DeviceOrientationCameraController:()=>XX,DirectionalLight:()=>nee,DiscardEmptyTileImagePolicy:()=>lI,DiscardMissingTileImagePolicy:()=>mB,DistanceDisplayCondition:()=>Mt,DistanceDisplayConditionGeometryInstanceAttribute:()=>jn,DoubleEndedPriorityQueue:()=>sb,DoublyLinkedList:()=>cw,DracoLoader:()=>QA,DrawCommand:()=>nt,DynamicAtmosphereLightingType:()=>qA,DynamicEnvironmentMapManager:()=>$A,DynamicGeometryBatch:()=>cE,DynamicGeometryUpdater:()=>Ci,EarthOrientationParameters:()=>gR,EarthOrientationParametersSample:()=>Gb,EasingFunction:()=>bs,EdgeDetectionPipelineStage:()=>rB,EdgeFramebuffer:()=>QX,EdgeVisibilityPipelineStage:()=>aB,EllipseGeometry:()=>Ul,EllipseGeometryLibrary:()=>Td,EllipseGeometryUpdater:()=>$w,EllipseGraphics:()=>Mx,EllipseOutlineGeometry:()=>bu,Ellipsoid:()=>ie,EllipsoidGeodesic:()=>RA,EllipsoidGeometry:()=>Va,EllipsoidGeometryUpdater:()=>tY,EllipsoidGraphics:()=>Ux,EllipsoidOutlineGeometry:()=>du,EllipsoidPrimitive:()=>CX,EllipsoidRhumbLine:()=>Ac,EllipsoidSurfaceAppearance:()=>iee,EllipsoidTangentPlane:()=>Ss,EllipsoidTerrainProvider:()=>kp,EllipsoidalOccluder:()=>tf,Empty3DTileContent:()=>VI,EncodedCartesian3:()=>ti,Entity:()=>xr,EntityCluster:()=>mu,EntityCollection:()=>Ga,EntityView:()=>UY,Event:()=>Ce,EventHelper:()=>Xr,Expression:()=>am,ExpressionNodeType:()=>It,ExtrapolationType:()=>fu,FeatureDetection:()=>rn,FeatureIdPipelineStage:()=>V0,Fog:()=>PX,ForEach:()=>Ye,FrameRateMonitor:()=>KM,FrameState:()=>MX,Framebuffer:()=>ns,FramebufferManager:()=>xi,Frozen:()=>Q,FrustumCommands:()=>OX,FrustumGeometry:()=>PE,FrustumOutlineGeometry:()=>ON,Fullscreen:()=>kr,FullscreenButton:()=>WU,FullscreenButtonViewModel:()=>LU,GaussianSplat3DTileContent:()=>v0,GaussianSplatPrimitive:()=>GI,GaussianSplatRenderResources:()=>H2,GaussianSplatSorter:()=>ZI,GaussianSplatTextureGenerator:()=>z2,GeoJsonDataSource:()=>hy,GeoJsonLoader:()=>cF,GeocodeType:()=>Ly,Geocoder:()=>BU,GeocoderService:()=>fZ,GeocoderViewModel:()=>FU,GeographicProjection:()=>vi,GeographicTilingScheme:()=>Qi,Geometry:()=>pt,Geometry3DTileContent:()=>tW,GeometryAttribute:()=>We,GeometryAttributes:()=>yn,GeometryFactory:()=>b6,GeometryInstance:()=>Bt,GeometryInstanceAttribute:()=>Yc,GeometryOffsetAttribute:()=>mn,GeometryPipeline:()=>Dn,GeometryPipelineStage:()=>uB,GeometryType:()=>zu,GeometryUpdater:()=>Ei,GeometryUpdaterSet:()=>yE,GeometryVisualizer:()=>ZY,GetFeatureInfoFormat:()=>TC,Globe:()=>xX,GlobeDepth:()=>zX,GlobeSurfaceShaderSet:()=>lX,GlobeSurfaceTile:()=>Om,GlobeSurfaceTileProvider:()=>uX,GlobeTranslucency:()=>mX,GlobeTranslucencyFramebuffer:()=>HX,GlobeTranslucencyState:()=>UX,GltfBufferViewLoader:()=>IS,GltfDracoLoader:()=>_S,GltfGpmLoader:()=>JW,GltfGpmLocal:()=>kS,GltfImageLoader:()=>ZS,GltfIndexBufferLoader:()=>RS,GltfJsonLoader:()=>VS,GltfLoader:()=>eu,GltfLoaderUtil:()=>md,GltfMeshPrimitiveGpmLoader:()=>eF,GltfSpzLoader:()=>yW,GltfStructuralMetadataLoader:()=>kW,GltfTextureLoader:()=>LS,GltfVertexBufferLoader:()=>WS,Google2DImageryProvider:()=>SB,GoogleEarthEnterpriseImageryProvider:()=>ree,GoogleEarthEnterpriseMapsProvider:()=>gB,GoogleEarthEnterpriseMetadata:()=>cb,GoogleEarthEnterpriseTerrainData:()=>pZ,GoogleEarthEnterpriseTerrainProvider:()=>I6,GoogleEarthEnterpriseTileInformation:()=>zN,GoogleGeocoderService:()=>Z6,GoogleMaps:()=>Am,GpxDataSource:()=>zY,GregorianDate:()=>mA,GridImageryProvider:()=>see,GridMaterialProperty:()=>t_,GroundGeometryUpdater:()=>ii,GroundPolylineGeometry:()=>Wx,GroundPolylinePrimitive:()=>bh,GroundPrimitive:()=>pl,GroupMetadata:()=>MI,HeadingPitchRange:()=>Xm,HeadingPitchRoll:()=>uc,Heap:()=>hR,HeightReference:()=>tt,HeightmapEncoding:()=>vm,HeightmapTerrainData:()=>Sc,HeightmapTessellator:()=>oZ,HermitePolynomialApproximation:()=>Uw,HermiteSpline:()=>Z0,HilbertOrder:()=>CS,HomeButton:()=>YU,HomeButtonViewModel:()=>wU,HorizontalOrigin:()=>Bi,I3SBuildingSceneLayerExplorer:()=>jee,I3SBuildingSceneLayerExplorerViewModel:()=>NU,I3SDataProvider:()=>Bf,I3SDecoder:()=>JM,I3SFeature:()=>jM,I3SField:()=>qM,I3SGeometry:()=>OZ,I3SLayer:()=>VT,I3SNode:()=>zZ,I3SStatistics:()=>tU,I3SSublayer:()=>iU,I3SSymbology:()=>eU,I3dmLoader:()=>dF,I3dmParser:()=>lF,ITwinData:()=>dee,ITwinPlatform:()=>ma,Iau2000Orientation:()=>KN,Iau2006XysData:()=>bR,Iau2006XysSample:()=>cx,IauOrientationAxes:()=>JN,IauOrientationParameters:()=>HN,ImageBasedLighting:()=>Kx,ImageBasedLightingPipelineStage:()=>IF,ImageMaterialProperty:()=>Hb,Imagery:()=>gI,ImageryConfiguration:()=>y2,ImageryCoverage:()=>xI,ImageryFlags:()=>RB,ImageryInput:()=>VB,ImageryLayer:()=>ds,ImageryLayerCollection:()=>jC,ImageryLayerFeatureInfo:()=>Ph,ImageryPipelineStage:()=>LB,ImageryProvider:()=>Wl,ImageryState:()=>Hn,Implicit3DTileContent:()=>YS,ImplicitAvailabilityBitstream:()=>TS,ImplicitMetadataView:()=>SS,ImplicitSubdivisionScheme:()=>Zs,ImplicitSubtree:()=>KA,ImplicitSubtreeCache:()=>DM,ImplicitSubtreeMetadata:()=>nW,ImplicitTileCoordinates:()=>yp,ImplicitTileset:()=>bp,IndexDatatype:()=>Pe,InfoBox:()=>PU,InfoBoxViewModel:()=>XU,InspectorShared:()=>Yd,InstanceAttributeSemantic:()=>Gs,InstancingPipelineStage:()=>PF,InterpolationAlgorithm:()=>G6,InterpolationType:()=>Bh,Intersect:()=>Jt,IntersectionTests:()=>di,Intersections2D:()=>Ef,Interval:()=>Or,InvertClassification:()=>GZ,Ion:()=>_h,IonGeocodeProviderType:()=>lb,IonGeocoderService:()=>UE,IonImageryProvider:()=>Fl,IonImageryProviderFactory:()=>pI,IonResource:()=>os,IonWorldImageryStyle:()=>hg,Iso8601:()=>Ke,JobScheduler:()=>DX,JobType:()=>yc,JsonMetadataTable:()=>eg,JulianDate:()=>j,KTX2Transcoder:()=>ZR,KeyboardEventModifier:()=>Wa,KeyframeNode:()=>No,KmlCamera:()=>HY,KmlDataSource:()=>VE,KmlLookAt:()=>RN,KmlTour:()=>GN,KmlTourFlyTo:()=>LN,KmlTourWait:()=>WN,Label:()=>X0,LabelCollection:()=>fp,LabelGraphics:()=>xh,LabelStyle:()=>cr,LabelVisualizer:()=>RY,LagrangePolynomialApproximation:()=>Dw,LeapSecond:()=>mo,Light:()=>uee,LightingModel:()=>dp,LightingPipelineStage:()=>FB,LinearApproximation:()=>iE,LinearSpline:()=>_0,ManagedArray:()=>Il,MapMode2D:()=>Ql,MapProjection:()=>W6,MapboxImageryProvider:()=>bB,MapboxStyleImageryProvider:()=>mee,MappedPositions:()=>GB,Material:()=>ho,MaterialAppearance:()=>Io,MaterialPipelineStage:()=>wB,MaterialProperty:()=>yr,Math:()=>V,Matrix2:()=>ki,Matrix3:()=>$,Matrix4:()=>F,Megatexture:()=>lM,MeshPrimitiveGpmLocal:()=>$W,MetadataClass:()=>Lh,MetadataClassProperty:()=>tp,MetadataComponentType:()=>jt,MetadataEntity:()=>zn,MetadataEnum:()=>EW,MetadataEnumValue:()=>CW,MetadataPicking:()=>vX,MetadataPickingPipelineStage:()=>iu,MetadataPipelineStage:()=>fm,MetadataSchema:()=>Zl,MetadataSchemaLoader:()=>f0,MetadataSemantic:()=>um,MetadataTable:()=>cm,MetadataTableProperty:()=>oW,MetadataType:()=>Et,MipmapHint:()=>Ju,Model:()=>Dh,Model3DTileContent:()=>ou,ModelAlphaOptions:()=>RC,ModelAnimation:()=>pF,ModelAnimationChannel:()=>fF,ModelAnimationCollection:()=>AF,ModelAnimationLoop:()=>hd,ModelAnimationState:()=>Nh,ModelArticulation:()=>ZF,ModelArticulationStage:()=>_F,ModelClippingPlanesPipelineStage:()=>VF,ModelClippingPolygonsPipelineStage:()=>FF,ModelColorPipelineStage:()=>G0,ModelComponents:()=>Tn,ModelDrawCommand:()=>u2,ModelDrawCommands:()=>f2,ModelFeature:()=>gF,ModelFeatureTable:()=>yF,ModelGraphics:()=>FA,ModelImagery:()=>x2,ModelImageryMapping:()=>IC,ModelLightingOptions:()=>s2,ModelMatrixUpdateStage:()=>MF,ModelNode:()=>BF,ModelPrimitiveImagery:()=>_C,ModelReader:()=>dg,ModelRenderResources:()=>$B,ModelRuntimeNode:()=>DF,ModelRuntimePrimitive:()=>jB,ModelSceneGraph:()=>p2,ModelSilhouettePipelineStage:()=>n2,ModelSkin:()=>qB,ModelSplitterPipelineStage:()=>o2,ModelStatistics:()=>A2,ModelType:()=>Yr,ModelUtility:()=>Xt,ModelVisualizer:()=>GY,Moon:()=>TX,MorphTargetsPipelineStage:()=>NB,MorphWeightSpline:()=>F6,MortonOrder:()=>O0,Multiple3DTileContent:()=>ew,MultisampleFramebuffer:()=>x1,NavigationHelpButton:()=>UU,NavigationHelpButtonViewModel:()=>MU,NearFarScalar:()=>kt,NeverTileDiscardPolicy:()=>fee,NodeRenderResources:()=>r2,NodeStatisticsPipelineStage:()=>UF,NodeTransformationProperty:()=>Dx,OIT:()=>JX,Occluder:()=>$N,OffsetGeometryInstanceAttribute:()=>go,OpenCageGeocoderService:()=>Y6,OpenStreetMapImageryProvider:()=>Eb,OrderedGroundPrimitiveCollection:()=>qw,OrientedBoundingBox:()=>tn,OrthographicFrustum:()=>hn,OrthographicOffCenterFrustum:()=>is,Packable:()=>N6,PackableForInterpolation:()=>X6,Particle:()=>JZ,ParticleBurst:()=>Aee,ParticleEmitter:()=>gee,ParticleSystem:()=>bee,Pass:()=>Ve,PassState:()=>Bc,PathGraphics:()=>BA,PathVisualizer:()=>LY,PeliasGeocoderService:()=>qN,PerInstanceColorAppearance:()=>pn,PerformanceDisplay:()=>ub,PerformanceWatchdog:()=>vU,PerformanceWatchdogViewModel:()=>DU,PerspectiveFrustum:()=>Ui,PerspectiveOffCenterFrustum:()=>kl,PickDepth:()=>kX,PickDepthFramebuffer:()=>qX,PickFramebuffer:()=>$X,PickedMetadataInfo:()=>pM,Picking:()=>rP,PickingPipelineStage:()=>XB,PinBuilder:()=>Jg,PixelDatatype:()=>ve,PixelFormat:()=>je,Plane:()=>an,PlaneGeometry:()=>nY,PlaneGeometryUpdater:()=>oY,PlaneGraphics:()=>wL,PlaneOutlineGeometry:()=>iY,PntsLoader:()=>b2,PntsParser:()=>WC,PointCloud:()=>WM,PointCloudEyeDomeLighting:()=>ng,PointCloudShading:()=>sp,PointCloudStylingPipelineStage:()=>MB,PointGraphics:()=>kx,PointPrimitive:()=>la,PointPrimitiveCollection:()=>JI,PointVisualizer:()=>FY,PolygonGeometry:()=>jA,PolygonGeometryLibrary:()=>ei,PolygonGeometryUpdater:()=>cY,PolygonGraphics:()=>Ch,PolygonHierarchy:()=>gc,PolygonOutlineGeometry:()=>aY,PolygonPipeline:()=>Si,Polyline:()=>xm,PolylineArrowMaterialProperty:()=>i_,PolylineCollection:()=>Oh,PolylineColorAppearance:()=>Is,PolylineDashMaterialProperty:()=>r_,PolylineGeometry:()=>Kg,PolylineGeometryUpdater:()=>YY,PolylineGlowMaterialProperty:()=>a_,PolylineGraphics:()=>Nc,PolylineMaterialAppearance:()=>Qa,PolylineOutlineMaterialProperty:()=>ey,PolylinePipeline:()=>zi,PolylineVisualizer:()=>XY,PolylineVolumeGeometry:()=>uY,PolylineVolumeGeometryLibrary:()=>qh,PolylineVolumeGeometryUpdater:()=>pY,PolylineVolumeGraphics:()=>Qx,PolylineVolumeOutlineGeometry:()=>fY,PositionProperty:()=>yh,PositionPropertyArray:()=>Pg,PostProcessStage:()=>Lo,PostProcessStageCollection:()=>RP,PostProcessStageComposite:()=>Wd,PostProcessStageLibrary:()=>Bu,PostProcessStageSampleMode:()=>Fu,PostProcessStageTextureCache:()=>cT,PpeMetadata:()=>qW,PpeSource:()=>Xee,PpeTexture:()=>jW,Primitive:()=>Nn,PrimitiveCollection:()=>Ml,PrimitiveLoadPlan:()=>yC,PrimitiveOutlineGenerator:()=>bC,PrimitiveOutlinePipelineStage:()=>vB,PrimitivePipeline:()=>Gx,PrimitiveRenderResources:()=>a2,PrimitiveState:()=>Kr,PrimitiveStatisticsPipelineStage:()=>kB,PrimitiveType:()=>Be,ProjectionPicker:()=>JU,ProjectionPickerViewModel:()=>KU,Property:()=>K,PropertyArray:()=>l_,PropertyAttribute:()=>gC,PropertyAttributeProperty:()=>MW,PropertyBag:()=>yl,PropertyTable:()=>Vl,PropertyTexture:()=>tg,PropertyTextureProperty:()=>PW,ProviderViewModel:()=>or,Proxy:()=>P6,QuadraticRealPolynomial:()=>dl,QuadtreeOccluders:()=>hX,QuadtreePrimitive:()=>yX,QuadtreeTile:()=>fX,QuadtreeTileLoadState:()=>Fa,QuadtreeTileProvider:()=>yee,QuantizedMeshTerrainData:()=>YE,QuarticRealPolynomial:()=>VR,Quaternion:()=>Me,QuaternionSpline:()=>hF,Queue:()=>y0,Ray:()=>xn,Rectangle:()=>de,RectangleCollisionChecker:()=>CE,RectangleGeometry:()=>hE,RectangleGeometryLibrary:()=>aa,RectangleGeometryUpdater:()=>AY,RectangleGraphics:()=>Eh,RectangleOutlineGeometry:()=>DC,ReferenceFrame:()=>eo,ReferenceProperty:()=>Mg,RenderState:()=>ke,Renderbuffer:()=>kd,RenderbufferFormat:()=>ml,Request:()=>pr,RequestErrorEvent:()=>Pf,RequestScheduler:()=>Lc,RequestState:()=>pi,RequestType:()=>Ys,Resource:()=>Ge,ResourceCache:()=>Li,ResourceCacheKey:()=>Rl,ResourceCacheStatistics:()=>IW,ResourceLoader:()=>Oi,ResourceLoaderState:()=>ft,Rotation:()=>Wm,RuntimeError:()=>he,S2Cell:()=>UA,SDFSettings:()=>_a,SampledPositionProperty:()=>ec,SampledProperty:()=>Au,Sampler:()=>Ht,ScaledPositionProperty:()=>Zp,Scene:()=>gM,SceneFramebuffer:()=>tT,SceneMode:()=>se,SceneMode2DPipelineStage:()=>QB,SceneModePicker:()=>HU,SceneModePickerViewModel:()=>zU,SceneTransforms:()=>no,SceneTransitioner:()=>VP,ScreenSpaceCameraController:()=>BP,ScreenSpaceEventHandler:()=>Lu,ScreenSpaceEventType:()=>Gn,SelectedFeatureIdPipelineStage:()=>W0,SelectionIndicator:()=>OU,SelectionIndicatorViewModel:()=>QU,SensorVolumePortionToDisplay:()=>h_,ShaderBuilder:()=>EA,ShaderCache:()=>p1,ShaderDestination:()=>be,ShaderFunction:()=>T1,ShaderProgram:()=>cn,ShaderSource:()=>ze,ShaderStruct:()=>E1,ShadowMap:()=>fb,ShadowMapShader:()=>qp,ShadowMode:()=>Rn,ShadowVolumeAppearance:()=>Hd,SharedContext:()=>S1,ShowGeometryInstanceAttribute:()=>Zn,Simon1994PlanetaryPositions:()=>Mb,SimplePolylineGeometry:()=>H6,SingleTileImageryProvider:()=>yB,SkinningPipelineStage:()=>zB,SkyAtmosphere:()=>xM,SkyBox:()=>TM,SpatialNode:()=>uM,Spdcf:()=>KW,SpecularEnvironmentCubeMap:()=>Ih,SphereEmitter:()=>Cee,SphereGeometry:()=>K6,SphereOutlineGeometry:()=>Zg,Spherical:()=>vw,Spline:()=>To,SplitDirection:()=>Br,Splitter:()=>UZ,StaticGeometryColorBatch:()=>Ym,StaticGeometryPerMaterialBatch:()=>Nm,StaticGroundGeometryColorBatch:()=>F_,StaticGroundGeometryPerMaterialBatch:()=>_Y,StaticGroundPolylinePerMaterialBatch:()=>NY,StaticOutlineGeometryBatch:()=>Y_,StencilConstants:()=>Qt,StencilFunction:()=>$n,StencilOperation:()=>Ct,SteppedSpline:()=>mF,Stereographic:()=>Uc,StorageType:()=>E0,StripeMaterialProperty:()=>u_,StripeOrientation:()=>sf,StructuralMetadata:()=>Sa,StyleCommandsNeeded:()=>Xh,StyleExpression:()=>Eee,Sun:()=>GM,SunLight:()=>CA,SunPostProcess:()=>NP,SupportedImageFormats:()=>QW,SvgPathBindingHandler:()=>hU,Sync:()=>I1,TaskProcessor:()=>Jn,Terrain:()=>aU,TerrainData:()=>Gd,TerrainEncoding:()=>ur,TerrainFillMesh:()=>CZ,TerrainMesh:()=>oc,TerrainOffsetProperty:()=>Ox,TerrainPicker:()=>NN,TerrainProvider:()=>Do,TerrainQuantization:()=>La,TerrainState:()=>Vo,Texture:()=>Wt,Texture3D:()=>_1,TextureAtlas:()=>Tx,TextureCache:()=>A1,TextureMagnificationFilter:()=>ui,TextureManager:()=>oM,TextureMinificationFilter:()=>zt,TexturePacker:()=>oS,TextureUniform:()=>Yee,TextureWrap:()=>bn,TileAvailability:()=>Cf,TileBoundingRegion:()=>lu,TileBoundingS2Cell:()=>ow,TileBoundingSphere:()=>Rg,TileBoundingVolume:()=>Tee,TileCoordinatesImageryProvider:()=>lU,TileDiscardPolicy:()=>Iee,TileEdge:()=>Sn,TileImagery:()=>bI,TileMapServiceImageryProvider:()=>B0,TileMetadata:()=>q2,TileOrientedBoundingBox:()=>xd,TileProviderError:()=>Ko,TileReplacementQueue:()=>pX,TileSelectionResult:()=>ci,TileState:()=>_ee,Tileset3DTileContent:()=>T2,TilesetMetadata:()=>rw,TilesetPipelineStage:()=>xF,TilingScheme:()=>J6,TimeConstants:()=>ai,TimeDynamicImagery:()=>SC,TimeDynamicPointCloud:()=>vZ,TimeInterval:()=>Wn,TimeIntervalCollection:()=>fs,TimeIntervalCollectionPositionProperty:()=>Ug,TimeIntervalCollectionProperty:()=>Dg,TimeStandard:()=>oi,Timeline:()=>$U,TimelineHighlightRange:()=>jU,TimelineTrack:()=>qU,Tipsify:()=>LR,ToggleButtonViewModel:()=>Ky,Tonemapper:()=>Ab,TrackingReferenceFrame:()=>ZA,Transforms:()=>Tt,TranslationRotationScale:()=>Kb,TranslucentTileClassification:()=>tP,TridiagonalSystemSolver:()=>qS,TrustedServers:()=>OT,TweenCollection:()=>uT,UniformState:()=>y1,UniformType:()=>wZ,UrlTemplateImageryProvider:()=>Ds,VERSION:()=>QWt,VRButton:()=>tD,VRButtonViewModel:()=>eD,VRTheWorldTerrainProvider:()=>j6,VaryingType:()=>Nee,Vector3DTileBatch:()=>$f,Vector3DTileClampedPolylines:()=>k2,Vector3DTileContent:()=>O2,Vector3DTileGeometry:()=>MA,Vector3DTilePoints:()=>N2,Vector3DTilePolygons:()=>X2,Vector3DTilePolylines:()=>XC,Vector3DTilePrimitive:()=>eC,VelocityOrientationProperty:()=>Qw,VelocityVectorProperty:()=>vg,VertexArray:()=>si,VertexArrayFacade:()=>TA,VertexAttributeSemantic:()=>at,VertexFormat:()=>we,VerticalExaggeration:()=>Eo,VerticalExaggerationPipelineStage:()=>KB,VerticalOrigin:()=>vn,VideoSynchronizer:()=>q6,View:()=>oT,Viewer:()=>ste,ViewportQuad:()=>Zee,Visibility:()=>Dr,Visualizer:()=>w7,VoxelBoundsCollection:()=>yb,VoxelBoxShape:()=>bT,VoxelCell:()=>MP,VoxelContent:()=>gT,VoxelCylinderShape:()=>yT,VoxelEllipsoidShape:()=>xT,VoxelInspector:()=>iD,VoxelInspectorViewModel:()=>nD,VoxelMetadataOrder:()=>nA,VoxelPrimitive:()=>Oy,VoxelProvider:()=>Gee,VoxelRenderResources:()=>nM,VoxelShape:()=>Vee,VoxelShapeType:()=>ac,VoxelTraversal:()=>mM,VulkanConstants:()=>$6,WallGeometry:()=>bY,WallGeometryLibrary:()=>fE,WallGeometryUpdater:()=>CY,WallGraphics:()=>wA,WallOutlineGeometry:()=>xY,WebGLConstants:()=>ne,WebMapServiceImageryProvider:()=>CB,WebMapTileServiceImageryProvider:()=>TB,WebMercatorProjection:()=>hi,WebMercatorTilingScheme:()=>Vs,WindingOrder:()=>Ns,WireframeIndexGenerator:()=>CI,WireframePipelineStage:()=>JB,_shadersAcesTonemappingStage:()=>sP,_shadersAdditiveBlend:()=>wP,_shadersAdjustTranslucentFS:()=>VZ,_shadersAllMaterialAppearanceFS:()=>F1,_shadersAllMaterialAppearanceVS:()=>B1,_shadersAmbientOcclusionGenerate:()=>aP,_shadersAmbientOcclusionModulate:()=>cP,_shadersAspectRampMaterial:()=>P1,_shadersAtmosphereCommon:()=>Fh,_shadersAtmosphereStageFS:()=>CF,_shadersAtmosphereStageVS:()=>EF,_shadersBasicMaterialAppearanceFS:()=>w1,_shadersBasicMaterialAppearanceVS:()=>Y1,_shadersBillboardCollectionFS:()=>S2,_shadersBillboardCollectionVS:()=>I2,_shadersBlackAndWhite:()=>lP,_shadersBloomComposite:()=>dP,_shadersBrdfLutGeneratorFS:()=>SX,_shadersBrightPass:()=>YP,_shadersBrightness:()=>uP,_shadersBumpMapMaterial:()=>M1,_shadersCPUStylingStageFS:()=>zF,_shadersCPUStylingStageVS:()=>OF,_shadersCheckerboardMaterial:()=>U1,_shadersCloudCollectionFS:()=>wM,_shadersCloudCollectionVS:()=>YM,_shadersCloudNoiseFS:()=>NM,_shadersCloudNoiseVS:()=>XM,_shadersCompareAndPackTranslucentDepth:()=>eP,_shadersCompositeOITFS:()=>KX,_shadersCompositeTranslucentClassification:()=>iT,_shadersComputeIrradianceFS:()=>WW,_shadersComputeRadianceMapFS:()=>FW,_shadersContrastBias:()=>mP,_shadersConvolveSpecularMapFS:()=>BW,_shadersConvolveSpecularMapVS:()=>wW,_shadersCustomShaderStageFS:()=>JF,_shadersCustomShaderStageVS:()=>KF,_shadersCzmBuiltins:()=>bx,_shadersDepthOfField:()=>hP,_shadersDepthPlaneFS:()=>FX,_shadersDepthPlaneVS:()=>BX,_shadersDepthView:()=>fP,_shadersDepthViewPacked:()=>wee,_shadersDotMaterial:()=>D1,_shadersEdgeDetection:()=>pP,_shadersEdgeDetectionStageFS:()=>oB,_shadersEdgeVisibilityStageFS:()=>sB,_shadersElevationBandMaterial:()=>v1,_shadersElevationContourMaterial:()=>k1,_shadersElevationRampMaterial:()=>Q1,_shadersEllipsoidFS:()=>TZ,_shadersEllipsoidSurfaceAppearanceFS:()=>zM,_shadersEllipsoidSurfaceAppearanceVS:()=>HM,_shadersEllipsoidVS:()=>SZ,_shadersFXAA:()=>bP,_shadersFXAA3_11:()=>SP,_shadersFadeMaterial:()=>O1,_shadersFeatureIdStageFS:()=>jF,_shadersFeatureIdStageVS:()=>qF,_shadersFilmicTonemapping:()=>AP,_shadersGaussianBlur1D:()=>ky,_shadersGeometryStageFS:()=>cB,_shadersGeometryStageVS:()=>lB,_shadersGlobeFS:()=>aX,_shadersGlobeVS:()=>cX,_shadersGridMaterial:()=>z1,_shadersGroundAtmosphere:()=>bZ,_shadersHSBToRGB:()=>WG,_shadersHSLToRGB:()=>FG,_shadersImageBasedLightingStageFS:()=>SF,_shadersInstancingStageCommon:()=>wF,_shadersInstancingStageVS:()=>YF,_shadersIntersectBox:()=>HP,_shadersIntersectCylinder:()=>KP,_shadersIntersectDepth:()=>OP,_shadersIntersectEllipsoid:()=>JP,_shadersIntersectLongitude:()=>BZ,_shadersIntersectPlane:()=>zP,_shadersIntersection:()=>fT,_shadersIntersectionUtils:()=>QP,_shadersLegacyInstancingStageVS:()=>NF,_shadersLensFlare:()=>yP,_shadersLightingStageFS:()=>WB,_shadersMaterialStageFS:()=>BB,_shadersMegatexture:()=>tM,_shadersMetadataStageFS:()=>$F,_shadersMetadataStageVS:()=>eB,_shadersModelClippingPlanesStageFS:()=>GF,_shadersModelClippingPolygonsStageFS:()=>WF,_shadersModelClippingPolygonsStageVS:()=>LF,_shadersModelColorStageFS:()=>RF,_shadersModelFS:()=>h2,_shadersModelSilhouetteStageFS:()=>e2,_shadersModelSilhouetteStageVS:()=>t2,_shadersModelSplitterStageFS:()=>i2,_shadersModelVS:()=>m2,_shadersModifiedReinhardTonemapping:()=>xP,_shadersMorphTargetsStageVS:()=>YB,_shadersNightVision:()=>CP,_shadersNormalMapMaterial:()=>H1,_shadersOctree:()=>eM,_shadersPassThrough:()=>Ld,_shadersPassThroughDepth:()=>Uy,_shadersPbrNeutralTonemapping:()=>gP,_shadersPerInstanceColorAppearanceFS:()=>rL,_shadersPerInstanceColorAppearanceVS:()=>sL,_shadersPerInstanceFlatColorAppearanceFS:()=>Zx,_shadersPerInstanceFlatColorAppearanceVS:()=>aL,_shadersPointCloudEyeDomeLighting:()=>nF,_shadersPointCloudStylingStageVS:()=>PB,_shadersPointPrimitiveCollectionFS:()=>$0,_shadersPointPrimitiveCollectionVS:()=>Ww,_shadersPolygonSignedDistanceFS:()=>VW,_shadersPolylineArrowMaterial:()=>K1,_shadersPolylineColorAppearanceVS:()=>EL,_shadersPolylineCommon:()=>Kd,_shadersPolylineDashMaterial:()=>J1,_shadersPolylineFS:()=>Bx,_shadersPolylineGlowMaterial:()=>j1,_shadersPolylineMaterialAppearanceVS:()=>TL,_shadersPolylineOutlineMaterial:()=>q1,_shadersPolylineShadowVolumeFS:()=>bL,_shadersPolylineShadowVolumeMorphFS:()=>yL,_shadersPolylineShadowVolumeMorphVS:()=>xL,_shadersPolylineShadowVolumeVS:()=>CL,_shadersPolylineVS:()=>L2,_shadersPrimitiveGaussianSplatFS:()=>J2,_shadersPrimitiveGaussianSplatVS:()=>K2,_shadersPrimitiveOutlineStageFS:()=>DB,_shadersPrimitiveOutlineStageVS:()=>UB,_shadersRGBToHSB:()=>BG,_shadersRGBToHSL:()=>wG,_shadersRGBToXYZ:()=>YG,_shadersReinhardTonemapping:()=>EP,_shadersReprojectWebMercatorFS:()=>_B,_shadersReprojectWebMercatorVS:()=>ZB,_shadersRimLightingMaterial:()=>$1,_shadersSelectedFeatureIdStageCommon:()=>rI,_shadersShadowVolumeAppearanceFS:()=>dS,_shadersShadowVolumeAppearanceVS:()=>dL,_shadersShadowVolumeFS:()=>Qb,_shadersSilhouette:()=>TP,_shadersSkinningStageVS:()=>OB,_shadersSkyAtmosphereCommon:()=>NZ,_shadersSkyAtmosphereFS:()=>bM,_shadersSkyAtmosphereVS:()=>yM,_shadersSkyBoxFS:()=>CM,_shadersSkyBoxVS:()=>EM,_shadersSlopeRampMaterial:()=>eL,_shadersStripeMaterial:()=>tL,_shadersSunFS:()=>SM,_shadersSunTextureFS:()=>IM,_shadersSunVS:()=>_M,_shadersTexturedMaterialAppearanceFS:()=>N1,_shadersTexturedMaterialAppearanceVS:()=>X1,_shadersVector3DTileClampedPolylinesFS:()=>D2,_shadersVector3DTileClampedPolylinesVS:()=>U2,_shadersVector3DTilePolylinesVS:()=>P2,_shadersVectorTileVS:()=>xS,_shadersVerticalExaggerationStageVS:()=>HB,_shadersViewportQuadFS:()=>PM,_shadersViewportQuadVS:()=>lx,_shadersVoxelFS:()=>vP,_shadersVoxelUtils:()=>DP,_shadersVoxelVS:()=>kP,_shadersWater:()=>iL,_shadersWaterMaskMaterial:()=>nL,_shadersXYZToRGB:()=>NG,_shadersacesTonemapping:()=>XG,_shadersalphaWeight:()=>PG,_shadersantialias:()=>MG,_shadersapplyHSBShift:()=>UG,_shadersapproximateSphericalCoordinates:()=>DG,_shadersapproximateTanh:()=>vG,_shadersbackFacing:()=>kG,_shadersbranchFreeTernary:()=>QG,_shaderscascadeColor:()=>OG,_shaderscascadeDistance:()=>zG,_shaderscascadeMatrix:()=>HG,_shaderscascadeWeights:()=>KG,_shadersclipPolygons:()=>JG,_shaderscolumbusViewMorph:()=>jG,_shaderscomputeAtmosphereColor:()=>qG,_shaderscomputeGroundAtmosphereScattering:()=>$G,_shaderscomputePosition:()=>eV,_shaderscomputeScattering:()=>tV,_shadersconvertLocalToBoxUv:()=>jP,_shadersconvertLocalToCylinderUv:()=>qP,_shadersconvertLocalToEllipsoidUv:()=>$P,_shaderscosineAndSine:()=>nV,_shadersdecompressTextureCoordinates:()=>iV,_shadersdegreesPerRadian:()=>XR,_shadersdepthClamp:()=>oV,_shadersdepthRange:()=>PR,_shadersdepthRangeStruct:()=>SG,_shaderseastNorthUpToEyeCoordinates:()=>rV,_shadersellipsoidContainsPoint:()=>sV,_shadersellipsoidTextureCoordinates:()=>aV,_shadersepsilon1:()=>MR,_shadersepsilon2:()=>UR,_shadersepsilon3:()=>DR,_shadersepsilon4:()=>vR,_shadersepsilon5:()=>kR,_shadersepsilon6:()=>QR,_shadersepsilon7:()=>OR,_shadersequalsEpsilon:()=>cV,_shaderseyeOffset:()=>lV,_shaderseyeToWindowCoordinates:()=>dV,_shadersfastApproximateAtan:()=>uV,_shadersfog:()=>mV,_shadersgammaCorrect:()=>hV,_shadersgeodeticSurfaceNormal:()=>fV,_shadersgetDefaultMaterial:()=>pV,_shadersgetDynamicAtmosphereLightDirection:()=>AV,_shadersgetLambertDiffuse:()=>gV,_shadersgetSpecular:()=>bV,_shadersgetWaterNoise:()=>yV,_shadershue:()=>xV,_shadersinfinity:()=>zR,_shadersinverseGamma:()=>CV,_shadersisEmpty:()=>EV,_shadersisFull:()=>TV,_shaderslatitudeToWebMercatorFraction:()=>SV,_shaderslineDistance:()=>IV,_shaderslinearToSrgb:()=>_V,_shadersluminance:()=>ZV,_shadersmaterial:()=>IG,_shadersmaterialInput:()=>_G,_shadersmaximumComponent:()=>RV,_shadersmetersPerPixel:()=>GV,_shadersmodelMaterial:()=>ZG,_shadersmodelToWindowCoordinates:()=>VV,_shadersmodelVertexOutput:()=>RG,_shadersmultiplyWithColorBalance:()=>LV,_shadersnearFarScalar:()=>WV,_shadersoctDecode:()=>FV,_shadersoneOverPi:()=>HR,_shadersoneOverTwoPi:()=>KR,_shaderspackDepth:()=>BV,_shaderspassCesium3DTile:()=>JR,_shaderspassCesium3DTileClassification:()=>jR,_shaderspassCesium3DTileClassificationIgnoreShow:()=>qR,_shaderspassCesium3DTileEdges:()=>$R,_shaderspassClassification:()=>eG,_shaderspassCompute:()=>tG,_shaderspassEnvironment:()=>nG,_shaderspassGaussianSplats:()=>iG,_shaderspassGlobe:()=>oG,_shaderspassOpaque:()=>rG,_shaderspassOverlay:()=>sG,_shaderspassTerrainClassification:()=>aG,_shaderspassTranslucent:()=>cG,_shaderspassVoxels:()=>lG,_shaderspbrLighting:()=>wV,_shaderspbrNeutralTonemapping:()=>YV,_shadersphong:()=>NV,_shaderspi:()=>dG,_shaderspiOverFour:()=>uG,_shaderspiOverSix:()=>mG,_shaderspiOverThree:()=>hG,_shaderspiOverTwo:()=>fG,_shadersplaneDistance:()=>XV,_shaderspointAlongRay:()=>PV,_shadersradiansPerDegree:()=>pG,_shadersray:()=>GG,_shadersrayEllipsoidIntersectionInterval:()=>MV,_shadersraySegment:()=>VG,_shadersraySphereIntersectionInterval:()=>UV,_shadersreadDepth:()=>DV,_shadersreadNonPerspective:()=>vV,_shadersreverseLogDepth:()=>kV,_shadersround:()=>QV,_shaderssaturation:()=>OV,_shaderssceneMode2D:()=>AG,_shaderssceneMode3D:()=>gG,_shaderssceneModeColumbusView:()=>bG,_shaderssceneModeMorphing:()=>yG,_shadersshadowDepthCompare:()=>zV,_shadersshadowParameters:()=>LG,_shadersshadowVisibility:()=>HV,_shaderssignNotZero:()=>KV,_shaderssolarRadius:()=>xG,_shaderssphericalHarmonics:()=>JV,_shaderssrgbToLinear:()=>jV,_shaderstangentToEyeSpaceMatrix:()=>qV,_shaderstextureCube:()=>$V,_shadersthreePiOver2:()=>CG,_shaderstransformPlane:()=>e1,_shaderstranslateRelativeToEye:()=>t1,_shaderstranslucentPhong:()=>n1,_shaderstranspose:()=>i1,_shaderstwoPi:()=>EG,_shadersunpackClippingExtents:()=>o1,_shadersunpackDepth:()=>r1,_shadersunpackFloat:()=>s1,_shadersunpackUint:()=>a1,_shadersvalueTransform:()=>c1,_shadersvertexLogDepth:()=>l1,_shaderswebMercatorMaxLatitude:()=>TG,_shaderswindowToEyeCoordinates:()=>d1,_shaderswriteDepthClamp:()=>u1,_shaderswriteLogDepth:()=>m1,_shaderswriteNonPerspective:()=>h1,addAllToArray:()=>ni,addBuffer:()=>mW,addDefaults:()=>rW,addExtensionsRequired:()=>lW,addExtensionsUsed:()=>lm,addPipelineExtras:()=>a0,addToArray:()=>ia,appendForwardSlash:()=>lR,arrayRemoveDuplicates:()=>Mo,barycentricCoordinates:()=>ux,binarySearch:()=>bo,buildModuleUrl:()=>en,buildVoxelDrawCommands:()=>iM,clone:()=>Qe,combine:()=>Rt,computeFlyToLocationForRectangle:()=>zE,createBillboardPointCallback:()=>BC,createCommand:()=>Fn,createDefaultImageryProviderViewModels:()=>bU,createDefaultTerrainProviderViewModels:()=>yU,createElevationBandMaterial:()=>Lee,createGooglePhotorealistic3DTileset:()=>Wee,createGuid:()=>Kn,createMaterialPropertyDescriptor:()=>er,createOsmBuildingsAsync:()=>Fee,createPropertyDescriptor:()=>ge,createRawPropertyDescriptor:()=>bl,createTangentSpaceDebugPrimitive:()=>Bee,createTaskProcessorWorker:()=>Pee,createUniform:()=>ER,createUniformArray:()=>TR,createWorldBathymetryAsync:()=>nX,createWorldImageryAsync:()=>fg,createWorldTerrainAsync:()=>kE,decodeGoogleEarthEnterpriseData:()=>iX,decodeVectorPolylinePositions:()=>Q2,defer:()=>ed,defined:()=>l,demodernizeShader:()=>f1,deprecationWarning:()=>Ms,destroyObject:()=>fe,exportKml:()=>M7,findAccessorMinMax:()=>lC,findContentMetadata:()=>MC,findGroupMetadata:()=>UC,findTileMetadata:()=>$2,forEachTextureInMaterial:()=>GS,formatError:()=>cp,freezeRenderState:()=>j3,getAbsoluteUri:()=>Nf,getAccessorByteStride:()=>ud,getBaseUri:()=>dR,getBinaryAccessor:()=>rm,getClipAndStyleCode:()=>VM,getClippingFunction:()=>HE,getComponentReader:()=>HA,getElement:()=>Xn,getExtensionFromUri:()=>hA,getFilenameFromUri:()=>Ng,getImageFromTypedArray:()=>oX,getImagePixels:()=>ah,getJsonFromTypedArray:()=>Cr,getMagic:()=>Zh,getMeshPrimitives:()=>tF,getMetadataClassProperty:()=>fM,getMetadataProperty:()=>AM,getStringFromTypedArray:()=>cd,getTimestamp:()=>Ni,hasExtension:()=>Ti,heightReferenceOnEntityPropertyChanged:()=>YA,isBitSet:()=>$c,isBlobUri:()=>tx,isCrossOriginUrl:()=>Lb,isDataUri:()=>ch,isLeapYear:()=>sh,knockout:()=>_e,knockout_3_5_1:()=>LT,knockout_es5:()=>mU,loadAndExecuteScript:()=>nx,loadCubeMap:()=>R1,loadImageFromTypedArray:()=>OA,loadKTX2:()=>nd,mergeSort:()=>zp,moveTechniqueRenderStates:()=>cW,moveTechniquesToExtension:()=>dW,numberOfComponentsForType:()=>qd,objectToQuery:()=>ix,oneTimeWarning:()=>At,parseBatchTable:()=>rg,parseFeatureMetadataLegacy:()=>vW,parseGlb:()=>cC,parseResponseHeaders:()=>uR,parseStructuralMetadata:()=>DW,pickModel:()=>EI,pointInsideTriangle:()=>oq,preprocess3DTileContent:()=>Sg,processVoxelProperties:()=>UP,queryToObject:()=>Ud,readAccessorPacked:()=>hW,removeExtension:()=>dC,removeExtensionsRequired:()=>sW,removeExtensionsUsed:()=>aC,removePipelineExtras:()=>aW,removeUnusedElements:()=>uW,resizeImageToNextPowerOfTwo:()=>d0,sampleTerrain:()=>rX,sampleTerrainMostDetailed:()=>QE,scaleToGeodeticSurface:()=>ex,srgbToLinear:()=>OE,subdivideArray:()=>uL,subscribeAndEvaluate:()=>cc,updateAccessorComponentTypes:()=>fW,updateVersion:()=>pW,usesExtension:()=>wr,viewerCesium3DTilesInspectorMixin:()=>ate,viewerCesiumInspectorMixin:()=>cte,viewerDragDropMixin:()=>dte,viewerPerformanceWatchdogMixin:()=>ute,viewerVoxelInspectorMixin:()=>hte,webGLConstantToGlslType:()=>aq,wrapFunction:()=>sX,writeTextToCanvas:()=>YC});var hQo=y(x(),1);var O0o=y(x(),1);var DFt=y(x(),1);var mFt=y(x(),1);var oFt=y(x(),1);var jWt=y(x(),1);function pRe(e){return e!=null}var l=pRe;var eFt=y(x(),1);function $y(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&($y.prototype=Object.create(Error.prototype),$y.prototype.constructor=$y);$y.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};$y.throwInstantiationError=function(){throw new $y("This function defines an interface and should not be called directly.")};var Ae=$y;var ta={};ta.typeOf={};function ARe(e){return`${e} is required, actual value was undefined`}function YT(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ta.defined=function(e,t){if(!l(t))throw new Ae(ARe(e))};ta.typeOf.func=function(e,t){if(typeof t!="function")throw new Ae(YT(typeof t,"function",e))};ta.typeOf.string=function(e,t){if(typeof t!="string")throw new Ae(YT(typeof t,"string",e))};ta.typeOf.number=function(e,t){if(typeof t!="number")throw new Ae(YT(typeof t,"number",e))};ta.typeOf.number.lessThan=function(e,t,n){if(ta.typeOf.number(e,t),t>=n)throw new Ae(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ta.typeOf.number.lessThanOrEquals=function(e,t,n){if(ta.typeOf.number(e,t),t>n)throw new Ae(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ta.typeOf.number.greaterThan=function(e,t,n){if(ta.typeOf.number(e,t),t<=n)throw new Ae(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ta.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ta.typeOf.number(e,t),t<n)throw new Ae(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ta.typeOf.object=function(e,t){if(typeof t!="object")throw new Ae(YT(typeof t,"object",e))};ta.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new Ae(YT(typeof t,"boolean",e))};ta.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new Ae(YT(typeof t,"bigint",e))};ta.typeOf.number.equals=function(e,t,n,i){if(ta.typeOf.number(e,n),ta.typeOf.number(t,i),n!==i)throw new Ae(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Xo=ta;var cFt=y(x(),1),a3=y(cD(),1);var ht={};ht.EPSILON1=.1;ht.EPSILON2=.01;ht.EPSILON3=.001;ht.EPSILON4=1e-4;ht.EPSILON5=1e-5;ht.EPSILON6=1e-6;ht.EPSILON7=1e-7;ht.EPSILON8=1e-8;ht.EPSILON9=1e-9;ht.EPSILON10=1e-10;ht.EPSILON11=1e-11;ht.EPSILON12=1e-12;ht.EPSILON13=1e-13;ht.EPSILON14=1e-14;ht.EPSILON15=1e-15;ht.EPSILON16=1e-16;ht.EPSILON17=1e-17;ht.EPSILON18=1e-18;ht.EPSILON19=1e-19;ht.EPSILON20=1e-20;ht.EPSILON21=1e-21;ht.GRAVITATIONALPARAMETER=3986004418e5;ht.SOLAR_RADIUS=6955e5;ht.LUNAR_RADIUS=1737400;ht.SIXTY_FOUR_KILOBYTES=64*1024;ht.FOUR_GIGABYTES=4*1024*1024*1024;ht.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};ht.signNotZero=function(e){return e<0?-1:1};ht.toSNorm=function(e,t){return t=t??255,Math.round((ht.clamp(e,-1,1)*.5+.5)*t)};ht.fromSNorm=function(e,t){return t=t??255,ht.clamp(e,0,t)/t*2-1};ht.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:ht.clamp((e-t)/n,0,1)};ht.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};ht.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};ht.lerp=function(e,t,n){return(1-n)*e+n*t};ht.PI=Math.PI;ht.ONE_OVER_PI=1/Math.PI;ht.PI_OVER_TWO=Math.PI/2;ht.PI_OVER_THREE=Math.PI/3;ht.PI_OVER_FOUR=Math.PI/4;ht.PI_OVER_SIX=Math.PI/6;ht.THREE_PI_OVER_TWO=3*Math.PI/2;ht.TWO_PI=2*Math.PI;ht.ONE_OVER_TWO_PI=1/(2*Math.PI);ht.RADIANS_PER_DEGREE=Math.PI/180;ht.DEGREES_PER_RADIAN=180/Math.PI;ht.RADIANS_PER_ARCSECOND=ht.RADIANS_PER_DEGREE/3600;ht.toRadians=function(e){return e*ht.RADIANS_PER_DEGREE};ht.toDegrees=function(e){return e*ht.DEGREES_PER_RADIAN};ht.convertLongitudeRange=function(e){let t=ht.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};ht.clampToLatitudeRange=function(e){return ht.clamp(e,-1*ht.PI_OVER_TWO,ht.PI_OVER_TWO)};ht.negativePiToPi=function(e){return e>=-ht.PI&&e<=ht.PI?e:ht.zeroToTwoPi(e+ht.PI)-ht.PI};ht.zeroToTwoPi=function(e){if(e>=0&&e<=ht.TWO_PI)return e;let t=ht.mod(e,ht.TWO_PI);return Math.abs(t)<ht.EPSILON14&&Math.abs(e)>ht.EPSILON14?ht.TWO_PI:t};ht.mod=function(e,t){return ht.sign(e)===ht.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};ht.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};ht.lessThan=function(e,t,n){return e-t<-n};ht.lessThanOrEquals=function(e,t,n){return e-t<n};ht.greaterThan=function(e,t,n){return e-t>n};ht.greaterThanOrEquals=function(e,t,n){return e-t>-n};var lD=[1];ht.factorial=function(e){let t=lD.length;if(e>=t){let n=lD[t-1];for(let i=t;i<=e;i++){let o=n*i;lD.push(o),n=o}}return lD[e]};ht.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};ht.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};ht.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};ht.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};ht.clamp=function(e,t,n){return e<t?t:e>n?n:e};var yte=new a3.default;ht.setRandomNumberSeed=function(e){yte=new a3.default(e)};ht.nextRandomNumber=function(){return yte.random()};ht.randomBetween=function(e,t){return ht.nextRandomNumber()*(t-e)+e};ht.acosClamped=function(e){return Math.acos(ht.clamp(e,-1,1))};ht.asinClamped=function(e){return Math.asin(ht.clamp(e,-1,1))};ht.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};ht.logBase=function(e,t){return Math.log(e)/Math.log(t)};ht.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};ht.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};ht.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};ht.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};ht.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=ht.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?ht.PI_OVER_TWO-i:i,i=e<0?ht.PI-i:i,i=t<0?-i:i,i};var V=ht;function ot(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}ot.fromSpherical=function(e,t){l(t)||(t=new ot);let n=e.clock,i=e.cone,o=e.magnitude??1,r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};ot.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new ot(e,t,n)};ot.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new ot(e.x,e.y,e.z)};ot.fromCartesian4=ot.clone;ot.packedLength=3;ot.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};ot.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ot),n.x=e[t++],n.y=e[t++],n.z=e[t],n};ot.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)ot.pack(e[o],t,o*3);return t};ot.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=ot.unpack(e,i,t[o])}return t};ot.fromArray=ot.unpack;ot.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};ot.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};ot.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};ot.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};ot.clamp=function(e,t,n,i){let o=V.clamp(e.x,t.x,n.x),r=V.clamp(e.y,t.y,n.y),s=V.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};ot.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};ot.magnitude=function(e){return Math.sqrt(ot.magnitudeSquared(e))};var uD=new ot;ot.distance=function(e,t){return ot.subtract(e,t,uD),ot.magnitude(uD)};ot.distanceSquared=function(e,t){return ot.subtract(e,t,uD),ot.magnitudeSquared(uD)};ot.normalize=function(e,t){let n=ot.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};ot.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};ot.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};ot.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};ot.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};ot.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};ot.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};ot.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};ot.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};ot.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var xte=new ot;ot.lerp=function(e,t,n,i){return ot.multiplyByScalar(t,n,xte),i=ot.multiplyByScalar(e,1-n,i),ot.add(xte,i,i)};var dD=new ot,c3=new ot;ot.angleBetween=function(e,t){ot.normalize(e,dD),ot.normalize(t,c3);let n=ot.dot(dD,c3),i=ot.magnitude(ot.cross(dD,c3,dD));return Math.atan2(i,n)};var gRe=new ot;ot.mostOrthogonalAxis=function(e,t){let n=ot.normalize(e,gRe);return ot.abs(n,n),n.x<=n.y?n.x<=n.z?t=ot.clone(ot.UNIT_X,t):t=ot.clone(ot.UNIT_Z,t):n.y<=n.z?t=ot.clone(ot.UNIT_Y,t):t=ot.clone(ot.UNIT_Z,t),t};ot.projectVector=function(e,t,n){let i=ot.dot(e,t)/ot.dot(t,t);return ot.multiplyByScalar(t,i,n)};ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};ot.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};ot.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&V.equalsEpsilon(e.x,t.x,n,i)&&V.equalsEpsilon(e.y,t.y,n,i)&&V.equalsEpsilon(e.z,t.z,n,i)};ot.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,d=o*c-r*a,u=r*s-i*c,h=i*a-o*s;return n.x=d,n.y=u,n.z=h,n};ot.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};ot.fromDegrees=function(e,t,n,i,o){return e=V.toRadians(e),t=V.toRadians(t),ot.fromRadians(e,t,n,i,o)};var ku=new ot,NT=new ot;ot._ellipsoidRadiiSquared=new ot(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);ot.fromRadians=function(e,t,n,i,o){n=n??0;let r=l(i)?i.radiiSquared:ot._ellipsoidRadiiSquared,s=Math.cos(t);ku.x=s*Math.cos(e),ku.y=s*Math.sin(e),ku.z=Math.sin(t),ku=ot.normalize(ku,ku),ot.multiplyComponents(r,ku,NT);let a=Math.sqrt(ot.dot(ku,NT));return NT=ot.divideByScalar(NT,a,NT),ku=ot.multiplyByScalar(ku,n,ku),l(o)||(o=new ot),ot.add(NT,ku,o)};ot.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=ot.fromDegrees(r,s,0,t,n[a])}return n};ot.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=ot.fromRadians(r,s,0,t,n[a])}return n};ot.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=ot.fromDegrees(r,s,a,t,n[c])}return n};ot.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=ot.fromRadians(r,s,a,t,n[c])}return n};ot.ZERO=Object.freeze(new ot(0,0,0));ot.ONE=Object.freeze(new ot(1,1,1));ot.UNIT_X=Object.freeze(new ot(1,0,0));ot.UNIT_Y=Object.freeze(new ot(0,1,0));ot.UNIT_Z=Object.freeze(new ot(0,0,1));ot.prototype.clone=function(e){return ot.clone(this,e)};ot.prototype.equals=function(e){return ot.equals(this,e)};ot.prototype.equalsEpsilon=function(e,t,n){return ot.equalsEpsilon(this,e,t,n)};ot.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var m=ot;var wFt=y(x(),1);var AFt=y(x(),1);function Zt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}Zt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new Zt(e,t,n,i)};Zt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Zt(e.red,e.green,e.blue,e.alpha)};Zt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Zt(e.x,e.y,e.z,e.w)};Zt.packedLength=4;Zt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};Zt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Zt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};Zt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Zt.pack(e[o],t,o*4);return t};Zt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Zt.unpack(e,i,t[o])}return t};Zt.fromArray=Zt.unpack;Zt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};Zt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};Zt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};Zt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};Zt.clamp=function(e,t,n,i){let o=V.clamp(e.x,t.x,n.x),r=V.clamp(e.y,t.y,n.y),s=V.clamp(e.z,t.z,n.z),a=V.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};Zt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};Zt.magnitude=function(e){return Math.sqrt(Zt.magnitudeSquared(e))};var mD=new Zt;Zt.distance=function(e,t){return Zt.subtract(e,t,mD),Zt.magnitude(mD)};Zt.distanceSquared=function(e,t){return Zt.subtract(e,t,mD),Zt.magnitudeSquared(mD)};Zt.normalize=function(e,t){let n=Zt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};Zt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};Zt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};Zt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};Zt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};Zt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};Zt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};Zt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};Zt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};Zt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var Cte=new Zt;Zt.lerp=function(e,t,n,i){return Zt.multiplyByScalar(t,n,Cte),i=Zt.multiplyByScalar(e,1-n,i),Zt.add(Cte,i,i)};var bRe=new Zt;Zt.mostOrthogonalAxis=function(e,t){let n=Zt.normalize(e,bRe);return Zt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=Zt.clone(Zt.UNIT_X,t):t=Zt.clone(Zt.UNIT_W,t):n.z<=n.w?t=Zt.clone(Zt.UNIT_Z,t):t=Zt.clone(Zt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=Zt.clone(Zt.UNIT_Y,t):t=Zt.clone(Zt.UNIT_W,t):n.z<=n.w?t=Zt.clone(Zt.UNIT_Z,t):t=Zt.clone(Zt.UNIT_W,t),t};Zt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};Zt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};Zt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&V.equalsEpsilon(e.x,t.x,n,i)&&V.equalsEpsilon(e.y,t.y,n,i)&&V.equalsEpsilon(e.z,t.z,n,i)&&V.equalsEpsilon(e.w,t.w,n,i)};Zt.ZERO=Object.freeze(new Zt(0,0,0,0));Zt.ONE=Object.freeze(new Zt(1,1,1,1));Zt.UNIT_X=Object.freeze(new Zt(1,0,0,0));Zt.UNIT_Y=Object.freeze(new Zt(0,1,0,0));Zt.UNIT_Z=Object.freeze(new Zt(0,0,1,0));Zt.UNIT_W=Object.freeze(new Zt(0,0,0,1));Zt.prototype.clone=function(e){return Zt.clone(this,e)};Zt.prototype.equals=function(e){return Zt.equals(this,e)};Zt.prototype.equalsEpsilon=function(e,t,n){return Zt.equalsEpsilon(this,e,t,n)};Zt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var l3=new Float32Array(1),Rc=new Uint8Array(l3.buffer),yRe=new Uint32Array([287454020]),xRe=new Uint8Array(yRe.buffer),Ete=xRe[0]===68;Zt.packFloat=function(e,t){return l(t)||(t=new Zt),l3[0]=e,Ete?(t.x=Rc[0],t.y=Rc[1],t.z=Rc[2],t.w=Rc[3]):(t.x=Rc[3],t.y=Rc[2],t.z=Rc[1],t.w=Rc[0]),t};Zt.unpackFloat=function(e){return Ete?(Rc[0]=e.x,Rc[1]=e.y,Rc[2]=e.z,Rc[3]=e.w):(Rc[0]=e.w,Rc[1]=e.z,Rc[2]=e.y,Rc[3]=e.x),l3[0]};var ce=Zt;var bFt=y(x(),1),d3={};d3.EMPTY_OBJECT=Object.freeze({});d3.EMPTY_ARRAY=Object.freeze([]);var Q=d3;var TFt=y(x(),1);function st(e,t,n,i,o,r,s,a,c){this[0]=e??0,this[1]=i??0,this[2]=s??0,this[3]=t??0,this[4]=o??0,this[5]=a??0,this[6]=n??0,this[7]=r??0,this[8]=c??0}st.packedLength=9;st.pack=function(e,t,n){return n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};st.unpack=function(e,t,n){return t=t??0,l(n)||(n=new st),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};st.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)st.pack(e[o],t,o*9);return t};st.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=st.unpack(e,i,t[o])}return t};st.clone=function(e,t){if(l(e))return l(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 st(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};st.fromArray=st.unpack;st.fromColumnMajorArray=function(e,t){return st.clone(e,t)};st.fromRowMajorArray=function(e,t){return l(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 st(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};st.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,d=e.z*e.z,u=e.z*e.w,h=e.w*e.w,p=n-s-d+h,g=2*(i-u),f=2*(o+c),b=2*(i+u),C=-n+s-d+h,E=2*(a-r),T=2*(o-c),S=2*(a+r),_=-n-s+d+h;return l(t)?(t[0]=p,t[1]=b,t[2]=T,t[3]=g,t[4]=C,t[5]=S,t[6]=f,t[7]=E,t[8]=_,t):new st(p,g,f,b,C,E,T,S,_)};st.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,d=-o*s+a*r*i,u=a*s+o*r*i,h=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,f=-r,b=a*n,C=o*n;return l(t)?(t[0]=c,t[1]=h,t[2]=f,t[3]=d,t[4]=p,t[5]=b,t[6]=u,t[7]=g,t[8]=C,t):new st(c,d,u,h,p,g,f,b,C)};st.fromScale=function(e,t){return l(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 st(e.x,0,0,0,e.y,0,0,0,e.z)};st.fromUniformScale=function(e,t){return l(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 st(e,0,0,0,e,0,0,0,e)};st.fromCrossProduct=function(e,t){return l(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 st(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};st.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new st(1,0,0,0,n,-i,0,i,n)};st.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new st(n,0,i,0,1,0,-i,0,n)};st.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new st(n,-i,0,i,n,0,0,0,1)};st.toArray=function(e,t){return l(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]]};st.getElementIndex=function(e,t){return e*3+t};st.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};st.setColumn=function(e,t,n,i){i=st.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};st.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};st.setRow=function(e,t,n,i){return i=st.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var CRe=new m;st.setScale=function(e,t,n){let i=st.getScale(e,CRe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var ERe=new m;st.setUniformScale=function(e,t,n){let i=st.getScale(e,ERe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var u3=new m;st.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],u3)),t.y=m.magnitude(m.fromElements(e[3],e[4],e[5],u3)),t.z=m.magnitude(m.fromElements(e[6],e[7],e[8],u3)),t};var Tte=new m;st.getMaximumScale=function(e){return st.getScale(e,Tte),m.maximumComponent(Tte)};var TRe=new m;st.setRotation=function(e,t,n){let i=st.getScale(e,TRe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var SRe=new m;st.getRotation=function(e,t){let n=st.getScale(e,SRe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};st.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],d=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],u=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 n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=d,n[7]=u,n[8]=h,n};st.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};st.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};st.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};st.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};st.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};st.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};st.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};st.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],d=e[5],u=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=d,t[8]=u,t};function IRe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var m3=[1,0,0],h3=[2,2,1];function _Re(e){let t=0;for(let n=0;n<3;++n){let i=e[st.getElementIndex(h3[n],m3[n])];t+=2*i*i}return Math.sqrt(t)}function ZRe(e,t){let n=V.EPSILON15,i=0,o=1;for(let d=0;d<3;++d){let u=Math.abs(e[st.getElementIndex(h3[d],m3[d])]);u>i&&(o=d,i=u)}let r=1,s=0,a=m3[o],c=h3[o];if(Math.abs(e[st.getElementIndex(c,a)])>n){let d=e[st.getElementIndex(c,c)],u=e[st.getElementIndex(a,a)],h=e[st.getElementIndex(c,a)],p=(d-u)/2/h,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=st.clone(st.IDENTITY,t),t[st.getElementIndex(a,a)]=t[st.getElementIndex(c,c)]=r,t[st.getElementIndex(c,a)]=s,t[st.getElementIndex(a,c)]=-s,t}var hD=new st,Ste=new st;st.computeEigenDecomposition=function(e,t){let n=V.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=st.clone(st.IDENTITY,t.unitary),a=t.diagonal=st.clone(e,t.diagonal),c=n*IRe(a);for(;r<i&&_Re(a)>c;)ZRe(a,hD),st.transpose(hD,Ste),st.multiply(a,hD,a),st.multiply(Ste,a,a),st.multiply(s,hD,s),++o>2&&(++r,o=0);return t};st.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};st.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],d=e[8];return t*(r*d-c*s)+o*(c*i-n*d)+a*(n*s-r*i)};st.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],d=e[7],u=e[8],h=st.determinant(e);t[0]=s*u-d*a,t[1]=d*o-i*u,t[2]=i*a-s*o,t[3]=c*a-r*u,t[4]=n*u-c*o,t[5]=r*o-n*a,t[6]=r*d-c*s,t[7]=c*i-n*d,t[8]=n*s-r*i;let p=1/h;return st.multiplyByScalar(t,p,t)};var RRe=new st;st.inverseTranspose=function(e,t){return st.inverse(st.transpose(e,RRe),t)};st.equals=function(e,t){return e===t||l(e)&&l(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]};st.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};st.IDENTITY=Object.freeze(new st(1,0,0,0,1,0,0,0,1));st.ZERO=Object.freeze(new st(0,0,0,0,0,0,0,0,0));st.COLUMN0ROW0=0;st.COLUMN0ROW1=1;st.COLUMN0ROW2=2;st.COLUMN1ROW0=3;st.COLUMN1ROW1=4;st.COLUMN1ROW2=5;st.COLUMN2ROW0=6;st.COLUMN2ROW1=7;st.COLUMN2ROW2=8;Object.defineProperties(st.prototype,{length:{get:function(){return st.packedLength}}});st.prototype.clone=function(e){return st.clone(this,e)};st.prototype.equals=function(e){return st.equals(this,e)};st.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};st.prototype.equalsEpsilon=function(e,t){return st.equalsEpsilon(this,e,t)};st.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
(${this[1]}, ${this[4]}, ${this[7]})
(${this[2]}, ${this[5]}, ${this[8]})`};var $=st;var _Ft=y(x(),1);function rR(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(rR.prototype=Object.create(Error.prototype),rR.prototype.constructor=rR);rR.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};var he=rR;function rt(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,b){this[0]=e??0,this[1]=o??0,this[2]=c??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=d??0,this[7]=g??0,this[8]=n??0,this[9]=s??0,this[10]=u??0,this[11]=f??0,this[12]=i??0,this[13]=a??0,this[14]=h??0,this[15]=b??0}rt.packedLength=16;rt.pack=function(e,t,n){return n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};rt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new rt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};rt.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)rt.pack(e[o],t,o*16);return t};rt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=rt.unpack(e,i,t[o])}return t};rt.clone=function(e,t){if(l(e))return l(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 rt(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])};rt.fromArray=rt.unpack;rt.fromColumnMajorArray=function(e,t){return rt.clone(e,t)};rt.fromRowMajorArray=function(e,t){return l(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 rt(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])};rt.fromRotationTranslation=function(e,t,n){return t=t??m.ZERO,l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new rt(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)};rt.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new rt);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,d=t.x*t.z,u=t.x*t.w,h=t.y*t.y,p=t.y*t.z,g=t.y*t.w,f=t.z*t.z,b=t.z*t.w,C=t.w*t.w,E=a-h-f+C,T=2*(c-b),S=2*(d+g),_=2*(c+b),R=-a+h-f+C,L=2*(p-u),W=2*(d-g),B=2*(p+u),Y=-a-h+f+C;return i[0]=E*o,i[1]=_*o,i[2]=W*o,i[3]=0,i[4]=T*r,i[5]=R*r,i[6]=B*r,i[7]=0,i[8]=S*s,i[9]=L*s,i[10]=Y*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};rt.fromTranslationRotationScale=function(e,t){return rt.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};rt.fromTranslation=function(e,t){return rt.fromRotationTranslation($.IDENTITY,e,t)};rt.fromScale=function(e,t){return l(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 rt(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};rt.fromUniformScale=function(e,t){return l(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 rt(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};rt.fromRotation=function(e,t){return l(t)||(t=new rt),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var XT=new m,PT=new m,sR=new m;rt.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;m.normalize(i,XT),m.normalize(m.cross(XT,o,PT),PT),m.normalize(m.cross(PT,XT,sR),sR);let r=PT.x,s=PT.y,a=PT.z,c=XT.x,d=XT.y,u=XT.z,h=sR.x,p=sR.y,g=sR.z,f=n.x,b=n.y,C=n.z,E=r*-f+s*-b+a*-C,T=h*-f+p*-b+g*-C,S=c*f+d*b+u*C;return l(t)?(t[0]=r,t[1]=h,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-d,t[7]=0,t[8]=a,t[9]=g,t[10]=-u,t[11]=0,t[12]=E,t[13]=T,t[14]=S,t[15]=1,t):new rt(r,s,a,E,h,p,g,T,-c,-d,-u,S,0,0,0,1)};rt.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),d=2*i*n/(n-i);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]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o};rt.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),d=1/(r-o),u=-(t+e)*a,h=-(i+n)*c,p=-(r+o)*d;return a*=2,c*=2,d*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=d,s[11]=0,s[12]=u,s[13]=h,s[14]=p,s[15]=1,s};rt.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),d=(t+e)/(t-e),u=(i+n)/(i-n),h=-(r+o)/(r-o),p=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=d,s[9]=u,s[10]=h,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};rt.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),d=(i+n)/(i-n),u=-1,h=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=d,r[10]=u,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};rt.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new rt),e=e??Q.EMPTY_OBJECT;let o=e.x??0,r=e.y??0,s=e.width??0,a=e.height??0;t=t??0,n=n??1;let c=s*.5,d=a*.5,u=(n-t)*.5,h=c,p=d,g=u,f=o+c,b=r+d,C=t+u,E=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=f,i[13]=b,i[14]=C,i[15]=E,i};rt.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-m.dot(i,e),o[13]=-m.dot(n,e),o[14]=m.dot(t,e),o[15]=1,o};rt.toArray=function(e,t){return l(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]]};rt.getElementIndex=function(e,t){return e*4+t};rt.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};rt.setColumn=function(e,t,n,i){i=rt.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};rt.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};rt.setRow=function(e,t,n,i){return i=rt.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};rt.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var GRe=new m;rt.setScale=function(e,t,n){let i=rt.getScale(e,GRe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var VRe=new m;rt.setUniformScale=function(e,t,n){let i=rt.getScale(e,VRe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var f3=new m;rt.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],f3)),t.y=m.magnitude(m.fromElements(e[4],e[5],e[6],f3)),t.z=m.magnitude(m.fromElements(e[8],e[9],e[10],f3)),t};var Ite=new m;rt.getMaximumScale=function(e){return rt.getScale(e,Ite),m.maximumComponent(Ite)};var LRe=new m;rt.setRotation=function(e,t,n){let i=rt.getScale(e,LRe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var WRe=new m;rt.getRotation=function(e,t){let n=rt.getScale(e,WRe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};rt.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],d=e[6],u=e[7],h=e[8],p=e[9],g=e[10],f=e[11],b=e[12],C=e[13],E=e[14],T=e[15],S=t[0],_=t[1],R=t[2],L=t[3],W=t[4],B=t[5],Y=t[6],N=t[7],A=t[8],I=t[9],Z=t[10],G=t[11],w=t[12],X=t[13],v=t[14],U=t[15],k=i*S+a*_+h*R+b*L,P=o*S+c*_+p*R+C*L,O=r*S+d*_+g*R+E*L,H=s*S+u*_+f*R+T*L,ee=i*W+a*B+h*Y+b*N,z=o*W+c*B+p*Y+C*N,te=r*W+d*B+g*Y+E*N,q=s*W+u*B+f*Y+T*N,me=i*A+a*I+h*Z+b*G,ye=o*A+c*I+p*Z+C*G,oe=r*A+d*I+g*Z+E*G,xe=s*A+u*I+f*Z+T*G,Ee=i*w+a*X+h*v+b*U,Le=o*w+c*X+p*v+C*U,Se=r*w+d*X+g*v+E*U,Fe=s*w+u*X+f*v+T*U;return n[0]=k,n[1]=P,n[2]=O,n[3]=H,n[4]=ee,n[5]=z,n[6]=te,n[7]=q,n[8]=me,n[9]=ye,n[10]=oe,n[11]=xe,n[12]=Ee,n[13]=Le,n[14]=Se,n[15]=Fe,n};rt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};rt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};rt.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],h=e[10],p=e[12],g=e[13],f=e[14],b=t[0],C=t[1],E=t[2],T=t[4],S=t[5],_=t[6],R=t[8],L=t[9],W=t[10],B=t[12],Y=t[13],N=t[14],A=i*b+s*C+d*E,I=o*b+a*C+u*E,Z=r*b+c*C+h*E,G=i*T+s*S+d*_,w=o*T+a*S+u*_,X=r*T+c*S+h*_,v=i*R+s*L+d*W,U=o*R+a*L+u*W,k=r*R+c*L+h*W,P=i*B+s*Y+d*N+p,O=o*B+a*Y+u*N+g,H=r*B+c*Y+h*N+f;return n[0]=A,n[1]=I,n[2]=Z,n[3]=0,n[4]=G,n[5]=w,n[6]=X,n[7]=0,n[8]=v,n[9]=U,n[10]=k,n[11]=0,n[12]=P,n[13]=O,n[14]=H,n[15]=1,n};rt.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],h=e[10],p=t[0],g=t[1],f=t[2],b=t[3],C=t[4],E=t[5],T=t[6],S=t[7],_=t[8],R=i*p+s*g+d*f,L=o*p+a*g+u*f,W=r*p+c*g+h*f,B=i*b+s*C+d*E,Y=o*b+a*C+u*E,N=r*b+c*C+h*E,A=i*T+s*S+d*_,I=o*T+a*S+u*_,Z=r*T+c*S+h*_;return n[0]=R,n[1]=L,n[2]=W,n[3]=0,n[4]=B,n[5]=Y,n[6]=N,n[7]=0,n[8]=A,n[9]=I,n[10]=Z,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};rt.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};rt.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?rt.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};rt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};rt.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,d=e[2]*i+e[6]*o+e[10]*r+e[14]*s,u=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=d,n.w=u,n};rt.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};rt.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};rt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};rt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};rt.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};rt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};rt.equals=function(e,t){return e===t||l(e)&&l(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]};rt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};rt.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};rt.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var FRe=new $,BRe=new $,wRe=new ce,YRe=new ce(0,0,0,1);rt.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],d=e[13],u=e[2],h=e[6],p=e[10],g=e[14],f=e[3],b=e[7],C=e[11],E=e[15],T=p*E,S=g*C,_=h*E,R=g*b,L=h*C,W=p*b,B=u*E,Y=g*f,N=u*C,A=p*f,I=u*b,Z=h*f,G=T*a+R*c+L*d-(S*a+_*c+W*d),w=S*s+B*c+A*d-(T*s+Y*c+N*d),X=_*s+Y*a+I*d-(R*s+B*a+Z*d),v=W*s+N*a+Z*c-(L*s+A*a+I*c),U=S*i+_*o+W*r-(T*i+R*o+L*r),k=T*n+Y*o+N*r-(S*n+B*o+A*r),P=R*n+B*i+Z*r-(_*n+Y*i+I*r),O=L*n+A*i+I*o-(W*n+N*i+Z*o);T=o*d,S=r*c,_=i*d,R=r*a,L=i*c,W=o*a,B=n*d,Y=r*s,N=n*c,A=o*s,I=n*a,Z=i*s;let H=T*b+R*C+L*E-(S*b+_*C+W*E),ee=S*f+B*C+A*E-(T*f+Y*C+N*E),z=_*f+Y*b+I*E-(R*f+B*b+Z*E),te=W*f+N*b+Z*C-(L*f+A*b+I*C),q=_*p+W*g+S*h-(L*g+T*h+R*p),me=N*g+T*u+Y*p-(B*p+A*g+S*u),ye=B*h+Z*g+R*u-(I*g+_*u+Y*h),oe=I*p+L*u+A*h-(N*h+Z*p+W*u),xe=n*G+i*w+o*X+r*v;if(Math.abs(xe)<V.EPSILON21){if($.equalsEpsilon(rt.getMatrix3(e,FRe),BRe,V.EPSILON7)&&ce.equals(rt.getRow(e,3,wRe),YRe))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 he("matrix is not invertible because its determinate is zero.")}return xe=1/xe,t[0]=G*xe,t[1]=w*xe,t[2]=X*xe,t[3]=v*xe,t[4]=U*xe,t[5]=k*xe,t[6]=P*xe,t[7]=O*xe,t[8]=H*xe,t[9]=ee*xe,t[10]=z*xe,t[11]=te*xe,t[12]=q*xe,t[13]=me*xe,t[14]=ye*xe,t[15]=oe*xe,t};rt.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],d=e[9],u=e[10],h=e[12],p=e[13],g=e[14],f=-n*h-i*p-o*g,b=-r*h-s*p-a*g,C=-c*h-d*p-u*g;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=d,t[7]=0,t[8]=o,t[9]=a,t[10]=u,t[11]=0,t[12]=f,t[13]=b,t[14]=C,t[15]=1,t};var NRe=new rt;rt.inverseTranspose=function(e,t){return rt.inverse(rt.transpose(e,NRe),t)};rt.IDENTITY=Object.freeze(new rt(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));rt.ZERO=Object.freeze(new rt(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));rt.COLUMN0ROW0=0;rt.COLUMN0ROW1=1;rt.COLUMN0ROW2=2;rt.COLUMN0ROW3=3;rt.COLUMN1ROW0=4;rt.COLUMN1ROW1=5;rt.COLUMN1ROW2=6;rt.COLUMN1ROW3=7;rt.COLUMN2ROW0=8;rt.COLUMN2ROW1=9;rt.COLUMN2ROW2=10;rt.COLUMN2ROW3=11;rt.COLUMN3ROW0=12;rt.COLUMN3ROW1=13;rt.COLUMN3ROW2=14;rt.COLUMN3ROW3=15;Object.defineProperties(rt.prototype,{length:{get:function(){return rt.packedLength}}});rt.prototype.clone=function(e){return rt.clone(this,e)};rt.prototype.equals=function(e){return rt.equals(this,e)};rt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};rt.prototype.equalsEpsilon=function(e,t){return rt.equalsEpsilon(this,e,t)};rt.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var F=rt;var NFt=y(x(),1),XRe={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_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,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},ne=Object.freeze(XRe);var PRe=new m;function Lt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Ma={};Ma[ne.FLOAT]="float";Ma[ne.FLOAT_VEC2]="vec2";Ma[ne.FLOAT_VEC3]="vec3";Ma[ne.FLOAT_VEC4]="vec4";Ma[ne.INT]="int";Ma[ne.INT_VEC2]="ivec2";Ma[ne.INT_VEC3]="ivec3";Ma[ne.INT_VEC4]="ivec4";Ma[ne.BOOL]="bool";Ma[ne.BOOL_VEC2]="bvec2";Ma[ne.BOOL_VEC3]="bvec3";Ma[ne.BOOL_VEC4]="bvec4";Ma[ne.FLOAT_MAT2]="mat2";Ma[ne.FLOAT_MAT3]="mat3";Ma[ne.FLOAT_MAT4]="mat4";Ma[ne.SAMPLER_2D]="sampler2D";Ma[ne.SAMPLER_CUBE]="samplerCube";Lt.prototype.getDeclaration=function(e){let t=`uniform ${Ma[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var MRe={czm_viewport:new Lt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Lt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Lt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Lt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Lt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_model:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Lt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Lt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Lt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Lt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Lt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Lt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Lt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Lt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Lt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Lt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Lt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Lt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Lt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Lt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,PRe)}}),czm_frameNumber:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Lt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Lt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Lt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Lt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Lt({size:9,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Lt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Lt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Lt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Lt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},dA=MRe;var lBt=y(x(),1);var kFt=y(x(),1);function URe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Kn=URe;var OFt=y(x(),1);function DRe(){return!0}function vRe(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=DRe}var fe=vRe;var jFt=y(x(),1);var ga={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT};ga.getSizeInBytes=function(e){switch(e){case ga.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ga.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ga.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ga.fromSizeInBytes=function(e){switch(e){case 2:return ga.UNSIGNED_SHORT;case 4:return ga.UNSIGNED_INT;case 1:return ga.UNSIGNED_BYTE}};ga.validate=function(e){return l(e)&&(e===ga.UNSIGNED_BYTE||e===ga.UNSIGNED_SHORT||e===ga.UNSIGNED_INT)};ga.createTypedArray=function(e,t){return e>=V.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ga.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=V.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ga.fromTypedArray=function(e){if(e instanceof Uint8Array)return ga.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ga.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ga.UNSIGNED_INT};var Pe=Object.freeze(ga);var eBt=y(x(),1);var aR={STREAM_DRAW:ne.STREAM_DRAW,STATIC_DRAW:ne.STATIC_DRAW,DYNAMIC_DRAW:ne.DYNAMIC_DRAW,DYNAMIC_READ:ne.DYNAMIC_READ,validate:function(e){return e===aR.STREAM_DRAW||e===aR.STATIC_DRAW||e===aR.DYNAMIC_DRAW||e===aR.DYNAMIC_READ}},Xe=Object.freeze(aR);function Gc(e){e=e??Q.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Kn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Gc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new Ae("A WebGL 2 context is required to create PixelBuffers.");return new Gc({context:e.context,bufferTarget:ne.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Gc.createVertexBuffer=function(e){return new Gc({context:e.context,bufferTarget:ne.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Gc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Pe.getSizeInBytes(n),o=new Gc({context:t,bufferTarget:ne.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(Gc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Gc.prototype._getBuffer=function(){return this._buffer};Gc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Gc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Gc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Gc.prototype.copyFromBuffer=function(e,t,n,i){let o=ne.COPY_READ_BUFFER,r=ne.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};Gc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=ne.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Gc.prototype.isDestroyed=function(){return!1};Gc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),fe(this)};var mt=Gc;var _Bt=y(x(),1);var EBt=y(x(),1);var ABt=y(x(),1);var mBt=y(x(),1);var Rb,es={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},$l={};Object.defineProperties($l,{element:{get:function(){if($l.supportsFullscreen())return document[es.fullscreenElement]}},changeEventName:{get:function(){if($l.supportsFullscreen())return es.fullscreenchange}},errorEventName:{get:function(){if($l.supportsFullscreen())return es.fullscreenerror}},enabled:{get:function(){if($l.supportsFullscreen())return document[es.fullscreenEnabled]}},fullscreen:{get:function(){if($l.supportsFullscreen())return $l.element!==null}}});$l.supportsFullscreen=function(){if(l(Rb))return Rb;Rb=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return es.requestFullscreen="requestFullscreen",es.exitFullscreen="exitFullscreen",es.fullscreenEnabled="fullscreenEnabled",es.fullscreenElement="fullscreenElement",es.fullscreenchange="fullscreenchange",es.fullscreenerror="fullscreenerror",Rb=!0,Rb;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(es.requestFullscreen=n,Rb=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(es.requestFullscreen=n,Rb=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?es.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(es.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?es.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(es.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?es.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(es.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),es.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),es.fullscreenerror=n)}return Rb};$l.requestFullscreen=function(e,t){$l.supportsFullscreen()&&e[es.requestFullscreen]({vrDisplay:t})};$l.exitFullscreen=function(){$l.supportsFullscreen()&&document[es.exitFullscreen]()};$l._names=es;var kr=$l;var Qu;typeof navigator<"u"?Qu=navigator:Qu={};function cR(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var fD,_te;function y3(){if(!l(fD)&&(fD=!1,!xD())){let e=/ Chrome\/([\.0-9]+)/.exec(Qu.userAgent);e!==null&&(fD=!0,_te=cR(e[1]))}return fD}function kRe(){return y3()&&_te}var pD,Zte;function Rte(){if(!l(pD)&&(pD=!1,!y3()&&!xD()&&/ Safari\/[\.0-9]+/.test(Qu.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Qu.userAgent);e!==null&&(pD=!0,Zte=cR(e[1]))}return pD}function QRe(){return Rte()&&Zte}var AD,b3;function Gte(){if(!l(AD)){AD=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Qu.userAgent);e!==null&&(AD=!0,b3=cR(e[1]),b3.isNightly=!!e[2])}return AD}function ORe(){return Gte()&&b3}var gD,Vte;function xD(){if(!l(gD)){gD=!1;let e=/ Edg\/([\.0-9]+)/.exec(Qu.userAgent);e!==null&&(gD=!0,Vte=cR(e[1]))}return gD}function zRe(){return xD()&&Vte}var bD,x3;function CD(){if(!l(bD)){bD=!1;let e=/Firefox\/([\.0-9]+)/.exec(Qu.userAgent);e!==null&&(bD=!0,x3=cR(e[1]))}return bD}var p3;function HRe(){return l(p3)||(p3=/Windows/i.test(Qu.appVersion)),p3}var A3;function KRe(){return l(A3)||(A3=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),A3}function JRe(){return CD()&&x3}var g3;function jRe(){return l(g3)||(g3=!CD()&&typeof PointerEvent<"u"&&(!l(Qu.pointerEnabled)||Qu.pointerEnabled)),g3}var Lte,yD;function Wte(){if(!l(yD)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;yD=l(t)&&t!=="",yD&&(Lte=t)}return yD}function qRe(){return Wte()?Lte:void 0}function cl(){return cl._result}cl._promise=void 0;cl._result=void 0;cl.initialize=function(){return l(cl._promise)||(cl._promise=new Promise(e=>{let t=new Image;t.onload=function(){cl._result=t.width>0&&t.height>0,e(cl._result)},t.onerror=function(){cl._result=!1,e(cl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),cl._promise};Object.defineProperties(cl,{initialized:{get:function(){return l(cl._result)}}});var MT=[];typeof ArrayBuffer<"u"&&(MT.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&MT.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&MT.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&MT.push(BigInt64Array),typeof BigUint64Array<"u"&&MT.push(BigUint64Array));var Ou={isChrome:y3,chromeVersion:kRe,isSafari:Rte,safariVersion:QRe,isWebkit:Gte,webkitVersion:ORe,isEdge:xD,edgeVersion:zRe,isFirefox:CD,firefoxVersion:JRe,isWindows:HRe,isIPadOrIOS:KRe,hardwareConcurrency:Qu.hardwareConcurrency??3,supportsPointerEvents:jRe,supportsImageRenderingPixelated:Wte,supportsWebP:cl,imageRenderingValue:qRe,typedArrayTypes:MT};Ou.supportsBasis=function(e){return Ou.supportsWebAssembly()&&e.context.supportsBasis};Ou.supportsFullscreen=function(){return kr.supportsFullscreen()};Ou.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Ou.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Ou.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Ou.supportsBigInt=function(){return typeof BigInt<"u"};Ou.supportsWebWorkers=function(){return typeof Worker<"u"};Ou.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Ou.supportsWebgl2=function(e){return e.context.webgl2};Ou.supportsEsmWebWorkers=function(){return!CD()||parseInt(x3)>=114};var rn=Ou;function C3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function le(e,t,n,i){this.red=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}le.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new le(e.x,e.y,e.z,e.w)};le.fromBytes=function(e,t,n,i,o){return e=le.byteToFloat(e??255),t=le.byteToFloat(t??255),n=le.byteToFloat(n??255),i=le.byteToFloat(i??255),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new le(e,t,n,i)};le.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new le(e.red,e.green,e.blue,t)};var E3,T3,uA;rn.supportsTypedArrays()&&(E3=new ArrayBuffer(4),T3=new Uint32Array(E3),uA=new Uint8Array(E3));le.fromRgba=function(e,t){return T3[0]=e,le.fromBytes(uA[0],uA[1],uA[2],uA[3],t)};le.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let d=2*n-c;r=C3(d,c,e+1/3),s=C3(d,c,e),a=C3(d,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new le(r,s,a,i)};le.fromRandom=function(e,t){e=e??Q.EMPTY_OBJECT;let n=e.red;if(!l(n)){let s=e.minimumRed??0,a=e.maximumRed??1;n=s+V.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;i=s+V.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;o=s+V.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;r=s+V.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new le(n,i,o,r)};var $Re=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,eGe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,tGe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,nGe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;le.fromCssColorString=function(e,t){l(t)||(t=new le),e=e.trim();let n=le[e.toUpperCase()];if(l(n))return le.clone(n,t),t;let i=$Re.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(i[4]??"f",16)/15,t):(i=eGe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(i[4]??"ff",16)/255,t):(i=tGe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(i[4]??"1.0"),t):(i=nGe.exec(e),i!==null?le.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};le.packedLength=4;le.pack=function(e,t,n){return n=n??0,t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};le.unpack=function(e,t,n){return t=t??0,l(n)||(n=new le),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};le.byteToFloat=function(e){return e/255};le.floatToByte=function(e){return e===1?255:e*256|0};le.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new le(e.red,e.green,e.blue,e.alpha)};le.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};le.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};le.prototype.clone=function(e){return le.clone(this,e)};le.prototype.equals=function(e){return le.equals(this,e)};le.prototype.equalsEpsilon=function(e,t){return this===e||l(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};le.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};le.prototype.toCssColorString=function(){let e=le.floatToByte(this.red),t=le.floatToByte(this.green),n=le.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};le.prototype.toCssHexString=function(){let e=le.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=le.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=le.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=le.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};le.prototype.toBytes=function(e){let t=le.floatToByte(this.red),n=le.floatToByte(this.green),i=le.floatToByte(this.blue),o=le.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};le.bytesToRgba=function(e,t,n,i){return uA[0]=e,uA[1]=t,uA[2]=n,uA[3]=i,T3[0]};le.prototype.toRgba=function(){return le.bytesToRgba(le.floatToByte(this.red),le.floatToByte(this.green),le.floatToByte(this.blue),le.floatToByte(this.alpha))};le.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};le.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};le.prototype.withAlpha=function(e,t){return le.fromAlpha(this,e,t)};le.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};le.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};le.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};le.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};le.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};le.lerp=function(e,t,n,i){return i.red=V.lerp(e.red,t.red,n),i.green=V.lerp(e.green,t.green,n),i.blue=V.lerp(e.blue,t.blue,n),i.alpha=V.lerp(e.alpha,t.alpha,n),i};le.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};le.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};le.ALICEBLUE=Object.freeze(le.fromCssColorString("#F0F8FF"));le.ANTIQUEWHITE=Object.freeze(le.fromCssColorString("#FAEBD7"));le.AQUA=Object.freeze(le.fromCssColorString("#00FFFF"));le.AQUAMARINE=Object.freeze(le.fromCssColorString("#7FFFD4"));le.AZURE=Object.freeze(le.fromCssColorString("#F0FFFF"));le.BEIGE=Object.freeze(le.fromCssColorString("#F5F5DC"));le.BISQUE=Object.freeze(le.fromCssColorString("#FFE4C4"));le.BLACK=Object.freeze(le.fromCssColorString("#000000"));le.BLANCHEDALMOND=Object.freeze(le.fromCssColorString("#FFEBCD"));le.BLUE=Object.freeze(le.fromCssColorString("#0000FF"));le.BLUEVIOLET=Object.freeze(le.fromCssColorString("#8A2BE2"));le.BROWN=Object.freeze(le.fromCssColorString("#A52A2A"));le.BURLYWOOD=Object.freeze(le.fromCssColorString("#DEB887"));le.CADETBLUE=Object.freeze(le.fromCssColorString("#5F9EA0"));le.CHARTREUSE=Object.freeze(le.fromCssColorString("#7FFF00"));le.CHOCOLATE=Object.freeze(le.fromCssColorString("#D2691E"));le.CORAL=Object.freeze(le.fromCssColorString("#FF7F50"));le.CORNFLOWERBLUE=Object.freeze(le.fromCssColorString("#6495ED"));le.CORNSILK=Object.freeze(le.fromCssColorString("#FFF8DC"));le.CRIMSON=Object.freeze(le.fromCssColorString("#DC143C"));le.CYAN=Object.freeze(le.fromCssColorString("#00FFFF"));le.DARKBLUE=Object.freeze(le.fromCssColorString("#00008B"));le.DARKCYAN=Object.freeze(le.fromCssColorString("#008B8B"));le.DARKGOLDENROD=Object.freeze(le.fromCssColorString("#B8860B"));le.DARKGRAY=Object.freeze(le.fromCssColorString("#A9A9A9"));le.DARKGREEN=Object.freeze(le.fromCssColorString("#006400"));le.DARKGREY=le.DARKGRAY;le.DARKKHAKI=Object.freeze(le.fromCssColorString("#BDB76B"));le.DARKMAGENTA=Object.freeze(le.fromCssColorString("#8B008B"));le.DARKOLIVEGREEN=Object.freeze(le.fromCssColorString("#556B2F"));le.DARKORANGE=Object.freeze(le.fromCssColorString("#FF8C00"));le.DARKORCHID=Object.freeze(le.fromCssColorString("#9932CC"));le.DARKRED=Object.freeze(le.fromCssColorString("#8B0000"));le.DARKSALMON=Object.freeze(le.fromCssColorString("#E9967A"));le.DARKSEAGREEN=Object.freeze(le.fromCssColorString("#8FBC8F"));le.DARKSLATEBLUE=Object.freeze(le.fromCssColorString("#483D8B"));le.DARKSLATEGRAY=Object.freeze(le.fromCssColorString("#2F4F4F"));le.DARKSLATEGREY=le.DARKSLATEGRAY;le.DARKTURQUOISE=Object.freeze(le.fromCssColorString("#00CED1"));le.DARKVIOLET=Object.freeze(le.fromCssColorString("#9400D3"));le.DEEPPINK=Object.freeze(le.fromCssColorString("#FF1493"));le.DEEPSKYBLUE=Object.freeze(le.fromCssColorString("#00BFFF"));le.DIMGRAY=Object.freeze(le.fromCssColorString("#696969"));le.DIMGREY=le.DIMGRAY;le.DODGERBLUE=Object.freeze(le.fromCssColorString("#1E90FF"));le.FIREBRICK=Object.freeze(le.fromCssColorString("#B22222"));le.FLORALWHITE=Object.freeze(le.fromCssColorString("#FFFAF0"));le.FORESTGREEN=Object.freeze(le.fromCssColorString("#228B22"));le.FUCHSIA=Object.freeze(le.fromCssColorString("#FF00FF"));le.GAINSBORO=Object.freeze(le.fromCssColorString("#DCDCDC"));le.GHOSTWHITE=Object.freeze(le.fromCssColorString("#F8F8FF"));le.GOLD=Object.freeze(le.fromCssColorString("#FFD700"));le.GOLDENROD=Object.freeze(le.fromCssColorString("#DAA520"));le.GRAY=Object.freeze(le.fromCssColorString("#808080"));le.GREEN=Object.freeze(le.fromCssColorString("#008000"));le.GREENYELLOW=Object.freeze(le.fromCssColorString("#ADFF2F"));le.GREY=le.GRAY;le.HONEYDEW=Object.freeze(le.fromCssColorString("#F0FFF0"));le.HOTPINK=Object.freeze(le.fromCssColorString("#FF69B4"));le.INDIANRED=Object.freeze(le.fromCssColorString("#CD5C5C"));le.INDIGO=Object.freeze(le.fromCssColorString("#4B0082"));le.IVORY=Object.freeze(le.fromCssColorString("#FFFFF0"));le.KHAKI=Object.freeze(le.fromCssColorString("#F0E68C"));le.LAVENDER=Object.freeze(le.fromCssColorString("#E6E6FA"));le.LAVENDAR_BLUSH=Object.freeze(le.fromCssColorString("#FFF0F5"));le.LAWNGREEN=Object.freeze(le.fromCssColorString("#7CFC00"));le.LEMONCHIFFON=Object.freeze(le.fromCssColorString("#FFFACD"));le.LIGHTBLUE=Object.freeze(le.fromCssColorString("#ADD8E6"));le.LIGHTCORAL=Object.freeze(le.fromCssColorString("#F08080"));le.LIGHTCYAN=Object.freeze(le.fromCssColorString("#E0FFFF"));le.LIGHTGOLDENRODYELLOW=Object.freeze(le.fromCssColorString("#FAFAD2"));le.LIGHTGRAY=Object.freeze(le.fromCssColorString("#D3D3D3"));le.LIGHTGREEN=Object.freeze(le.fromCssColorString("#90EE90"));le.LIGHTGREY=le.LIGHTGRAY;le.LIGHTPINK=Object.freeze(le.fromCssColorString("#FFB6C1"));le.LIGHTSEAGREEN=Object.freeze(le.fromCssColorString("#20B2AA"));le.LIGHTSKYBLUE=Object.freeze(le.fromCssColorString("#87CEFA"));le.LIGHTSLATEGRAY=Object.freeze(le.fromCssColorString("#778899"));le.LIGHTSLATEGREY=le.LIGHTSLATEGRAY;le.LIGHTSTEELBLUE=Object.freeze(le.fromCssColorString("#B0C4DE"));le.LIGHTYELLOW=Object.freeze(le.fromCssColorString("#FFFFE0"));le.LIME=Object.freeze(le.fromCssColorString("#00FF00"));le.LIMEGREEN=Object.freeze(le.fromCssColorString("#32CD32"));le.LINEN=Object.freeze(le.fromCssColorString("#FAF0E6"));le.MAGENTA=Object.freeze(le.fromCssColorString("#FF00FF"));le.MAROON=Object.freeze(le.fromCssColorString("#800000"));le.MEDIUMAQUAMARINE=Object.freeze(le.fromCssColorString("#66CDAA"));le.MEDIUMBLUE=Object.freeze(le.fromCssColorString("#0000CD"));le.MEDIUMORCHID=Object.freeze(le.fromCssColorString("#BA55D3"));le.MEDIUMPURPLE=Object.freeze(le.fromCssColorString("#9370DB"));le.MEDIUMSEAGREEN=Object.freeze(le.fromCssColorString("#3CB371"));le.MEDIUMSLATEBLUE=Object.freeze(le.fromCssColorString("#7B68EE"));le.MEDIUMSPRINGGREEN=Object.freeze(le.fromCssColorString("#00FA9A"));le.MEDIUMTURQUOISE=Object.freeze(le.fromCssColorString("#48D1CC"));le.MEDIUMVIOLETRED=Object.freeze(le.fromCssColorString("#C71585"));le.MIDNIGHTBLUE=Object.freeze(le.fromCssColorString("#191970"));le.MINTCREAM=Object.freeze(le.fromCssColorString("#F5FFFA"));le.MISTYROSE=Object.freeze(le.fromCssColorString("#FFE4E1"));le.MOCCASIN=Object.freeze(le.fromCssColorString("#FFE4B5"));le.NAVAJOWHITE=Object.freeze(le.fromCssColorString("#FFDEAD"));le.NAVY=Object.freeze(le.fromCssColorString("#000080"));le.OLDLACE=Object.freeze(le.fromCssColorString("#FDF5E6"));le.OLIVE=Object.freeze(le.fromCssColorString("#808000"));le.OLIVEDRAB=Object.freeze(le.fromCssColorString("#6B8E23"));le.ORANGE=Object.freeze(le.fromCssColorString("#FFA500"));le.ORANGERED=Object.freeze(le.fromCssColorString("#FF4500"));le.ORCHID=Object.freeze(le.fromCssColorString("#DA70D6"));le.PALEGOLDENROD=Object.freeze(le.fromCssColorString("#EEE8AA"));le.PALEGREEN=Object.freeze(le.fromCssColorString("#98FB98"));le.PALETURQUOISE=Object.freeze(le.fromCssColorString("#AFEEEE"));le.PALEVIOLETRED=Object.freeze(le.fromCssColorString("#DB7093"));le.PAPAYAWHIP=Object.freeze(le.fromCssColorString("#FFEFD5"));le.PEACHPUFF=Object.freeze(le.fromCssColorString("#FFDAB9"));le.PERU=Object.freeze(le.fromCssColorString("#CD853F"));le.PINK=Object.freeze(le.fromCssColorString("#FFC0CB"));le.PLUM=Object.freeze(le.fromCssColorString("#DDA0DD"));le.POWDERBLUE=Object.freeze(le.fromCssColorString("#B0E0E6"));le.PURPLE=Object.freeze(le.fromCssColorString("#800080"));le.RED=Object.freeze(le.fromCssColorString("#FF0000"));le.ROSYBROWN=Object.freeze(le.fromCssColorString("#BC8F8F"));le.ROYALBLUE=Object.freeze(le.fromCssColorString("#4169E1"));le.SADDLEBROWN=Object.freeze(le.fromCssColorString("#8B4513"));le.SALMON=Object.freeze(le.fromCssColorString("#FA8072"));le.SANDYBROWN=Object.freeze(le.fromCssColorString("#F4A460"));le.SEAGREEN=Object.freeze(le.fromCssColorString("#2E8B57"));le.SEASHELL=Object.freeze(le.fromCssColorString("#FFF5EE"));le.SIENNA=Object.freeze(le.fromCssColorString("#A0522D"));le.SILVER=Object.freeze(le.fromCssColorString("#C0C0C0"));le.SKYBLUE=Object.freeze(le.fromCssColorString("#87CEEB"));le.SLATEBLUE=Object.freeze(le.fromCssColorString("#6A5ACD"));le.SLATEGRAY=Object.freeze(le.fromCssColorString("#708090"));le.SLATEGREY=le.SLATEGRAY;le.SNOW=Object.freeze(le.fromCssColorString("#FFFAFA"));le.SPRINGGREEN=Object.freeze(le.fromCssColorString("#00FF7F"));le.STEELBLUE=Object.freeze(le.fromCssColorString("#4682B4"));le.TAN=Object.freeze(le.fromCssColorString("#D2B48C"));le.TEAL=Object.freeze(le.fromCssColorString("#008080"));le.THISTLE=Object.freeze(le.fromCssColorString("#D8BFD8"));le.TOMATO=Object.freeze(le.fromCssColorString("#FF6347"));le.TURQUOISE=Object.freeze(le.fromCssColorString("#40E0D0"));le.VIOLET=Object.freeze(le.fromCssColorString("#EE82EE"));le.WHEAT=Object.freeze(le.fromCssColorString("#F5DEB3"));le.WHITE=Object.freeze(le.fromCssColorString("#FFFFFF"));le.WHITESMOKE=Object.freeze(le.fromCssColorString("#F5F5F5"));le.YELLOW=Object.freeze(le.fromCssColorString("#FFFF00"));le.YELLOWGREEN=Object.freeze(le.fromCssColorString("#9ACD32"));le.TRANSPARENT=Object.freeze(new le(0,0,0,0));var D=le;function ED(e){e=e??Q.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}ED.ALL=Object.freeze(new ED({color:new D(0,0,0,0),depth:1,stencil:0}));ED.prototype.execute=function(e,t){e.clear(this,t)};var li=ED;var WBt=y(x(),1);var RBt=y(x(),1),iGe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE:5,CESIUM_3D_TILE_CLASSIFICATION:6,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:7,OPAQUE:8,TRANSLUCENT:9,VOXELS:10,GAUSSIAN_SPLATS:11,OVERLAY:12,NUMBER_OF_PASSES:13},Ve=Object.freeze(iGe);function Fte(e){e=e??Q.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.canceled=e.canceled,this.persists=e.persists??!1,this.pass=Ve.COMPUTE,this.owner=e.owner}Fte.prototype.execute=function(e){e.execute(this)};var ll=Fte;var ZPt=y(x(),1);var HNt=y(x(),1);var YBt=y(x(),1);function vt(e,t){this.x=e??0,this.y=t??0}vt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new vt(e,t)};vt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new vt(e.x,e.y)};vt.fromCartesian3=vt.clone;vt.fromCartesian4=vt.clone;vt.packedLength=2;vt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n]=e.y,t};vt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new vt),n.x=e[t++],n.y=e[t],n};vt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)vt.pack(e[o],t,o*2);return t};vt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=vt.unpack(e,i,t[o])}return t};vt.fromArray=vt.unpack;vt.maximumComponent=function(e){return Math.max(e.x,e.y)};vt.minimumComponent=function(e){return Math.min(e.x,e.y)};vt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};vt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};vt.clamp=function(e,t,n,i){let o=V.clamp(e.x,t.x,n.x),r=V.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};vt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};vt.magnitude=function(e){return Math.sqrt(vt.magnitudeSquared(e))};var TD=new vt;vt.distance=function(e,t){return vt.subtract(e,t,TD),vt.magnitude(TD)};vt.distanceSquared=function(e,t){return vt.subtract(e,t,TD),vt.magnitudeSquared(TD)};vt.normalize=function(e,t){let n=vt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};vt.dot=function(e,t){return e.x*t.x+e.y*t.y};vt.cross=function(e,t){return e.x*t.y-e.y*t.x};vt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};vt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};vt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};vt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};vt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};vt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};vt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};vt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var Bte=new vt;vt.lerp=function(e,t,n,i){return vt.multiplyByScalar(t,n,Bte),i=vt.multiplyByScalar(e,1-n,i),vt.add(Bte,i,i)};var wte=new vt,Yte=new vt;vt.angleBetween=function(e,t){return vt.normalize(e,wte),vt.normalize(t,Yte),V.acosClamped(vt.dot(wte,Yte))};var oGe=new vt;vt.mostOrthogonalAxis=function(e,t){let n=vt.normalize(e,oGe);return vt.abs(n,n),n.x<=n.y?t=vt.clone(vt.UNIT_X,t):t=vt.clone(vt.UNIT_Y,t),t};vt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};vt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};vt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&V.equalsEpsilon(e.x,t.x,n,i)&&V.equalsEpsilon(e.y,t.y,n,i)};vt.ZERO=Object.freeze(new vt(0,0));vt.ONE=Object.freeze(new vt(1,1));vt.UNIT_X=Object.freeze(new vt(1,0));vt.UNIT_Y=Object.freeze(new vt(0,1));vt.prototype.clone=function(e){return vt.clone(this,e)};vt.prototype.equals=function(e){return vt.equals(this,e)};vt.prototype.equalsEpsilon=function(e,t,n){return vt.equalsEpsilon(this,e,t,n)};vt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var M=vt;var zBt=y(x(),1);var UBt=y(x(),1);var rGe=new m,sGe=new m;function aGe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,d=t.y,u=t.z,h=r*r*c*c,p=s*s*d*d,g=a*a*u*u,f=h+p+g,b=Math.sqrt(1/f),C=m.multiplyByScalar(e,b,rGe);if(f<i)return isFinite(b)?m.clone(C,o):void 0;let E=n.x,T=n.y,S=n.z,_=sGe;_.x=C.x*E*2,_.y=C.y*T*2,_.z=C.z*S*2;let R=(1-b)*m.magnitude(e)/(.5*m.magnitude(_)),L=0,W,B,Y,N,A,I,Z,G,w,X,v;do{R-=L,Y=1/(1+R*E),N=1/(1+R*T),A=1/(1+R*S),I=Y*Y,Z=N*N,G=A*A,w=I*Y,X=Z*N,v=G*A,W=h*I+p*Z+g*G-1,B=h*w*E+p*X*T+g*v*S;let U=-2*B;L=W/U}while(Math.abs(W)>V.EPSILON12);return l(o)?(o.x=r*Y,o.y=s*N,o.z=a*A,o):new m(r*Y,s*N,a*A)}var ex=aGe;function rr(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}rr.fromRadians=function(e,t,n,i){return n=n??0,l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new rr(e,t,n)};rr.fromDegrees=function(e,t,n,i){return e=V.toRadians(e),t=V.toRadians(t),rr.fromRadians(e,t,n,i)};var cGe=new m,lGe=new m,dGe=new m;rr._ellipsoidOneOverRadii=new m(1/6378137,1/6378137,1/6356752314245179e-9);rr._ellipsoidOneOverRadiiSquared=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));rr._ellipsoidCenterToleranceSquared=V.EPSILON1;rr.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:rr._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:rr._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:rr._ellipsoidCenterToleranceSquared,s=ex(e,i,o,r,lGe);if(!l(s))return;let a=m.multiplyComponents(s,o,cGe);a=m.normalize(a,a);let c=m.subtract(e,s,dGe),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),h=V.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=d,n.latitude=u,n.height=h,n):new rr(d,u,h)};rr.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};rr.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new rr(e.longitude,e.latitude,e.height)};rr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};rr.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};rr.ZERO=Object.freeze(new rr(0,0,0));rr.prototype.clone=function(e){return rr.clone(this,e)};rr.prototype.equals=function(e){return rr.equals(this,e)};rr.prototype.equalsEpsilon=function(e,t){return rr.equalsEpsilon(this,e,t)};rr.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var pe=rr;var t2t=y(x(),1);function Xte(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=V.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function _i(e,t,n){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,Xte(this,e,t,n)}Object.defineProperties(_i.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}}});_i.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new _i(n.x,n.y,n.z)};_i.fromCartesian3=function(e,t){return l(t)||(t=new _i),l(e)&&Xte(t,e.x,e.y,e.z),t};_i.WGS84=Object.freeze(new _i(6378137,6378137,6356752314245179e-9));_i.UNIT_SPHERE=Object.freeze(new _i(1,1,1));_i.MOON=Object.freeze(new _i(V.LUNAR_RADIUS,V.LUNAR_RADIUS,V.LUNAR_RADIUS));_i.MARS=Object.freeze(new _i(3396190,3396190,3376200));_i._default=_i.WGS84;Object.defineProperties(_i,{default:{get:function(){return _i._default},set:function(e){_i._default=e,m._ellipsoidRadiiSquared=e.radiiSquared,pe._ellipsoidOneOverRadii=e.oneOverRadii,pe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,pe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});_i.prototype.clone=function(e){return _i.clone(this,e)};_i.packedLength=m.packedLength;_i.pack=function(e,t,n){return n=n??0,m.pack(e._radii,t,n),t};_i.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t);return _i.fromCartesian3(i,n)};_i.prototype.geocentricSurfaceNormal=m.normalize;_i.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};_i.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,V.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var uGe=new m,mGe=new m;_i.prototype.cartographicToCartesian=function(e,t){let n=uGe,i=mGe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,o,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};_i.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var hGe=new m,fGe=new m,pGe=new m;_i.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,fGe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,hGe),o=m.subtract(e,n,pGe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=V.sign(m.dot(o,e))*m.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new pe(r,s,a)};_i.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};_i.prototype.scaleToGeodeticSurface=function(e,t){return ex(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};_i.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new m);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return m.multiplyByScalar(e,s,t)};_i.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._oneOverRadii,t)};_i.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._radii,t)};_i.prototype.equals=function(e){return this===e||l(e)&&m.equals(this._radii,e._radii)};_i.prototype.toString=function(){return this._radii.toString()};_i.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=t??0;let i=this._squaredXOverSquaredZ;if(l(n)||(n=new m),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var AGe=new m;_i.prototype.getLocalCurvature=function(e,t){l(t)||(t=new M);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,AGe),i=m.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return M.fromElements(1/i,1/r,t)};var gGe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],bGe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Nte(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*gGe[s];r+=bGe[s]*(n(i+a)+n(i-a))}return r*=o,r}_i.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=V.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,d=s*a;return Nte(i,o,function(u){let h=Math.cos(u),p=Math.sin(u);return Math.cos(u)*Nte(t,n,function(g){let f=Math.cos(g),b=Math.sin(g);return Math.sqrt(d*p*p+c*(a*f*f+s*b*b)*h*h)})})};var ie=_i;var a2t=y(x(),1);function SD(e){this._ellipsoid=e??ie.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(SD.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});SD.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};SD.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new pe(i,o,r)};var vi=SD;var l2t=y(x(),1),yGe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Jt=Object.freeze(yGe);var PNt=y(x(),1);var VNt=y(x(),1);var YYt=y(x(),1);var u2t=y(x(),1);function xGe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var bo=xGe;var h2t=y(x(),1);function CGe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Gb=CGe;var w2t=y(x(),1);var x2t=y(x(),1);var p2t=y(x(),1);function EGe(e){return e%4===0&&e%100!==0||e%400===0}var sh=EGe;var Pte=[31,28,31,30,31,30,31,31,30,31,30,31];function TGe(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function b(){Xo.typeOf.number.greaterThanOrEquals("Year",e,1),Xo.typeOf.number.lessThanOrEquals("Year",e,9999),Xo.typeOf.number.greaterThanOrEquals("Month",t,1),Xo.typeOf.number.lessThanOrEquals("Month",t,12),Xo.typeOf.number.greaterThanOrEquals("Day",n,1),Xo.typeOf.number.lessThanOrEquals("Day",n,31),Xo.typeOf.number.greaterThanOrEquals("Hour",i,0),Xo.typeOf.number.lessThanOrEquals("Hour",i,23),Xo.typeOf.number.greaterThanOrEquals("Minute",o,0),Xo.typeOf.number.lessThanOrEquals("Minute",o,59),Xo.typeOf.bool("IsLeapSecond",a),Xo.typeOf.number.greaterThanOrEquals("Second",r,0),Xo.typeOf.number.lessThanOrEquals("Second",r,a?60:59),Xo.typeOf.number.greaterThanOrEquals("Millisecond",s,0),Xo.typeOf.number.lessThan("Millisecond",s,1e3)}function C(){let E=t===2&&sh(e)?Pte[t-1]+1:Pte[t-1];if(n>E)throw new Ae("Month and Day represents invalid date")}}var mA=TGe;var E2t=y(x(),1);function SGe(e,t){this.julianDate=e,this.offset=t}var mo=SGe;var S2t=y(x(),1),IGe={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:24000005e-1},ai=Object.freeze(IGe);var _2t=y(x(),1),_Ge={UTC:0,TAI:1},oi=Object.freeze(_Ge);var Ute=new mA,S3=[31,28,31,30,31,30,31,31,30,31,30,31],I3=29;function _3(e,t){return Pt.compare(e.julianDate,t.julianDate)}var UT=new mo;function _D(e){UT.julianDate=e;let t=Pt.leapSeconds,n=bo(t,UT,_3);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Pt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Pt.addSeconds(e,i,e)}function Mte(e,t){UT.julianDate=e;let n=Pt.leapSeconds,i=bo(n,UT,_3);if(i<0&&(i=~i),i===0)return Pt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Pt.addSeconds(e,-n[i-1].offset,t);let o=Pt.secondsDifference(n[i].julianDate,e);if(o===0)return Pt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Pt.addSeconds(e,-n[--i].offset,t)}function Vb(e,t,n){let i=t/ai.SECONDS_PER_DAY|0;return e+=i,t-=ai.SECONDS_PER_DAY*i,t<0&&(e--,t+=ai.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Z3(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,d=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*ai.SECONDS_PER_HOUR+o*ai.SECONDS_PER_MINUTE+s*ai.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var ZGe=/^(\d{4})$/,RGe=/^(\d{4})-(\d{2})$/,GGe=/^(\d{4})-?(\d{3})$/,VGe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,LGe=/^(\d{4})-?(\d{2})-?(\d{2})$/,R3=/([Z+\-])?(\d{2})?:?(\d{2})?$/,WGe=/^(\d{2})(\.\d+)?/.source+R3.source,FGe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+R3.source,BGe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+R3.source;function Pt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??oi.UTC;let i=e|0;t=t+(e-i)*ai.SECONDS_PER_DAY,Vb(i,t,this),n===oi.UTC&&_D(this)}Pt.fromGregorianDate=function(e,t){let n=Z3(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Vb(n[0],n[1],t),_D(t),t):new Pt(n[0],n[1],oi.UTC)};Pt.fromDate=function(e,t){let n=Z3(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Vb(n[0],n[1],t),_D(t),t):new Pt(n[0],n[1],oi.UTC)};Pt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,d=0,u=n[0],h=n[1],p,g;if(n=u.match(LGe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=u.match(RGe),n!==null)i=+n[1],o=+n[2];else if(n=u.match(ZGe),n!==null)i=+n[1];else{let E;if(n=u.match(GGe),n!==null)i=+n[1],E=+n[2],g=sh(i);else if(n=u.match(VGe),n!==null){i=+n[1];let T=+n[2],S=+n[3]||0,_=new Date(Date.UTC(i,0,4));E=T*7+S-_.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(E),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=sh(i);let f;if(l(h)){n=h.match(BGe),n!==null?(s=+n[1],a=+n[2],c=+n[3],d=+(n[4]||0)*1e3,f=5):(n=h.match(FGe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,f=4):(n=h.match(WGe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,f=3)));let E=n[f],T=+n[f+1],S=+(n[f+2]||0);switch(E){case"+":s=s-T,a=a-S;break;case"-":s=s+T,a=a+S;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let b=c===60;for(b&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?I3:S3[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?I3:S3[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?I3:S3[o-1],r+=p;let C=Z3(i,o,r,s,a,c,d);return l(t)?(Vb(C[0],C[1],t),_D(t)):t=new Pt(C[0],C[1],oi.UTC),b&&Pt.addSeconds(t,1,t),t};Pt.now=function(e){return Pt.fromDate(new Date,e)};var ID=new Pt(0,0,oi.TAI);Pt.toGregorianDate=function(e,t){let n=!1,i=Mte(e,ID);l(i)||(Pt.addSeconds(e,-1,ID),i=Mte(ID,ID),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;let h=d+2-12*s|0,p=100*(a-49)+c+s|0,g=r/ai.SECONDS_PER_HOUR|0,f=r-g*ai.SECONDS_PER_HOUR,b=f/ai.SECONDS_PER_MINUTE|0;f=f-b*ai.SECONDS_PER_MINUTE;let C=f|0,E=(f-C)/ai.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(C+=1),l(t)?(t.year=p,t.month=h,t.day=u,t.hour=g,t.minute=b,t.second=C,t.millisecond=E,t.isLeapSecond=n,t):new mA(p,h,u,g,b,C,E,n)};Pt.toDate=function(e){let t=Pt.toGregorianDate(e,Ute),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Pt.toIso8601=function(e,t){let n=Pt.toGregorianDate(e,Ute),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,d=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&d===0&&(i=9999,o=12,r=31,s=24);let u;if(!l(t)&&d!==0){let h=d*.01;return u=h<1e-6?h.toFixed(20).replace(".","").replace(/0+$/,""):h.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)};Pt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Pt(e.dayNumber,e.secondsOfDay,oi.TAI)};Pt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Pt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Pt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(Pt.secondsDifference(e,t))<=n};Pt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/ai.SECONDS_PER_DAY};Pt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*ai.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Pt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/ai.SECONDS_PER_DAY;return n+i};Pt.computeTaiMinusUtc=function(e){UT.julianDate=e;let t=Pt.leapSeconds,n=bo(t,UT,_3);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Pt.addSeconds=function(e,t,n){return Vb(e.dayNumber,e.secondsOfDay+t,n)};Pt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*ai.SECONDS_PER_MINUTE;return Vb(e.dayNumber,i,n)};Pt.addHours=function(e,t,n){let i=e.secondsOfDay+t*ai.SECONDS_PER_HOUR;return Vb(e.dayNumber,i,n)};Pt.addDays=function(e,t,n){let i=e.dayNumber+t;return Vb(i,e.secondsOfDay,n)};Pt.lessThan=function(e,t){return Pt.compare(e,t)<0};Pt.lessThanOrEquals=function(e,t){return Pt.compare(e,t)<=0};Pt.greaterThan=function(e,t){return Pt.compare(e,t)>0};Pt.greaterThanOrEquals=function(e,t){return Pt.compare(e,t)>=0};Pt.prototype.clone=function(e){return Pt.clone(this,e)};Pt.prototype.equals=function(e){return Pt.equals(this,e)};Pt.prototype.equalsEpsilon=function(e,t){return Pt.equalsEpsilon(this,e,t)};Pt.prototype.toString=function(){return Pt.toIso8601(this)};Pt.leapSeconds=[new mo(new Pt(2441317,43210,oi.TAI),10),new mo(new Pt(2441499,43211,oi.TAI),11),new mo(new Pt(2441683,43212,oi.TAI),12),new mo(new Pt(2442048,43213,oi.TAI),13),new mo(new Pt(2442413,43214,oi.TAI),14),new mo(new Pt(2442778,43215,oi.TAI),15),new mo(new Pt(2443144,43216,oi.TAI),16),new mo(new Pt(2443509,43217,oi.TAI),17),new mo(new Pt(2443874,43218,oi.TAI),18),new mo(new Pt(2444239,43219,oi.TAI),19),new mo(new Pt(2444786,43220,oi.TAI),20),new mo(new Pt(2445151,43221,oi.TAI),21),new mo(new Pt(2445516,43222,oi.TAI),22),new mo(new Pt(2446247,43223,oi.TAI),23),new mo(new Pt(2447161,43224,oi.TAI),24),new mo(new Pt(2447892,43225,oi.TAI),25),new mo(new Pt(2448257,43226,oi.TAI),26),new mo(new Pt(2448804,43227,oi.TAI),27),new mo(new Pt(2449169,43228,oi.TAI),28),new mo(new Pt(2449534,43229,oi.TAI),29),new mo(new Pt(2450083,43230,oi.TAI),30),new mo(new Pt(2450630,43231,oi.TAI),31),new mo(new Pt(2451179,43232,oi.TAI),32),new mo(new Pt(2453736,43233,oi.TAI),33),new mo(new Pt(2454832,43234,oi.TAI),34),new mo(new Pt(2456109,43235,oi.TAI),35),new mo(new Pt(2457204,43236,oi.TAI),36),new mo(new Pt(2457754,43237,oi.TAI),37)];var j=Pt;var SYt=y(x(),1),sne=y(Md(),1);var U2t=y(x(),1);function wGe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var lR=wGe;var v2t=y(x(),1);function Hte(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=Hte(o,t)),n[i]=o}return n}var Qe=Hte;var O2t=y(x(),1);function Kte(e,t,n){n=n??!1;let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=Kte(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Rt=Kte;var H2t=y(x(),1);function YGe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var ed=YGe;var j2t=y(x(),1),Jte=y(Md(),1);function G3(e,t){let n;return typeof document<"u"&&(n=document),G3._implementation(e,t,n)}G3._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Jte.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Nf=G3;var $2t=y(x(),1),jte=y(Md(),1);function NGe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new jte.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var dR=NGe;var twt=y(x(),1),qte=y(Md(),1);function XGe(e){let t=new qte.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var hA=XGe;var owt=y(x(),1);var $te={};function PGe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=$te[t];l(i)||(i={},$te[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var ah=PGe;var swt=y(x(),1);var MGe=/^blob:/i;function UGe(e){return MGe.test(e)}var tx=UGe;var lwt=y(x(),1);var Xf;function DGe(e){l(Xf)||(Xf=document.createElement("a")),Xf.href=window.location.href;let t=Xf.host,n=Xf.protocol;return Xf.href=e,Xf.href=Xf.href,n!==Xf.protocol||t!==Xf.host}var Lb=DGe;var uwt=y(x(),1);var vGe=/^data:/i;function kGe(e){return vGe.test(e)}var ch=kGe;var hwt=y(x(),1);function QGe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var nx=QGe;var pwt=y(x(),1);function OGe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var ix=OGe;var bwt=y(x(),1);function zGe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Ud=zGe;var Rwt=y(x(),1);var xwt=y(x(),1),HGe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},pi=Object.freeze(HGe);var Ewt=y(x(),1),KGe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Ys=Object.freeze(KGe);function VD(e){e=e??Q.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??Ys.OTHER,this.serverKey=e.serverKey,this.state=pi.UNISSUED,this.deferred=void 0,this.cancelled=!1}VD.prototype.cancel=function(){this.cancelled=!0};VD.prototype.clone=function(e){return l(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=pi.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new VD(this)};var pr=VD;var Bwt=y(x(),1);var Vwt=y(x(),1);function JGe(e){let t={};if(!e)return t;let n=e.split(`\r
`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var uR=JGe;function ene(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=uR(this.responseHeaders))}ene.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Pf=ene;var Kwt=y(x(),1),LD=y(Md(),1);var Nwt=y(x(),1);function mR(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(mR.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});mR.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return L3(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function L3(e,t,n,i){t.has(n)||t.set(n,new Set);let o=t.get(n);return o.has(i)?!1:(o.add(i),!0)}mR.prototype.removeEventListener=function(e,t){let n=V3(this,this._listeners,e,t),i=V3(this,this._toAdd,e,t),o=n||i;return o&&this._listenerCount--,o};function V3(e,t,n,i){let o=t.get(n);if(!o||!o.has(i))return!1;if(e._invokingListeners){if(!L3(e,e._toRemove,n,i))return!1}else o.delete(i),o.size===0&&t.delete(n);return!0}mR.prototype.raiseEvent=function(){this._invokingListeners=!0;for(let[e,t]of this._listeners.entries())if(l(e))for(let n of t)e.apply(n,arguments);this._invokingListeners=!1;for(let[e,t]of this._toAdd.entries())for(let n of t)L3(this,this._listeners,e,n);this._toAdd.clear();for(let[e,t]of this._toRemove.entries())for(let n of t)V3(this,this._listeners,e,n);this._toRemove.clear()};var Ce=mR;var Mwt=y(x(),1);function ox(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(ox.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function W3(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}ox.prototype.reserve=function(e){e=e??this._length,this._array.length=e};ox.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(W3(i,o,e),e=o):r=!1}};ox.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};ox.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)W3(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};ox.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return W3(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var hR=ox;function jGe(e,t){return e.priority-t.priority}var yo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},kT=20,Vc=new hR({comparator:jGe});Vc.maximumLength=kT;Vc.reserve(kT);var Mf=[],fA={},qGe=typeof document<"u"?new LD.default(document.location.href):new LD.default,WD=new Ce;function Ar(){}Ar.maximumRequests=50;Ar.maximumRequestsPerServer=18;Ar.requestsByServer={};Ar.throttleRequests=!0;Ar.debugShowStatistics=!1;Ar.requestCompletedEvent=WD;Object.defineProperties(Ar,{statistics:{get:function(){return yo}},priorityHeapLength:{get:function(){return kT},set:function(e){if(e<kT)for(;Vc.length>e;){let t=Vc.pop();rx(t)}kT=e,Vc.maximumLength=e,Vc.reserve(e)}}});function tne(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Ar.serverHasOpenSlots=function(e,t){t=t??1;let n=Ar.requestsByServer[e]??Ar.maximumRequestsPerServer;return fA[e]+t<=n};Ar.heapHasOpenSlots=function(e){return Vc.length+e<=kT};function nne(e){return e.state===pi.UNISSUED&&(e.state=pi.ISSUED,e.deferred=ed()),e.deferred.promise}function $Ge(e){return function(t){if(e.state===pi.CANCELLED)return;let n=e.deferred;--yo.numberOfActiveRequests,--fA[e.serverKey],WD.raiseEvent(),e.state=pi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function eVe(e){return function(t){e.state!==pi.CANCELLED&&(++yo.numberOfFailedRequests,--yo.numberOfActiveRequests,--fA[e.serverKey],WD.raiseEvent(t),e.state=pi.FAILED,e.deferred.reject(t))}}function ine(e){let t=nne(e);return e.state=pi.ACTIVE,Mf.push(e),++yo.numberOfActiveRequests,++yo.numberOfActiveRequestsEver,++fA[e.serverKey],e.requestFunction().then($Ge(e)).catch(eVe(e)),t}function rx(e){let t=e.state===pi.ACTIVE;if(e.state=pi.CANCELLED,++yo.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--yo.numberOfActiveRequests,--fA[e.serverKey],++yo.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Ar.update=function(){let e,t,n=0,i=Mf.length;for(e=0;e<i;++e){if(t=Mf[e],t.cancelled&&rx(t),t.state!==pi.ACTIVE){++n;continue}n>0&&(Mf[e-n]=t)}Mf.length-=n;let o=Vc.internalArray,r=Vc.length;for(e=0;e<r;++e)tne(o[e]);Vc.resort();let s=Math.max(Ar.maximumRequests-Mf.length,0),a=0;for(;a<s&&Vc.length>0;){if(t=Vc.pop(),t.cancelled){rx(t);continue}if(t.throttleByServer&&!Ar.serverHasOpenSlots(t.serverKey)){rx(t);continue}ine(t),++a}tVe()};Ar.getServerKey=function(e){let t=new LD.default(e);t.scheme()===""&&(t=t.absoluteTo(qGe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=fA[n];return l(i)||(fA[n]=0),n};Ar.request=function(e){if(ch(e.url)||tx(e.url))return WD.raiseEvent(),e.state=pi.RECEIVED,e.requestFunction();if(++yo.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Ar.getServerKey(e.url)),Ar.throttleRequests&&e.throttleByServer&&!Ar.serverHasOpenSlots(e.serverKey))return;if(!Ar.throttleRequests||!e.throttle)return ine(e);if(Mf.length>=Ar.maximumRequests)return;tne(e);let t=Vc.insert(e);if(l(t)){if(t===e)return;rx(t)}return nne(e)};function tVe(){Ar.debugShowStatistics&&(yo.numberOfActiveRequests===0&&yo.lastNumberOfActiveRequests>0&&(yo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${yo.numberOfAttemptedRequests}`),yo.numberOfAttemptedRequests=0),yo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${yo.numberOfCancelledRequests}`),yo.numberOfCancelledRequests=0),yo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${yo.numberOfCancelledActiveRequests}`),yo.numberOfCancelledActiveRequests=0),yo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${yo.numberOfFailedRequests}`),yo.numberOfFailedRequests=0)),yo.lastNumberOfActiveRequests=yo.numberOfActiveRequests)}Ar.clearForSpecs=function(){for(;Vc.length>0;){let t=Vc.pop();rx(t)}let e=Mf.length;for(let t=0;t<e;++t)rx(Mf[t]);Mf.length=0,fA={},yo.numberOfAttemptedRequests=0,yo.numberOfActiveRequests=0,yo.numberOfCancelledRequests=0,yo.numberOfCancelledActiveRequests=0,yo.numberOfFailedRequests=0,yo.numberOfActiveRequestsEver=0,yo.lastNumberOfActiveRequests=0};Ar.numberOfActiveRequestsByServer=function(e){return fA[e]};Ar.requestHeap=Vc;var Lc=Ar;var qwt=y(x(),1),one=y(Md(),1);var fR={},QT={};fR.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(QT[n])||(QT[n]=!0)};fR.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(QT[n])&&delete QT[n]};function nVe(e){let t=new one.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}fR.contains=function(e){let t=nVe(e);return!!(l(t)&&l(QT[t]))};fR.clear=function(){QT={}};var OT=fR;var ane=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function wt(e){e=e??Q.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Uf(e.templateValues,{}),this._queryParameters=Uf(e.queryParameters,{}),this.headers=Uf(e.headers,{}),this.request=e.request??new pr,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Uf(e,t){return l(e)?Qe(e):t}wt.createIfNeeded=function(e){return e instanceof wt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new wt({url:e})};var zT;wt.supportsImageBitmapOptions=function(){return l(zT)?zT:typeof createImageBitmap!="function"?(zT=Promise.resolve(!1),zT):(zT=wt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=ah(t[0]),i=ah(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),zT)};Object.defineProperties(wt,{isBlobSupported:{get:function(){return ane}}});Object.defineProperties(wt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return hA(this._url)}},isDataUri:{get:function(){return ch(this._url)}},isBlobUri:{get:function(){return tx(this._url)}},isCrossOriginUrl:{get:function(){return Lb(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});wt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};wt.prototype.parseUrl=function(e,t,n,i){let o=new sne.default(e),r=iVe(o.query());this._queryParameters=t?BD(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Nf(i))),this._url=o.toString()};function iVe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Ud(e)}function BD(e,t,n){if(!n)return Rt(e,t);let i=Qe(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}wt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${oVe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function oVe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${ix(e)}`}wt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=BD(this._queryParameters,e,!1):this._queryParameters=BD(e,this._queryParameters,!1)};wt.prototype.appendQueryParameters=function(e){this._queryParameters=BD(e,this._queryParameters,!0)};wt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Rt(this._templateValues,e):this._templateValues=Rt(e,this._templateValues)};wt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Rt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Rt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Rt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};wt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};wt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Qe(this._queryParameters),e._templateValues=Qe(this._templateValues),e.headers=Qe(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new wt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};wt.prototype.getBaseUri=function(e){return dR(this.getUrlComponent(e),e)};wt.prototype.appendForwardSlash=function(){this._url=lR(this._url)};wt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};wt.fetchArrayBuffer=function(e){return new wt(e).fetchArrayBuffer()};wt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};wt.fetchBlob=function(e){return new wt(e).fetchBlob()};wt.prototype.fetchImage=function(e){e=e??Q.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(F3(this.request),!ane||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return wt.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return wt.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(u);return c=new wt({url:h}),c._fetchImage({flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(l(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return l(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};wt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=ed();return wt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Lc.request(r);if(l(s))return s.catch(function(a){return r.state!==pi.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=pi.UNISSUED,r.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})};wt.fetchImage=function(e){return new wt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};wt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};wt.fetchText=function(e){return new wt(e).fetchText()};wt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};wt.fetchJson=function(e){return new wt(e).fetchJson()};wt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};wt.fetchXML=function(e){return new wt(e).fetchXML()};wt.prototype.fetchJsonp=function(e){e=e??"callback",F3(this.request);let t;do t=`loadJsonp${V.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return cne(this,e,t)};function cne(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=ed();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},wt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Lc.request(o);if(l(s))return s.catch(function(a){return o.state!==pi.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=pi.UNISSUED,o.deferred=void 0,cne(e,t,n)):Promise.reject(a)})})}wt.fetchJsonp=function(e){return new wt(e).fetchJsonp(e.callbackParameterName)};wt.prototype._makeRequest=function(e){let t=this;F3(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=Rt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=ed(),h=wt._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),u.promise};let o=Lc.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==pi.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=pi.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function F3(e){if(e.state===pi.ISSUED||e.state===pi.ACTIVE)throw new he("The Resource is already being fetched.");e.state=pi.UNISSUED,e.deferred=void 0}var rVe=/^data:(.*?)(;base64)?,(.*)$/;function FD(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function rne(e,t){let n=FD(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function sVe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return FD(i,o);case"arraybuffer":return rne(i,o);case"blob":return r=rne(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(FD(i,o),n);case"json":return JSON.parse(FD(i,o));default:}}wt.prototype.fetch=function(e){return e=Uf(e,{}),e.method="GET",this._makeRequest(e)};wt.fetch=function(e){return new wt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};wt.prototype.delete=function(e){return e=Uf(e,{}),e.method="DELETE",this._makeRequest(e)};wt.delete=function(e){return new wt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};wt.prototype.head=function(e){return e=Uf(e,{}),e.method="HEAD",this._makeRequest(e)};wt.head=function(e){return new wt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};wt.prototype.options=function(e){return e=Uf(e,{}),e.method="OPTIONS",this._makeRequest(e)};wt.options=function(e){return new wt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};wt.prototype.post=function(e,t){return Xo.defined("data",e),t=Uf(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};wt.post=function(e){return new wt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};wt.prototype.put=function(e,t){return Xo.defined("data",e),t=Uf(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};wt.put=function(e){return new wt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};wt.prototype.patch=function(e,t){return Xo.defined("data",e),t=Uf(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};wt.patch=function(e){return new wt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};wt._Implementations={};wt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(OT.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};wt._Implementations.createImage=function(e,t,n,i,o,r,s){let a=e.url;wt.supportsImageBitmapOptions().then(function(c){if(!(c&&r)){wt._Implementations.loadImageElement(a,t,n);return}let d="blob",u="GET",h=ed(),p=wt._Implementations.loadWithXhr(a,d,u,void 0,s,h,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),h.promise.then(function(g){if(!l(g)){n.reject(new he(`Successfully retrieved ${a} but it contained no content.`));return}return wt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};wt.createImageBitmapFromBlob=function(e,t){return Xo.defined("options",t),Xo.typeOf.bool("options.flipY",t.flipY),Xo.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),Xo.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function aVe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new Pf(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new Pf)})}var cVe=typeof XMLHttpRequest>"u";wt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=rVe.exec(e);if(a!==null){r.resolve(sVe(a,t));return}if(cVe){aVe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(OT.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);l(t)&&(c.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new Pf(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};g.forEach(function(b){let C=b.split(": "),E=C.shift();f[E]=C.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||h===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(h===""||h==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(h===""||h==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new he("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Pf)},c.send(i),c};wt._Implementations.loadAndExecuteScript=function(e,t,n){return nx(e,t).catch(function(i){n.reject(i)})};wt._DefaultImplementations={};wt._DefaultImplementations.createImage=wt._Implementations.createImage;wt._DefaultImplementations.loadWithXhr=wt._Implementations.loadWithXhr;wt._DefaultImplementations.loadAndExecuteScript=wt._Implementations.loadAndExecuteScript;wt.DEFAULT=Object.freeze(new wt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ge=wt;function AR(e){e=e??Q.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._addNewLeapSeconds=e.addNewLeapSeconds??!0,l(e.data)?lne(this,e.data):lne(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}AR.fromUrl=async function(e,t){t=t??Q.EMPTY_OBJECT;let n=Ge.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new he(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new AR({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};AR.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Gb(0,0,0,0,0),t}});AR.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Gb(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],d=j.lessThanOrEquals(a,e),u=!l(c),h=u||j.greaterThanOrEquals(c,e);if(d&&h)return o=i,!u&&c.equals(e)&&++o,r=o+1,une(this,n,this._samples,e,o,r,t),t}let s=bo(n,e,j.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,une(this,n,this._samples,e,o,r,t),t};function lVe(e,t){return j.compare(e.julianDate,t)}function lne(e,t){if(!l(t.columnNames))throw new he("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new he("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new he("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let d=e._samples=t.samples,u=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let g=0,f=d.length;g<f;g+=e._columnCount){let b=d[g+n],C=d[g+c],E=b+ai.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new j(E,C,oi.TAI);if(u.push(T),p){if(C!==h&&l(h)){let S=j.leapSeconds,_=bo(S,T,lVe);if(_<0){let R=new mo(T,C);S.splice(~_,0,R)}}h=C}}}function dne(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function pR(e,t,n){return t+e*(n-t)}function une(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],d=t[r];if(c.equals(d)||i.equals(c))return dne(e,n,o,a,s),s;if(i.equals(d))return dne(e,n,r,a,s),s;let u=j.secondsDifference(i,c)/j.secondsDifference(d,c),h=o*a,p=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],b=f-g;if(b>.5||b<-.5){let C=n[h+e._taiMinusUtcSecondsColumn],E=n[p+e._taiMinusUtcSecondsColumn];C!==E&&(d.equals(i)?g=f:f-=E-C)}return s.xPoleWander=pR(u,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=pR(u,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=pR(u,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=pR(u,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=pR(u,g,f),s}var gR=AR;var MYt=y(x(),1);function Wc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Wc.fromQuaternion=function(e,t){l(t)||(t=new Wc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-V.asinClamped(n),t};Wc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Wc),i.heading=e*V.RADIANS_PER_DEGREE,i.pitch=t*V.RADIANS_PER_DEGREE,i.roll=n*V.RADIANS_PER_DEGREE,i};Wc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Wc(e.heading,e.pitch,e.roll)};Wc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Wc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&V.equalsEpsilon(e.heading,t.heading,n,i)&&V.equalsEpsilon(e.pitch,t.pitch,n,i)&&V.equalsEpsilon(e.roll,t.roll,n,i)};Wc.prototype.clone=function(e){return Wc.clone(this,e)};Wc.prototype.equals=function(e){return Wc.equals(this,e)};Wc.prototype.equalsEpsilon=function(e,t,n){return Wc.equalsEpsilon(this,e,t,n)};Wc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var uc=Wc;var iNt=y(x(),1);var QYt=y(x(),1);var mne={};var hne=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function dVe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=hne.exec(i);if(o!==null)return o[1]}}var wD;function fne(e){return typeof document>"u"?e:(l(wD)||(wD=document.createElement("a")),wD.href=e,wD.href)}var sx;function pne(){if(l(sx))return sx;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(mne?.url)?e=Nf(".",mne.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(aD.toUrl)?e=Nf("..",ax("Core/buildModuleUrl.js")):e=dVe(),sx=new Ge({url:fne(e)}),sx.appendForwardSlash(),sx}function uVe(e){return fne(aD.toUrl(`../${e}`))}function Ane(e){return pne().getDerivedResource({url:e}).url}var YD;function ax(e){return l(YD)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(aD.toUrl)?YD=uVe:YD=Ane),YD(e)}ax._cesiumScriptRegex=hne;ax._buildModuleUrlFromBaseUrl=Ane;ax._clearBaseResource=function(){sx=void 0};ax.setBaseUrl=function(e){sx=Ge.DEFAULT.getDerivedResource({url:e})};ax.getCesiumBaseUrl=pne;var en=ax;var HYt=y(x(),1);function mVe(e,t,n){this.x=e,this.y=t,this.s=n}var cx=mVe;function Y3(e){e=e??Q.EMPTY_OBJECT,this._xysFileUrlTemplate=Ge.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new j(this._sampleZeroJulianEphemerisDate,0,oi.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var hVe=new j(0,0,oi.TAI);function B3(e,t,n){let i=hVe;return i.dayNumber=t,i.secondsOfDay=n,j.daysDifference(i,e._sampleZeroDateTT)}Y3.prototype.preload=function(e,t,n,i){let o=B3(this,e,t),r=B3(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let h=c;h<=d;++h)u.push(w3(this,h));return Promise.all(u)};Y3.prototype.computeXysRadians=function(e,t,n){let i=B3(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,d=this._samples;if(l(d[s*3])||(w3(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(w3(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new cx(0,0,0);let u=i-s*this._stepSizeDays,h=this._work,p=this._denominators,g=this._coef,f=this._xTable,b,C;for(b=0;b<=r;++b)h[b]=u-f[b];for(b=0;b<=r;++b){for(g[b]=1,C=0;C<=r;++C)C!==b&&(g[b]*=h[C]);g[b]*=p[b];let E=(s+b)*3;n.x+=g[b]*d[E++],n.y+=g[b]*d[E++],n.s+=g[b]*d[E]}return n};function w3(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Ge({url:en(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let d=0,u=a.length;d<u;++d)s[c+d]=a[d]});return e._chunkDownloadsInProgress[t]=o,o}var bR=Y3;var dNt=y(x(),1);function ct(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var yR=new m;ct.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);yR=m.normalize(e,yR);let r=yR.x*o,s=yR.y*o,a=yR.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new ct(r,s,a,c)};var fVe=[1,2,0],pVe=new Array(3);ct.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],d=e[$.COLUMN2ROW2],u=a+c+d;if(u>0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let h=fVe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let g=h[p],f=h[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(f,f)]+1);let b=pVe;b[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(f,g)]-e[$.getElementIndex(g,f)])*n,b[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,b[f]=(e[$.getElementIndex(f,p)]+e[$.getElementIndex(p,f)])*n,i=-b[0],o=-b[1],r=-b[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ct(i,o,r,s)};var gne=new ct,bne=new ct,N3=new ct,yne=new ct;ct.fromHeadingPitchRoll=function(e,t){return yne=ct.fromAxisAngle(m.UNIT_X,e.roll,gne),N3=ct.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=ct.multiply(N3,yne,N3),bne=ct.fromAxisAngle(m.UNIT_Z,-e.heading,gne),ct.multiply(bne,t,t)};var ND=new m,X3=new m,lh=new ct,xne=new ct,XD=new ct;ct.packedLength=4;ct.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ct.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ct),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ct.packedInterpolationLength=3;ct.convertPackedArrayForInterpolation=function(e,t,n,i){ct.unpack(e,n*4,XD),ct.conjugate(XD,XD);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;ct.unpack(e,(t+o)*4,lh),ct.multiply(lh,XD,lh),lh.w<0&&ct.negate(lh,lh),ct.computeAxis(lh,ND);let a=ct.computeAngle(lh);l(i)||(i=[]),i[s]=ND.x*a,i[s+1]=ND.y*a,i[s+2]=ND.z*a}};ct.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new ct),m.fromArray(e,0,X3);let r=m.magnitude(X3);return ct.unpack(t,i*4,xne),r===0?ct.clone(ct.IDENTITY,lh):ct.fromAxisAngle(X3,r,lh),ct.multiply(lh,xne,o)};ct.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new ct(e.x,e.y,e.z,e.w)};ct.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};ct.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};ct.magnitude=function(e){return Math.sqrt(ct.magnitudeSquared(e))};ct.normalize=function(e,t){let n=1/ct.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};ct.inverse=function(e,t){let n=ct.magnitudeSquared(e);return t=ct.conjugate(e,t),ct.multiplyByScalar(t,1/n,t)};ct.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};ct.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};ct.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};ct.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};ct.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,d=t.z,u=t.w,h=s*a+i*u+o*d-r*c,p=s*c-i*d+o*u+r*a,g=s*d+i*c-o*a+r*u,f=s*u-i*a-o*c-r*d;return n.x=h,n.y=p,n.z=g,n.w=f,n};ct.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};ct.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};ct.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<V.EPSILON6||Math.abs(n+1)<V.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};ct.computeAngle=function(e){return Math.abs(e.w-1)<V.EPSILON6?0:2*Math.acos(e.w)};var P3=new ct;ct.lerp=function(e,t,n,i){return P3=ct.multiplyByScalar(t,n,P3),i=ct.multiplyByScalar(e,1-n,i),ct.add(P3,i,i)};var Cne=new ct,M3=new ct,U3=new ct;ct.slerp=function(e,t,n,i){let o=ct.dot(e,t),r=t;if(o<0&&(o=-o,r=Cne=ct.negate(t,Cne)),1-o<V.EPSILON6)return ct.lerp(e,r,n,i);let s=Math.acos(o);return M3=ct.multiplyByScalar(e,Math.sin((1-n)*s),M3),U3=ct.multiplyByScalar(r,Math.sin(n*s),U3),i=ct.add(M3,U3,i),ct.multiplyByScalar(i,1/Math.sin(s),i)};ct.log=function(e,t){let n=V.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),m.multiplyByScalar(e,i,t)};ct.exp=function(e,t){let n=m.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var AVe=new m,gVe=new m,xR=new ct,HT=new ct;ct.computeInnerQuadrangle=function(e,t,n,i){let o=ct.conjugate(t,xR);ct.multiply(o,n,HT);let r=ct.log(HT,AVe);ct.multiply(o,e,HT);let s=ct.log(HT,gVe);return m.add(r,s,r),m.multiplyByScalar(r,.25,r),m.negate(r,r),ct.exp(r,xR),ct.multiply(t,xR,i)};ct.squad=function(e,t,n,i,o,r){let s=ct.slerp(e,t,o,xR),a=ct.slerp(n,i,o,HT);return ct.slerp(s,a,2*o*(1-o),r)};var bVe=new ct,Ene=1.9011074535173003,PD=rn.supportsTypedArrays()?new Float32Array(8):[],MD=rn.supportsTypedArrays()?new Float32Array(8):[],pA=rn.supportsTypedArrays()?new Float32Array(8):[],AA=rn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;PD[e]=1/(t*n),MD[e]=t/n}PD[7]=Ene/136;MD[7]=Ene*8/17;ct.fastSlerp=function(e,t,n,i){let o=ct.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let g=7;g>=0;--g)pA[g]=(PD[g]*c-MD[g])*s,AA[g]=(PD[g]*d-MD[g])*s;let u=r*n*(1+pA[0]*(1+pA[1]*(1+pA[2]*(1+pA[3]*(1+pA[4]*(1+pA[5]*(1+pA[6]*(1+pA[7])))))))),h=a*(1+AA[0]*(1+AA[1]*(1+AA[2]*(1+AA[3]*(1+AA[4]*(1+AA[5]*(1+AA[6]*(1+AA[7])))))))),p=ct.multiplyByScalar(e,h,bVe);return ct.multiplyByScalar(t,u,i),ct.add(p,i,i)};ct.fastSquad=function(e,t,n,i,o,r){let s=ct.fastSlerp(e,t,o,xR),a=ct.fastSlerp(n,i,o,HT);return ct.fastSlerp(s,a,2*o*(1-o),r)};ct.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ct.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};ct.ZERO=Object.freeze(new ct(0,0,0,0));ct.IDENTITY=Object.freeze(new ct(0,0,0,1));ct.prototype.clone=function(e){return ct.clone(this,e)};ct.prototype.equals=function(e){return ct.equals(this,e)};ct.prototype.equalsEpsilon=function(e,t){return ct.equalsEpsilon(this,e,t)};ct.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Me=ct;var Ai={},D3={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"}},KT={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},v3={},td={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},Wb=new m,Fb=new m,Bb=new m;Ai.localFrameToFixedFrameGenerator=function(e,t){if(!D3.hasOwnProperty(e)||!D3[e].hasOwnProperty(t))throw new Ae("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=D3[e][t],i,o=e+t;return l(v3[o])?i=v3[o]:(i=function(r,s,a){if(l(a)||(a=new F),m.equalsEpsilon(r,m.ZERO,V.EPSILON14))m.unpack(KT[e],0,Wb),m.unpack(KT[t],0,Fb),m.unpack(KT[n],0,Bb);else if(V.equalsEpsilon(r.x,0,V.EPSILON14)&&V.equalsEpsilon(r.y,0,V.EPSILON14)){let c=V.sign(r.z);m.unpack(KT[e],0,Wb),e!=="east"&&e!=="west"&&m.multiplyByScalar(Wb,c,Wb),m.unpack(KT[t],0,Fb),t!=="east"&&t!=="west"&&m.multiplyByScalar(Fb,c,Fb),m.unpack(KT[n],0,Bb),n!=="east"&&n!=="west"&&m.multiplyByScalar(Bb,c,Bb)}else{s=s??ie.default,s.geodeticSurfaceNormal(r,td.up);let c=td.up,d=td.east;d.x=-r.y,d.y=r.x,d.z=0,m.normalize(d,td.east),m.cross(c,d,td.north),m.multiplyByScalar(td.up,-1,td.down),m.multiplyByScalar(td.east,-1,td.west),m.multiplyByScalar(td.north,-1,td.south),Wb=td[e],Fb=td[t],Bb=td[n]}return a[0]=Wb.x,a[1]=Wb.y,a[2]=Wb.z,a[3]=0,a[4]=Fb.x,a[5]=Fb.y,a[6]=Fb.z,a[7]=0,a[8]=Bb.x,a[9]=Bb.y,a[10]=Bb.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},v3[o]=i),i};Ai.eastNorthUpToFixedFrame=Ai.localFrameToFixedFrameGenerator("east","north");Ai.northEastDownToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","east");Ai.northUpEastToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","up");Ai.northWestUpToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","west");var yVe=new Me,xVe=new m(1,1,1),CVe=new F;Ai.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??Ai.eastNorthUpToFixedFrame;let r=Me.fromHeadingPitchRoll(t,yVe),s=F.fromTranslationQuaternionRotationScale(m.ZERO,r,xVe,CVe);return o=i(e,n,o),F.multiply(o,s,o)};var EVe=new F,TVe=new $;Ai.headingPitchRollQuaternion=function(e,t,n,i,o){let r=Ai.headingPitchRollToFixedFrame(e,t,n,i,EVe),s=F.getMatrix3(r,TVe);return Me.fromRotationMatrix(s,o)};var SVe=new m(1,1,1),IVe=new m,Tne=new F,_Ve=new F,ZVe=new $,RVe=new Me;Ai.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ie.default,n=n??Ai.eastNorthUpToFixedFrame,l(i)||(i=new uc);let o=F.getTranslation(e,IVe);if(m.equals(o,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,Tne),Tne),s=F.setScale(e,SVe,_Ve);s=F.setTranslation(s,m.ZERO,s),r=F.multiply(r,s,r);let a=Me.fromRotationMatrix(F.getMatrix3(r,ZVe),RVe);return a=Me.normalize(a,a),uc.fromQuaternion(a,i)};var GVe=6*3600+2460+50.54841,VVe=8640184812866e-6,LVe=.093104,WVe=-62e-7,FVe=11772758384668e-32,BVe=72921158553e-15,wVe=V.TWO_PI/86400,UD=new j;Ai.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ai.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ai.computeTemeToPseudoFixedMatrix(e,t)),n};Ai.computeTemeToPseudoFixedMatrix=function(e,t){UD=j.addSeconds(e,-j.computeTaiMinusUtc(e),UD);let n=UD.dayNumber,i=UD.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/ai.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/ai.DAYS_PER_JULIAN_CENTURY;let a=(GVe+o*(VVe+o*(LVe+o*WVe)))*wVe%V.TWO_PI,c=BVe+FVe*(n-24515455e-1),d=(i+ai.SECONDS_PER_DAY*.5)%ai.SECONDS_PER_DAY,u=a+c*d,h=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(h,p,0,-p,h,0,0,0,1)};Ai.iau2006XysData=new bR;Ai.earthOrientationParameters=gR.NONE;var O3=32.184,YVe=2451545;Ai.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+O3,i=e.stop.dayNumber,o=e.stop.secondsOfDay+O3;return Ai.iau2006XysData.preload(t,n,i,o)};Ai.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ai.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var NVe=32.184,XVe=2451545,DD=new uc,PVe=new $,MVe=new j;Ai.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=j.addSeconds(e,NVe,MVe),i=j.totalDays(n)-XVe,o=V.toRadians(12.112)-V.toRadians(.052992)*i,r=V.toRadians(24.224)-V.toRadians(.105984)*i,s=V.toRadians(227.645)+V.toRadians(13.012)*i,a=V.toRadians(261.105)+V.toRadians(13.340716)*i,c=V.toRadians(358)+V.toRadians(.9856)*i;return DD.pitch=V.toRadians(180)-V.toRadians(3.878)*Math.sin(o)-V.toRadians(.12)*Math.sin(r)+V.toRadians(.07)*Math.sin(s)-V.toRadians(.017)*Math.sin(a),DD.roll=V.toRadians(66.53-90)+V.toRadians(1.543)*Math.cos(o)+V.toRadians(.24)*Math.cos(r)-V.toRadians(.028)*Math.cos(s)+V.toRadians(.007)*Math.cos(a),DD.heading=V.toRadians(244.375-90)+V.toRadians(13.17635831)*i+V.toRadians(3.558)*Math.sin(o)+V.toRadians(.121)*Math.sin(r)-V.toRadians(.064)*Math.sin(s)+V.toRadians(.016)*Math.sin(a)+V.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(DD,PVe)};Ai.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ai.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var UVe=new cx(0,0,0),DVe=new Gb(0,0,0,0,0,0),k3=new $,Q3=new $;Ai.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Ai.earthOrientationParameters.compute(e,DVe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+O3,r=Ai.iau2006XysData.computeXysRadians(i,o,UVe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=k3;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);let u=$.fromRotationZ(-r.s,Q3),h=$.multiply(d,u,k3),p=e.dayNumber,g=e.secondsOfDay-j.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,b=g/ai.SECONDS_PER_DAY,C=.779057273264+b+.00273781191135448*(f+b);C=C%1*V.TWO_PI;let E=$.fromRotationZ(C,Q3),T=$.multiply(h,E,k3),S=Math.cos(n.xPoleWander),_=Math.cos(n.yPoleWander),R=Math.sin(n.xPoleWander),L=Math.sin(n.yPoleWander),W=i-YVe+o/ai.SECONDS_PER_DAY;W/=36525;let B=-47e-6*W*V.RADIANS_PER_DEGREE/3600,Y=Math.cos(B),N=Math.sin(B),A=Q3;return A[0]=S*Y,A[1]=S*N,A[2]=R,A[3]=-_*N+L*R*Y,A[4]=_*Y+L*R*N,A[5]=-L*S,A[6]=-L*N-_*R*Y,A[7]=L*Y-_*R*N,A[8]=_*S,$.multiply(T,A,t)};var vVe=new ce;Ai.pointToWindowCoordinates=function(e,t,n,i){return i=Ai.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ai.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new M);let o=vVe;return F.multiplyByVector(e,ce.fromElements(n.x,n.y,n.z,1,o),o),ce.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),M.fromCartesian4(o,i)};var kVe=new m,QVe=new m,OVe=new m;Ai.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??ie.default).geodeticSurfaceNormal(e,kVe),r=m.cross(t,o,QVe);m.equalsEpsilon(r,m.ZERO,V.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,OVe);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};Ai.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var Sne=new pe,z3=new m,zVe=new m,HVe=new $,H3=new F,Ine=new F;Ai.basisTo2D=function(e,t,n){let i=F.getTranslation(t,zVe),o=e.ellipsoid,r;if(m.equals(i,m.ZERO))r=m.clone(m.ZERO,z3);else{let u=o.cartesianToCartographic(i,Sne);r=e.project(u,z3),m.fromElements(r.z,r.x,r.y,r)}let s=Ai.eastNorthUpToFixedFrame(i,o,H3),a=F.inverseTransformation(s,Ine),c=F.getMatrix3(t,HVe),d=F.multiplyByMatrix3(a,c,n);return F.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,d,n),F.setTranslation(n,r,n),n};Ai.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=Ai.eastNorthUpToFixedFrame(t,i,H3),r=F.inverseTransformation(o,Ine),s=i.cartesianToCartographic(t,Sne),a=e.project(s,z3);m.fromElements(a.z,a.x,a.y,a);let c=F.fromTranslation(a,H3);return F.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,r,n),F.multiply(c,n,n),n};var Tt=Ai;function Yn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(Yn.prototype,{width:{get:function(){return Yn.computeWidth(this)}},height:{get:function(){return Yn.computeHeight(this)}}});Yn.packedLength=4;Yn.pack=function(e,t,n){return n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Yn.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Yn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Yn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=V.TWO_PI),t-n};Yn.computeHeight=function(e){return e.north-e.south};Yn.fromDegrees=function(e,t,n,i,o){return e=V.toRadians(e??0),t=V.toRadians(t??0),n=V.toRadians(n??0),i=V.toRadians(i??0),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new Yn(e,t,n,i)};Yn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=e??0,o.south=t??0,o.east=n??0,o.north=i??0,o):new Yn(e,t,n,i)};Yn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,d=e.length;c<d;c++){let u=e[c];n=Math.min(n,u.longitude),i=Math.max(i,u.longitude),s=Math.min(s,u.latitude),a=Math.max(a,u.latitude);let h=u.longitude>=0?u.longitude:u.longitude+V.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>V.PI&&(i=i-V.TWO_PI),n>V.PI&&(n=n-V.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new Yn(n,s,i,a)};Yn.fromCartesianArray=function(e,t,n){t=t??ie.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let d=0,u=e.length;d<u;d++){let h=t.cartesianToCartographic(e[d]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),c=Math.max(c,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+V.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>V.PI&&(o=o-V.TWO_PI),i>V.PI&&(i=i-V.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new Yn(i,a,o,c)};var KVe=new m,JVe=new m,jVe=new m,qVe=new m,$Ve=new m,K3=new Array(5);for(let e=0;e<K3.length;++e)K3[e]=new m;Yn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=ie.default),l(n)||(n=new Yn),m.equals(i,m.ZERO))return Yn.clone(Yn.MAX_VALUE,n),n;let r=Tt.eastNorthUpToFixedFrame(i,t,KVe),s=F.multiplyByPointAsVector(r,m.UNIT_X,JVe);m.normalize(s,s);let a=F.multiplyByPointAsVector(r,m.UNIT_Y,jVe);m.normalize(a,a),m.multiplyByScalar(a,o,a),m.multiplyByScalar(s,o,s);let c=m.negate(a,$Ve),d=m.negate(s,qVe),u=K3,h=u[0];return m.add(i,a,h),h=u[1],m.add(i,d,h),h=u[2],m.add(i,c,h),h=u[3],m.add(i,s,h),u[4]=i,Yn.fromCartesianArray(u,t,n)};Yn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Yn(e.west,e.south,e.east,e.north)};Yn.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};Yn.prototype.clone=function(e){return Yn.clone(this,e)};Yn.prototype.equals=function(e){return Yn.equals(this,e)};Yn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};Yn.prototype.equalsEpsilon=function(e,t){return Yn.equalsEpsilon(this,e,t)};Yn._validate=function(e){};Yn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new pe(e.west,e.south)};Yn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new pe(e.west,e.north)};Yn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new pe(e.east,e.north)};Yn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new pe(e.east,e.south)};Yn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=V.TWO_PI);let o=V.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new pe(o,r)};Yn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=V.TWO_PI:r<s&&i>0&&(r+=V.TWO_PI),i<o&&s<0?s+=V.TWO_PI:r<s&&o<0&&(o+=V.TWO_PI);let a=V.negativePiToPi(Math.max(o,s)),c=V.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let d=Math.max(e.south,t.south),u=Math.min(e.north,t.north);if(!(d>=u))return l(n)?(n.west=a,n.south=d,n.east=c,n.north=u,n):new Yn(a,d,c,u)};Yn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new Yn(i,o,r,s)};Yn.union=function(e,t,n){l(n)||(n=new Yn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=V.TWO_PI:r<s&&i>0&&(r+=V.TWO_PI),i<o&&s<0?s+=V.TWO_PI:r<s&&o<0&&(o+=V.TWO_PI);let a=V.negativePiToPi(Math.min(o,s)),c=V.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};Yn.expand=function(e,t,n){return l(n)||(n=new Yn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};Yn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=V.TWO_PI,n<0&&(n+=V.TWO_PI)),(n>o||V.equalsEpsilon(n,o,V.EPSILON14))&&(n<r||V.equalsEpsilon(n,r,V.EPSILON14))&&i>=e.south&&i<=e.north};var e1e=new pe;Yn.subsample=function(e,t,n,i){t=t??ie.default,n=n??0,l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,d=e1e;d.height=n,d.longitude=c,d.latitude=r,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.latitude=s,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*V.PI_OVER_TWO,Yn.contains(e,d)&&(i[o]=t.cartographicToCartesian(d,i[o]),o++);return d.latitude===0&&(d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++),i.length=o,i};Yn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new Yn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=V.TWO_PI+e.east-e.west;r.west=V.negativePiToPi(e.west+t*a),r.east=V.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};Yn.MAX_VALUE=Object.freeze(new Yn(-Math.PI,-V.PI_OVER_TWO,Math.PI,V.PI_OVER_TWO));var de=Yn;function ts(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}ts.packedLength=4;ts.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};ts.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ts),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};ts.fromPoints=function(e,t){if(l(t)||(t=new ts),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],d=c.x,u=c.y;i=Math.min(d,i),r=Math.max(d,r),o=Math.min(u,o),s=Math.max(u,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var _ne=new vi,t1e=new pe,n1e=new pe;ts.fromRectangle=function(e,t,n){if(l(n)||(n=new ts),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;_ne._ellipsoid=ie.default,t=t??_ne;let i=t.project(de.southwest(e,t1e)),o=t.project(de.northeast(e,n1e));return M.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};ts.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new ts(e.x,e.y,e.width,e.height)};ts.union=function(e,t,n){l(n)||(n=new ts);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};ts.expand=function(e,t,n){n=ts.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};ts.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?Jt.OUTSIDE:Jt.INTERSECTING};ts.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};ts.prototype.clone=function(e){return ts.clone(this,e)};ts.prototype.intersect=function(e){return ts.intersect(this,e)};ts.prototype.equals=function(e){return ts.equals(this,e)};var $e=ts;var jNt=y(x(),1);var mc={POINTS:ne.POINTS,LINES:ne.LINES,LINE_LOOP:ne.LINE_LOOP,LINE_STRIP:ne.LINE_STRIP,TRIANGLES:ne.TRIANGLES,TRIANGLE_STRIP:ne.TRIANGLE_STRIP,TRIANGLE_FAN:ne.TRIANGLE_FAN};mc.isLines=function(e){return e===mc.LINES||e===mc.LINE_LOOP||e===mc.LINE_STRIP};mc.isTriangles=function(e){return e===mc.TRIANGLES||e===mc.TRIANGLE_STRIP||e===mc.TRIANGLE_FAN};mc.validate=function(e){return e===mc.POINTS||e===mc.LINES||e===mc.LINE_LOOP||e===mc.LINE_STRIP||e===mc.TRIANGLES||e===mc.TRIANGLE_STRIP||e===mc.TRIANGLE_FAN};var Be=Object.freeze(mc);var $Nt=y(x(),1),lx=`in vec4 position;
in vec2 textureCoordinates;

out vec2 v_textureCoordinates;

void main() 
{
    gl_Position = position;
    v_textureCoordinates = textureCoordinates;
}
`;var oXt=y(x(),1);var Qr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function CR(e){e=e??Q.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Be.TRIANGLES,this._vertexArray=e.vertexArray,this._count=e.count,this._offset=e.offset??0,this._instanceCount=e.instanceCount??0,this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=e.cull??!0,this.occlude=e.occlude??!0,this.executeInClosestFrustum=e.executeInClosestFrustum??!1,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.castShadows=e.castShadows??!1,this.receiveShadows=e.receiveShadows??!1,this.pickOnly=e.pickOnly??!1,this.depthForTranslucentClassification=e.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Fc(e,t){return(e._flags&t)===t}function wb(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(CR.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 Fc(this,Qr.CULL)},set:function(e){Fc(this,Qr.CULL)!==e&&(wb(this,Qr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Fc(this,Qr.OCCLUDE)},set:function(e){Fc(this,Qr.OCCLUDE)!==e&&(wb(this,Qr.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 Fc(this,Qr.CAST_SHADOWS)},set:function(e){Fc(this,Qr.CAST_SHADOWS)!==e&&(wb(this,Qr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Fc(this,Qr.RECEIVE_SHADOWS)},set:function(e){Fc(this,Qr.RECEIVE_SHADOWS)!==e&&(wb(this,Qr.RECEIVE_SHADOWS,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 Fc(this,Qr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Fc(this,Qr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(wb(this,Qr.EXECUTE_IN_CLOSEST_FRUSTUM,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 Fc(this,Qr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Fc(this,Qr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(wb(this,Qr.DEBUG_SHOW_BOUNDING_VOLUME,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)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return Fc(this,Qr.PICK_ONLY)},set:function(e){Fc(this,Qr.PICK_ONLY)!==e&&(wb(this,Qr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Fc(this,Qr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Fc(this,Qr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(wb(this,Qr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});CR.shallowClone=function(e,t){if(l(e))return l(t)||(t=new CR),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,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._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};CR.prototype.execute=function(e,t){e.draw(this,t)};var nt=CR;var yXt=y(x(),1);var uXt=y(x(),1);var aXt=y(x(),1);var Vi={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,HALF_FLOAT:ne.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ne.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ne.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ne.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ne.UNSIGNED_SHORT_5_6_5};Vi.toWebGLConstant=function(e,t){switch(e){case Vi.UNSIGNED_BYTE:return ne.UNSIGNED_BYTE;case Vi.UNSIGNED_SHORT:return ne.UNSIGNED_SHORT;case Vi.UNSIGNED_INT:return ne.UNSIGNED_INT;case Vi.FLOAT:return ne.FLOAT;case Vi.HALF_FLOAT:return t.webgl2?ne.HALF_FLOAT:ne.HALF_FLOAT_OES;case Vi.UNSIGNED_INT_24_8:return ne.UNSIGNED_INT_24_8;case Vi.UNSIGNED_SHORT_4_4_4_4:return ne.UNSIGNED_SHORT_4_4_4_4;case Vi.UNSIGNED_SHORT_5_5_5_1:return ne.UNSIGNED_SHORT_5_5_5_1;case Vi.UNSIGNED_SHORT_5_6_5:return Vi.UNSIGNED_SHORT_5_6_5}};Vi.isPacked=function(e){return e===Vi.UNSIGNED_INT_24_8||e===Vi.UNSIGNED_SHORT_4_4_4_4||e===Vi.UNSIGNED_SHORT_5_5_5_1||e===Vi.UNSIGNED_SHORT_5_6_5};Vi.sizeInBytes=function(e){switch(e){case Vi.UNSIGNED_BYTE:return 1;case Vi.UNSIGNED_SHORT:case Vi.UNSIGNED_SHORT_4_4_4_4:case Vi.UNSIGNED_SHORT_5_5_5_1:case Vi.UNSIGNED_SHORT_5_6_5:case Vi.HALF_FLOAT:return 2;case Vi.UNSIGNED_INT:case Vi.FLOAT:case Vi.UNSIGNED_INT_24_8:return 4}};Vi.validate=function(e){return e===Vi.UNSIGNED_BYTE||e===Vi.UNSIGNED_SHORT||e===Vi.UNSIGNED_INT||e===Vi.FLOAT||e===Vi.HALF_FLOAT||e===Vi.UNSIGNED_INT_24_8||e===Vi.UNSIGNED_SHORT_4_4_4_4||e===Vi.UNSIGNED_SHORT_5_5_5_1||e===Vi.UNSIGNED_SHORT_5_6_5};Vi.getTypedArrayConstructor=function(e){let t=Vi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Vi.FLOAT?Float32Array:Uint32Array};var ve=Object.freeze(Vi);var et={DEPTH_COMPONENT:ne.DEPTH_COMPONENT,DEPTH_STENCIL:ne.DEPTH_STENCIL,ALPHA:ne.ALPHA,RED:ne.RED,RG:ne.RG,RGB:ne.RGB,RGBA:ne.RGBA,RED_INTEGER:ne.RED_INTEGER,RG_INTEGER:ne.RG_INTEGER,RGB_INTEGER:ne.RGB_INTEGER,RGBA_INTEGER:ne.RGBA_INTEGER,LUMINANCE:ne.LUMINANCE,LUMINANCE_ALPHA:ne.LUMINANCE_ALPHA,RGB_DXT1:ne.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ne.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ne.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ne.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ne.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ne.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ne.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ne.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ne.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ne.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ne.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ne.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ne.COMPRESSED_RGBA_BPTC_UNORM};et.componentsLength=function(e){switch(e){case et.RGB:case et.RGB_INTEGER:return 3;case et.RGBA:case et.RGBA_INTEGER:return 4;case et.LUMINANCE_ALPHA:case et.RG:case et.RG_INTEGER:return 2;case et.ALPHA:case et.RED:case et.RED_INTEGER:case et.LUMINANCE:return 1;default:return 1}};et.validate=function(e){return e===et.DEPTH_COMPONENT||e===et.DEPTH_STENCIL||e===et.ALPHA||e===et.RED||e===et.RG||e===et.RGB||e===et.RGBA||e===et.RED_INTEGER||e===et.RG_INTEGER||e===et.RGB_INTEGER||e===et.RGBA_INTEGER||e===et.LUMINANCE||e===et.LUMINANCE_ALPHA||e===et.RGB_DXT1||e===et.RGBA_DXT1||e===et.RGBA_DXT3||e===et.RGBA_DXT5||e===et.RGB_PVRTC_4BPPV1||e===et.RGB_PVRTC_2BPPV1||e===et.RGBA_PVRTC_4BPPV1||e===et.RGBA_PVRTC_2BPPV1||e===et.RGBA_ASTC||e===et.RGB_ETC1||e===et.RGB8_ETC2||e===et.RGBA8_ETC2_EAC||e===et.RGBA_BC7};et.isColorFormat=function(e){return e===et.RED||e===et.ALPHA||e===et.RGB||e===et.RGBA||e===et.LUMINANCE||e===et.LUMINANCE_ALPHA};et.isDepthFormat=function(e){return e===et.DEPTH_COMPONENT||e===et.DEPTH_STENCIL};et.isCompressedFormat=function(e){return e===et.RGB_DXT1||e===et.RGBA_DXT1||e===et.RGBA_DXT3||e===et.RGBA_DXT5||e===et.RGB_PVRTC_4BPPV1||e===et.RGB_PVRTC_2BPPV1||e===et.RGBA_PVRTC_4BPPV1||e===et.RGBA_PVRTC_2BPPV1||e===et.RGBA_ASTC||e===et.RGB_ETC1||e===et.RGB8_ETC2||e===et.RGBA8_ETC2_EAC||e===et.RGBA_BC7};et.isDXTFormat=function(e){return e===et.RGB_DXT1||e===et.RGBA_DXT1||e===et.RGBA_DXT3||e===et.RGBA_DXT5};et.isPVRTCFormat=function(e){return e===et.RGB_PVRTC_4BPPV1||e===et.RGB_PVRTC_2BPPV1||e===et.RGBA_PVRTC_4BPPV1||e===et.RGBA_PVRTC_2BPPV1};et.isASTCFormat=function(e){return e===et.RGBA_ASTC};et.isETC1Format=function(e){return e===et.RGB_ETC1};et.isETC2Format=function(e){return e===et.RGB8_ETC2||e===et.RGBA8_ETC2_EAC};et.isBC7Format=function(e){return e===et.RGBA_BC7};et.compressedTextureSizeInBytes=function(e,t,n){switch(e){case et.RGB_DXT1:case et.RGBA_DXT1:case et.RGB_ETC1:case et.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case et.RGBA_DXT3:case et.RGBA_DXT5:case et.RGBA_ASTC:case et.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case et.RGB_PVRTC_4BPPV1:case et.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case et.RGB_PVRTC_2BPPV1:case et.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case et.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};et.textureSizeInBytes=function(e,t,n,i){let o=et.componentsLength(e);return ve.isPacked(t)&&(o=1),o*ve.sizeInBytes(t)*n*i};et.texture3DSizeInBytes=function(e,t,n,i,o){let r=et.componentsLength(e);return ve.isPacked(t)&&(r=1),r*ve.sizeInBytes(t)*n*i*o};et.alignmentInBytes=function(e,t,n){let i=et.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};et.createTypedArray=function(e,t,n,i){let o=ve.getTypedArrayConstructor(t),r=et.componentsLength(e)*n*i;return new o(r)};et.flipY=function(e,t,n,i,o){if(o===1)return e;let r=et.createTypedArray(t,n,i,o),s=et.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let d=c*i*s,u=(o-c-1)*i*s;for(let h=0;h<a;++h)r[u+h]=e[d+h]}return r};et.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===et.DEPTH_STENCIL)return ne.DEPTH24_STENCIL8;if(e===et.DEPTH_COMPONENT){if(t===ve.UNSIGNED_SHORT)return ne.DEPTH_COMPONENT16;if(t===ve.UNSIGNED_INT)return ne.DEPTH_COMPONENT24}if(t===ve.FLOAT)switch(e){case et.RGBA:return ne.RGBA32F;case et.RGB:return ne.RGB32F;case et.RG:return ne.RG32F;case et.RED:return ne.R32F}if(t===ve.HALF_FLOAT)switch(e){case et.RGBA:return ne.RGBA16F;case et.RGB:return ne.RGB16F;case et.RG:return ne.RG16F;case et.RED:return ne.R16F}if(t===ve.UNSIGNED_BYTE)switch(e){case et.RGBA:return ne.RGBA8;case et.RGB:return ne.RGB8;case et.RG:return ne.RG8;case et.RED:return ne.R8}if(t===ve.INT)switch(e){case et.RGBA_INTEGER:return ne.RGBA32I;case et.RGB_INTEGER:return ne.RGB32I;case et.RG_INTEGER:return ne.RG32I;case et.RED_INTEGER:return ne.R32I}if(t===ve.UNSIGNED_INT)switch(e){case et.RGBA_INTEGER:return ne.RGBA32UI;case et.RGB_INTEGER:return ne.RGB32UI;case et.RG_INTEGER:return ne.RG32UI;case et.RED_INTEGER:return ne.R32UI}return e};var je=Object.freeze(et);var hXt=y(x(),1),Fr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize: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,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Fr,{maximumCombinedTextureImageUnits:{get:function(){return Fr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Fr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Fr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Fr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Fr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Fr._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Fr._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Fr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Fr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Fr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Fr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Fr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Fr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Fr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Fr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Fr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Fr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Fr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Fr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Fr._maximumColorAttachments}},maximumSamples:{get:function(){return Fr._maximumSamples}},highpFloatSupported:{get:function(){return Fr._highpFloatSupported}},highpIntSupported:{get:function(){return Fr._highpIntSupported}}});var Yt=Fr;function J3(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function vD(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function dh(e){e=e??Q.EMPTY_OBJECT;let n=e.context._gl,i=Yt.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.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=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;J3(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;vD(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;J3(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;vD(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;vD(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;J3(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;vD(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(dh.prototype,{status:{get:function(){this._bind();let 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)}}});dh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};dh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};dh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};dh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};dh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};dh.prototype.getColorTexture=function(e){return this._colorTextures[e]};dh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};dh.prototype.isDestroyed=function(){return!1};dh.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.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),fe(this)};var ns=dh;var WXt=y(x(),1);var EXt=y(x(),1);var kD={CLOCKWISE:ne.CW,COUNTER_CLOCKWISE:ne.CCW};kD.validate=function(e){return e===kD.CLOCKWISE||e===kD.COUNTER_CLOCKWISE};var Ns=Object.freeze(kD);var SXt=y(x(),1);function Zne(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=Zne(e[t]));return Object.freeze(e)}var j3=Zne;function vf(e){let t=e??Q.EMPTY_OBJECT,n=t.cull??Q.EMPTY_OBJECT,i=t.polygonOffset??Q.EMPTY_OBJECT,o=t.scissorTest??Q.EMPTY_OBJECT,r=o.rectangle??Q.EMPTY_OBJECT,s=t.depthRange??Q.EMPTY_OBJECT,a=t.depthTest??Q.EMPTY_OBJECT,c=t.colorMask??Q.EMPTY_OBJECT,d=t.blending??Q.EMPTY_OBJECT,u=d.color??Q.EMPTY_OBJECT,h=t.stencilTest??Q.EMPTY_OBJECT,p=h.frontOperation??Q.EMPTY_OBJECT,g=h.backOperation??Q.EMPTY_OBJECT,f=t.sampleCoverage??Q.EMPTY_OBJECT,b=t.viewport;this.frontFace=t.frontFace??Ns.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ne.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:o.enabled??!1,rectangle:$e.clone(r)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??ne.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:d.enabled??!1,color:new D(u.red??0,u.green??0,u.blue??0,u.alpha??0),equationRgb:d.equationRgb??ne.FUNC_ADD,equationAlpha:d.equationAlpha??ne.FUNC_ADD,functionSourceRgb:d.functionSourceRgb??ne.ONE,functionSourceAlpha:d.functionSourceAlpha??ne.ONE,functionDestinationRgb:d.functionDestinationRgb??ne.ZERO,functionDestinationAlpha:d.functionDestinationAlpha??ne.ZERO},this.stencilTest={enabled:h.enabled??!1,frontFunction:h.frontFunction??ne.ALWAYS,backFunction:h.backFunction??ne.ALWAYS,reference:h.reference??0,mask:h.mask??-1,frontOperation:{fail:p.fail??ne.KEEP,zFail:p.zFail??ne.KEEP,zPass:p.zPass??ne.KEEP},backOperation:{fail:g.fail??ne.KEEP,zFail:g.zFail??ne.KEEP,zPass:g.zPass??ne.KEEP}},this.sampleCoverage={enabled:f.enabled??!1,value:f.value??1,invert:f.invert??!1},this.viewport=l(b)?new $e(b.x,b.y,b.width,b.height):void 0,this.id=0,this._applyFunctions=[]}var i1e=0,Df={};vf.fromCache=function(e){let t=JSON.stringify(e),n=Df[t];if(l(n))return++n.referenceCount,n.state;let i=new vf(e),o=JSON.stringify(i);return n=Df[o],l(n)||(i.id=i1e++,n={referenceCount:0,state:i},Df[o]=n),++n.referenceCount,Df[t]={referenceCount:1,state:n.state},n.state};vf.removeFromCache=function(e){let t=new vf(e),n=JSON.stringify(t),i=Df[n],o=JSON.stringify(e),r=Df[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete Df[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Df[n]};vf.getCache=function(){return Df};vf.clearCache=function(){Df={}};function dx(e,t,n){n?e.enable(t):e.disable(t)}function Rne(e,t){e.frontFace(t.frontFace)}function Gne(e,t){let n=t.cull,i=n.enabled;dx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Vne(e,t){e.lineWidth(t.lineWidth)}function Lne(e,t){let n=t.polygonOffset,i=n.enabled;dx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Wne(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(dx(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function Fne(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function Bne(e,t){let n=t.depthTest,i=n.enabled;dx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function wne(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Yne(e,t){e.depthMask(t.depthMask)}function Nne(e,t){e.stencilMask(t.stencilMask)}function o1e(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Xne(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;dx(e,e.BLEND,o),o&&(o1e(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Pne(e,t){let n=t.stencilTest,i=n.enabled;if(dx(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,d=c.fail,u=c.zFail,h=c.zPass;e.stencilOpSeparate(e.FRONT,d,u,h);let p=n.backOperation,g=p.fail,f=p.zFail,b=p.zPass;e.stencilOpSeparate(e.BACK,g,f,b)}}function Mne(e,t){let n=t.sampleCoverage,i=n.enabled;dx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var r1e=new $e;function Une(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=r1e,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}vf.apply=function(e,t,n){Rne(e,t),Gne(e,t),Vne(e,t),Lne(e,t),Fne(e,t),Bne(e,t),wne(e,t),Yne(e,t),Nne(e,t),Pne(e,t),Mne(e,t),Wne(e,t,n),Xne(e,t,n),Une(e,t,n)};function s1e(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(Rne),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Gne),e.lineWidth!==t.lineWidth&&n.push(Vne),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Lne),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Fne),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Bne),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(wne),e.depthMask!==t.depthMask&&n.push(Yne),e.stencilMask!==t.stencilMask&&n.push(Nne),(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)&&n.push(Pne),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Mne),n}vf.partialApply=function(e,t,n,i,o,r){if(t!==n){let u=n._applyFunctions[t.id];l(u)||(u=s1e(t,n),n._applyFunctions[t.id]=u);let h=u.length;for(let p=0;p<h;++p)u[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&Wne(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,d=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==d||d&&t.blending!==n.blending)&&Xne(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Une(e,n,o)};vf.getState=function(e){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:$e.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:D.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:l(e.viewport)?$e.clone(e.viewport):void 0}};var ke=vf;var fPt=y(x(),1);var zXt=y(x(),1);var YXt=y(x(),1);function on(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}on.packedLength=4;on.pack=function(e,t,n){return n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};on.unpack=function(e,t,n){return t=t??0,l(n)||(n=new on),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};on.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)on.pack(e[o],t,o*4);return t};on.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=on.unpack(e,i,t[o])}return t};on.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new on(e[0],e[2],e[1],e[3])};on.fromArray=on.unpack;on.fromColumnMajorArray=function(e,t){return on.clone(e,t)};on.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new on(e[0],e[1],e[2],e[3])};on.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new on(e.x,0,0,e.y)};on.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new on(e,0,0,e)};on.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new on(n,-i,i,n)};on.toArray=function(e,t){return l(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]]};on.getElementIndex=function(e,t){return e*2+t};on.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};on.setColumn=function(e,t,n,i){i=on.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};on.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};on.setRow=function(e,t,n,i){return i=on.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var a1e=new M;on.setScale=function(e,t,n){let i=on.getScale(e,a1e),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var c1e=new M;on.setUniformScale=function(e,t,n){let i=on.getScale(e,c1e),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var Dne=new M;on.getScale=function(e,t){return t.x=M.magnitude(M.fromElements(e[0],e[1],Dne)),t.y=M.magnitude(M.fromElements(e[2],e[3],Dne)),t};var vne=new M;on.getMaximumScale=function(e){return on.getScale(e,vne),M.maximumComponent(vne)};var l1e=new M;on.setRotation=function(e,t,n){let i=on.getScale(e,l1e);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var d1e=new M;on.getRotation=function(e,t){let n=on.getScale(e,d1e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};on.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};on.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};on.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};on.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};on.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};on.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};on.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};on.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};on.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};on.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};on.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};on.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};on.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};on.IDENTITY=Object.freeze(new on(1,0,0,1));on.ZERO=Object.freeze(new on(0,0,0,0));on.COLUMN0ROW0=0;on.COLUMN0ROW1=1;on.COLUMN1ROW0=2;on.COLUMN1ROW1=3;Object.defineProperties(on.prototype,{length:{get:function(){return on.packedLength}}});on.prototype.clone=function(e){return on.clone(this,e)};on.prototype.equals=function(e){return on.equals(this,e)};on.prototype.equalsEpsilon=function(e,t){return on.equalsEpsilon(this,e,t)};on.prototype.toString=function(){return`(${this[0]}, ${this[2]})
(${this[1]}, ${this[3]})`};var ki=on;function u1e(e,t,n,i){switch(t.type){case e.FLOAT:return new kne(e,t,n,i);case e.FLOAT_VEC2:return new Qne(e,t,n,i);case e.FLOAT_VEC3:return new One(e,t,n,i);case e.FLOAT_VEC4:return new zne(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new QD(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new QD(e,t,n,i);case e.INT:case e.BOOL:return new Hne(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Kne(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Jne(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new jne(e,t,n,i);case e.FLOAT_MAT2:return new qne(e,t,n,i);case e.FLOAT_MAT3:return new $ne(e,t,n,i);case e.FLOAT_MAT4:return new eie(e,t,n,i);default:throw new he(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function kne(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}kne.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Qne(e,t,n,i){this.name=n,this.value=void 0,this._value=new M,this._gl=e,this._location=i}Qne.prototype.set=function(){let e=this.value;M.equals(e,this._value)||(M.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function One(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}One.prototype.set=function(){let e=this.value;l(e.red)?D.equals(e,this._value)||(this._value=D.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(m.equals(e,this._value)||(this._value=m.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function zne(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}zne.prototype.set=function(){let e=this.value;l(e.red)?D.equals(e,this._value)||(this._value=D.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(ce.equals(e,this._value)||(this._value=ce.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function QD(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}QD.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};QD.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Hne(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Hne.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function Kne(e,t,n,i){this.name=n,this.value=void 0,this._value=new M,this._gl=e,this._location=i}Kne.prototype.set=function(){let e=this.value;M.equals(e,this._value)||(M.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Jne(e,t,n,i){this.name=n,this.value=void 0,this._value=new m,this._gl=e,this._location=i}Jne.prototype.set=function(){let e=this.value;m.equals(e,this._value)||(m.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function jne(e,t,n,i){this.name=n,this.value=void 0,this._value=new ce,this._gl=e,this._location=i}jne.prototype.set=function(){let e=this.value;ce.equals(e,this._value)||(ce.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var m1e=new Float32Array(4);function qne(e,t,n,i){this.name=n,this.value=void 0,this._value=new ki,this._gl=e,this._location=i}qne.prototype.set=function(){if(!ki.equalsArray(this.value,this._value,0)){ki.clone(this.value,this._value);let e=ki.toArray(this.value,m1e);this._gl.uniformMatrix2fv(this._location,!1,e)}};var h1e=new Float32Array(9);function $ne(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}$ne.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,h1e);this._gl.uniformMatrix3fv(this._location,!1,e)}};var f1e=new Float32Array(16);function eie(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}eie.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,f1e);this._gl.uniformMatrix4fv(this._location,!1,e)}};var ER=u1e;var oPt=y(x(),1);function p1e(e,t,n,i){switch(t.type){case e.FLOAT:return new tie(e,t,n,i);case e.FLOAT_VEC2:return new nie(e,t,n,i);case e.FLOAT_VEC3:return new iie(e,t,n,i);case e.FLOAT_VEC4:return new oie(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new q3(e,t,n,i);case e.INT:case e.BOOL:return new rie(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new sie(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new aie(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new cie(e,t,n,i);case e.FLOAT_MAT2:return new lie(e,t,n,i);case e.FLOAT_MAT3:return new die(e,t,n,i);case e.FLOAT_MAT4:return new uie(e,t,n,i);default:throw new he(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function tie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}tie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function nie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}nie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];M.equalsArray(s,n,o)||(M.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function iie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}iie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function oie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}oie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0):l(s.x)&&(ce.equalsArray(s,n,o)||(ce.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function q3(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}q3.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};q3.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function rie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}rie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function sie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}sie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];M.equalsArray(s,n,o)||(M.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function aie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}aie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function cie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}cie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];ce.equalsArray(s,n,o)||(ce.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function lie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}lie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];ki.equalsArray(s,n,o)||(ki.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function die(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}die.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function uie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}uie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var TR=p1e;var A1e=0;function gA(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=g1e(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=A1e++}gA.fromCache=function(e){return e=e??Q.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};gA.replaceCache=function(e){return e=e??Q.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(gA.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return OD(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return OD(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return OD(this),this._uniformsByName}}});function mie(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function g1e(e,t){let n={};if(!Yt.highpFloatSupported||!Yt.highpIntSupported){let i,o,r,s,a=mie(e),c=mie(t),d=a.length,u=c.length;for(i=0;i<d;i++)for(o=0;o<u;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let h=new RegExp(`${r}\\b`,"g");t=t.replace(h,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var kf="[Cesium WebGL] ";function b1e(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${kf}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${kf}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${kf}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${kf}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),d=`Program failed to link.  Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${kf}Vertex shader compile log: ${c}`),console.error(`${kf} Vertex shader source:
${n}`),d=`Vertex shader failed to compile.  Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${kf}Fragment shader compile log: ${c}`),console.error(`${kf} Fragment shader source:
${i}`),d=`Fragment shader failed to compile.  Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new he(d);function h(p,g){if(!l(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${kf}${g} shader translation failed.`);return}console.error(`${kf}Translated ${g} shaderSource:
${f}`)}}function y1e(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function x1e(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",d=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(d.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let u=e.getUniformLocation(t,d);if(u!==null){let h=ER(e,a,d,u);n[d]=h,i.push(h),h._setSampler&&o.push(h)}}else{let u,h,p,g,f=d.indexOf("[");if(f>=0){if(u=n[d.slice(0,f)],!l(u))continue;h=u._locations,h.length<=1&&(p=u.value,g=e.getUniformLocation(t,d),g!==null&&(h.push(g),p.push(e.getUniform(t,g))))}else{h=[];for(let b=0;b<a.size;++b)g=e.getUniformLocation(t,`${d}[${b}]`),g!==null&&h.push(g);u=TR(e,a,d,h),n[d]=u,i.push(u),u._setSampler&&o.push(u)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function C1e(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=dA[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function E1e(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function OD(e){l(e._program)||hie(e)}function hie(e){let t=e._program,n=e._gl,i=b1e(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=x1e(n,i),s=C1e(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=y1e(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=E1e(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,d,u){let h=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{hie(e),d(e._program)}catch(f){e._vertexShaderText=h,e._fragmentShaderText=p;let C=/(?:Compile|Link) error: ([^]*)/.exec(f.message);u(C?C[1]:f.message)}})}gA.prototype._bind=function(){OD(this),this._gl.useProgram(this._program)};gA.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};gA.prototype.isDestroyed=function(){return!1};gA.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};gA.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),fe(this)};var cn=gA;function zD(e){this._context=e}var SR,T1e=new nt({primitiveType:Be.TRIANGLES}),S1e=new li({color:new D(0,0,0,0)});function I1e(e,t){return new ns({context:e,colorTextures:[t],destroyAttachments:!1})}function _1e(e,t){return cn.fromCache({context:e,vertexShaderSource:lx,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function Z1e(e,t){return(!l(SR)||SR.viewport.width!==e||SR.viewport.height!==t)&&(SR=ke.fromCache({viewport:new $e(0,0,e,t)})),SR}zD.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:_1e(o,e.fragmentShaderSource),a=I1e(o,t),c=Z1e(n,i),d=e.uniformMap,u=S1e;u.framebuffer=a,u.renderState=c,u.execute(o);let h=T1e;h.vertexArray=r,h.renderState=c,h.shaderProgram=s,h.uniformMap=d,h.framebuffer=a,h.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};zD.prototype.isDestroyed=function(){return!1};zD.prototype.destroy=function(){return fe(this)};var IR=zD;var PJt=y(x(),1);var LPt=y(x(),1);var Bn={BYTE:ne.BYTE,UNSIGNED_BYTE:ne.UNSIGNED_BYTE,SHORT:ne.SHORT,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,INT:ne.INT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,DOUBLE:ne.DOUBLE};Bn.getSizeInBytes=function(e){switch(e){case Bn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Bn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Bn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Bn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Bn.INT:return Int32Array.BYTES_PER_ELEMENT;case Bn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Bn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Bn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Bn.fromTypedArray=function(e){if(e instanceof Int8Array)return Bn.BYTE;if(e instanceof Uint8Array)return Bn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Bn.SHORT;if(e instanceof Uint16Array)return Bn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Bn.INT;if(e instanceof Uint32Array)return Bn.UNSIGNED_INT;if(e instanceof Float32Array)return Bn.FLOAT;if(e instanceof Float64Array)return Bn.DOUBLE};Bn.validate=function(e){return l(e)&&(e===Bn.BYTE||e===Bn.UNSIGNED_BYTE||e===Bn.SHORT||e===Bn.UNSIGNED_SHORT||e===Bn.INT||e===Bn.UNSIGNED_INT||e===Bn.FLOAT||e===Bn.DOUBLE)};Bn.createTypedArray=function(e,t){switch(e){case Bn.BYTE:return new Int8Array(t);case Bn.UNSIGNED_BYTE:return new Uint8Array(t);case Bn.SHORT:return new Int16Array(t);case Bn.UNSIGNED_SHORT:return new Uint16Array(t);case Bn.INT:return new Int32Array(t);case Bn.UNSIGNED_INT:return new Uint32Array(t);case Bn.FLOAT:return new Float32Array(t);case Bn.DOUBLE:return new Float64Array(t)}};Bn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/Bn.getSizeInBytes(e),e){case Bn.BYTE:return new Int8Array(t,n,i);case Bn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Bn.SHORT:return new Int16Array(t,n,i);case Bn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Bn.INT:return new Int32Array(t,n,i);case Bn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Bn.FLOAT:return new Float32Array(t,n,i);case Bn.DOUBLE:return new Float64Array(t,n,i)}};Bn.fromName=function(e){switch(e){case"BYTE":return Bn.BYTE;case"UNSIGNED_BYTE":return Bn.UNSIGNED_BYTE;case"SHORT":return Bn.SHORT;case"UNSIGNED_SHORT":return Bn.UNSIGNED_SHORT;case"INT":return Bn.INT;case"UNSIGNED_INT":return Bn.UNSIGNED_INT;case"FLOAT":return Bn.FLOAT;case"DOUBLE":return Bn.DOUBLE}};var J=Object.freeze(Bn);var HPt=y(x(),1);var FPt=y(x(),1),R1e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},zu=Object.freeze(R1e);function $3(e){e=e??Q.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Be.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??zu.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}$3.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var G1e=new pe,V1e=new m,fie=new F,L1e=[new pe,new pe,new pe],W1e=[new M,new M,new M],F1e=[new M,new M,new M],B1e=new m,w1e=new Me,Y1e=new F,N1e=new ki;$3._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=de.center(i,G1e),s=pe.toCartesian(r,n,V1e),a=Tt.eastNorthUpToFixedFrame(s,n,fie),c=F.inverse(a,fie),d=W1e,u=L1e;u[0].longitude=i.west,u[0].latitude=i.south,u[1].longitude=i.west,u[1].latitude=i.north,u[2].longitude=i.east,u[2].latitude=i.south;let h=B1e;for(o=0;o<3;o++)pe.toCartesian(u[o],n,h),h=F.multiplyByPointAsVector(c,h,h),d[o].x=h.x,d[o].y=h.y;let p=Me.fromAxisAngle(m.UNIT_Z,-t,w1e),g=$.fromQuaternion(p,Y1e),f=e.length,b=Number.POSITIVE_INFINITY,C=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(o=0;o<f;o++)h=F.multiplyByPointAsVector(c,e[o],h),h=$.multiplyByVector(g,h,h),b=Math.min(b,h.x),C=Math.min(C,h.y),E=Math.max(E,h.x),T=Math.max(T,h.y);let S=ki.fromRotation(t,N1e),_=F1e;_[0].x=b,_[0].y=C,_[1].x=b,_[1].y=T,_[2].x=E,_[2].y=C;let R=d[0],L=d[2].x-R.x,W=d[1].y-R.y;for(o=0;o<3;o++){let I=_[o];ki.multiplyByVector(S,I,I),I.x=(I.x-R.x)/L,I.y=(I.y-R.y)/W}let B=_[0],Y=_[1],N=_[2],A=new Array(6);return M.pack(B,A),M.pack(Y,A,2),M.pack(N,A,4),A};var pt=$3;var jPt=y(x(),1);function X1e(e){e=e??Q.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var We=X1e;var CMt=y(x(),1);var gMt=y(x(),1);var eMt=y(x(),1);function JT(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(JT.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});JT.clone=function(e){if(l(e))return new JT(e._format,e._datatype,e._width,e._height,e._buffer)};JT.prototype.clone=function(){return JT.clone(this)};var _R=JT;var uMt=y(x(),1),pie=y(Md(),1);function Aie(){if(!l(Ua._canTransferArrayBuffer)){let e=nz("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Ua._canTransferArrayBuffer=!1,Ua._canTransferArrayBuffer}Ua._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),Ua._canTransferArrayBuffer=s}})}return Ua._canTransferArrayBuffer}var tz=new Ce;function ez(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function nz(e){let t=new pie.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Lb(e))s=e;else if(!n){let a=en(`${Ua._workerModulePrefix}/${i}.js`);Lb(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=ez(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=`
      importScripts("${ez(CESIUM_WORKERS)}");
      CesiumWorkers["${i}"]();
    `;return r=ez(a),new Worker(r,o)}if(r=e,n||(r=en(`${Ua._workerModulePrefix+i}.js`)),!rn.supportsEsmWebWorkers())throw new he("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function P1e(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!rn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new he(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=en(t.fallbackModulePath),n}n.wasmBinaryFile=en(t.wasmBinaryFile);let i=await Ge.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function Ua(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var M1e=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new he(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new Ae(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),tz.raiseEvent(s),i(s)}else tz.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},U1e=[];async function D1e(e,t,n){let i=await Promise.resolve(Aie());l(n)?i||(n.length=0):n=U1e;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",M1e(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:en.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function v1e(e,t,n){++e._activeTasks;try{let i=await D1e(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Ua.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=nz(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return v1e(this,e,t)};Ua.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=nz(this._workerPath),i=await P1e(this,e),o=await Promise.resolve(Aie()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,d)=>{n.onmessage=function({data:u}){l(u)?c(u.result):d(new he("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};Ua.prototype.isDestroyed=function(){return!1};Ua.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),fe(this)};Ua.taskCompletedEvent=tz;Ua._defaultWorkerModulePrefix="Workers/";Ua._workerModulePrefix=Ua._defaultWorkerModulePrefix;Ua._canTransferArrayBuffer=void 0;var Jn=Ua;function bA(){}bA._transcodeTaskProcessor=new Jn("transcodeKTX2",Number.POSITIVE_INFINITY);bA._readyPromise=void 0;function k1e(){let e=bA._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return bA._transcodeTaskProcessor;throw new he("KTX2 transcoder could not be initialized.")});bA._readyPromise=e}bA.transcode=function(e,t){return l(bA._readyPromise)||k1e(),bA._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let c=s[o[a]];s[o[a]]=new _R(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var ZR=bA;var gie;bie.setKTX2SupportedFormats=function(e,t,n,i,o,r){gie={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function bie(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Ge.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return ZR.transcode(n,gie)})}var nd=bie;var Mvt=y(x(),1);var oUt=y(x(),1);var YMt=y(x(),1);var TMt=y(x(),1);function Q1e(e,t){this.start=e??0,this.stop=t??0}var Or=Q1e;function En(e,t){this.center=m.clone(e??m.ZERO),this.radius=t??0}var rz=new m,sz=new m,az=new m,cz=new m,lz=new m,dz=new m,uz=new m,Da=new m,mz=new m,hz=new m,fz=new m,pz=new m,O1e=4/3*V.PI;En.fromPoints=function(e,t){if(l(t)||(t=new En),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],uz),i=m.clone(n,rz),o=m.clone(n,sz),r=m.clone(n,az),s=m.clone(n,cz),a=m.clone(n,lz),c=m.clone(n,dz),d=e.length,u;for(u=1;u<d;u++){m.clone(e[u],n);let B=n.x,Y=n.y,N=n.z;B<i.x&&m.clone(n,i),B>s.x&&m.clone(n,s),Y<o.y&&m.clone(n,o),Y>a.y&&m.clone(n,a),N<r.z&&m.clone(n,r),N>c.z&&m.clone(n,c)}let h=m.magnitudeSquared(m.subtract(s,i,Da)),p=m.magnitudeSquared(m.subtract(a,o,Da)),g=m.magnitudeSquared(m.subtract(c,r,Da)),f=i,b=s,C=h;p>C&&(C=p,f=o,b=a),g>C&&(C=g,f=r,b=c);let E=mz;E.x=(f.x+b.x)*.5,E.y=(f.y+b.y)*.5,E.z=(f.z+b.z)*.5;let T=m.magnitudeSquared(m.subtract(b,E,Da)),S=Math.sqrt(T),_=hz;_.x=i.x,_.y=o.y,_.z=r.z;let R=fz;R.x=s.x,R.y=a.y,R.z=c.z;let L=m.midpoint(_,R,pz),W=0;for(u=0;u<d;u++){m.clone(e[u],n);let B=m.magnitude(m.subtract(n,L,Da));B>W&&(W=B);let Y=m.magnitudeSquared(m.subtract(n,E,Da));if(Y>T){let N=Math.sqrt(Y);S=(S+N)*.5,T=S*S;let A=N-S;E.x=(S*E.x+A*n.x)/N,E.y=(S*E.y+A*n.y)/N,E.z=(S*E.z+A*n.z)/N}}return S<W?(m.clone(E,t.center),t.radius=S):(m.clone(L,t.center),t.radius=W),t};var yie=new vi,z1e=new m,H1e=new m,iz=new pe,oz=new pe;En.fromRectangle2D=function(e,t,n){return En.fromRectangleWithHeights2D(e,t,0,0,n)};En.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new En),!l(e))return o.center=m.clone(m.ZERO,o.center),o.radius=0,o;yie._ellipsoid=ie.default,t=t??yie,de.southwest(e,iz),iz.height=n,de.northeast(e,oz),oz.height=i;let r=t.project(iz,z1e),s=t.project(oz,H1e),a=s.x-r.x,c=s.y-r.y,d=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+d*d)*.5;let u=o.center;return u.x=r.x+a*.5,u.y=r.y+c*.5,u.z=r.z+d*.5,o};var K1e=[];En.fromRectangle3D=function(e,t,n,i){if(t=t??ie.default,n=n??0,l(i)||(i=new En),!l(e))return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;let o=de.subsample(e,t,n,K1e);return En.fromPoints(o,i)};En.fromVertices=function(e,t,n,i){if(l(i)||(i=new En),!l(e)||e.length===0)return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;t=t??m.ZERO,n=n??3;let o=uz;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=m.clone(o,rz),s=m.clone(o,sz),a=m.clone(o,az),c=m.clone(o,cz),d=m.clone(o,lz),u=m.clone(o,dz),h=e.length,p;for(p=0;p<h;p+=n){let N=e[p]+t.x,A=e[p+1]+t.y,I=e[p+2]+t.z;o.x=N,o.y=A,o.z=I,N<r.x&&m.clone(o,r),N>c.x&&m.clone(o,c),A<s.y&&m.clone(o,s),A>d.y&&m.clone(o,d),I<a.z&&m.clone(o,a),I>u.z&&m.clone(o,u)}let g=m.magnitudeSquared(m.subtract(c,r,Da)),f=m.magnitudeSquared(m.subtract(d,s,Da)),b=m.magnitudeSquared(m.subtract(u,a,Da)),C=r,E=c,T=g;f>T&&(T=f,C=s,E=d),b>T&&(T=b,C=a,E=u);let S=mz;S.x=(C.x+E.x)*.5,S.y=(C.y+E.y)*.5,S.z=(C.z+E.z)*.5;let _=m.magnitudeSquared(m.subtract(E,S,Da)),R=Math.sqrt(_),L=hz;L.x=r.x,L.y=s.y,L.z=a.z;let W=fz;W.x=c.x,W.y=d.y,W.z=u.z;let B=m.midpoint(L,W,pz),Y=0;for(p=0;p<h;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let N=m.magnitude(m.subtract(o,B,Da));N>Y&&(Y=N);let A=m.magnitudeSquared(m.subtract(o,S,Da));if(A>_){let I=Math.sqrt(A);R=(R+I)*.5,_=R*R;let Z=I-R;S.x=(R*S.x+Z*o.x)/I,S.y=(R*S.y+Z*o.y)/I,S.z=(R*S.z+Z*o.z)/I}}return R<Y?(m.clone(S,i.center),i.radius=R):(m.clone(B,i.center),i.radius=Y),i};En.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new En),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=m.clone(m.ZERO,n.center),n.radius=0,n;let i=uz;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=m.clone(i,rz),r=m.clone(i,sz),s=m.clone(i,az),a=m.clone(i,cz),c=m.clone(i,lz),d=m.clone(i,dz),u=e.length,h;for(h=0;h<u;h+=3){let Y=e[h]+t[h],N=e[h+1]+t[h+1],A=e[h+2]+t[h+2];i.x=Y,i.y=N,i.z=A,Y<o.x&&m.clone(i,o),Y>a.x&&m.clone(i,a),N<r.y&&m.clone(i,r),N>c.y&&m.clone(i,c),A<s.z&&m.clone(i,s),A>d.z&&m.clone(i,d)}let p=m.magnitudeSquared(m.subtract(a,o,Da)),g=m.magnitudeSquared(m.subtract(c,r,Da)),f=m.magnitudeSquared(m.subtract(d,s,Da)),b=o,C=a,E=p;g>E&&(E=g,b=r,C=c),f>E&&(E=f,b=s,C=d);let T=mz;T.x=(b.x+C.x)*.5,T.y=(b.y+C.y)*.5,T.z=(b.z+C.z)*.5;let S=m.magnitudeSquared(m.subtract(C,T,Da)),_=Math.sqrt(S),R=hz;R.x=o.x,R.y=r.y,R.z=s.z;let L=fz;L.x=a.x,L.y=c.y,L.z=d.z;let W=m.midpoint(R,L,pz),B=0;for(h=0;h<u;h+=3){i.x=e[h]+t[h],i.y=e[h+1]+t[h+1],i.z=e[h+2]+t[h+2];let Y=m.magnitude(m.subtract(i,W,Da));Y>B&&(B=Y);let N=m.magnitudeSquared(m.subtract(i,T,Da));if(N>S){let A=Math.sqrt(N);_=(_+A)*.5,S=_*_;let I=A-_;T.x=(_*T.x+I*i.x)/A,T.y=(_*T.y+I*i.y)/A,T.z=(_*T.z+I*i.z)/A}}return _<B?(m.clone(T,n.center),n.radius=_):(m.clone(W,n.center),n.radius=B),n};En.fromCornerPoints=function(e,t,n){l(n)||(n=new En);let i=m.midpoint(e,t,n.center);return n.radius=m.distance(i,t),n};En.fromEllipsoid=function(e,t){return l(t)||(t=new En),m.clone(m.ZERO,t.center),t.radius=e.maximumRadius,t};var J1e=new m;En.fromBoundingSpheres=function(e,t){if(l(t)||(t=new En),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return En.clone(e[0],t);if(n===2)return En.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=En.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,m.distance(r,a.center,J1e)+a.radius)}return t.radius=s,t};var j1e=new m,q1e=new m,$1e=new m;En.fromOrientedBoundingBox=function(e,t){l(t)||(t=new En);let n=e.halfAxes,i=$.getColumn(n,0,j1e),o=$.getColumn(n,1,q1e),r=$.getColumn(n,2,$1e);return m.add(i,o,i),m.add(i,r,i),t.center=m.clone(e.center,t.center),t.radius=m.magnitude(i),t};var eLe=new m,tLe=new m;En.fromTransformation=function(e,t){l(t)||(t=new En);let n=F.getTranslation(e,eLe),i=F.getScale(e,tLe),o=.5*m.magnitude(i);return t.center=m.clone(n,t.center),t.radius=o,t};En.clone=function(e,t){if(l(e))return l(t)?(t.center=m.clone(e.center,t.center),t.radius=e.radius,t):new En(e.center,e.radius)};En.packedLength=4;En.pack=function(e,t,n){n=n??0;let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};En.unpack=function(e,t,n){t=t??0,l(n)||(n=new En);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var nLe=new m,iLe=new m;En.union=function(e,t,n){l(n)||(n=new En);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=m.subtract(r,i,nLe),c=m.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let d=(o+c+s)*.5,u=m.multiplyByScalar(a,(-o+d)/c,iLe);return m.add(u,i,u),m.clone(u,n.center),n.radius=d,n};var oLe=new m;En.expand=function(e,t,n){n=En.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,oLe));return i>n.radius&&(n.radius=i),n};En.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?Jt.OUTSIDE:r<i?Jt.INTERSECTING:Jt.INSIDE};En.transform=function(e,t,n){return l(n)||(n=new En),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var rLe=new m;En.distanceSquaredTo=function(e,t){let n=m.subtract(e.center,t,rLe),i=m.magnitude(n)-e.radius;return i<=0?0:i*i};En.transformWithoutScale=function(e,t,n){return l(n)||(n=new En),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var sLe=new m;En.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Or);let o=m.subtract(e.center,t,sLe),r=m.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var xie=new m,aLe=new m,cLe=new m,lLe=new m,dLe=new m,uLe=new pe,Eie=new Array(8);for(let e=0;e<8;++e)Eie[e]=new m;var Cie=new vi;En.projectTo2D=function(e,t,n){Cie._ellipsoid=ie.default,t=t??Cie;let i=t.ellipsoid,o=e.center,r=e.radius,s;m.equals(o,m.ZERO)?s=m.clone(m.UNIT_X,xie):s=i.geodeticSurfaceNormal(o,xie);let a=m.cross(m.UNIT_Z,s,aLe);m.normalize(a,a);let c=m.cross(s,a,cLe);m.normalize(c,c),m.multiplyByScalar(s,r,s),m.multiplyByScalar(c,r,c),m.multiplyByScalar(a,r,a);let d=m.negate(c,dLe),u=m.negate(a,lLe),h=Eie,p=h[0];m.add(s,c,p),m.add(p,a,p),p=h[1],m.add(s,c,p),m.add(p,u,p),p=h[2],m.add(s,d,p),m.add(p,u,p),p=h[3],m.add(s,d,p),m.add(p,a,p),m.negate(s,s),p=h[4],m.add(s,c,p),m.add(p,a,p),p=h[5],m.add(s,c,p),m.add(p,u,p),p=h[6],m.add(s,d,p),m.add(p,u,p),p=h[7],m.add(s,d,p),m.add(p,a,p);let g=h.length;for(let E=0;E<g;++E){let T=h[E];m.add(o,T,T);let S=i.cartesianToCartographic(T,uLe);t.project(S,T)}n=En.fromPoints(h,n),o=n.center;let f=o.x,b=o.y,C=o.z;return o.x=C,o.y=f,o.z=b,n};En.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};En.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&e.radius===t.radius};En.prototype.intersectPlane=function(e){return En.intersectPlane(this,e)};En.prototype.distanceSquaredTo=function(e){return En.distanceSquaredTo(this,e)};En.prototype.computePlaneDistances=function(e,t,n){return En.computePlaneDistances(this,e,t,n)};En.prototype.isOccluded=function(e){return En.isOccluded(this,e)};En.prototype.equals=function(e){return En.equals(this,e)};En.prototype.clone=function(e){return En.clone(this,e)};En.prototype.volume=function(){let e=this.radius;return O1e*e*e*e};var ue=En;var PMt=y(x(),1);function mLe(e){e=e??Q.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}var yn=mLe;var UMt=y(x(),1),hLe={NONE:0,TOP:1,ALL:2},mn=Object.freeze(hLe);var QMt=y(x(),1);function Xs(e){e=e??Q.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}Xs.POSITION_ONLY=Object.freeze(new Xs({position:!0}));Xs.POSITION_AND_NORMAL=Object.freeze(new Xs({position:!0,normal:!0}));Xs.POSITION_NORMAL_AND_ST=Object.freeze(new Xs({position:!0,normal:!0,st:!0}));Xs.POSITION_AND_ST=Object.freeze(new Xs({position:!0,st:!0}));Xs.POSITION_AND_COLOR=Object.freeze(new Xs({position:!0,color:!0}));Xs.ALL=Object.freeze(new Xs({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Xs.DEFAULT=Xs.POSITION_NORMAL_AND_ST;Xs.packedLength=6;Xs.pack=function(e,t,n){return n=n??0,t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};Xs.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Xs),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};Xs.clone=function(e,t){if(l(e))return l(t)||(t=new Xs),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 we=Xs;var fLe=new m;function Dd(e){e=e??Q.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??we.DEFAULT;this._minimum=m.clone(t),this._maximum=m.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Dd.fromDimensions=function(e){e=e??Q.EMPTY_OBJECT;let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new Dd({minimum:m.negate(n,new m),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Dd.fromAxisAlignedBoundingBox=function(e){return new Dd({minimum:e.minimum,maximum:e.maximum})};Dd.packedLength=2*m.packedLength+we.packedLength+1;Dd.pack=function(e,t,n){return n=n??0,m.pack(e._minimum,t,n),m.pack(e._maximum,t,n+m.packedLength),we.pack(e._vertexFormat,t,n+2*m.packedLength),t[n+2*m.packedLength+we.packedLength]=e._offsetAttribute??-1,t};var Sie=new m,Iie=new m,_ie=new we,Tie={minimum:Sie,maximum:Iie,vertexFormat:_ie,offsetAttribute:void 0};Dd.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,Sie),o=m.unpack(e,t+m.packedLength,Iie),r=we.unpack(e,t+2*m.packedLength,_ie),s=e[t+2*m.packedLength+we.packedLength];return l(n)?(n._minimum=m.clone(i,n._minimum),n._maximum=m.clone(o,n._maximum),n._vertexFormat=we.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Tie.offsetAttribute=s===-1?void 0:s,new Dd(Tie))};Dd.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(m.equals(t,n))return;let o=new yn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(72),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let d=new Float32Array(72);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=1,d[9]=0,d[10]=0,d[11]=1,d[12]=0,d[13]=0,d[14]=-1,d[15]=0,d[16]=0,d[17]=-1,d[18]=0,d[19]=0,d[20]=-1,d[21]=0,d[22]=0,d[23]=-1,d[24]=1,d[25]=0,d[26]=0,d[27]=1,d[28]=0,d[29]=0,d[30]=1,d[31]=0,d[32]=0,d[33]=1,d[34]=0,d[35]=0,d[36]=-1,d[37]=0,d[38]=0,d[39]=-1,d[40]=0,d[41]=0,d[42]=-1,d[43]=0,d[44]=0,d[45]=-1,d[46]=0,d[47]=0,d[48]=0,d[49]=1,d[50]=0,d[51]=0,d[52]=1,d[53]=0,d[54]=0,d[55]=1,d[56]=0,d[57]=0,d[58]=1,d[59]=0,d[60]=0,d[61]=-1,d[62]=0,d[63]=0,d[64]=-1,d[65]=0,d[66]=0,d[67]=-1,d[68]=0,d[69]=0,d[70]=-1,d[71]=0,o.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:d})}if(i.st){let d=new Float32Array(48);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=1,d[5]=1,d[6]=0,d[7]=1,d[8]=1,d[9]=0,d[10]=0,d[11]=0,d[12]=0,d[13]=1,d[14]=1,d[15]=1,d[16]=0,d[17]=0,d[18]=1,d[19]=0,d[20]=1,d[21]=1,d[22]=0,d[23]=1,d[24]=1,d[25]=0,d[26]=0,d[27]=0,d[28]=0,d[29]=1,d[30]=1,d[31]=1,d[32]=1,d[33]=0,d[34]=0,d[35]=0,d[36]=0,d[37]=1,d[38]=1,d[39]=1,d[40]=0,d[41]=0,d[42]=1,d[43]=0,d[44]=1,d[45]=1,d[46]=0,d[47]=1,o.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:d})}if(i.tangent){let d=new Float32Array(72);d[0]=1,d[1]=0,d[2]=0,d[3]=1,d[4]=0,d[5]=0,d[6]=1,d[7]=0,d[8]=0,d[9]=1,d[10]=0,d[11]=0,d[12]=-1,d[13]=0,d[14]=0,d[15]=-1,d[16]=0,d[17]=0,d[18]=-1,d[19]=0,d[20]=0,d[21]=-1,d[22]=0,d[23]=0,d[24]=0,d[25]=1,d[26]=0,d[27]=0,d[28]=1,d[29]=0,d[30]=0,d[31]=1,d[32]=0,d[33]=0,d[34]=1,d[35]=0,d[36]=0,d[37]=-1,d[38]=0,d[39]=0,d[40]=-1,d[41]=0,d[42]=0,d[43]=-1,d[44]=0,d[45]=0,d[46]=-1,d[47]=0,d[48]=-1,d[49]=0,d[50]=0,d[51]=-1,d[52]=0,d[53]=0,d[54]=-1,d[55]=0,d[56]=0,d[57]=-1,d[58]=0,d[59]=0,d[60]=1,d[61]=0,d[62]=0,d[63]=1,d[64]=0,d[65]=0,d[66]=1,d[67]=0,d[68]=0,d[69]=1,d[70]=0,d[71]=0,o.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:d})}if(i.bitangent){let d=new Float32Array(72);d[0]=0,d[1]=1,d[2]=0,d[3]=0,d[4]=1,d[5]=0,d[6]=0,d[7]=1,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=1,d[14]=0,d[15]=0,d[16]=1,d[17]=0,d[18]=0,d[19]=1,d[20]=0,d[21]=0,d[22]=1,d[23]=0,d[24]=0,d[25]=0,d[26]=1,d[27]=0,d[28]=0,d[29]=1,d[30]=0,d[31]=0,d[32]=1,d[33]=0,d[34]=0,d[35]=1,d[36]=0,d[37]=0,d[38]=1,d[39]=0,d[40]=0,d[41]=1,d[42]=0,d[43]=0,d[44]=1,d[45]=0,d[46]=0,d[47]=1,d[48]=0,d[49]=0,d[50]=1,d[51]=0,d[52]=0,d[53]=1,d[54]=0,d[55]=0,d[56]=1,d[57]=0,d[58]=0,d[59]=1,d[60]=0,d[61]=0,d[62]=1,d[63]=0,d[64]=0,d[65]=1,d[66]=0,d[67]=0,d[68]=1,d[69]=0,d[70]=0,d[71]=1,o.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:d})}r=new Uint16Array(36),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(24),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(36),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=m.subtract(n,t,fLe),c=m.magnitude(a)*.5;if(l(e._offsetAttribute)){let d=s.length,u=e._offsetAttribute===mn.NONE?0:1,h=new Uint8Array(d/3).fill(u);o.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new pt({attributes:o,indices:r,primitiveType:Be.TRIANGLES,boundingSphere:new ue(m.ZERO,c),offsetAttribute:e._offsetAttribute})};var Az;Dd.getUnitBox=function(){return l(Az)||(Az=Dd.createGeometry(Dd.fromDimensions({dimensions:new m(1,1,1),vertexFormat:we.POSITION_ONLY}))),Az};var hc=Dd;var NDt=y(x(),1);var xUt=y(x(),1);var mUt=y(x(),1);var xo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};xo.getMathType=function(e){switch(e){case xo.SCALAR:return Number;case xo.VEC2:return M;case xo.VEC3:return m;case xo.VEC4:return ce;case xo.MAT2:return ki;case xo.MAT3:return $;case xo.MAT4:return F}};xo.getNumberOfComponents=function(e){switch(e){case xo.SCALAR:return 1;case xo.VEC2:return 2;case xo.VEC3:return 3;case xo.VEC4:case xo.MAT2:return 4;case xo.MAT3:return 9;case xo.MAT4:return 16}};xo.getAttributeLocationCount=function(e){switch(e){case xo.SCALAR:case xo.VEC2:case xo.VEC3:case xo.VEC4:return 1;case xo.MAT2:return 2;case xo.MAT3:return 3;case xo.MAT4:return 4}};xo.getGlslType=function(e){switch(e){case xo.SCALAR:return"float";case xo.VEC2:return"vec2";case xo.VEC3:return"vec3";case xo.VEC4:return"vec4";case xo.MAT2:return"mat2";case xo.MAT3:return"mat3";case xo.MAT4:return"mat4"}};var Ut=Object.freeze(xo);var Zie=1/256,Rie=256,Po={};Po.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*V.signNotZero(i),n.y=(1-Math.abs(i))*V.signNotZero(o)}return n.x=V.toSNorm(n.x,t),n.y=V.toSNorm(n.y,t),n};Po.octEncode=function(e,t){return Po.octEncodeInRange(e,255,t)};var RR=new M,Gie=new Uint8Array(1);function HD(e){return Gie[0]=e,Gie[0]}Po.octEncodeToCartesian4=function(e,t){return Po.octEncodeInRange(e,65535,RR),t.x=HD(RR.x*Zie),t.y=HD(RR.x),t.z=HD(RR.y*Zie),t.w=HD(RR.y),t};Po.octDecodeInRange=function(e,t,n,i){if(i.x=V.fromSNorm(e,n),i.y=V.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*V.signNotZero(o),i.y=(1-Math.abs(o))*V.signNotZero(i.y)}return m.normalize(i,i)};Po.octDecode=function(e,t,n){return Po.octDecodeInRange(e,t,255,n)};Po.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*Rie+i,a=o*Rie+r;return Po.octDecodeInRange(s,a,65535,t)};Po.octPackFloat=function(e){return 256*e.x+e.y};var bz=new M;Po.octEncodeFloat=function(e){return Po.octEncode(e,bz),Po.octPackFloat(bz)};Po.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return Po.octDecode(i,o,t)};Po.octPack=function(e,t,n,i){let o=Po.octEncodeFloat(e),r=Po.octEncodeFloat(t),s=Po.octEncode(n,bz);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};Po.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;Po.octDecodeFloat(s,t),Po.octDecodeFloat(c,n),Po.octDecode(r,a,i)};Po.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Po.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function gz(e){return e>>1^-(e&1)}Po.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=gz(e[a]),r+=gz(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=gz(n[a]),n[a]=s)};Po.dequantize=function(e,t,n,i){let o=Ut.getNumberOfComponents(n),r;switch(t){case J.BYTE:r=127;break;case J.UNSIGNED_BYTE:r=255;break;case J.SHORT:r=32767;break;case J.UNSIGNED_SHORT:r=65535;break;case J.INT:r=2147483647;break;case J.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let d=a*o+c;s[d]=Math.max(e[d]/r,-1)}return s};Po.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],d=c>>11,u=c>>5&o,h=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=h*r}return t};var _n=Po;var _Ut=y(x(),1);var Vie=new m,Lie=new m,Wie=new m;function pLe(e,t,n,i,o){l(o)||(o=new m);let r,s,a,c,d,u,h,p;if(l(t.z)){if(m.equalsEpsilon(e,t,V.EPSILON14))return m.clone(m.UNIT_X,o);if(m.equalsEpsilon(e,n,V.EPSILON14))return m.clone(m.UNIT_Y,o);if(m.equalsEpsilon(e,i,V.EPSILON14))return m.clone(m.UNIT_Z,o);r=m.subtract(n,t,Vie),s=m.subtract(i,t,Lie),a=m.subtract(e,t,Wie),c=m.dot(r,r),d=m.dot(r,s),u=m.dot(r,a),h=m.dot(s,s),p=m.dot(s,a)}else{if(M.equalsEpsilon(e,t,V.EPSILON14))return m.clone(m.UNIT_X,o);if(M.equalsEpsilon(e,n,V.EPSILON14))return m.clone(m.UNIT_Y,o);if(M.equalsEpsilon(e,i,V.EPSILON14))return m.clone(m.UNIT_Z,o);r=M.subtract(n,t,Vie),s=M.subtract(i,t,Lie),a=M.subtract(e,t,Wie),c=M.dot(r,r),d=M.dot(r,s),u=M.dot(r,a),h=M.dot(s,s),p=M.dot(s,a)}o.y=h*u-d*p,o.z=c*p-d*u;let g=c*h-d*d;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var ux=pLe;var VUt=y(x(),1);function Qf(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}Qf.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var yA={high:0,low:0};Qf.fromCartesian=function(e,t){l(t)||(t=new Qf);let n=t.high,i=t.low;return Qf.encode(e.x,yA),n.x=yA.high,i.x=yA.low,Qf.encode(e.y,yA),n.y=yA.high,i.y=yA.low,Qf.encode(e.z,yA),n.z=yA.high,i.z=yA.low,t};var yz=new Qf;Qf.writeElements=function(e,t,n){Qf.fromCartesian(e,yz);let i=yz.high,o=yz.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var ti=Qf;var nDt=y(x(),1);var FUt=y(x(),1);var xz={};xz.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Fie(e,t,n){let i=e+t;return V.sign(e)!==V.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}xz.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),d=Math.abs(e);if(c<d&&c/d<V.EPSILON14)return[0,0];if(c>d&&d/c<V.EPSILON14)return[];if(i=-n/e,i<0)return[];let u=Math.sqrt(i);return[-u,u]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=Fie(o,-r,V.EPSILON14);if(s<0)return[];let a=-.5*Fie(t,V.sign(t)*Math.sqrt(s),V.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var dl=xz;var UUt=y(x(),1);var YUt=y(x(),1);var Ez={};Ez.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function Cz(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,h=s*s,p=o*s-u,g=o*a-r*s,f=r*a-h,b=4*p*f-g*g,C,E;if(b<0){let O,H,ee;u*d>=c*h?(O=o,H=p,ee=-2*r*p+o*g):(O=a,H=f,ee=-a*g+2*s*f);let te=-(ee<0?-1:1)*Math.abs(O)*Math.sqrt(-b);E=-ee+te;let q=E/2,me=q<0?-Math.pow(-q,1/3):Math.pow(q,1/3),ye=E===te?-me:-H/me;return C=H<=0?me+ye:-ee/(me*me+ye*ye+H),u*d>=c*h?[(C-r)/o]:[-a/(C+s)]}let T=p,S=-2*r*p+o*g,_=f,R=-a*g+2*s*f,L=Math.sqrt(b),W=Math.sqrt(3)/2,B=Math.abs(Math.atan2(o*L,-S)/3);C=2*Math.sqrt(-T);let Y=Math.cos(B);E=C*Y;let N=C*(-Y/2-W*Math.sin(B)),A=E+N>2*r?E-r:N-r,I=o,Z=A/I;B=Math.abs(Math.atan2(a*L,-R)/3),C=2*Math.sqrt(-_),Y=Math.cos(B),E=C*Y,N=C*(-Y/2-W*Math.sin(B));let G=-a,w=E+N<2*s?E+s:N+s,X=G/w,v=I*w,U=-A*w-I*G,k=A*G,P=(s*U-r*k)/(-r*U+s*v);return Z<=P?Z<=X?P<=X?[Z,P,X]:[Z,X,P]:[X,Z,P]:Z<=X?[P,Z,X]:P<=X?[P,X,Z]:[X,P,Z]}Ez.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return dl.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=dl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Cz(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):Cz(e,t,0,i);if(i===0)return o=dl.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return Cz(e,t,n,i)};var mx=Ez;var Tz={};Tz.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,d=n*n,u=d*n,h=i*i,p=h*i,g=o*o,f=g*o;return a*d*h-4*c*p-4*e*u*h+18*e*t*n*p-27*r*h*h+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function uh(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=mx.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let d=-e/4,u=c[c.length-1];if(Math.abs(u)<V.EPSILON14){let h=dl.computeRealRoots(1,r,a);if(h.length===2){let p=h[0],g=h[1],f;if(p>=0&&g>=0){let b=Math.sqrt(p),C=Math.sqrt(g);return[d-C,d-b,d+b,d+C]}else{if(p>=0&&g<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}}return[]}else if(u>0){let h=Math.sqrt(u),p=(r+u-s/h)/2,g=(r+u+s/h)/2,f=dl.computeRealRoots(1,h,p),b=dl.computeRealRoots(1,-h,g);return f.length!==0?(f[0]+=d,f[1]+=d,b.length!==0?(b[0]+=d,b[1]+=d,f[1]<=b[0]?[f[0],f[1],b[0],b[1]]:b[1]<=f[0]?[b[0],b[1],f[0],f[1]]:f[0]>=b[0]&&f[1]<=b[1]?[b[0],f[0],f[1],b[1]]:b[0]>=f[0]&&b[1]<=f[1]?[f[0],b[0],b[1],f[1]]:f[0]>b[0]&&f[0]<b[1]?[b[0],f[0],b[1],f[1]]:[f[0],b[0],f[1],b[1]]):f):b.length!==0?(b[0]+=d,b[1]+=d,b):[]}}return[]}function GR(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,d=s*i-n*t*e+o,u=mx.computeRealRoots(1,a,c,d);if(u.length>0){let h=u[0],p=t-h,g=p*p,f=e/2,b=p/2,C=g-4*i,E=g+4*Math.abs(i),T=s-4*h,S=s+4*Math.abs(h),_,R;if(h<0||C*S<T*E){let I=Math.sqrt(T);_=I/2,R=I===0?0:(e*b-n)/I}else{let I=Math.sqrt(C);_=I===0?0:(e*b-n)/I,R=I/2}let L,W;f===0&&_===0?(L=0,W=0):V.sign(f)===V.sign(_)?(L=f+_,W=h/L):(W=f-_,L=h/W);let B,Y;b===0&&R===0?(B=0,Y=0):V.sign(b)===V.sign(R)?(B=b+R,Y=i/B):(Y=b-R,B=i/Y);let N=dl.computeRealRoots(1,L,B),A=dl.computeRealRoots(1,W,Y);if(N.length!==0)return A.length!==0?N[1]<=A[0]?[N[0],N[1],A[0],A[1]]:A[1]<=N[0]?[A[0],A[1],N[0],N[1]]:N[0]>=A[0]&&N[1]<=A[1]?[A[0],N[0],N[1],A[1]]:A[0]>=N[0]&&A[1]<=N[1]?[N[0],A[0],A[1],N[1]]:N[0]>A[0]&&N[0]<A[1]?[A[0],N[0],A[1],N[1]]:[N[0],A[0],N[1],A[1]]:N;if(A.length!==0)return A}return[]}Tz.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<V.EPSILON15)return mx.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,d=r<0?1:0;switch(d+=s<0?d+1:d,d+=a<0?d+1:d,d+=c<0?d+1:d,d){case 0:return uh(r,s,a,c);case 1:return GR(r,s,a,c);case 2:return GR(r,s,a,c);case 3:return uh(r,s,a,c);case 4:return uh(r,s,a,c);case 5:return GR(r,s,a,c);case 6:return uh(r,s,a,c);case 7:return uh(r,s,a,c);case 8:return GR(r,s,a,c);case 9:return uh(r,s,a,c);case 10:return uh(r,s,a,c);case 11:return GR(r,s,a,c);case 12:return uh(r,s,a,c);case 13:return uh(r,s,a,c);case 14:return uh(r,s,a,c);case 15:return uh(r,s,a,c);default:return}};var VR=Tz;var QUt=y(x(),1);function KD(e,t){t=m.clone(t??m.ZERO),m.equals(t,m.ZERO)||m.normalize(t,t),this.origin=m.clone(e??m.ZERO),this.direction=t}KD.clone=function(e,t){if(l(e))return l(t)?(t.origin=m.clone(e.origin),t.direction=m.clone(e.direction),t):new KD(e.origin,e.direction)};KD.getPoint=function(e,t,n){return l(n)||(n=new m),n=m.multiplyByScalar(e.direction,t,n),m.add(e.origin,n,n)};var xn=KD;var $o={};$o.rayPlane=function(e,t,n){l(n)||(n=new m);let i=e.origin,o=e.direction,r=t.normal,s=m.dot(r,o);if(Math.abs(s)<V.EPSILON15)return;let a=(-t.distance-m.dot(r,i))/s;if(!(a<0))return n=m.multiplyByScalar(o,a,n),m.add(i,n,n)};var ALe=new m,gLe=new m,Uie=new m,Bie=new m,wie=new m;$o.rayTriangleParametric=function(e,t,n,i,o){o=o??!1;let r=e.origin,s=e.direction,a=m.subtract(n,t,ALe),c=m.subtract(i,t,gLe),d=m.cross(s,c,Uie),u=m.dot(a,d),h,p,g,f,b;if(o){if(u<V.EPSILON6||(h=m.subtract(r,t,Bie),g=m.dot(h,d),g<0||g>u)||(p=m.cross(h,a,wie),f=m.dot(s,p),f<0||g+f>u))return;b=m.dot(c,p)/u}else{if(Math.abs(u)<V.EPSILON6)return;let C=1/u;if(h=m.subtract(r,t,Bie),g=m.dot(h,d)*C,g<0||g>1||(p=m.cross(h,a,wie),f=m.dot(s,p)*C,f<0||g+f>1))return;b=m.dot(c,p)*C}return b};$o.rayTriangle=function(e,t,n,i,o,r){let s=$o.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var bLe=new xn;$o.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=bLe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=$o.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function yLe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,d=(-t-a)*s;return c<d?(i.root0=c,i.root1=d):(i.root0=d,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var xLe={root0:0,root1:0};function Die(e,t,n){l(n)||(n=new Or);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=m.subtract(i,r,Uie),c=m.dot(o,o),d=2*m.dot(o,a),u=m.magnitudeSquared(a)-s,h=yLe(c,d,u,xLe);if(l(h))return n.start=h.root0,n.stop=h.root1,n}$o.raySphere=function(e,t,n){if(n=Die(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var CLe=new xn;$o.lineSegmentSphere=function(e,t,n,i){let o=CLe;m.clone(e,o.origin);let r=m.subtract(t,e,o.direction),s=m.magnitude(r);if(m.normalize(r,r),i=Die(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var ELe=new m,TLe=new m;$o.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,ELe),o=m.multiplyComponents(n,e.direction,TLe),r=m.magnitudeSquared(i),s=m.dot(i,o),a,c,d,u,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=m.magnitudeSquared(o),d=c*a,p<d)return;if(p>d){u=s*s-d,h=-s+Math.sqrt(u);let f=h/c,b=a/h;return f<b?new Or(f,b):{start:b,stop:f}}let g=Math.sqrt(a/c);return new Or(g,g)}else if(r<1)return a=r-1,c=m.magnitudeSquared(o),d=c*a,u=s*s-d,h=-s+Math.sqrt(u),new Or(0,h/c);if(s<0)return c=m.magnitudeSquared(o),new Or(0,-s/c)};var SLe=new Or,ILe=new Or,_Le=new Or;$o.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Or);let i=Sz(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,SLe),o=Sz(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,ILe),r=Sz(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,_Le);if(n.start=i.start>o.start?i.start:o.start,n.stop=i.stop<o.stop?i.stop:o.stop,!(i.start>o.stop||o.start>i.stop)&&!(n.start>r.stop||r.start>n.stop))return r.start>n.start&&(n.start=r.start),r.stop<n.stop&&(n.stop=r.stop),n};function Sz(e,t,n,i,o){if(o.start=(n-e)/t,o.stop=(i-e)/t,o.stop<o.start){let r=o.stop;o.stop=o.start,o.start=r}return o}function hx(e,t,n){let i=e+t;return V.sign(e)!==V.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}$o.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*hx(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],V.EPSILON15)+t.y),d=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,u=s*hx(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],V.EPSILON15),h=o*(i*hx(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(h===0&&u===0){if(p=dl.computeRealRoots(a,c,d),p.length===0)return g;let B=p[0],Y=Math.sqrt(Math.max(1-B*B,0));if(g.push(new m(i,o*B,o*-Y)),g.push(new m(i,o*B,o*Y)),p.length===2){let N=p[1],A=Math.sqrt(Math.max(1-N*N,0));g.push(new m(i,o*N,o*-A)),g.push(new m(i,o*N,o*A))}return g}let f=h*h,b=u*u,C=a*a,E=h*u,T=C+b,S=2*(c*a+E),_=2*d*a+c*c-b+f,R=2*(d*c-E),L=d*d-f;if(T===0&&S===0&&_===0&&R===0)return g;p=VR.computeRealRoots(T,S,_,R,L);let W=p.length;if(W===0)return g;for(let B=0;B<W;++B){let Y=p[B],N=Y*Y,A=Math.max(1-N,0),I=Math.sqrt(A),Z;V.sign(a)===V.sign(d)?Z=hx(a*N+d,c*Y,V.EPSILON12):V.sign(d)===V.sign(c*Y)?Z=hx(a*N,c*Y+d,V.EPSILON12):Z=hx(a*N+c*Y,d,V.EPSILON12);let G=hx(u*Y,h,V.EPSILON15),w=Z*G;w<0?g.push(new m(i,o*Y,o*I)):w>0?g.push(new m(i,o*Y,o*-I)):I!==0?(g.push(new m(i,o*Y,o*-I)),g.push(new m(i,o*Y,o*I)),++B):g.push(new m(i,o*Y,o*I))}return g};var Iz=new m,Yie=new m,Nie=new m,JD=new m,ZLe=new m,RLe=new $,GLe=new $,VLe=new $,LLe=new $,WLe=new $,Xie=new $,Pie=new $,Mie=new m,FLe=new m,BLe=new pe;$o.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let L=t.geodeticSurfaceNormal(n,Iz);if(m.dot(i,L)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,Iz),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,JD),c=m.normalize(m.cross(a,s,Yie),Yie),d=m.normalize(m.cross(s,c,Nie),Nie),u=RLe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let h=$.transpose(u,GLe),p=$.fromScale(t.radii,VLe),g=$.fromScale(t.oneOverRadii,LLe),f=WLe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let b=$.multiply($.multiply(h,g,Xie),f,Xie),C=$.multiply($.multiply(b,p,Pie),u,Pie),E=$.multiplyByVector(b,n,ZLe),T=$o.quadraticVectorExpression(C,m.negate(E,Iz),0,0,1),S,_,R=T.length;if(R>0){let L=m.clone(m.ZERO,FLe),W=Number.NEGATIVE_INFINITY;for(let Y=0;Y<R;++Y){S=$.multiplyByVector(p,$.multiplyByVector(u,T[Y],Mie),Mie);let N=m.normalize(m.subtract(S,n,JD),JD),A=m.dot(N,i);A>W&&(W=A,L=m.clone(S,L))}let B=t.cartesianToCartographic(L,BLe);return W=V.clamp(W,0,1),_=m.magnitude(m.subtract(L,n,JD))*Math.sqrt(1-W*W),_=o?-_:_,B.height=_,t.cartographicToCartesian(B,new m)}};var wLe=new m;$o.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let o=m.subtract(t,e,wLe),r=n.normal,s=m.dot(r,o);if(Math.abs(s)<V.EPSILON6)return;let a=m.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return m.multiplyByScalar(o,c,i),m.add(e,i,i),i};$o.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,c=m.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,h;if((d===1||d===2)&&(u=new m,h=new m),d===1){if(s)return $o.lineSegmentPlane(e,t,i,u),$o.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,u,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return $o.lineSegmentPlane(t,n,i,u),$o.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,u,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return $o.lineSegmentPlane(n,e,i,u),$o.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,u,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return $o.lineSegmentPlane(e,n,i,u),$o.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,u,h],indices:[0,1,4,0,4,3,2,3,4]}}else return $o.lineSegmentPlane(n,t,i,u),$o.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,u,h],indices:[2,0,4,2,4,3,1,3,4]};else return $o.lineSegmentPlane(t,e,i,u),$o.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,u,h],indices:[1,2,4,1,4,3,0,3,4]}};var di=$o;var cDt=y(x(),1);function ba(e,t){this.normal=m.clone(e),this.distance=t}ba.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new ba(t,i)};var YLe=new m;ba.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,YLe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new ba(n,i)};ba.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var NLe=new m;ba.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=ba.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,NLe);return m.subtract(t,o,n)};var XLe=new F,PLe=new ce,MLe=new m;ba.transform=function(e,t,n){let i=e.normal,o=e.distance,r=F.inverseTranspose(t,XLe),s=ce.fromElements(i.x,i.y,i.z,o,PLe);s=F.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,MLe);return s=ce.divideByScalar(s,m.magnitude(a),s),ba.fromCartesian4(s,n)};ba.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new ba(e.normal,e.distance)};ba.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};ba.ORIGIN_XY_PLANE=Object.freeze(new ba(m.UNIT_Z,0));ba.ORIGIN_YZ_PLANE=Object.freeze(new ba(m.UNIT_X,0));ba.ORIGIN_ZX_PLANE=Object.freeze(new ba(m.UNIT_Y,0));var an=ba;var mDt=y(x(),1);var _z={};_z.calculateACMR=function(e){e=e??Q.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};_z.tipsify=function(e){e=e??Q.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(A,I,Z,G){for(;I.length>=1;){let w=I[I.length-1];if(I.splice(I.length-1,1),A[w].numLiveTriangles>0)return w}for(;o<G;){if(A[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(A,I,Z,G,w,X,v){let U=-1,k,P=-1,O=0;for(;O<Z.length;){let H=Z[O];G[H].numLiveTriangles&&(k=0,w-G[H].timeStamp+2*G[H].numLiveTriangles<=I&&(k=w-G[H].timeStamp),(k>P||P===-1)&&(P=k,U=H)),++O}return U===-1?r(G,X,A,v):U}let a=t.length,c=0,d=0,u=t[d],h=a;if(l(n))c=n+1;else{for(;d<h;)u>c&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;let f=0;for(;d<h;)p[t[d]].vertexTriangles.push(f),++p[t[d]].numLiveTriangles,p[t[d+1]].vertexTriangles.push(f),++p[t[d+1]].numLiveTriangles,p[t[d+2]].vertexTriangles.push(f),++p[t[d+2]].numLiveTriangles,++f,d+=3;let b=0,C=i+1;o=1;let E=[],T=[],S,_,R=0,L=[],W=a/3,B=[];for(g=0;g<W;g++)B[g]=!1;let Y,N;for(;b!==-1;){E=[],_=p[b],N=_.vertexTriangles.length;for(let A=0;A<N;++A)if(f=_.vertexTriangles[A],!B[f]){B[f]=!0,d=f+f+f;for(let I=0;I<3;++I)Y=t[d],E.push(Y),T.push(Y),L[R]=Y,++R,S=p[Y],--S.numLiveTriangles,C-S.timeStamp>i&&(S.timeStamp=C,++C),++d}b=s(t,i,E,p,C,T,c)}return L};var LR=_z;var ul={};function iv(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function ULe(e){let t=e.length,n=t/3*6,i=Pe.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)iv(i,o,e[r],e[r+1],e[r+2]);return i}function DLe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Pe.createTypedArray(t,n);iv(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)iv(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function vLe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Pe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)iv(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}ul.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Be.TRIANGLES:e.indices=ULe(t);break;case Be.TRIANGLE_STRIP:e.indices=DLe(t);break;case Be.TRIANGLE_FAN:e.indices=vLe(t);break}e.primitiveType=Be.LINES}return e};ul.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let u=0;u<r;u+=3)s[a++]=i[u],s[a++]=i[u+1],s[a++]=i[u+2],s[a++]=i[u]+o[u]*n,s[a++]=i[u+1]+o[u+1]*n,s[a++]=i[u+2]+o[u+2]*n;let c,d=e.boundingSphere;return l(d)&&(c=new ue(d.center,d.radius+n)),new pt({attributes:{position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Be.LINES,boundingSphere:c})};ul.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};ul.reorderForPreVertexCache=function(e){let t=pt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Pe.createTypedArray(t,r),a=0,c=0,d=0,u;for(;a<r;)u=i[o[a]],u!==-1?s[c]=u:(u=o[a],i[u]=d,s[c]=d,++d),++a,++c;e.indices=s;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&l(h[p])&&l(h[p].values)){let g=h[p],f=g.values,b=0,C=g.componentsPerAttribute,E=J.createTypedArray(g.componentDatatype,d*C);for(;b<t;){let T=i[b];if(T!==-1)for(let S=0;S<C;S++)E[C*T+S]=f[C*b+S];++b}g.values=E}}return e};ul.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Be.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=LR.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function vie(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new We({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function kLe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}ul.fitToUnsignedShortIndices=function(e){let t=[],n=pt.computeNumberOfVertices(e);if(l(e.indices)&&n>=V.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=vie(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===Be.TRIANGLES?d=3:e.primitiveType===Be.LINES?d=2:e.primitiveType===Be.POINTS&&(d=1);for(let u=0;u<c;u+=d){for(let h=0;h<d;++h){let p=a[u+h],g=i[p];l(g)||(g=r++,i[p]=g,kLe(s,e.attributes,p)),o.push(g)}r+d>=V.SIXTY_FOUR_KILOBYTES&&(t.push(new pt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=vie(e.attributes))}o.length!==0&&t.push(new pt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var kie=new m,QLe=new pe;ul.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new vi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u<a.length;u+=3){let h=m.fromArray(a,u,kie),p=s.cartesianToCartographic(h,QLe),g=o.project(p,kie);c[d++]=g.x,c[d++]=g.y,c[d++]=g.z}return e.attributes[n]=r,e.attributes[i]=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var Zz={high:0,low:0};ul.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let u=0;u<s;++u)ti.encode(r[u],Zz),a[u]=Zz.high,c[u]=Zz.low;let d=o.componentsPerAttribute;return e.attributes[n]=new We({componentDatatype:J.FLOAT,componentsPerAttribute:d,values:a}),e.attributes[i]=new We({componentDatatype:J.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var hh=new m;function Rz(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,hh),F.multiplyByPoint(e,hh,hh),m.pack(hh,n,o)}}function Gz(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,hh),$.multiplyByVector(e,hh,hh),hh=m.normalize(hh,hh),m.pack(hh,n,o)}}var jD=new F,qD=new $;ul.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;Rz(t,n.position),Rz(t,n.prevPosition),Rz(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(F.inverse(t,jD),F.transpose(jD,jD),F.getMatrix3(jD,qD),Gz(qD,n.normal),Gz(qD,n.tangent),Gz(qD,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function OLe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let d=1;d<n;++d){let u=e[d][t].attributes[r];if(!l(u)||s.componentDatatype!==u.componentDatatype||s.componentsPerAttribute!==u.componentsPerAttribute||s.normalize!==u.normalize){c=!1;break}a+=u.values.length}c&&(i[r]=new We({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:J.createTypedArray(s.componentDatatype,a)}))}return i}var zLe=new m;function Vz(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),d=e[0][t].primitiveType,u=OLe(e,t),h,p,g;for(i in u)if(u.hasOwnProperty(i))for(h=u[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,g=p.length,r=0;r<g;++r)h[s++]=p[r];let f;if(c){let T=0;for(o=0;o<n;++o)T+=e[o][t].indices.length;let S=pt.computeNumberOfVertices(new pt({attributes:u,primitiveType:Be.POINTS})),_=Pe.createTypedArray(S,T),R=0,L=0;for(o=0;o<n;++o){let W=e[o][t].indices,B=W.length;for(s=0;s<B;++s)_[R++]=L+W[s];L+=pt.computeNumberOfVertices(e[o][t])}f=_}let b=new m,C=0,E;for(o=0;o<n;++o){if(E=e[o][t].boundingSphere,!l(E)){b=void 0;break}m.add(E.center,b,b)}if(l(b))for(m.divideByScalar(b,n,b),o=0;o<n;++o){E=e[o][t].boundingSphere;let T=m.magnitude(m.subtract(E.center,b,zLe))+E.radius;T>C&&(C=T)}return new pt({attributes:u,indices:f,primitiveType:d,boundingSphere:l(b)?new ue(b,C):void 0})}ul.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(Vz(t,"geometry")),n.length>0&&(o.push(Vz(n,"westHemisphereGeometry")),o.push(Vz(n,"eastHemisphereGeometry"))),o};var Hu=new m,WR=new m,jT=new m,qT=new m;ul.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),d;for(d=0;d<o;d++)s[d]={indexOffset:0,count:0,currentCount:0};let u=0;for(d=0;d<r;d+=3){let f=t[d],b=t[d+1],C=t[d+2],E=f*3,T=b*3,S=C*3;WR.x=i[E],WR.y=i[E+1],WR.z=i[E+2],jT.x=i[T],jT.y=i[T+1],jT.z=i[T+2],qT.x=i[S],qT.y=i[S+1],qT.z=i[S+2],s[f].count++,s[b].count++,s[C].count++,m.subtract(jT,WR,jT),m.subtract(qT,WR,qT),a[u]=m.cross(jT,qT,new m),u++}let h=0;for(d=0;d<o;d++)s[d].indexOffset+=h,h+=s[d].count;u=0;let p;for(d=0;d<r;d+=3){p=s[t[d]];let f=p.indexOffset+p.currentCount;c[f]=u,p.currentCount++,p=s[t[d+1]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,p=s[t[d+2]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,u++}let g=new Float32Array(o*3);for(d=0;d<o;d++){let f=d*3;if(p=s[d],m.clone(m.ZERO,Hu),p.count>0){for(u=0;u<p.count;u++)m.add(Hu,a[c[p.indexOffset+u]],Hu);m.equalsEpsilon(m.ZERO,Hu,V.EPSILON10)&&m.clone(a[c[p.indexOffset]],Hu)}m.equalsEpsilon(m.ZERO,Hu,V.EPSILON10)&&(Hu.z=1),m.normalize(Hu,Hu),g[f]=Hu.x,g[f+1]=Hu.y,g[f+2]=Hu.z}return e.attributes.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:g}),e};var HLe=new m,Qie=new m,KLe=new m;ul.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),d;for(d=0;d<c.length;d++)c[d]=0;let u,h,p;for(d=0;d<a;d+=3){let b=n[d],C=n[d+1],E=n[d+2];u=b*3,h=C*3,p=E*3;let T=b*2,S=C*2,_=E*2,R=i[u],L=i[u+1],W=i[u+2],B=r[T],Y=r[T+1],N=r[S+1]-Y,A=r[_+1]-Y,I=1/((r[S]-B)*A-(r[_]-B)*N),Z=(A*(i[h]-R)-N*(i[p]-R))*I,G=(A*(i[h+1]-L)-N*(i[p+1]-L))*I,w=(A*(i[h+2]-W)-N*(i[p+2]-W))*I;c[u]+=Z,c[u+1]+=G,c[u+2]+=w,c[h]+=Z,c[h+1]+=G,c[h+2]+=w,c[p]+=Z,c[p+1]+=G,c[p+2]+=w}let g=new Float32Array(s*3),f=new Float32Array(s*3);for(d=0;d<s;d++){u=d*3,h=u+1,p=u+2;let b=m.fromArray(o,u,HLe),C=m.fromArray(c,u,KLe),E=m.dot(b,C);m.multiplyByScalar(b,E,Qie),m.normalize(m.subtract(C,Qie,C),C),g[u]=C.x,g[h]=C.y,g[p]=C.z,m.normalize(m.cross(b,C,C),C),f[u]=C.x,f[h]=C.y,f[p]=C.z}return e.attributes.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f}),e};var FR=new M,mh=new m,Oie=new m,zie=new m,$D=new M;ul.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let L=t.values;i=L.length/3;let W=new Float32Array(i*2),B=0;for(n=0;n<i;++n){if(m.fromArray(L,n*3,mh),m.equals(mh,m.ZERO)){B+=2;continue}$D=_n.octEncodeInRange(mh,65535,$D),W[B++]=$D.x,W[B++]=$D.y}return e.attributes.compressedAttributes=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:W}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,d=e.attributes.bitangent,u=l(c),h=l(d),p,g,f,b;s&&(p=o.values),a&&(g=r.values),u&&(f=c.values),h&&(b=d.values),i=(s?p.length:g.length)/(s?3:2);let T=i,S=a&&s?2:1;S+=u||h?1:0,T*=S;let _=new Float32Array(T),R=0;for(n=0;n<i;++n){a&&(M.fromArray(g,n*2,FR),_[R++]=_n.compressTextureCoordinates(FR));let L=n*3;s&&l(f)&&l(b)?(m.fromArray(p,L,mh),m.fromArray(f,L,Oie),m.fromArray(b,L,zie),_n.octPack(mh,Oie,zie,FR),_[R++]=FR.x,_[R++]=FR.y):(s&&(m.fromArray(p,L,mh),_[R++]=_n.octEncodeFloat(mh)),u&&(m.fromArray(f,L,mh),_[R++]=_n.octEncodeFloat(mh)),h&&(m.fromArray(b,L,mh),_[R++]=_n.octEncodeFloat(mh)))}return e.attributes.compressedAttributes=new We({componentDatatype:J.FLOAT,componentsPerAttribute:S,values:_}),s&&delete e.attributes.normal,a&&delete e.attributes.st,h&&delete e.attributes.bitangent,u&&delete e.attributes.tangent,e};function JLe(e){if(l(e.indices))return e;let t=pt.computeNumberOfVertices(e),n=Pe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function jLe(e){let t=pt.computeNumberOfVertices(e),n=Pe.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Be.TRIANGLES,e}function qLe(e){let t=pt.computeNumberOfVertices(e),n=Pe.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Be.TRIANGLES,e}function $Le(e){if(l(e.indices))return e;let t=pt.computeNumberOfVertices(e),n=Pe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function eWe(e){let t=pt.computeNumberOfVertices(e),n=Pe.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Be.LINES,e}function tWe(e){let t=pt.computeNumberOfVertices(e),n=Pe.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Be.LINES,e}function nWe(e){switch(e.primitiveType){case Be.TRIANGLE_FAN:return jLe(e);case Be.TRIANGLE_STRIP:return qLe(e);case Be.TRIANGLES:return JLe(e);case Be.LINE_STRIP:return eWe(e);case Be.LINE_LOOP:return tWe(e);case Be.LINES:return $Le(e)}return e}function Yb(e,t){Math.abs(e.y)<V.EPSILON6&&(t?e.y=-V.EPSILON6:e.y=V.EPSILON6)}function iWe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Yb(e,e.y<0),Yb(t,t.y<0),Yb(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=V.sign(e.y):s=V.sign(n.y):o>r?s=V.sign(t.y):s=V.sign(n.y);let a=s<0;Yb(e,a),Yb(t,a),Yb(n,a)}var Hie=new m;function Ku(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,Hie),e.y/(e.y-t.y),Hie),n),m.clone(n,i),Yb(n,!0),Yb(i,!1)}var fx=new m,px=new m,Ax=new m,gx=new m,Lz={positions:new Array(7),indices:new Array(9)};function oWe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;iWe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=Lz.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Ku(e,t,fx,Ax),Ku(e,n,px,gx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Ku(t,n,fx,Ax),Ku(t,e,px,gx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Ku(n,e,fx,Ax),Ku(n,t,px,gx),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Ku(n,e,fx,Ax),Ku(n,t,px,gx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Ku(t,n,fx,Ax),Ku(t,e,px,gx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Ku(e,t,fx,Ax),Ku(e,n,px,gx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=Lz.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=fx,c[4]=px,c[5]=Ax,c[6]=gx,c.length=7),Lz}function Kie(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=J.createTypedArray(r.componentDatatype,r.values)}let i=pt.computeNumberOfVertices(e);return e.indices=Pe.createTypedArray(i,e.indices),t&&(e.boundingSphere=ue.fromVertices(n.position.values)),e}function eS(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new We({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new pt({attributes:n,indices:[],primitiveType:e.primitiveType})}function wz(e,t,n){let i=l(e.geometry.boundingSphere);t=Kie(t,i),n=Kie(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function Yz(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,h,p){let g=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),b=e.fromArray(d,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(b,c.z,b);let C=e.add(g,f,g);e.add(C,b,C),p&&e.normalize(C,C),e.pack(C,u,h*t)}}var rWe=Yz(ce,4),nv=Yz(m,3),toe=Yz(M,2),sWe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,d=o[n]*i.z;r[s]=a+c+d>V.EPSILON6?1:0},BR=new m,Wz=new m,Fz=new m,aWe=new m;function ev(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,b){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&g===0)return;let C=m.fromArray(o,e*3,BR),E=m.fromArray(o,t*3,Wz),T=m.fromArray(o,n*3,Fz),S=ux(i,C,E,T,aWe);if(l(S)){if(l(r)&&nv(e,t,n,S,r,h.normal.values,b,!0),l(d)){let _=m.fromArray(d,e*3,BR),R=m.fromArray(d,t*3,Wz),L=m.fromArray(d,n*3,Fz);m.multiplyByScalar(_,S.x,_),m.multiplyByScalar(R,S.y,R),m.multiplyByScalar(L,S.z,L);let W;!m.equals(_,m.ZERO)||!m.equals(R,m.ZERO)||!m.equals(L,m.ZERO)?(W=m.add(_,R,_),m.add(W,L,W),m.normalize(W,W)):(W=BR,W.x=0,W.y=0,W.z=0),m.pack(W,h.extrudeDirection.values,b*3)}if(l(u)&&sWe(e,t,n,S,u,h.applyOffset.values,b),l(s)&&nv(e,t,n,S,s,h.tangent.values,b,!0),l(a)&&nv(e,t,n,S,a,h.bitangent.values,b,!0),l(c)&&toe(e,t,n,S,c,h.st.values,b),g>0)for(let _=0;_<g;_++){let R=p[_];cWe(e,t,n,S,b,f[R],h[R])}}}function cWe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,d=s.values;switch(a){case 4:rWe(e,t,n,i,c,d,o,!1);break;case 3:nv(e,t,n,i,c,d,o,!1);break;case 2:toe(e,t,n,i,c,d,o,!1);break;default:d[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Of(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var lWe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Jie(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,d=l(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,h=[];for(let W in n)n.hasOwnProperty(W)&&!lWe[W]&&l(n[W])&&h.push(W);let p=h.length,g=eS(t),f=eS(t),b,C,E,T,S,_=[];_.length=i.length/3;let R=[];for(R.length=i.length/3,S=0;S<_.length;++S)_[S]=-1,R[S]=-1;let L=u.length;for(S=0;S<L;S+=3){let W=u[S],B=u[S+1],Y=u[S+2],N=m.fromArray(i,W*3),A=m.fromArray(i,B*3),I=m.fromArray(i,Y*3),Z=oWe(N,A,I);if(l(Z)&&Z.positions.length>3){let G=Z.positions,w=Z.indices,X=w.length;for(let v=0;v<X;++v){let U=w[v],k=G[U];k.y<0?(b=f.attributes,C=f.indices,E=_):(b=g.attributes,C=g.indices,E=R),T=Of(b,C,E,u,U<3?S+U:-1,k),ev(W,B,Y,k,i,o,s,r,a,c,d,b,h,p,n,T)}}else l(Z)&&(N=Z.positions[0],A=Z.positions[1],I=Z.positions[2]),N.y<0?(b=f.attributes,C=f.indices,E=_):(b=g.attributes,C=g.indices,E=R),T=Of(b,C,E,u,S,N),ev(W,B,Y,N,i,o,s,r,a,c,d,b,h,p,n,T),T=Of(b,C,E,u,S+1,A),ev(W,B,Y,A,i,o,s,r,a,c,d,b,h,p,n,T),T=Of(b,C,E,u,S+2,I),ev(W,B,Y,I,i,o,s,r,a,c,d,b,h,p,n,T)}wz(e,f,g)}var noe=an.fromPointNormal(m.ZERO,m.UNIT_Y),dWe=new m,uWe=new m;function $T(e,t,n,i,o,r,s){if(!l(s))return;let a=m.fromArray(i,e*3,BR);m.equalsEpsilon(a,n,V.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function jie(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=eS(t),a=eS(t),c,d=r.length,u=[];u.length=i.length/3;let h=[];for(h.length=i.length/3,c=0;c<u.length;++c)u[c]=-1,h[c]=-1;for(c=0;c<d;c+=2){let p=r[c],g=r[c+1],f=m.fromArray(i,p*3,BR),b=m.fromArray(i,g*3,Wz),C;Math.abs(f.y)<V.EPSILON6&&(f.y<0?f.y=-V.EPSILON6:f.y=V.EPSILON6),Math.abs(b.y)<V.EPSILON6&&(b.y<0?b.y=-V.EPSILON6:b.y=V.EPSILON6);let E=s.attributes,T=s.indices,S=h,_=a.attributes,R=a.indices,L=u,W=di.lineSegmentPlane(f,b,noe,Fz);if(l(W)){let B=m.multiplyByScalar(m.UNIT_Y,5*V.EPSILON9,dWe);f.y<0&&(m.negate(B,B),E=a.attributes,T=a.indices,S=u,_=s.attributes,R=s.indices,L=h);let Y=m.add(W,B,uWe);C=Of(E,T,S,r,c,f),$T(p,g,f,i,C,E,o),C=Of(E,T,S,r,-1,Y),$T(p,g,Y,i,C,E,o),m.negate(B,B),m.add(W,B,Y),C=Of(_,R,L,r,-1,Y),$T(p,g,Y,i,C,_,o),C=Of(_,R,L,r,c+1,b),$T(p,g,b,i,C,_,o)}else{let B,Y,N;f.y<0?(B=a.attributes,Y=a.indices,N=u):(B=s.attributes,Y=s.indices,N=h),C=Of(B,Y,N,r,c,f),$T(p,g,f,i,C,B,o),C=Of(B,Y,N,r,c+1,b),$T(p,g,b,i,C,B,o)}}wz(e,a,s)}var qie=new M,mWe=new M,ioe=new m,ooe=new m,Bz=new m,hWe=new m,fWe=new m,pWe=new m,$ie=new ce;function eoe(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=m.unpack(n,s,ioe);if(a.x>0)continue;let c=m.unpack(i,s,ooe);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let d=m.unpack(o,s,Bz);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):m.pack(a,o,s))}}var AWe=5*V.EPSILON9,tv=V.EPSILON6;function gWe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,d=eS(t),u=eS(t),h,p,g,f=!1,b=i.length/3;for(h=0;h<b;h+=4){let C=h,E=h+2,T=m.fromArray(i,C*3,ioe),S=m.fromArray(i,E*3,ooe);if(Math.abs(T.y)<tv)for(T.y=tv*(S.y<0?-1:1),i[h*3+1]=T.y,i[(h+1)*3+1]=T.y,p=C*3;p<C*3+12;p+=3)o[p]=i[h*3],o[p+1]=i[h*3+1],o[p+2]=i[h*3+2];if(Math.abs(S.y)<tv)for(S.y=tv*(T.y<0?-1:1),i[(h+2)*3+1]=S.y,i[(h+3)*3+1]=S.y,p=C*3;p<C*3+12;p+=3)r[p]=i[(h+2)*3],r[p+1]=i[(h+2)*3+1],r[p+2]=i[(h+2)*3+2];let _=d.attributes,R=d.indices,L=u.attributes,W=u.indices,B=di.lineSegmentPlane(T,S,noe,hWe);if(l(B)){f=!0;let Y=m.multiplyByScalar(m.UNIT_Y,AWe,fWe);T.y<0&&(m.negate(Y,Y),_=u.attributes,R=u.indices,L=d.attributes,W=d.indices);let N=m.add(B,Y,pWe);_.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),_.position.values.push(N.x,N.y,N.z),_.position.values.push(N.x,N.y,N.z),_.prevPosition.values.push(o[C*3],o[C*3+1],o[C*3+2]),_.prevPosition.values.push(o[C*3+3],o[C*3+4],o[C*3+5]),_.prevPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),_.nextPosition.values.push(N.x,N.y,N.z),_.nextPosition.values.push(N.x,N.y,N.z),_.nextPosition.values.push(N.x,N.y,N.z),_.nextPosition.values.push(N.x,N.y,N.z),m.negate(Y,Y),m.add(B,Y,N),L.position.values.push(N.x,N.y,N.z),L.position.values.push(N.x,N.y,N.z),L.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),L.prevPosition.values.push(N.x,N.y,N.z),L.prevPosition.values.push(N.x,N.y,N.z),L.prevPosition.values.push(N.x,N.y,N.z),L.prevPosition.values.push(N.x,N.y,N.z),L.nextPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),L.nextPosition.values.push(r[E*3],r[E*3+1],r[E*3+2]),L.nextPosition.values.push(r[E*3+3],r[E*3+4],r[E*3+5]);let A=M.fromArray(s,C*2,qie),I=Math.abs(A.y);_.expandAndWidth.values.push(-1,I,1,I),_.expandAndWidth.values.push(-1,-I,1,-I),L.expandAndWidth.values.push(-1,I,1,I),L.expandAndWidth.values.push(-1,-I,1,-I);let Z=m.magnitudeSquared(m.subtract(B,T,Bz));if(Z/=m.magnitudeSquared(m.subtract(S,T,Bz)),l(c)){let G=ce.fromArray(c,C*4,$ie),w=ce.fromArray(c,E*4,$ie),X=V.lerp(G.x,w.x,Z),v=V.lerp(G.y,w.y,Z),U=V.lerp(G.z,w.z,Z),k=V.lerp(G.w,w.w,Z);for(p=C*4;p<C*4+8;++p)_.color.values.push(c[p]);for(_.color.values.push(X,v,U,k),_.color.values.push(X,v,U,k),L.color.values.push(X,v,U,k),L.color.values.push(X,v,U,k),p=E*4;p<E*4+8;++p)L.color.values.push(c[p])}if(l(a)){let G=M.fromArray(a,C*2,qie),w=M.fromArray(a,(h+3)*2,mWe),X=V.lerp(G.x,w.x,Z);for(p=C*2;p<C*2+4;++p)_.st.values.push(a[p]);for(_.st.values.push(X,G.y),_.st.values.push(X,w.y),L.st.values.push(X,G.y),L.st.values.push(X,w.y),p=E*2;p<E*2+4;++p)L.st.values.push(a[p])}g=_.position.values.length/3-4,R.push(g,g+2,g+1),R.push(g+1,g+2,g+3),g=L.position.values.length/3-4,W.push(g,g+2,g+1),W.push(g+1,g+2,g+3)}else{let Y,N;for(T.y<0?(Y=u.attributes,N=u.indices):(Y=d.attributes,N=d.indices),Y.position.values.push(T.x,T.y,T.z),Y.position.values.push(T.x,T.y,T.z),Y.position.values.push(S.x,S.y,S.z),Y.position.values.push(S.x,S.y,S.z),p=h*3;p<h*3+12;++p)Y.prevPosition.values.push(o[p]),Y.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+8;++p)Y.expandAndWidth.values.push(s[p]),l(a)&&Y.st.values.push(a[p]);if(l(c))for(p=h*4;p<h*4+16;++p)Y.color.values.push(c[p]);g=Y.position.values.length/3-4,N.push(g,g+2,g+1),N.push(g+1,g+2,g+3)}}f&&(eoe(u),eoe(d)),wz(e,u,d)}ul.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,an.ORIGIN_ZX_PLANE)!==Jt.INTERSECTING))return e;if(t.geometryType!==zu.NONE)switch(t.geometryType){case zu.POLYLINES:gWe(e);break;case zu.TRIANGLES:Jie(e);break;case zu.LINES:jie(e);break}else nWe(t),t.primitiveType===Be.TRIANGLES?Jie(e):t.primitiveType===Be.LINES&&jie(e);return e};var Dn=ul;var DDt=y(x(),1);function wR(e,t,n,i,o,r,s,a,c,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=d,this._initialized=u}Object.defineProperties(wR.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});wR.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let u=i.arrayBufferView,h=this._size,p=this._pixelFormat,g=this._internalFormat,f=this._pixelDatatype,b=this._preMultiplyAlpha,C=this._flipY,E=4;l(u)&&(E=je.alignmentInBytes(p,f,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,E),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let T=!1;if(!this._initialized){let S;t===0&&n===0&&r===h&&s===h?(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),C&&(u=je.flipY(u,p,f,h,h)),S=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,C),S=i),T=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),S=je.createTypedArray(p,f,h,h)),a.texImage2D(d,0,g,h,h,0,p,ve.toWebGLConstant(f,this._context),S),this._initialized=!0}T||(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),C&&(u=je.flipY(u,p,f,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,ve.toWebGLConstant(f,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,C),a.texSubImage2D(d,0,t,n,p,ve.toWebGLConstant(f,this._context),i))),a.bindTexture(c,null)};wR.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};wR.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0;let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var YR=wR;var QDt=y(x(),1);var ov={DONT_CARE:ne.DONT_CARE,FASTEST:ne.FASTEST,NICEST:ne.NICEST,validate:function(e){return e===ov.DONT_CARE||e===ov.FASTEST||e===ov.NICEST}},Ju=Object.freeze(ov);var avt=y(x(),1);var HDt=y(x(),1);var rv={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR};rv.validate=function(e){return e===rv.NEAREST||e===rv.LINEAR};var ui=Object.freeze(rv);var jDt=y(x(),1);var Nb={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR,NEAREST_MIPMAP_NEAREST:ne.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ne.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ne.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ne.LINEAR_MIPMAP_LINEAR};Nb.validate=function(e){return e===Nb.NEAREST||e===Nb.LINEAR||e===Nb.NEAREST_MIPMAP_NEAREST||e===Nb.LINEAR_MIPMAP_NEAREST||e===Nb.NEAREST_MIPMAP_LINEAR||e===Nb.LINEAR_MIPMAP_LINEAR};var zt=Object.freeze(Nb);var evt=y(x(),1);var sv={CLAMP_TO_EDGE:ne.CLAMP_TO_EDGE,REPEAT:ne.REPEAT,MIRRORED_REPEAT:ne.MIRRORED_REPEAT,validate:function(e){return e===sv.CLAMP_TO_EDGE||e===sv.REPEAT||e===sv.MIRRORED_REPEAT}},bn=Object.freeze(sv);function NR(e){e=e??Q.EMPTY_OBJECT;let{wrapR:t=bn.CLAMP_TO_EDGE,wrapS:n=bn.CLAMP_TO_EDGE,wrapT:i=bn.CLAMP_TO_EDGE,minificationFilter:o=zt.LINEAR,magnificationFilter:r=ui.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=o,this._magnificationFilter=r,this._maximumAnisotropy=s}Object.defineProperties(NR.prototype,{wrapR:{get:function(){return this._wrapR}},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}}});NR.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};NR.NEAREST=Object.freeze(new NR({wrapR:bn.CLAMP_TO_EDGE,wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:zt.NEAREST,magnificationFilter:ui.NEAREST}));var Ht=NR;var Cvt=y(x(),1);function bWe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??J.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(c){let d=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function soe(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function xA(e){e=e??Q.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,d=!1,u=i.length;for(r=0;r<u;++r)bWe(s,i[r],r,t);for(u=s.length,r=0;r<u;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*J.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(r=0;r<u;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(d=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),soe(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=h,this._attributes=s,this._indexBuffer=o}function roe(e){return e.values.length/e.componentsPerAttribute}function yWe(e){return J.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function xWe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===J.DOUBLE&&(e[n].componentDatatype=J.FLOAT,e[n].values=J.createTypedArray(J.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=roe(e[o[0]]),t=1;t<s;++t){let d=roe(e[o[t]]);if(d!==r)throw new he(`Each attribute list must have the same number of vertices.  Attribute ${o[t]} has a different number of vertices (${d.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(d,u){return J.getSizeInBytes(e[u].componentDatatype)-J.getSizeInBytes(e[d].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=yWe(i);if(a>0){let d=J.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let h=r*a,p=new ArrayBuffer(h),g={};for(t=0;t<s;++t){n=o[t];let f=J.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:J.createTypedArray(e[n].componentDatatype,p),index:c[n]/f,strideInComponentType:a/f}}for(t=0;t<r;++t)for(let f=0;f<s;++f){n=o[f],i=e[n];let b=i.values,C=g[n],E=C.pointer,T=i.componentsPerAttribute;for(let S=0;S<T;++S)E[C.index+S]=b[t*T+S];C.index+=C.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}xA.fromGeometry=function(e){e=e??Q.EMPTY_OBJECT;let t=e.context,n=e.geometry??Q.EMPTY_OBJECT,i=e.bufferUsage??Xe.DYNAMIC_DRAW,o=e.attributeLocations??Q.EMPTY_OBJECT,r=e.interleave??!1,s=e.vertexArrayAttributes,a,c,d,u=l(s)?s:[],h=n.attributes;if(r){let f=xWe(h);if(l(f)){d=mt.createVertexBuffer({context:t,typedArray:f.buffer,usage:i});let b=f.offsetsInBytes,C=f.vertexSizeInBytes;for(a in h)h.hasOwnProperty(a)&&l(h[a])&&(c=h[a],l(c.values)?u.push({index:o[a],vertexBuffer:d,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:b[a],strideInBytes:C}):u.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in h)if(h.hasOwnProperty(a)&&l(h[a])){c=h[a];let f=c.componentDatatype;f===J.DOUBLE&&(f=J.FLOAT);let b={};d=void 0,l(c.values)&&(d=mt.createVertexBuffer({context:t,typedArray:J.createTypedArray(f,c.values),usage:i}),b={index:o[a],vertexBuffer:d,value:c.value,componentDatatype:f,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(d=mt.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),b={index:o[a],vertexBuffer:d,value:void 0,componentDatatype:f,componentsPerAttribute:Ut.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),u.push(b)}let p,g=n.indices;return l(g)&&(pt.computeNumberOfVertices(n)>=V.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=mt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Pe.UNSIGNED_INT}):p=mt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Pe.UNSIGNED_SHORT})),new xA({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(xA.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});xA.prototype.getAttribute=function(e){return this._attributes[e]};function CWe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Yt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let d=c.instanceDivisor,u=c.index;d!==i[u]&&(t.glVertexAttribDivisor(u,d),i[u]=d)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function EWe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}xA.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&CWe(this),this._hasConstantAttributes&&EWe(this,this._gl)):soe(this._gl,this._attributes,this._indexBuffer)};xA.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};xA.prototype.isDestroyed=function(){return!1};xA.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),fe(this)};var si=xA;function gr(e){e=e??Q.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=je.RGBA,pixelDatatype:o=ve.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e,c=e.preMultiplyAlpha||i===je.RGB||i===je.LUMINANCE,{width:d,height:u}=e;l(n)&&({width:d,height:u}=n.positiveX);let h=d,p=je.textureSizeInBytes(i,o,h,h)*6,g=je.toInternalFormat(i,o,t),f=t._gl,b=f.TEXTURE_CUBE_MAP,C=f.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=b,this._texture=C,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let E=l(n);function T(S){return new YR(t,C,b,S,g,i,o,h,c,r,E)}this._positiveX=T(f.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=T(f.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=T(f.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=T(f.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=T(f.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=T(f.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,aoe(this,a),f.activeTexture(f.TEXTURE0),f.bindTexture(b,C),s?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL);for(let S of gr.faceNames())Nz(this[S],n?.[S],0);f.bindTexture(b,null)}gr.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new ns({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};gr.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*TWe(){yield gr.FaceName.POSITIVEX,yield gr.FaceName.NEGATIVEX,yield gr.FaceName.POSITIVEY,yield gr.FaceName.NEGATIVEY,yield gr.FaceName.POSITIVEZ,yield gr.FaceName.NEGATIVEZ}gr.faceNames=function(){return TWe()};function Nz(e,t,n){n=n??0;let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,d=e._preMultiplyAlpha,u=e._context,h=u._gl;if(!l(t)){h.texImage2D(i,n,a,o,o,0,r,ve.toWebGLConstant(s,u),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=je.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,g),l(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=je.flipY(p,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,ve.toWebGLConstant(s,u),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),h.texImage2D(i,n,a,r,ve.toWebGLConstant(s,u),t))}gr.loadFace=Nz;Object.defineProperties(gr.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){aoe(this,e),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(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});gr.getDirection=function(e,t){switch(e){case gr.FaceName.POSITIVEX:return m.clone(m.UNIT_X,t);case gr.FaceName.NEGATIVEX:return m.negate(m.UNIT_X,t);case gr.FaceName.POSITIVEY:return m.clone(m.UNIT_Y,t);case gr.FaceName.NEGATIVEY:return m.negate(m.UNIT_Y,t);case gr.FaceName.POSITIVEZ:return m.clone(m.UNIT_Z,t);case gr.FaceName.NEGATIVEZ:return m.negate(m.UNIT_Z,t)}};function aoe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[zt.NEAREST_MIPMAP_NEAREST,zt.NEAREST_MIPMAP_LINEAR,zt.LINEAR_MIPMAP_NEAREST,zt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===ve.FLOAT&&!r.textureFloatLinear||s===ve.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?zt.NEAREST_MIPMAP_NEAREST:zt.NEAREST,i=ui.NEAREST);let a=r._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}gr.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let s=e[r],a=r+1;for(let c of gr.faceNames())Nz(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};gr.prototype.generateMipmap=function(e){e=e??Ju.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};gr.createVertexArray=function(e){let t=hc.createGeometry(hc.fromDimensions({dimensions:new m(2,2,2),vertexFormat:we.POSITION_ONLY})),n=this._attributeLocations=Dn.createAttributeLocations(t);return si.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Xe.STATIC_DRAW})};gr.prototype.isDestroyed=function(){return!1};gr.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=fe(this._positiveX),this._negativeX=fe(this._negativeX),this._positiveY=fe(this._positiveY),this._negativeY=fe(this._negativeY),this._positiveZ=fe(this._positiveZ),this._negativeZ=fe(this._negativeZ),fe(this)};var zr=gr;var Dvt=y(x(),1);function SWe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Bc=SWe;var UHt=y(x(),1);var wHt=y(x(),1);var _Ht=y(x(),1);var kvt=y(x(),1),XR=`/**
 * A built-in GLSL floating-point constant for converting radians to degrees.
 *
 * @alias czm_degreesPerRadian
 * @glslConstant
 *
 * @see CesiumMath.DEGREES_PER_RADIAN
 *
 * @example
 * // GLSL declaration
 * const float czm_degreesPerRadian = ...;
 *
 * // Example
 * float deg = czm_degreesPerRadian * rad;
 */
const float czm_degreesPerRadian = 57.29577951308232;
`;var Ovt=y(x(),1),PR=`/**
 * A built-in GLSL vec2 constant for defining the depth range.
 * This is a workaround to a bug where IE11 does not implement gl_DepthRange.
 *
 * @alias czm_depthRange
 * @glslConstant
 *
 * @example
 * // GLSL declaration
 * float depthRangeNear = czm_depthRange.near;
 * float depthRangeFar = czm_depthRange.far;
 *
 */
const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
`;var Hvt=y(x(),1),MR=`/**
 * 0.1
 *
 * @name czm_epsilon1
 * @glslConstant
 */
const float czm_epsilon1 = 0.1;
`;var Jvt=y(x(),1),UR=`/**
 * 0.01
 *
 * @name czm_epsilon2
 * @glslConstant
 */
const float czm_epsilon2 = 0.01;
`;var qvt=y(x(),1),DR=`/**
 * 0.001
 *
 * @name czm_epsilon3
 * @glslConstant
 */
const float czm_epsilon3 = 0.001;
`;var ekt=y(x(),1),vR=`/**
 * 0.0001
 *
 * @name czm_epsilon4
 * @glslConstant
 */
const float czm_epsilon4 = 0.0001;
`;var nkt=y(x(),1),kR=`/**
 * 0.00001
 *
 * @name czm_epsilon5
 * @glslConstant
 */
const float czm_epsilon5 = 0.00001;
`;var okt=y(x(),1),QR=`/**
 * 0.000001
 *
 * @name czm_epsilon6
 * @glslConstant
 */
const float czm_epsilon6 = 0.000001;
`;var skt=y(x(),1),OR=`/**
 * 0.0000001
 *
 * @name czm_epsilon7
 * @glslConstant
 */
const float czm_epsilon7 = 0.0000001;
`;var ckt=y(x(),1),zR=`/**
 * DOC_TBA
 *
 * @name czm_infinity
 * @glslConstant
 */
const float czm_infinity = 5906376272000.0;  // Distance from the Sun to Pluto in meters.  TODO: What is best given lowp, mediump, and highp?
`;var dkt=y(x(),1),HR=`/**
 * A built-in GLSL floating-point constant for <code>1/pi</code>.
 *
 * @alias czm_oneOverPi
 * @glslConstant
 *
 * @see CesiumMath.ONE_OVER_PI
 *
 * @example
 * // GLSL declaration
 * const float czm_oneOverPi = ...;
 *
 * // Example
 * float pi = 1.0 / czm_oneOverPi;
 */
const float czm_oneOverPi = 0.3183098861837907;
`;var mkt=y(x(),1),KR=`/**
 * A built-in GLSL floating-point constant for <code>1/2pi</code>.
 *
 * @alias czm_oneOverTwoPi
 * @glslConstant
 *
 * @see CesiumMath.ONE_OVER_TWO_PI
 *
 * @example
 * // GLSL declaration
 * const float czm_oneOverTwoPi = ...;
 *
 * // Example
 * float pi = 2.0 * czm_oneOverTwoPi;
 */
const float czm_oneOverTwoPi = 0.15915494309189535;
`;var fkt=y(x(),1),JR=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
 *
 * @name czm_passCesium3DTile
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTile = 5.0;
`;var Akt=y(x(),1),jR=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
 *
 * @name czm_passCesium3DTileClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTileClassification = 6.0;
`;var bkt=y(x(),1),qR=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
 *
 * @name czm_passCesium3DTileClassificationIgnoreShow
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTileClassificationIgnoreShow = 7.0;
`;var xkt=y(x(),1),$R=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_EDGES}
 *
 * @name czm_passCesium3DTileEdges
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTileEdges = 4.0;

`;var Ekt=y(x(),1),eG=`/**
 * The automatic GLSL constant for {@link Pass#CLASSIFICATION}
 *
 * @name czm_passClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passClassification = 7.0;
`;var Skt=y(x(),1),tG=`/**
 * The automatic GLSL constant for {@link Pass#COMPUTE}
 *
 * @name czm_passCompute
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCompute = 1.0;
`;var _kt=y(x(),1),nG=`/**
 * The automatic GLSL constant for {@link Pass#ENVIRONMENT}
 *
 * @name czm_passEnvironment
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passEnvironment = 0.0;
`;var Rkt=y(x(),1),iG=`/**
 * The automatic GLSL constant for {@link Pass#GAUSSIAN_SPLATS}
 *
 * @name czm_passGaussianSplats
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passGaussianSplats = 11.0;
`;var Vkt=y(x(),1),oG=`/**
 * The automatic GLSL constant for {@link Pass#GLOBE}
 *
 * @name czm_passGlobe
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passGlobe = 2.0;
`;var Wkt=y(x(),1),rG=`/**
 * The automatic GLSL constant for {@link Pass#OPAQUE}
 *
 * @name czm_passOpaque
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passOpaque = 8.0;
`;var Bkt=y(x(),1),sG=`/**
 * The automatic GLSL constant for {@link Pass#OVERLAY}
 *
 * @name czm_passOverlay
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passOverlay = 12.0;
`;var Ykt=y(x(),1),aG=`/**
 * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
 *
 * @name czm_passTerrainClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passTerrainClassification = 3.0;
`;var Xkt=y(x(),1),cG=`/**
 * The automatic GLSL constant for {@link Pass#TRANSLUCENT}
 *
 * @name czm_passTranslucent
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passTranslucent = 9.0;
`;var Mkt=y(x(),1),lG=`/**
 * The automatic GLSL constant for {@link Pass#VOXELS}
 *
 * @name czm_passVoxels
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passVoxels = 10.0;
`;var Dkt=y(x(),1),dG=`/**
 * A built-in GLSL floating-point constant for <code>Math.PI</code>.
 *
 * @alias czm_pi
 * @glslConstant
 *
 * @see CesiumMath.PI
 *
 * @example
 * // GLSL declaration
 * const float czm_pi = ...;
 *
 * // Example
 * float twoPi = 2.0 * czm_pi;
 */
const float czm_pi = 3.141592653589793;
`;var kkt=y(x(),1),uG=`/**
 * A built-in GLSL floating-point constant for <code>pi/4</code>.
 *
 * @alias czm_piOverFour
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_FOUR
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverFour = ...;
 *
 * // Example
 * float pi = 4.0 * czm_piOverFour;
 */
const float czm_piOverFour = 0.7853981633974483;
`;var Okt=y(x(),1),mG=`/**
 * A built-in GLSL floating-point constant for <code>pi/6</code>.
 *
 * @alias czm_piOverSix
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_SIX
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverSix = ...;
 *
 * // Example
 * float pi = 6.0 * czm_piOverSix;
 */
const float czm_piOverSix = 0.5235987755982988;
`;var Hkt=y(x(),1),hG=`/**
 * A built-in GLSL floating-point constant for <code>pi/3</code>.
 *
 * @alias czm_piOverThree
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_THREE
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverThree = ...;
 *
 * // Example
 * float pi = 3.0 * czm_piOverThree;
 */
const float czm_piOverThree = 1.0471975511965976;
`;var Jkt=y(x(),1),fG=`/**
 * A built-in GLSL floating-point constant for <code>pi/2</code>.
 *
 * @alias czm_piOverTwo
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_TWO
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverTwo = ...;
 *
 * // Example
 * float pi = 2.0 * czm_piOverTwo;
 */
const float czm_piOverTwo = 1.5707963267948966;
`;var qkt=y(x(),1),pG=`/**
 * A built-in GLSL floating-point constant for converting degrees to radians.
 *
 * @alias czm_radiansPerDegree
 * @glslConstant
 *
 * @see CesiumMath.RADIANS_PER_DEGREE
 *
 * @example
 * // GLSL declaration
 * const float czm_radiansPerDegree = ...;
 *
 * // Example
 * float rad = czm_radiansPerDegree * deg;
 */
const float czm_radiansPerDegree = 0.017453292519943295;
`;var e9t=y(x(),1),AG=`/**
 * The constant identifier for the 2D {@link SceneMode}
 *
 * @name czm_sceneMode2D
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneModeColumbusView
 * @see czm_sceneMode3D
 * @see czm_sceneModeMorphing
 */
const float czm_sceneMode2D = 2.0;
`;var n9t=y(x(),1),gG=`/**
 * The constant identifier for the 3D {@link SceneMode}
 *
 * @name czm_sceneMode3D
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneMode2D
 * @see czm_sceneModeColumbusView
 * @see czm_sceneModeMorphing
 */
const float czm_sceneMode3D = 3.0;
`;var o9t=y(x(),1),bG=`/**
 * The constant identifier for the Columbus View {@link SceneMode}
 *
 * @name czm_sceneModeColumbusView
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneMode2D
 * @see czm_sceneMode3D
 * @see czm_sceneModeMorphing
 */
const float czm_sceneModeColumbusView = 1.0;
`;var s9t=y(x(),1),yG=`/**
 * The constant identifier for the Morphing {@link SceneMode}
 *
 * @name czm_sceneModeMorphing
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneMode2D
 * @see czm_sceneModeColumbusView
 * @see czm_sceneMode3D
 */
const float czm_sceneModeMorphing = 0.0;
`;var c9t=y(x(),1),xG=`/**
 * A built-in GLSL floating-point constant for one solar radius.
 *
 * @alias czm_solarRadius
 * @glslConstant
 *
 * @see CesiumMath.SOLAR_RADIUS
 *
 * @example
 * // GLSL declaration
 * const float czm_solarRadius = ...;
 */
const float czm_solarRadius = 695500000.0;
`;var d9t=y(x(),1),CG=`/**
 * A built-in GLSL floating-point constant for <code>3pi/2</code>.
 *
 * @alias czm_threePiOver2
 * @glslConstant
 *
 * @see CesiumMath.THREE_PI_OVER_TWO
 *
 * @example
 * // GLSL declaration
 * const float czm_threePiOver2 = ...;
 *
 * // Example
 * float pi = (2.0 / 3.0) * czm_threePiOver2;
 */
const float czm_threePiOver2 = 4.71238898038469;
`;var m9t=y(x(),1),EG=`/**
 * A built-in GLSL floating-point constant for <code>2pi</code>.
 *
 * @alias czm_twoPi
 * @glslConstant
 *
 * @see CesiumMath.TWO_PI
 *
 * @example
 * // GLSL declaration
 * const float czm_twoPi = ...;
 *
 * // Example
 * float pi = czm_twoPi / 2.0;
 */
const float czm_twoPi = 6.283185307179586;
`;var f9t=y(x(),1),TG=`/**
 * The maximum latitude, in radians, both North and South, supported by a Web Mercator
 * (EPSG:3857) projection.  Technically, the Mercator projection is defined
 * for any latitude up to (but not including) 90 degrees, but it makes sense
 * to cut it off sooner because it grows exponentially with increasing latitude.
 * The logic behind this particular cutoff value, which is the one used by
 * Google Maps, Bing Maps, and Esri, is that it makes the projection
 * square.  That is, the rectangle is equal in the X and Y directions.
 *
 * The constant value is computed as follows:
 *   czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))
 *
 * @name czm_webMercatorMaxLatitude
 * @glslConstant
 */
const float czm_webMercatorMaxLatitude = 1.4844222297453324;
`;var A9t=y(x(),1),SG=`/**
 * @name czm_depthRangeStruct
 * @glslStruct
 */
struct czm_depthRangeStruct
{
    float near;
    float far;
};
`;var b9t=y(x(),1),IG=`/**
 * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.
 *
 * @name czm_material
 * @glslStruct
 *
 * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
 * @property {float} specular Intensity of incoming light reflecting in a single direction.
 * @property {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.
 * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
 * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
 * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
 */
struct czm_material
{
    vec3 diffuse;
    float specular;
    float shininess;
    vec3 normal;
    vec3 emission;
    float alpha;
};
`;var x9t=y(x(),1),_G=`/**
 * Used as input to every material's czm_getMaterial function.
 *
 * @name czm_materialInput
 * @glslStruct
 *
 * @property {float} s 1D texture coordinates.
 * @property {vec2} st 2D texture coordinates.
 * @property {vec3} str 3D texture coordinates.
 * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.
 * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.
 * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates.  The magnitude is the distance in meters from the fragment to the eye.
 * @property {float} height The height of the terrain in meters above or below the ellipsoid.  Only available for globe materials.
 * @property {float} slope The slope of the terrain in radians.  0 is flat; pi/2 is vertical.  Only available for globe materials.
 * @property {float} aspect The aspect of the terrain in radians.  0 is East, pi/2 is North, pi is West, 3pi/2 is South.  Only available for globe materials.
* @property {float} waterMask The value of the water mask. 0 is land, 1 is water. Only available for globe materials.
 */
struct czm_materialInput
{
    float s;
    vec2 st;
    vec3 str;
    vec3 normalEC;
    mat3 tangentToEyeMatrix;
    vec3 positionToEyeEC;
    float height;
    float slope;
    float aspect;
    float waterMask;
};
`;var E9t=y(x(),1),ZG=`/**
 * Struct for representing a material for a {@link Model}. The model
 * rendering pipeline will pass this struct between material, custom shaders,
 * and lighting stages. This is not to be confused with {@link czm_material}
 * which is used by the older Fabric materials system, although they are similar.
 * <p>
 * All color values (diffuse, specular, emissive) are in linear color space.
 * </p>
 *
 * @name czm_modelMaterial
 * @glslStruct
 *
 * @property {vec4} baseColor The base color of the material.
 * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
 * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
 * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.
 * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.
 * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
 * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.
 * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
 */
struct czm_modelMaterial {
    vec4 baseColor;
    vec3 diffuse;
    float alpha;
    vec3 specular;
    float roughness;
    vec3 normalEC;
    float occlusion;
    vec3 emissive;
#ifdef USE_SPECULAR
    float specularWeight;
#endif
#ifdef USE_ANISOTROPY
    vec3 anisotropicT;
    vec3 anisotropicB;
    float anisotropyStrength;
#endif
#ifdef USE_CLEARCOAT
    float clearcoatFactor;
    float clearcoatRoughness;
    vec3 clearcoatNormal;
    // Add clearcoatF0 when KHR_materials_ior is implemented
#endif
};
`;var S9t=y(x(),1),RG=`/**
 * Struct for representing the output of a custom vertex shader.
 * 
 * @name czm_modelVertexOutput
 * @glslStruct
 *
 * @see {@link CustomShader}
 * @see {@link Model}
 *
 * @property {vec3} positionMC The position of the vertex in model coordinates
 * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. 
 */
struct czm_modelVertexOutput {
  vec3 positionMC;
  float pointSize;
};
`;var _9t=y(x(),1),GG=`/**
 * DOC_TBA
 *
 * @name czm_ray
 * @glslStruct
 */
struct czm_ray
{
    vec3 origin;
    vec3 direction;
};
`;var R9t=y(x(),1),VG=`/**
 * DOC_TBA
 *
 * @name czm_raySegment
 * @glslStruct
 */
struct czm_raySegment
{
    float start;
    float stop;
};

/**
 * DOC_TBA
 *
 * @name czm_emptyRaySegment
 * @glslConstant 
 */
const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);

/**
 * DOC_TBA
 *
 * @name czm_fullRaySegment
 * @glslConstant 
 */
const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
`;var V9t=y(x(),1),LG=`struct czm_shadowParameters
{
#ifdef USE_CUBE_MAP_SHADOW
    vec3 texCoords;
#else
    vec2 texCoords;
#endif

    float depthBias;
    float depth;
    float nDotL;
    vec2 texelStepSize;
    float normalShadingSmooth;
    float darkness;
};
`;var W9t=y(x(),1),WG=`/**
 * Converts an HSB color (hue, saturation, brightness) to RGB
 * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
 *
 * @name czm_HSBToRGB
 * @glslFunction
 * 
 * @param {vec3} hsb The color in HSB.
 *
 * @returns {vec3} The color in RGB.
 *
 * @example
 * vec3 hsb = czm_RGBToHSB(rgb);
 * hsb.z *= 0.1;
 * rgb = czm_HSBToRGB(hsb);
 */

const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);

vec3 czm_HSBToRGB(vec3 hsb)
{
    vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);
    return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);
}
`;var B9t=y(x(),1),FG=`/**
 * Converts an HSL color (hue, saturation, lightness) to RGB
 * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
 *
 * @name czm_HSLToRGB
 * @glslFunction
 * 
 * @param {vec3} rgb The color in HSL.
 *
 * @returns {vec3} The color in RGB.
 *
 * @example
 * vec3 hsl = czm_RGBToHSL(rgb);
 * hsl.z *= 0.1;
 * rgb = czm_HSLToRGB(hsl);
 */

vec3 hueToRGB(float hue)
{
    float r = abs(hue * 6.0 - 3.0) - 1.0;
    float g = 2.0 - abs(hue * 6.0 - 2.0);
    float b = 2.0 - abs(hue * 6.0 - 4.0);
    return clamp(vec3(r, g, b), 0.0, 1.0);
}

vec3 czm_HSLToRGB(vec3 hsl)
{
    vec3 rgb = hueToRGB(hsl.x);
    float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
    return (rgb - 0.5) * c + hsl.z;
}
`;var Y9t=y(x(),1),BG=`/**
 * Converts an RGB color to HSB (hue, saturation, brightness)
 * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
 *
 * @name czm_RGBToHSB
 * @glslFunction
 * 
 * @param {vec3} rgb The color in RGB.
 *
 * @returns {vec3} The color in HSB.
 *
 * @example
 * vec3 hsb = czm_RGBToHSB(rgb);
 * hsb.z *= 0.1;
 * rgb = czm_HSBToRGB(hsb);
 */

const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);

vec3 czm_RGBToHSB(vec3 rgb)
{
    vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));
    vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));

    float d = q.x - min(q.w, q.y);
    return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);
}
`;var X9t=y(x(),1),wG=`/**
 * Converts an RGB color to HSL (hue, saturation, lightness)
 * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
 *
 * @name czm_RGBToHSL
 * @glslFunction
 * 
 * @param {vec3} rgb The color in RGB.
 *
 * @returns {vec3} The color in HSL.
 *
 * @example
 * vec3 hsl = czm_RGBToHSL(rgb);
 * hsl.z *= 0.1;
 * rgb = czm_HSLToRGB(hsl);
 */
 
vec3 RGBtoHCV(vec3 rgb)
{
    // Based on work by Sam Hocevar and Emil Persson
    vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);
    vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);
    float c = q.x - min(q.w, q.y);
    float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);
    return vec3(h, c, q.x);
}

vec3 czm_RGBToHSL(vec3 rgb)
{
    vec3 hcv = RGBtoHCV(rgb);
    float l = hcv.z - hcv.y * 0.5;
    float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);
    return vec3(hcv.x, s, l);
}
`;var M9t=y(x(),1),YG=`/**
 * Converts an RGB color to CIE Yxy.
 * <p>The conversion is described in
 * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
 * </p>
 * 
 * @name czm_RGBToXYZ
 * @glslFunction
 * 
 * @param {vec3} rgb The color in RGB.
 *
 * @returns {vec3} The color in CIE Yxy.
 *
 * @example
 * vec3 xyz = czm_RGBToXYZ(rgb);
 * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
 * rgb = czm_XYZToRGB(xyz);
 */
vec3 czm_RGBToXYZ(vec3 rgb)
{
    const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,
                              0.3576, 0.7152, 0.1192,
                              0.1805, 0.0722, 0.9505);
    vec3 xyz = RGB2XYZ * rgb;
    vec3 Yxy;
    Yxy.r = xyz.g;
    float temp = dot(vec3(1.0), xyz);
    Yxy.gb = xyz.rg / temp;
    return Yxy;
}
`;var D9t=y(x(),1),NG=`/**
 * Converts a CIE Yxy color to RGB.
 * <p>The conversion is described in
 * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
 * </p>
 * 
 * @name czm_XYZToRGB
 * @glslFunction
 * 
 * @param {vec3} Yxy The color in CIE Yxy.
 *
 * @returns {vec3} The color in RGB.
 *
 * @example
 * vec3 xyz = czm_RGBToXYZ(rgb);
 * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
 * rgb = czm_XYZToRGB(xyz);
 */
vec3 czm_XYZToRGB(vec3 Yxy)
{
    const mat3 XYZ2RGB = mat3( 3.2405, -0.9693,  0.0556,
                              -1.5371,  1.8760, -0.2040,
                              -0.4985,  0.0416,  1.0572);
    vec3 xyz;
    xyz.r = Yxy.r * Yxy.g / Yxy.b;
    xyz.g = Yxy.r;
    xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
    
    return XYZ2RGB * xyz;
}
`;var k9t=y(x(),1),XG=`// See:
//    https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/

vec3 czm_acesTonemapping(vec3 color) {
    float g = 0.985;
    float a = 0.065;
    float b = 0.0001;
    float c = 0.433;
    float d = 0.238;

    color = (color * (color + a) - b) / (color * (g * color + c) + d);

    color = clamp(color, 0.0, 1.0);

    return color;
}
`;var O9t=y(x(),1),PG=`/**
 * @private
 */
float czm_alphaWeight(float a)
{
    float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];

    // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:
    // http://jcgt.org/published/0002/02/09/
    return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));
}
`;var H9t=y(x(),1),MG=`/**
 * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.
 *
 * @name czm_antialias
 * @glslFunction
 *
 * @param {vec4} color1 The color on one side of the edge.
 * @param {vec4} color2 The color on the other side of the edge.
 * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.
 * @param {float} dist The distance to the edge in texture coordinates.
 * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.
 * @returns {vec4} The anti-aliased color.
 *
 * @example
 * // GLSL declarations
 * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);
 * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);
 *
 * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space
 * float dist = abs(textureCoordinates.t - 0.5);
 * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));
 * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);
 */
vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)
{
    float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);
    float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);
    val1 = val1 * (1.0 - val2);
    val1 = val1 * val1 * (3.0 - (2.0 * val1));
    val1 = pow(val1, 0.5); //makes the transition nicer
    
    vec4 midColor = (color1 + color2) * 0.5;
    return mix(midColor, currentColor, val1);
}

vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)
{
    return czm_antialias(color1, color2, currentColor, dist, 0.1);
}
`;var J9t=y(x(),1),UG=`/**
 * Apply a HSB color shift to an RGB color.
 *
 * @param {vec3} rgb The color in RGB space.
 * @param {vec3} hsbShift The amount to shift each component. The xyz components correspond to hue, saturation, and brightness. Shifting the hue by +/- 1.0 corresponds to shifting the hue by a full cycle. Saturation and brightness are clamped between 0 and 1 after the adjustment
 * @param {bool} ignoreBlackPixels If true, black pixels will be unchanged. This is necessary in some shaders such as atmosphere-related effects.
 *
 * @return {vec3} The RGB color after shifting in HSB space and clamping saturation and brightness to a valid range.
 */
vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {
    // Convert rgb color to hsb
    vec3 hsb = czm_RGBToHSB(rgb);

    // Perform hsb shift
    // Hue cycles around so no clamp is needed.
    hsb.x += hsbShift.x; // hue
    hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); // saturation

    // brightness
    //
    // Some shaders such as atmosphere-related effects need to leave black
    // pixels unchanged
    if (ignoreBlackPixels) {
        hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0;
    } else {
        hsb.z = hsb.z + hsbShift.z;
    }
    hsb.z = clamp(hsb.z, 0.0, 1.0);

    // Convert shifted hsb back to rgb
    return czm_HSBToRGB(hsb);
}
`;var q9t=y(x(),1),DG=`/**
 * Approximately computes spherical coordinates given a normal.
 * Uses approximate inverse trigonometry for speed and consistency,
 * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.
 *
 * @name czm_approximateSphericalCoordinates
 * @glslFunction
 *
 * @param {vec3} normal arbitrary-length normal.
 *
 * @returns {vec2} Approximate latitude and longitude spherical coordinates.
 */
vec2 czm_approximateSphericalCoordinates(vec3 normal) {
    // Project into plane with vertical for latitude
    float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);
    float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);
    return vec2(latitudeApproximation, longitudeApproximation);
}
`;var eQt=y(x(),1),vG=`/**
 * Compute a rational approximation to tanh(x)
 *
 * @param {float} x A real number input
 * @returns {float} An approximation for tanh(x)
*/
float czm_approximateTanh(float x) {
    float x2 = x * x;
    return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));
}
`;var nQt=y(x(),1),kG=`/**
 * Determines if the fragment is back facing
 *
 * @name czm_backFacing
 * @glslFunction 
 * 
 * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.
 */
bool czm_backFacing()
{
    // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.
    return gl_FrontFacing == false;
}
`;var oQt=y(x(),1),QG=`/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a float expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {float} a Value to return if the comparison is true.
 * @param {float} b Value to return if the comparison is false.
 *
 * @returns {float} equivalent of comparison ? a : b
 */
float czm_branchFreeTernary(bool comparison, float a, float b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}

/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a vec2 expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {vec2} a Value to return if the comparison is true.
 * @param {vec2} b Value to return if the comparison is false.
 *
 * @returns {vec2} equivalent of comparison ? a : b
 */
vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}

/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a vec3 expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {vec3} a Value to return if the comparison is true.
 * @param {vec3} b Value to return if the comparison is false.
 *
 * @returns {vec3} equivalent of comparison ? a : b
 */
vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}

/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a vec4 expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {vec3} a Value to return if the comparison is true.
 * @param {vec3} b Value to return if the comparison is false.
 *
 * @returns {vec3} equivalent of comparison ? a : b
 */
vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}
`;var sQt=y(x(),1),OG=`
vec4 czm_cascadeColor(vec4 weights)
{
    return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +
           vec4(0.0, 1.0, 0.0, 1.0) * weights.y +
           vec4(0.0, 0.0, 1.0, 1.0) * weights.z +
           vec4(1.0, 0.0, 1.0, 1.0) * weights.w;
}
`;var cQt=y(x(),1),zG=`
uniform vec4 shadowMap_cascadeDistances;

float czm_cascadeDistance(vec4 weights)
{
    return dot(shadowMap_cascadeDistances, weights);
}
`;var dQt=y(x(),1),HG=`
uniform mat4 shadowMap_cascadeMatrices[4];

mat4 czm_cascadeMatrix(vec4 weights)
{
    return shadowMap_cascadeMatrices[0] * weights.x +
           shadowMap_cascadeMatrices[1] * weights.y +
           shadowMap_cascadeMatrices[2] * weights.z +
           shadowMap_cascadeMatrices[3] * weights.w;
}
`;var mQt=y(x(),1),KG=`
uniform vec4 shadowMap_cascadeSplits[2];

vec4 czm_cascadeWeights(float depthEye)
{
    // One component is set to 1.0 and all others set to 0.0.
    vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
    vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
    return near * far;
}
`;var fQt=y(x(),1),JG=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
    float signedDistance = texture(clippingDistance, uv).r;
    return (signedDistance - 0.5) * 2.0;
}

void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 clippingPosition, int regionIndex) {
    // Position is completely outside of polygons bounds
    vec2 rectUv = clippingPosition;
    if (regionIndex < 0 || rectUv.x <= 0.0 || rectUv.y <= 0.0 || rectUv.x >= 1.0 || rectUv.y >= 1.0) {
        #ifdef CLIPPING_INVERSE 
            discard;
        #endif
        return;
    }

    vec2 clippingDistanceTextureDimensions = vec2(textureSize(clippingDistance, 0));
    vec2 sampleOffset = max(1.0 / clippingDistanceTextureDimensions, vec2(0.005));
    float dimension = float(extentsLength);
    if (extentsLength > 2) {
       dimension = ceil(log2(float(extentsLength)));
    }

    vec2 textureOffset = vec2(mod(float(regionIndex), dimension), floor(float(regionIndex) / dimension)) / dimension;
    vec2 uv = textureOffset + rectUv / dimension;

    float signedDistance = getSignedDistance(uv, clippingDistance);

    #ifdef CLIPPING_INVERSE
    if (signedDistance > 0.0)  {
        discard;
    }
    #else
    if (signedDistance < 0.0)  {
        discard;
    }
    #endif
}
`;var AQt=y(x(),1),jG=`/**
 * DOC_TBA
 *
 * @name czm_columbusViewMorph
 * @glslFunction
 */
vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
{
    // Just linear for now.
    // We're manually doing the equivalent of a \`mix\` here because, some GPUs
    // (NVidia GeForce 3070 Ti and Intel Arc A750, to name two), \`mix\` seems to
    // use an alternate formulation that introduces jitter even when \`time\` is
    // 0.0 or 1.0. That is, the value of \`p\` won't be exactly \`position2D.xyz\`
    // when \`time\` is 0.0 and it won't be exactly \`position3D.xyz\` when \`time\` is
    // 1.0. The "textbook" formulation here, while probably a bit slower,
    // does not have this problem.
    vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time;
    return vec4(p, 1.0);
}
`;var bQt=y(x(),1),qG=`/**
 * Compute the atmosphere color, applying Rayleigh and Mie scattering. This
 * builtin uses automatic uniforms so the atmophere settings are synced with the
 * state of the Scene, even in other contexts like Model.
 *
 * @name czm_computeAtmosphereColor
 * @glslFunction
 *
 * @param {vec3} positionWC Position of the fragment in world coords (low precision)
 * @param {vec3} lightDirection Light direction from the sun or other light source.
 * @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
 * @param {vec3} mieColor The Mie scattering color computed by a scattering function
 * @param {float} opacity The opacity computed by a scattering function.
 */
vec4 czm_computeAtmosphereColor(
    vec3 positionWC,
    vec3 lightDirection,
    vec3 rayleighColor,
    vec3 mieColor,
    float opacity
) {
    // Setup the primary ray: from the camera position to the vertex position.
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);

    float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
    float cosAngleSq = cosAngle * cosAngle;

    float G = czm_atmosphereMieAnisotropy;
    float GSq = G * G;

    // The Rayleigh phase function.
    float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
    // The Mie phase function.
    float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));

    // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
    vec3 rayleigh = rayleighPhase * rayleighColor;
    vec3 mie = miePhase * mieColor;

    vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;

    return vec4(color, opacity);
}

/**
 * Compute the atmosphere color, applying Rayleigh and Mie scattering. This
 * builtin uses automatic uniforms so the atmophere settings are synced with the
 * state of the Scene, even in other contexts like Model.
 *
 * @name czm_computeAtmosphereColor
 * @glslFunction
 *
 * @param {czm_ray} primaryRay Ray from the origin to sky fragment to in world coords (low precision)
 * @param {vec3} lightDirection Light direction from the sun or other light source.
 * @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
 * @param {vec3} mieColor The Mie scattering color computed by a scattering function
 * @param {float} opacity The opacity computed by a scattering function.
 */
vec4 czm_computeAtmosphereColor(
    czm_ray primaryRay,
    vec3 lightDirection,
    vec3 rayleighColor,
    vec3 mieColor,
    float opacity
) {
    vec3 direction = normalize(primaryRay.direction);

    float cosAngle = dot(direction, lightDirection);
    float cosAngleSq = cosAngle * cosAngle;

    float G = czm_atmosphereMieAnisotropy;
    float GSq = G * G;

    // The Rayleigh phase function.
    float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
    // The Mie phase function.
    float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));

    // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
    vec3 rayleigh = rayleighPhase * rayleighColor;
    vec3 mie = miePhase * mieColor;

    vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;

    return vec4(color, opacity);
}

`;var xQt=y(x(),1),$G=`/**
 * Compute atmosphere scattering for the ground atmosphere and fog. This method
 * uses automatic uniforms so it is always synced with the scene settings.
 *
 * @name czm_computeGroundAtmosphereScattering
 * @glslfunction
 *
 * @param {vec3} positionWC The position of the fragment in world coordinates.
 * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
 * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
 * @param {vec3} mieColor The variable the Mie scattering will be written to.
 * @param {float} opacity The variable the transmittance will be written to.
 */
void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);

    float atmosphereInnerRadius = length(positionWC);

    czm_computeScattering(
        primaryRay,
        length(cameraToPositionWC),
        lightDirection,
        atmosphereInnerRadius,
        rayleighColor,
        mieColor,
        opacity
    );
}
`;var EQt=y(x(),1),eV=`/**
 * Returns a position in model coordinates relative to eye taking into
 * account the current scene mode: 3D, 2D, or Columbus view.
 * <p>
 * This uses standard position attributes, <code>position3DHigh</code>, 
 * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, 
 * and should be used when writing a vertex shader for an {@link Appearance}.
 * </p>
 *
 * @name czm_computePosition
 * @glslFunction
 *
 * @returns {vec4} The position relative to eye.
 *
 * @example
 * vec4 p = czm_computePosition();
 * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
 * gl_Position = czm_modelViewProjectionRelativeToEye * p;
 *
 * @see czm_translateRelativeToEye
 */
vec4 czm_computePosition();
`;var SQt=y(x(),1),tV=`/**
 * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
 * the transmittance value for the ray. This function uses automatic uniforms
 * so the atmosphere settings are always synced with the current scene.
 *
 * @name czm_computeScattering
 * @glslfunction
 *
 * @param {czm_ray} primaryRay The ray from the camera to the position.
 * @param {float} primaryRayLength The length of the primary ray.
 * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
 * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
 * @param {vec3} mieColor The variable the Mie scattering will be written to.
 * @param {float} opacity The variable the transmittance will be written to.
 */
void czm_computeScattering(
    czm_ray primaryRay,
    float primaryRayLength,
    vec3 lightDirection,
    float atmosphereInnerRadius,
    out vec3 rayleighColor,
    out vec3 mieColor,
    out float opacity
) {
    const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
    const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
    const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

    // Initialize the default scattering amounts to 0.
    rayleighColor = vec3(0.0);
    mieColor = vec3(0.0);
    opacity = 0.0;

    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;

    vec3 origin = vec3(0.0);

    // Calculate intersection from the camera to the outer ring of the atmosphere.
    czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);

    // Return empty colors if no intersection with the atmosphere geometry.
    if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
        return;
    }

    // To deal with smaller values of PRIMARY_STEPS (e.g. 4)
    // we implement a split strategy: sky or horizon.
    // For performance reasons, instead of a if/else branch
    // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
    float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
    // Value close to 0.0: close to the horizon
    // Value close to 1.0: above in the sky
    float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));

    // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
    float start_0 = primaryRayAtmosphereIntersect.start;
    primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
    // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
    primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));

    // For the number of ray steps, distinguish inside or outside atmosphere (outer space)
    // (1) from outer space we have to use more ray steps to get a realistic rendering
    // (2) within atmosphere we need fewer steps for faster rendering
    float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
    float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
    int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
    int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

    // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
    float rayPositionLength = primaryRayAtmosphereIntersect.start;
    // (1) Outside the atmosphere: constant rayStepLength
    // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
    float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
    float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
    float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));

    vec3 rayleighAccumulation = vec3(0.0);
    vec3 mieAccumulation = vec3(0.0);
    vec2 opticalDepth = vec2(0.0);
    vec2 heightScale = vec2(czm_atmosphereRayleighScaleHeight, czm_atmosphereMieScaleHeight);

    // Sample positions on the primary ray.
    for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {

        // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
        // loop with non-constant condition, so it has to break early instead
        if (i >= PRIMARY_STEPS) {
            break;
        }

        // Calculate sample position along viewpoint ray.
        vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);

        // Calculate height of sample position above ellipsoid.
        float sampleHeight = length(samplePosition) - atmosphereInnerRadius;

        // Calculate and accumulate density of particles at the sample position.
        vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
        opticalDepth += sampleDensity;

        // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
        czm_ray lightRay = czm_ray(samplePosition, lightDirection);
        czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);

        float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
        float lightPositionLength = 0.0;

        vec2 lightOpticalDepth = vec2(0.0);

        // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
        for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {

            // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
            // loop with non-constant condition, so it has to break early instead
            if (j >= LIGHT_STEPS) {
                break;
            }

            // Calculate sample position along light ray.
            vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);

            // Calculate height of the light sample position above ellipsoid.
            float lightHeight = length(lightPosition) - atmosphereInnerRadius;

            // Calculate density of photons at the light sample position.
            lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;

            // Increment distance on light ray.
            lightPositionLength += lightStepLength;
        }

        // Compute attenuation via the primary ray and the light ray.
        vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));

        // Accumulate the scattering.
        rayleighAccumulation += sampleDensity.x * attenuation;
        mieAccumulation += sampleDensity.y * attenuation;

        // Increment distance on primary ray.
        rayPositionLength += (rayStepLength += rayStepLengthIncrease);
    }

    // Compute the scattering amount.
    rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;
    mieColor = czm_atmosphereMieCoefficient * mieAccumulation;

    // Compute the transmittance i.e. how much light is passing through the atmosphere.
    opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));
}
`;var _Qt=y(x(),1),nV=`/**
 * @private
 */
vec2 cordic(float angle)
{
// Scale the vector by the appropriate factor for the 24 iterations to follow.
    vec2 vector = vec2(6.0725293500888267e-1, 0.0);
// Iteration 1
    float sense = (angle < 0.0) ? -1.0 : 1.0;
 //   float factor = sense * 1.0;  // 2^-0
    mat2 rotation = mat2(1.0, sense, -sense, 1.0);
    vector = rotation * vector;
    angle -= sense * 7.8539816339744828e-1;  // atan(2^-0)
// Iteration 2
    sense = (angle < 0.0) ? -1.0 : 1.0;
    float factor = sense * 5.0e-1;  // 2^-1
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 4.6364760900080609e-1;  // atan(2^-1)
// Iteration 3
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 2.5e-1;  // 2^-2
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 2.4497866312686414e-1;  // atan(2^-2)
// Iteration 4
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.25e-1;  // 2^-3
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.2435499454676144e-1;  // atan(2^-3)
// Iteration 5
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 6.25e-2;  // 2^-4
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 6.2418809995957350e-2;  // atan(2^-4)
// Iteration 6
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.125e-2;  // 2^-5
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.1239833430268277e-2;  // atan(2^-5)
// Iteration 7
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.5625e-2;  // 2^-6
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.5623728620476831e-2;  // atan(2^-6)
// Iteration 8
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 7.8125e-3;  // 2^-7
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 7.8123410601011111e-3;  // atan(2^-7)
// Iteration 9
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.90625e-3;  // 2^-8
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.9062301319669718e-3;  // atan(2^-8)
// Iteration 10
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.953125e-3;  // 2^-9
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.9531225164788188e-3;  // atan(2^-9)
// Iteration 11
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 9.765625e-4;  // 2^-10
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 9.7656218955931946e-4;  // atan(2^-10)
// Iteration 12
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 4.8828125e-4;  // 2^-11
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 4.8828121119489829e-4;  // atan(2^-11)
// Iteration 13
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 2.44140625e-4;  // 2^-12
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 2.4414062014936177e-4;  // atan(2^-12)
// Iteration 14
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.220703125e-4;  // 2^-13
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.2207031189367021e-4;  // atan(2^-13)
// Iteration 15
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 6.103515625e-5;  // 2^-14
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 6.1035156174208773e-5;  // atan(2^-14)
// Iteration 16
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.0517578125e-5;  // 2^-15
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.0517578115526096e-5;  // atan(2^-15)
// Iteration 17
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.52587890625e-5;  // 2^-16
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.5258789061315762e-5;  // atan(2^-16)
// Iteration 18
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 7.62939453125e-6;  // 2^-17
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 7.6293945311019700e-6;  // atan(2^-17)
// Iteration 19
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.814697265625e-6;  // 2^-18
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.8146972656064961e-6;  // atan(2^-18)
// Iteration 20
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.9073486328125e-6;  // 2^-19
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.9073486328101870e-6;  // atan(2^-19)
// Iteration 21
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 9.5367431640625e-7;  // 2^-20
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 9.5367431640596084e-7;  // atan(2^-20)
// Iteration 22
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 4.76837158203125e-7;  // 2^-21
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 4.7683715820308884e-7;  // atan(2^-21)
// Iteration 23
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 2.384185791015625e-7;  // 2^-22
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 2.3841857910155797e-7;  // atan(2^-22)
// Iteration 24
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.1920928955078125e-7;  // 2^-23
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
//    angle -= sense * 1.1920928955078068e-7;  // atan(2^-23)

    return vector;
}

/**
 * Computes the cosine and sine of the provided angle using the CORDIC algorithm.
 *
 * @name czm_cosineAndSine
 * @glslFunction
 *
 * @param {float} angle The angle in radians.
 *
 * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).
 *
 * @example
 * vec2 v = czm_cosineAndSine(czm_piOverSix);
 * float cosine = v.x;
 * float sine = v.y;
 */
vec2 czm_cosineAndSine(float angle)
{
    if (angle < -czm_piOverTwo || angle > czm_piOverTwo)
    {
        if (angle < 0.0)
        {
            return -cordic(angle + czm_pi);
        }
        else
        {
            return -cordic(angle - czm_pi);
        }
    }
    else
    {
        return cordic(angle);
    }
}
`;var RQt=y(x(),1),iV=`/**
 * Decompresses texture coordinates that were packed into a single float.
 *
 * @name czm_decompressTextureCoordinates
 * @glslFunction
 *
 * @param {float} encoded The compressed texture coordinates.
 * @returns {vec2} The decompressed texture coordinates.
 */
 vec2 czm_decompressTextureCoordinates(float encoded)
 {
    float temp = encoded / 4096.0;
    float xZeroTo4095 = floor(temp);
    float stx = xZeroTo4095 / 4095.0;
    float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;
    return vec2(stx, sty);
 }
`;var VQt=y(x(),1),oV=`// emulated noperspective
#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
out float v_WindowZ;
#endif

/**
 * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.
 * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, 
 * capping the shadow volume. More information here: 
 * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.
 *
 * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring 
 * no geometry gets clipped by setting the clip space z value to 0.0 and then
 * sending the unaltered screen space z value (using emulated noperspective
 * interpolation) to the frag shader where it is clamped to [0,1] and then
 * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:
 * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.
 *
 * When GL_EXT_frag_depth is not available, which is the case on some mobile 
 * devices, we must attempt to fix this only in the vertex shader. 
 * The approach is to clamp the z value to the far plane, which closes the 
 * shadow volume but also distorts the geometry, so there can still be artifacts
 * on frustum seams.
 *
 * @name czm_depthClamp
 * @glslFunction
 *
 * @param {vec4} coords The vertex in clip coordinates.
 * @returns {vec4} The modified vertex.
 *
 * @example
 * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));
 *
 * @see czm_writeDepthClamp
 */
vec4 czm_depthClamp(vec4 coords)
{
#ifndef LOG_DEPTH
#if __VERSION__ == 300 || defined(GL_EXT_frag_depth)
    v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;
    coords.z = 0.0;
#else
    coords.z = min(coords.z, coords.w);
#endif
#endif
    return coords;
}
`;var WQt=y(x(),1),rV=`/**
 * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system 
 * to eye coordinates.  In east-north-up coordinates, x points east, y points north, and z points along the 
 * surface normal.  East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.
 * <br /><br />
 * The ellipsoid is assumed to be centered at the model coordinate's origin.
 *
 * @name czm_eastNorthUpToEyeCoordinates
 * @glslFunction
 *
 * @param {vec3} positionMC The position on the ellipsoid in model coordinates.
 * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.
 *
 * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.
 *
 * @example
 * // Transform a vector defined in the east-north-up coordinate 
 * // system, (0, 0, 1) which is the surface normal, to eye 
 * // coordinates.
 * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
 * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);
 */
mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
{
    vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));  // normalized surface tangent in model coordinates
    vec3 tangentEC = normalize(czm_normal3D * tangentMC);                // normalized surface tangent in eye coordinates
    vec3 bitangentEC = normalize(cross(normalEC, tangentEC));            // normalized surface bitangent in eye coordinates

    return mat3(
        tangentEC.x,   tangentEC.y,   tangentEC.z,
        bitangentEC.x, bitangentEC.y, bitangentEC.z,
        normalEC.x,    normalEC.y,    normalEC.z);
}
`;var BQt=y(x(),1),sV=`/**
 * DOC_TBA
 *
 * @name czm_ellipsoidContainsPoint
 * @glslFunction
 *
 */
bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)
{
    vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;
    return (dot(scaled, scaled) <= 1.0);
}
`;var YQt=y(x(),1),aV=`/**
 * Approximate uv coordinates based on the ellipsoid normal.
 *
 * @name czm_ellipsoidTextureCoordinates
 * @glslFunction
 */
vec2 czm_ellipsoidTextureCoordinates(vec3 normal)
{
    return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
}
`;var XQt=y(x(),1),cV=`/**
 * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>
 * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs
 * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,
 * <code>vec3</code>s, or <code>vec4</code>s.
 *
 * @name czm_equalsEpsilon
 * @glslFunction
 *
 * @param {} left The first vector.
 * @param {} right The second vector.
 * @param {float} epsilon The epsilon to use for equality testing.
 * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.
 *
 * @example
 * // GLSL declarations
 * bool czm_equalsEpsilon(float left, float right, float epsilon);
 * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);
 * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);
 * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);
 */
bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {
    return all(lessThanEqual(abs(left - right), vec4(epsilon)));
}

bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {
    return all(lessThanEqual(abs(left - right), vec3(epsilon)));
}

bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {
    return all(lessThanEqual(abs(left - right), vec2(epsilon)));
}

bool czm_equalsEpsilon(float left, float right, float epsilon) {
    return (abs(left - right) <= epsilon);
}
`;var MQt=y(x(),1),lV=`/**
 * DOC_TBA
 *
 * @name czm_eyeOffset
 * @glslFunction
 *
 * @param {vec4} positionEC DOC_TBA.
 * @param {vec3} eyeOffset DOC_TBA.
 *
 * @returns {vec4} DOC_TBA.
 */
vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
{
    // This equation is approximate in x and y.
    vec4 p = positionEC;
    vec4 zEyeOffset = normalize(p) * eyeOffset.z;
    p.xy += eyeOffset.xy + zEyeOffset.xy;
    p.z += zEyeOffset.z;
    return p;
}
`;var DQt=y(x(),1),dV=`/**
 * Transforms a position from eye to window coordinates.  The transformation
 * from eye to clip coordinates is done using {@link czm_projection}.
 * The transform from normalized device coordinates to window coordinates is
 * done using {@link czm_viewportTransformation}, which assumes a depth range
 * of <code>near = 0</code> and <code>far = 1</code>.
 * <br /><br />
 * This transform is useful when there is a need to manipulate window coordinates
 * in a vertex shader as done by {@link BillboardCollection}.
 *
 * @name czm_eyeToWindowCoordinates
 * @glslFunction
 *
 * @param {vec4} position The position in eye coordinates to transform.
 *
 * @returns {vec4} The transformed position in window coordinates.
 *
 * @see czm_modelToWindowCoordinates
 * @see czm_projection
 * @see czm_viewportTransformation
 * @see BillboardCollection
 *
 * @example
 * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
 */
vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
{
    vec4 q = czm_projection * positionEC;                        // clip coordinates
    q.xyz /= q.w;                                                // normalized device coordinates
    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
    return q;
}
`;var kQt=y(x(),1),uV=`/**
 * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.
 *
 * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on
 * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
 * Adapted from ShaderFastLibs under MIT License.
 *
 * Chosen for the following characteristics over range [0, 1]:
 * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)
 * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)
 *
 * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);
 * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.
 *
 * @name czm_fastApproximateAtan
 * @glslFunction
 *
 * @param {float} x Value between 0 and 1 inclusive.
 *
 * @returns {float} Approximation of atan(x)
 */
float czm_fastApproximateAtan(float x) {
    return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
}

/**
 * Approximation of atan2.
 *
 * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html
 * However, we replaced their atan curve with Michael Drobot's (see above).
 *
 * @name czm_fastApproximateAtan
 * @glslFunction
 *
 * @param {float} x Value between -1 and 1 inclusive.
 * @param {float} y Value between -1 and 1 inclusive.
 *
 * @returns {float} Approximation of atan2(x, y)
 */
float czm_fastApproximateAtan(float x, float y) {
    // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.
    // So range-reduce using abs and by flipping whether x or y is on top.
    float t = abs(x); // t used as swap and atan result.
    float opposite = abs(y);
    float adjacent = max(t, opposite);
    opposite = min(t, opposite);

    t = czm_fastApproximateAtan(opposite / adjacent);

    // Undo range reduction
    t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
    t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
    t = czm_branchFreeTernary(y < 0.0, -t, t);
    return t;
}
`;var OQt=y(x(),1),mV=`/**
 * Gets the color with fog at a distance from the camera.
 *
 * @name czm_fog
 * @glslFunction
 *
 * @param {float} distanceToCamera The distance to the camera in meters.
 * @param {vec3} color The original color.
 * @param {vec3} fogColor The color of the fog.
 *
 * @returns {vec3} The color adjusted for fog at the distance from the camera.
 */
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)
{
    float scalar = distanceToCamera * czm_fogDensity;
    float fog = 1.0 - exp(-(scalar * scalar));
    return mix(color, fogColor, fog);
}

/**
 * Gets the color with fog at a distance from the camera.
 *
 * @name czm_fog
 * @glslFunction
 *
 * @param {float} distanceToCamera The distance to the camera in meters.
 * @param {vec3} color The original color.
 * @param {vec3} fogColor The color of the fog.
 * @param {float} fogModifierConstant A constant to modify the appearance of fog.
 *
 * @returns {vec3} The color adjusted for fog at the distance from the camera.
 */
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)
{
    float scalar = distanceToCamera * czm_fogDensity;
    float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));
    return mix(color, fogColor, fog);
}
`;var HQt=y(x(),1),hV=`/**
 * Converts a color from RGB space to linear space.
 *
 * @name czm_gammaCorrect
 * @glslFunction
 *
 * @param {vec3} color The color in RGB space.
 * @returns {vec3} The color in linear space.
 */
vec3 czm_gammaCorrect(vec3 color) {
#ifdef HDR
    color = pow(color, vec3(czm_gamma));
#endif
    return color;
}

vec4 czm_gammaCorrect(vec4 color) {
#ifdef HDR
    color.rgb = pow(color.rgb, vec3(czm_gamma));
#endif
    return color;
}
`;var JQt=y(x(),1),fV=`/**
 * DOC_TBA
 *
 * @name czm_geodeticSurfaceNormal
 * @glslFunction
 *
 * @param {vec3} positionOnEllipsoid DOC_TBA
 * @param {vec3} ellipsoidCenter DOC_TBA
 * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA
 * 
 * @returns {vec3} DOC_TBA.
 */
vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
{
    return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
}
`;var qQt=y(x(),1),pV=`/**
 * An czm_material with default values. Every material's czm_getMaterial
 * should use this default material as a base for the material it returns.
 * The default normal value is given by materialInput.normalEC.
 *
 * @name czm_getDefaultMaterial
 * @glslFunction
 *
 * @param {czm_materialInput} input The input used to construct the default material.
 *
 * @returns {czm_material} The default material.
 *
 * @see czm_materialInput
 * @see czm_material
 * @see czm_getMaterial
 */
czm_material czm_getDefaultMaterial(czm_materialInput materialInput)
{
    czm_material material;
    material.diffuse = vec3(0.0);
    material.specular = 0.0;
    material.shininess = 1.0;
    material.normal = materialInput.normalEC;
    material.emission = vec3(0.0);
    material.alpha = 1.0;
    return material;
}
`;var e5t=y(x(),1),AV=`/**
 * Select which direction vector to use for dynamic atmosphere lighting based on an enum value
 *
 * @name czm_getDynamicAtmosphereLightDirection
 * @glslfunction
 * @see DynamicAtmosphereLightingType.js
 *
 * @param {vec3} positionWC the position of the vertex/fragment in world coordinates. This is normalized and returned when dynamic lighting is turned off.
 * @param {float} lightEnum The enum value for selecting between light sources.
 * @return {vec3} The normalized light direction vector. Depending on the enum value, it is either positionWC, czm_lightDirectionWC or czm_sunDirectionWC
 */
vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) {
    const float NONE = 0.0;
    const float SCENE_LIGHT = 1.0;
    const float SUNLIGHT = 2.0;

    vec3 lightDirection =
        positionWC * float(lightEnum == NONE) +
        czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) +
        czm_sunDirectionWC * float(lightEnum == SUNLIGHT);
    return normalize(lightDirection);
}
`;var n5t=y(x(),1),gV=`/**
 * Calculates the intensity of diffusely reflected light.
 *
 * @name czm_getLambertDiffuse
 * @glslFunction
 *
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 *
 * @returns {float} The intensity of the diffuse reflection.
 *
 * @see czm_phong
 *
 * @example
 * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
 * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
 * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
 */
float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
{
    return max(dot(lightDirectionEC, normalEC), 0.0);
}
`;var o5t=y(x(),1),bV=`/**
 * Calculates the specular intensity of reflected light.
 *
 * @name czm_getSpecular
 * @glslFunction
 *
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 * @param {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.
 *
 * @returns {float} The intensity of the specular highlight.
 *
 * @see czm_phong
 *
 * @example
 * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
 * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
 * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
 */
float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
{
    vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
    float specular = max(dot(toReflectedLight, toEyeEC), 0.0);

    // pow has undefined behavior if both parameters <= 0.
    // Prevent this by making sure shininess is at least czm_epsilon2.
    return pow(specular, max(shininess, czm_epsilon2));
}
`;var s5t=y(x(),1),yV=`/**
 * @private
 */
vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
{
    float cosAngle = cos(angleInRadians);
    float sinAngle = sin(angleInRadians);

    // time dependent sampling directions
    vec2 s0 = vec2(1.0/17.0, 0.0);
    vec2 s1 = vec2(-1.0/29.0, 0.0);
    vec2 s2 = vec2(1.0/101.0, 1.0/59.0);
    vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);

    // rotate sampling direction by specified angle
    s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));
    s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));
    s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));
    s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));

    vec2 uv0 = (uv/103.0) + (time * s0);
    vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);
    vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);
    vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);

    uv0 = fract(uv0);
    uv1 = fract(uv1);
    uv2 = fract(uv2);
    uv3 = fract(uv3);
    vec4 noise = (texture(normalMap, uv0)) +
                 (texture(normalMap, uv1)) +
                 (texture(normalMap, uv2)) +
                 (texture(normalMap, uv3));

    // average and scale to between -1 and 1
    return ((noise / 4.0) - 0.5) * 2.0;
}
`;var c5t=y(x(),1),xV=`/**
 * Adjusts the hue of a color.
 * 
 * @name czm_hue
 * @glslFunction
 * 
 * @param {vec3} rgb The color.
 * @param {float} adjustment The amount to adjust the hue of the color in radians.
 *
 * @returns {float} The color with the hue adjusted.
 *
 * @example
 * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)
 */
vec3 czm_hue(vec3 rgb, float adjustment)
{
    const mat3 toYIQ = mat3(0.299,     0.587,     0.114,
                            0.595716, -0.274453, -0.321263,
                            0.211456, -0.522591,  0.311135);
    const mat3 toRGB = mat3(1.0,  0.9563,  0.6210,
                            1.0, -0.2721, -0.6474,
                            1.0, -1.107,   1.7046);
    
    vec3 yiq = toYIQ * rgb;
    float hue = atan(yiq.z, yiq.y) + adjustment;
    float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);
    
    vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));
    return toRGB * color;
}
`;var d5t=y(x(),1),CV=`/**
 * Converts a color in linear space to RGB space.
 *
 * @name czm_inverseGamma
 * @glslFunction
 *
 * @param {vec3} color The color in linear space.
 * @returns {vec3} The color in RGB space.
 */
vec3 czm_inverseGamma(vec3 color) {
    return pow(color, vec3(1.0 / czm_gamma));
}
`;var m5t=y(x(),1),EV=`/**
 * Determines if a time interval is empty.
 *
 * @name czm_isEmpty
 * @glslFunction 
 * 
 * @param {czm_raySegment} interval The interval to test.
 * 
 * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
 *
 * @example
 * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true
 * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
 * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
 */
bool czm_isEmpty(czm_raySegment interval)
{
    return (interval.stop < 0.0);
}
`;var f5t=y(x(),1),TV=`/**
 * Determines if a time interval is empty.
 *
 * @name czm_isFull
 * @glslFunction 
 * 
 * @param {czm_raySegment} interval The interval to test.
 * 
 * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
 *
 * @example
 * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true
 * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
 * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
 */
bool czm_isFull(czm_raySegment interval)
{
    return (interval.start == 0.0 && interval.stop == czm_infinity);
}
`;var A5t=y(x(),1),SV=`/**
 * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.
 *
 * @name czm_latitudeToWebMercatorFraction
 * @glslFunction
 *
 * @param {float} latitude The geodetic latitude, in radians.
 * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.
 * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.
 *
 * @returns {float} The fraction of the rectangle at which the latitude occurs.  If the latitude is the southern
 *          boundary of the rectangle, the return value will be zero.  If it is the northern boundary, the return
 *          value will be 1.0.  Latitudes in between are mapped according to the Web Mercator projection.
 */ 
float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)
{
    float sinLatitude = sin(latitude);
    float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));
    
    return (mercatorY - southMercatorY) * oneOverMercatorHeight;
}
`;var b5t=y(x(),1),IV=`/**
 * Computes distance from an point in 2D to a line in 2D.
 *
 * @name czm_lineDistance
 * @glslFunction
 *
 * param {vec2} point1 A point along the line.
 * param {vec2} point2 A point along the line.
 * param {vec2} point A point that may or may not be on the line.
 * returns {float} The distance from the point to the line.
 */
float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {
    return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);
}
`;var x5t=y(x(),1),_V=`/**
 * Converts a linear RGB color to an sRGB color.
 *
 * @param {vec3|vec4} linearIn The color in linear color space.
 * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.
 */
vec3 czm_linearToSrgb(vec3 linearIn) 
{
    return pow(linearIn, vec3(1.0/2.2));
}

vec4 czm_linearToSrgb(vec4 linearIn) 
{
    vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
    return vec4(srgbOut, linearIn.a);
}
`;var E5t=y(x(),1),ZV=`/**
 * Computes the luminance of a color. 
 *
 * @name czm_luminance
 * @glslFunction
 *
 * @param {vec3} rgb The color.
 * 
 * @returns {float} The luminance.
 *
 * @example
 * float light = czm_luminance(vec3(0.0)); // 0.0
 * float dark = czm_luminance(vec3(1.0));  // ~1.0 
 */
float czm_luminance(vec3 rgb)
{
    // Algorithm from Chapter 10 of Graphics Shaders.
    const vec3 W = vec3(0.2125, 0.7154, 0.0721);
    return dot(rgb, W);
}
`;var S5t=y(x(),1),RV=`/**
 * Find the maximum component of a vector.
 *
 * @name czm_maximumComponent
 * @glslFunction
 *
 * @param {vec2|vec3|vec4} v The input vector.
 * @returns {float} The value of the largest component.
 */
float czm_maximumComponent(vec2 v)
{
    return max(v.x, v.y);
}
float czm_maximumComponent(vec3 v)
{
    return max(max(v.x, v.y), v.z);
}
float czm_maximumComponent(vec4 v)
{
    return max(max(max(v.x, v.y), v.z), v.w);
}
`;var _5t=y(x(),1),GV=`/**
 * Computes the size of a pixel in meters at a distance from the eye.
 * <p>
 * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.
 * </p>
 * @name czm_metersPerPixel
 * @glslFunction
 *
 * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
 * @param {float} pixelRatio The scaling factor from pixel space to coordinate space
 *
 * @returns {float} The meters per pixel at positionEC.
 */
float czm_metersPerPixel(vec4 positionEC, float pixelRatio)
{
    float width = czm_viewport.z;
    float height = czm_viewport.w;
    float pixelWidth;
    float pixelHeight;

    float top = czm_frustumPlanes.x;
    float bottom = czm_frustumPlanes.y;
    float left = czm_frustumPlanes.z;
    float right = czm_frustumPlanes.w;

    if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)
    {
        float frustumWidth = right - left;
        float frustumHeight = top - bottom;
        pixelWidth = frustumWidth / width;
        pixelHeight = frustumHeight / height;
    }
    else
    {
        float distanceToPixel = -positionEC.z;
        float inverseNear = 1.0 / czm_currentFrustum.x;
        float tanTheta = top * inverseNear;
        pixelHeight = 2.0 * distanceToPixel * tanTheta / height;
        tanTheta = right * inverseNear;
        pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
    }

    return max(pixelWidth, pixelHeight) * pixelRatio;
}

/**
 * Computes the size of a pixel in meters at a distance from the eye.
 * <p>
 * Use this version when scaling by pixel ratio.
 * </p>
 * @name czm_metersPerPixel
 * @glslFunction
 *
 * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
 *
 * @returns {float} The meters per pixel at positionEC.
 */
float czm_metersPerPixel(vec4 positionEC)
{
    return czm_metersPerPixel(positionEC, czm_pixelRatio);
}
`;var R5t=y(x(),1),VV=`/**
 * Transforms a position from model to window coordinates.  The transformation
 * from model to clip coordinates is done using {@link czm_modelViewProjection}.
 * The transform from normalized device coordinates to window coordinates is
 * done using {@link czm_viewportTransformation}, which assumes a depth range
 * of <code>near = 0</code> and <code>far = 1</code>.
 * <br /><br />
 * This transform is useful when there is a need to manipulate window coordinates
 * in a vertex shader as done by {@link BillboardCollection}.
 * <br /><br />
 * This function should not be confused with {@link czm_viewportOrthographic},
 * which is an orthographic projection matrix that transforms from window 
 * coordinates to clip coordinates.
 *
 * @name czm_modelToWindowCoordinates
 * @glslFunction
 *
 * @param {vec4} position The position in model coordinates to transform.
 *
 * @returns {vec4} The transformed position in window coordinates.
 *
 * @see czm_eyeToWindowCoordinates
 * @see czm_modelViewProjection
 * @see czm_viewportTransformation
 * @see czm_viewportOrthographic
 * @see BillboardCollection
 *
 * @example
 * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);
 */
vec4 czm_modelToWindowCoordinates(vec4 position)
{
    vec4 positionEC = czm_modelView * position;
    vec4 q = czm_projection * positionEC;
    q.xyz /= q.w;                                                // normalized device coordinates
    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
    return q;
}
`;var V5t=y(x(),1),LV=`/**
 * DOC_TBA
 *
 * @name czm_multiplyWithColorBalance
 * @glslFunction
 */
vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
{
    // Algorithm from Chapter 10 of Graphics Shaders.
    const vec3 W = vec3(0.2125, 0.7154, 0.0721);
    
    vec3 target = left * right;
    float leftLuminance = dot(left, W);
    float rightLuminance = dot(right, W);
    float targetLuminance = dot(target, W);
    
    return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;
}
`;var W5t=y(x(),1),WV=`/**
 * Computes a value that scales with distance.  The scaling is clamped at the near and
 * far distances, and does not extrapolate.  This function works with the
 * {@link NearFarScalar} JavaScript class.
 *
 * @name czm_nearFarScalar
 * @glslFunction
 *
 * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).
 * @param {float} cameraDistSq The square of the current distance from the camera.
 *
 * @returns {float} The value at this distance.
 */
float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)
{
    float valueAtMin = nearFarScalar.y;
    float valueAtMax = nearFarScalar.w;
    float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;
    float farDistanceSq = nearFarScalar.z * nearFarScalar.z;

    float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);

    t = pow(clamp(t, 0.0, 1.0), 0.2);

    return mix(valueAtMin, valueAtMax, t);
}
`;var B5t=y(x(),1),FV=` /**
  * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
  * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  *
  * @name czm_octDecode
  * @param {vec2} encoded The oct-encoded, unit-length vector
  * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
  * @returns {vec3} The decoded and normalized vector
  */
  vec3 czm_octDecode(vec2 encoded, float range)
  {
      if (encoded.x == 0.0 && encoded.y == 0.0) {
          return vec3(0.0, 0.0, 0.0);
      }

     encoded = encoded / range * 2.0 - 1.0;
     vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
     if (v.z < 0.0)
     {
         v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
     }

     return normalize(v);
  }

/**
 * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
 * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
 * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
 *
 * @name czm_octDecode
 * @param {vec2} encoded The oct-encoded, unit-length vector
 * @returns {vec3} The decoded and normalized vector
 */
 vec3 czm_octDecode(vec2 encoded)
 {
    return czm_octDecode(encoded, 255.0);
 }

 /**
 * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.
 * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
 * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
 *
 * @name czm_octDecode
 * @param {float} encoded The oct-encoded, unit-length vector
 * @returns {vec3} The decoded and normalized vector
 */
 vec3 czm_octDecode(float encoded)
 {
    float temp = encoded / 256.0;
    float x = floor(temp);
    float y = (temp - x) * 256.0;
    return czm_octDecode(vec2(x, y));
 }

/**
 * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.
 * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
 * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
 *
 * @name czm_octDecode
 * @param {vec2} encoded The packed oct-encoded, unit-length vectors.
 * @param {vec3} vector1 One decoded and normalized vector.
 * @param {vec3} vector2 One decoded and normalized vector.
 * @param {vec3} vector3 One decoded and normalized vector.
 */
  void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
 {
    float temp = encoded.x / 65536.0;
    float x = floor(temp);
    float encodedFloat1 = (temp - x) * 65536.0;

    temp = encoded.y / 65536.0;
    float y = floor(temp);
    float encodedFloat2 = (temp - y) * 65536.0;

    vector1 = czm_octDecode(encodedFloat1);
    vector2 = czm_octDecode(encodedFloat2);
    vector3 = czm_octDecode(vec2(x, y));
 }

`;var Y5t=y(x(),1),BV=`/**
 * Packs a depth value into a vec4 that can be represented by unsigned bytes.
 *
 * @name czm_packDepth
 * @glslFunction
 *
 * @param {float} depth The floating-point depth.
 * @returns {vec4} The packed depth.
 */
vec4 czm_packDepth(float depth)
{
    // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
    vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;
    enc = fract(enc);
    enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
    return enc;
}
`;var X5t=y(x(),1),wV=`vec3 lambertianDiffuse(vec3 diffuseColor)
{
    return diffuseColor / czm_pi;
}

vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
{
    float versine = 1.0 - VdotH;
    // pow(versine, 5.0) is slow. See https://stackoverflow.com/a/68793086/10082269
    float versineSquared = versine * versine;
    return f0 + (f90 - f0) * versineSquared * versineSquared * versine;
}

#ifdef USE_ANISOTROPY
/**
 * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
 * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
 * @param {vec3} lightDirection The direction from the fragment to the light source, transformed to tangent-bitangent-normal coordinates
 * @param {vec3} viewDirection The direction from the fragment to the camera, transformed to tangent-bitangent-normal coordinates
 */
float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection)
{
    vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0);
    float GGXV = lightDirection.z * length(roughnessScale * viewDirection);
    float GGXL = viewDirection.z * length(roughnessScale * lightDirection);
    float v = 0.5 / (GGXV + GGXL);
    return clamp(v, 0.0, 1.0);
}

/**
 * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
 * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
 * @param {vec3} halfwayDirection The unit vector halfway between light and view directions, transformed to tangent-bitangent-normal coordinates
 */
float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection)
{
    float roughnessSquared = bitangentRoughness * tangentialRoughness;
    vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared);
    float w2 = roughnessSquared / dot(f, f);
    return roughnessSquared * w2 * w2 / czm_pi;
}
#endif

/**
 * Estimate the geometric self-shadowing of the microfacets in a surface,
 * using the Smith Joint GGX visibility function.
 * Note: Vis = G / (4 * NdotL * NdotV)
 * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
 * see Real-Time Rendering. Page 331 to 336.
 * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
 *
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
 * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
 */
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
{
    float alphaRoughnessSq = alphaRoughness * alphaRoughness;

    float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
    float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);

    float GGX = GGXV + GGXL;
    if (GGX > 0.0)
    {
        return 0.5 / GGX;
    }
    return 0.0;
}

/**
 * Estimate the fraction of the microfacets in a surface that are aligned with 
 * the halfway vector, which is aligned halfway between the directions from
 * the fragment to the camera and from the fragment to the light source.
 *
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @param {float} NdotH The cosine of the angle between the surface normal and the halfway vector.
 * @return {float} The fraction of microfacets aligned to the halfway vector.
 */
float GGX(float alphaRoughness, float NdotH)
{
    float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
    float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0;
    return alphaRoughnessSquared / (czm_pi * f * f);
}

/**
 * Compute the strength of the specular reflection due to direct lighting.
 *
 * @param {vec3} normal The surface normal.
 * @param {vec3} lightDirection The unit vector pointing from the fragment to the light source.
 * @param {vec3} viewDirection The unit vector pointing from the fragment to the camera.
 * @param {vec3} halfwayDirection The unit vector pointing from the fragment to halfway between the light source and the camera.
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @return {float} The strength of the specular reflection.
 */
float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness)
{
    float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0);
    float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
    float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
    float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0);
    float D = GGX(alphaRoughness, NdotH);
    return G * D;
}

/**
 * Compute the diffuse and specular contributions using physically based
 * rendering. This function only handles direct lighting.
 * <p>
 * This function only handles the lighting calculations. Metallic/roughness
 * and specular/glossy must be handled separately. See {@MaterialStageFS}
 * </p>
 *
 * @name czm_pbrLighting
 * @glslFunction
 *
 * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position
 * @param {vec3} normalEC The surface normal in eye coordinates
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {czm_modelMaterial} The material properties.
 * @return {vec3} The computed HDR color
 */
vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material)
{
    vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC);
    float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0);
    float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0);

    vec3 f0 = material.specular;
    float reflectance = czm_maximumComponent(f0);
    // Typical dielectrics will have reflectance 0.04, so f90 will be 1.0.
    // In this case, at grazing angle, all incident energy is reflected.
    vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
    vec3 F = fresnelSchlick2(f0, f90, VdotH);

    #if defined(USE_SPECULAR)
        F *= material.specularWeight;
    #endif

    float alphaRoughness = material.roughness * material.roughness;
    #ifdef USE_ANISOTROPY
        mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC);
        vec3 lightDirection = lightDirectionEC * tbn;
        vec3 viewDirection = viewDirectionEC * tbn;
        vec3 halfwayDirection = halfwayDirectionEC * tbn;
        float anisotropyStrength = material.anisotropyStrength;
        float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength);
        float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0);
        float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection);
        float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection);
        vec3 specularContribution = F * G * D;
    #else
        float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness);
        vec3 specularContribution = F * specularStrength;
    #endif

    vec3 diffuseColor = material.diffuse;
    // F here represents the specular contribution
    vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);

    // Lo = (diffuse + specular) * Li * NdotL
    return (diffuseContribution + specularContribution) * NdotL;
}
`;var M5t=y(x(),1),YV=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral

// Input color is non-negative and resides in the Linear Rec. 709 color space.
// Output color is also Linear Rec. 709, but in the [0, 1] range.

vec3 czm_pbrNeutralTonemapping(vec3 color) {
    const float startCompression = 0.8 - 0.04;
    const float desaturation = 0.15;

    float x = min(color.r, min(color.g, color.b));
    float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04);
    color -= offset;

    float peak = max(color.r, max(color.g, color.b));
    if (peak < startCompression) return color;

    const float d = 1.0 - startCompression;
    float newPeak = 1.0 - d * d / (peak + d - startCompression);
    color *= newPeak / peak;

    float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);
    return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g);
}
`;var D5t=y(x(),1),NV=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)
{
    return czm_getLambertDiffuse(lightDirectionEC, material.normal);
}

float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)
{
    return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);
}

/**
 * Computes a color using the Phong lighting model.
 *
 * @name czm_phong
 * @glslFunction
 *
 * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.
 * @param {czm_material} material The fragment's material.
 *
 * @returns {vec4} The computed color.
 *
 * @example
 * vec3 positionToEyeEC = // ...
 * czm_material material = // ...
 * vec3 lightDirectionEC = // ...
 * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);
 *
 * @see czm_getMaterial
 */
vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
    // Diffuse from directional light sources at eye (for top-down)
    float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
    if (czm_sceneMode == czm_sceneMode3D) {
        // (and horizon views in 3D)
        diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
    }

    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);

    // Temporary workaround for adding ambient.
    vec3 materialDiffuse = material.diffuse * 0.5;

    vec3 ambient = materialDiffuse;
    vec3 color = ambient + material.emission;
    color += materialDiffuse * diffuse * czm_lightColor;
    color += material.specular * specular * czm_lightColor;

    return vec4(color, material.alpha);
}

vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
    float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);
    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);

    vec3 ambient = vec3(0.0);
    vec3 color = ambient + material.emission;
    color += material.diffuse * diffuse * czm_lightColor;
    color += material.specular * specular * czm_lightColor;

    return vec4(color, material.alpha);
}
`;var k5t=y(x(),1),XV=`/**
 * Computes distance from a point to a plane.
 *
 * @name czm_planeDistance
 * @glslFunction
 *
 * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js
 * param {vec3} point A point in the same space as the plane.
 * returns {float} The distance from the point to the plane.
 */
float czm_planeDistance(vec4 plane, vec3 point) {
    return (dot(plane.xyz, point) + plane.w);
}

/**
 * Computes distance from a point to a plane.
 *
 * @name czm_planeDistance
 * @glslFunction
 *
 * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js
 * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js
 * param {vec3} point A point in the same space as the plane.
 * returns {float} The distance from the point to the plane.
 */
float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
    return (dot(planeNormal, point) + planeDistance);
}
`;var O5t=y(x(),1),PV=`/**
 * Computes the point along a ray at the given time.  <code>time</code> can be positive, negative, or zero.
 *
 * @name czm_pointAlongRay
 * @glslFunction
 *
 * @param {czm_ray} ray The ray to compute the point along.
 * @param {float} time The time along the ray.
 * 
 * @returns {vec3} The point along the ray at the given time.
 * 
 * @example
 * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction
 * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)
 */
vec3 czm_pointAlongRay(czm_ray ray, float time)
{
    return ray.origin + (time * ray.direction);
}
`;var H5t=y(x(),1),MV=`/**
 * DOC_TBA
 *
 * @name czm_rayEllipsoidIntersectionInterval
 * @glslFunction
 */
czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
{
   // ray and ellipsoid center in eye coordinates.  radii in model coordinates.
    vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;
    vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;

    q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;

    float q2 = dot(q, q);
    float qw = dot(q, w);

    if (q2 > 1.0) // Outside ellipsoid.
    {
        if (qw >= 0.0) // Looking outward or tangent (0 intersections).
        {
            return czm_emptyRaySegment;
        }
        else // qw < 0.0.
        {
            float qw2 = qw * qw;
            float difference = q2 - 1.0; // Positively valued.
            float w2 = dot(w, w);
            float product = w2 * difference;

            if (qw2 < product) // Imaginary roots (0 intersections).
            {
                return czm_emptyRaySegment;
            }
            else if (qw2 > product) // Distinct roots (2 intersections).
            {
                float discriminant = qw * qw - product;
                float temp = -qw + sqrt(discriminant); // Avoid cancellation.
                float root0 = temp / w2;
                float root1 = difference / temp;
                if (root0 < root1)
                {
                    czm_raySegment i = czm_raySegment(root0, root1);
                    return i;
                }
                else
                {
                    czm_raySegment i = czm_raySegment(root1, root0);
                    return i;
                }
            }
            else // qw2 == product.  Repeated roots (2 intersections).
            {
                float root = sqrt(difference / w2);
                czm_raySegment i = czm_raySegment(root, root);
                return i;
            }
        }
    }
    else if (q2 < 1.0) // Inside ellipsoid (2 intersections).
    {
        float difference = q2 - 1.0; // Negatively valued.
        float w2 = dot(w, w);
        float product = w2 * difference; // Negatively valued.
        float discriminant = qw * qw - product;
        float temp = -qw + sqrt(discriminant); // Positively valued.
        czm_raySegment i = czm_raySegment(0.0, temp / w2);
        return i;
    }
    else // q2 == 1.0. On ellipsoid.
    {
        if (qw < 0.0) // Looking inward.
        {
            float w2 = dot(w, w);
            czm_raySegment i = czm_raySegment(0.0, -qw / w2);
            return i;
        }
        else // qw >= 0.0.  Looking outward or tangent.
        {
            return czm_emptyRaySegment;
        }
    }
}
`;var J5t=y(x(),1),UV=`/**
 * Compute the intersection interval of a ray with a sphere.
 *
 * @name czm_raySphereIntersectionInterval
 * @glslFunction
 *
 * @param {czm_ray} ray The ray.
 * @param {vec3} center The center of the sphere.
 * @param {float} radius The radius of the sphere.
 * @return {czm_raySegment} The intersection interval of the ray with the sphere.
 */
czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)
{
    vec3 o = ray.origin;
    vec3 d = ray.direction;

    vec3 oc = o - center;

    float a = dot(d, d);
    float b = 2.0 * dot(d, oc);
    float c = dot(oc, oc) - (radius * radius);

    float det = (b * b) - (4.0 * a * c);

    if (det < 0.0) {
        return czm_emptyRaySegment;
    }

    float sqrtDet = sqrt(det);

    float t0 = (-b - sqrtDet) / (2.0 * a);
    float t1 = (-b + sqrtDet) / (2.0 * a);

    czm_raySegment result = czm_raySegment(t0, t1);
    return result;
}
`;var q5t=y(x(),1),DV=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
    return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var eOt=y(x(),1),vV=`/**
 * Reads a value previously transformed with {@link czm_writeNonPerspective}
 * by dividing it by \`w\`, the value used in the perspective divide.
 * This function is intended to be called in a fragment shader to access a
 * \`varying\` that should not be subject to perspective interpolation.
 * For example, screen-space texture coordinates. The value should have been
 * previously written in the vertex shader with a call to
 * {@link czm_writeNonPerspective}.
 *
 * @name czm_readNonPerspective
 * @glslFunction
 *
 * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.
 * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`.
 * @returns {float|vec2|vec3|vec4} The usable value.
 */
float czm_readNonPerspective(float value, float oneOverW) {
    return value * oneOverW;
}

vec2 czm_readNonPerspective(vec2 value, float oneOverW) {
    return value * oneOverW;
}

vec3 czm_readNonPerspective(vec3 value, float oneOverW) {
    return value * oneOverW;
}

vec4 czm_readNonPerspective(vec4 value, float oneOverW) {
    return value * oneOverW;
}
`;var nOt=y(x(),1),kV=`float czm_reverseLogDepth(float logZ)
{
#ifdef LOG_DEPTH
    float near = czm_currentFrustum.x;
    float far = czm_currentFrustum.y;
    float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;
    float depthFromNear = exp2(log2Depth) - 1.0;
    return far * (1.0 - near / (depthFromNear + near)) / (far - near);
#endif
    return logZ;
}
`;var oOt=y(x(),1),QV=`/**
 * Round a floating point value. This function exists because round() doesn't
 * exist in GLSL 1.00. 
 *
 * @param {float|vec2|vec3|vec4} value The value to round
 * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.
 */
float czm_round(float value) {
  return floor(value + 0.5);
}

vec2 czm_round(vec2 value) {
  return floor(value + 0.5);
}

vec3 czm_round(vec3 value) {
  return floor(value + 0.5);
}

vec4 czm_round(vec4 value) {
  return floor(value + 0.5);
}
`;var sOt=y(x(),1),OV=`/**
 * Adjusts the saturation of a color.
 * 
 * @name czm_saturation
 * @glslFunction
 * 
 * @param {vec3} rgb The color.
 * @param {float} adjustment The amount to adjust the saturation of the color.
 *
 * @returns {float} The color with the saturation adjusted.
 *
 * @example
 * vec3 greyScale = czm_saturation(color, 0.0);
 * vec3 doubleSaturation = czm_saturation(color, 2.0);
 */
vec3 czm_saturation(vec3 rgb, float adjustment)
{
    // Algorithm from Chapter 16 of OpenGL Shading Language
    const vec3 W = vec3(0.2125, 0.7154, 0.0721);
    vec3 intensity = vec3(dot(rgb, W));
    return mix(intensity, rgb, adjustment);
}
`;var cOt=y(x(),1),zV=`
float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)
{
    return czm_unpackDepth(czm_textureCube(shadowMap, d));
}

float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)
{
#ifdef USE_SHADOW_DEPTH_TEXTURE
    return texture(shadowMap, uv).r;
#else
    return czm_unpackDepth(texture(shadowMap, uv));
#endif
}

float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
{
    return step(depth, czm_sampleShadowMap(shadowMap, uv));
}

float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
{
    return step(depth, czm_sampleShadowMap(shadowMap, uv));
}
`;var dOt=y(x(),1),HV=`
float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)
{
#ifdef USE_NORMAL_SHADING
#ifdef USE_NORMAL_SHADING_SMOOTH
    float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);
#else
    float strength = step(0.0, nDotL);
#endif
    visibility *= strength;
#endif

    visibility = max(visibility, darkness);
    return visibility;
}

#ifdef USE_CUBE_MAP_SHADOW
float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)
{
    float depthBias = shadowParameters.depthBias;
    float depth = shadowParameters.depth;
    float nDotL = shadowParameters.nDotL;
    float normalShadingSmooth = shadowParameters.normalShadingSmooth;
    float darkness = shadowParameters.darkness;
    vec3 uvw = shadowParameters.texCoords;

    depth -= depthBias;
    float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);
    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#else
float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)
{
    float depthBias = shadowParameters.depthBias;
    float depth = shadowParameters.depth;
    float nDotL = shadowParameters.nDotL;
    float normalShadingSmooth = shadowParameters.normalShadingSmooth;
    float darkness = shadowParameters.darkness;
    vec2 uv = shadowParameters.texCoords;

    depth -= depthBias;
#ifdef USE_SOFT_SHADOWS
    vec2 texelStepSize = shadowParameters.texelStepSize;
    float radius = 1.0;
    float dx0 = -texelStepSize.x * radius;
    float dy0 = -texelStepSize.y * radius;
    float dx1 = texelStepSize.x * radius;
    float dy1 = texelStepSize.y * radius;
    float visibility = (
        czm_shadowDepthCompare(shadowMap, uv, depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)
    ) * (1.0 / 9.0);
#else
    float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);
#endif

    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#endif
`;var mOt=y(x(),1),KV=`/**
 * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.  This is similar to the GLSL
 * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.
 * 
 * @name czm_signNotZero
 * @glslFunction
 *
 * @param {} value The value for which to determine the sign.
 * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.
 */
float czm_signNotZero(float value)
{
    return value >= 0.0 ? 1.0 : -1.0;
}

vec2 czm_signNotZero(vec2 value)
{
    return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));
}

vec3 czm_signNotZero(vec3 value)
{
    return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));
}

vec4 czm_signNotZero(vec4 value)
{
    return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));
}
`;var fOt=y(x(),1),JV=`/**
 * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.
 * <p>
 * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].
 * </p>
 *
 * @name czm_sphericalHarmonics
 * @glslFunction
 *
 * @param {vec3} normal The normalized direction.
 * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.
 * @returns {vec3} The color at the direction.
 *
 * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf
 */
vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])
{
    vec3 L00 = coefficients[0];
    vec3 L1_1 = coefficients[1];
    vec3 L10 = coefficients[2];
    vec3 L11 = coefficients[3];
    vec3 L2_2 = coefficients[4];
    vec3 L2_1 = coefficients[5];
    vec3 L20 = coefficients[6];
    vec3 L21 = coefficients[7];
    vec3 L22 = coefficients[8];

    float x = normal.x;
    float y = normal.y;
    float z = normal.z;

    vec3 L =
          L00
        + L1_1 * y
        + L10 * z
        + L11 * x
        + L2_2 * (y * x)
        + L2_1 * (y * z)
        + L20 * (3.0 * z * z - 1.0)
        + L21 * (z * x)
        + L22 * (x * x - y * y);
        
    return max(L, vec3(0.0));
}
`;var AOt=y(x(),1),jV=`/**
 * Converts an sRGB color to a linear RGB color.
 *
 * @param {vec3|vec4} srgbIn The color in sRGB space
 * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.
 */
vec3 czm_srgbToLinear(vec3 srgbIn)
{
    return pow(srgbIn, vec3(2.2));
}

vec4 czm_srgbToLinear(vec4 srgbIn) 
{
    vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
    return vec4(linearOut, srgbIn.a);
}
`;var bOt=y(x(),1),qV=`/**
 * Creates a matrix that transforms vectors from tangent space to eye space.
 *
 * @name czm_tangentToEyeSpaceMatrix
 * @glslFunction
 *
 * @param {vec3} normalEC The normal vector in eye coordinates.
 * @param {vec3} tangentEC The tangent vector in eye coordinates.
 * @param {vec3} bitangentEC The bitangent vector in eye coordinates.
 *
 * @returns {mat3} The matrix that transforms from tangent space to eye space.
 *
 * @example
 * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);
 * vec3 normal = tangentToEye * texture(normalMap, st).xyz;
 */
mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)
{
    vec3 normal = normalize(normalEC);
    vec3 tangent = normalize(tangentEC);
    vec3 bitangent = normalize(bitangentEC);
    return mat3(tangent.x  , tangent.y  , tangent.z,
                bitangent.x, bitangent.y, bitangent.z,
                normal.x   , normal.y   , normal.z);
}
`;var xOt=y(x(),1),$V=`/**
 * A wrapper around the texture (WebGL2) / textureCube (WebGL1)
 * function to allow for WebGL 1 support.
 * 
 * @name czm_textureCube
 * @glslFunction
 *
 * @param {samplerCube} sampler The sampler.
 * @param {vec3} p The coordinate at which to sample the texture.
 */
vec4 czm_textureCube(samplerCube sampler, vec3 p) {
#if __VERSION__ == 300
    return texture(sampler, p);
#else
    return textureCube(sampler, p);
#endif
}

/**
 * A wrapper around the textureLod (WebGL2) / textureCube (WebGL1)
 * function to allow for WebGL 1 support in fragment shaders.
 *
 * @name czm_textureCubeLod
 * @glslFunction
 *
 * @param {samplerCube} sampler The sampler.
 * @param {vec3} p The coordinate at which to sample the texture.
 * @param {float} lod The mipmap level from which to sample.
 */
vec4 czm_textureCube(samplerCube sampler, vec3 p, float lod) {
#if __VERSION__ == 300
    return textureLod(sampler, p, lod);
#elif defined(GL_EXT_shader_texture_lod)
    return textureCubeLodEXT(sampler, p, lod);
#endif
}`;var EOt=y(x(),1),e1=`/**
 * Transforms a plane.
 * 
 * @name czm_transformPlane
 * @glslFunction
 *
 * @param {vec4} plane The plane in Hessian Normal Form.
 * @param {mat4} transform The inverse-transpose of a transformation matrix.
 */
vec4 czm_transformPlane(vec4 plane, mat4 transform) {
    vec4 transformedPlane = transform * plane;
    // Convert the transformed plane to Hessian Normal Form
    float normalMagnitude = length(transformedPlane.xyz);
    return transformedPlane / normalMagnitude;
}
`;var SOt=y(x(),1),t1=`/**
 * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},
 * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to
 * be relative to the eye.  As shown in the example, the position can then be transformed in eye
 * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},
 * respectively.
 * <p>
 * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as
 * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
 * </p>
 *
 * @name czm_translateRelativeToEye
 * @glslFunction
 *
 * @param {vec3} high The position's high bits.
 * @param {vec3} low The position's low bits.
 * @returns {vec3} The position translated to be relative to the camera's position.
 *
 * @example
 * in vec3 positionHigh;
 * in vec3 positionLow;
 *
 * void main()
 * {
 *   vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
 *   gl_Position = czm_modelViewProjectionRelativeToEye * p;
 * }
 *
 * @see czm_modelViewRelativeToEye
 * @see czm_modelViewProjectionRelativeToEye
 * @see czm_computePosition
 * @see EncodedCartesian3
 */
vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
{
    vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
    // This check handles the case when NaN values have gotten into \`highDifference\`.
    // Such a thing could happen on devices running iOS.
    if (length(highDifference) == 0.0) {  
        highDifference = vec3(0);  
    }
    vec3 lowDifference = low - czm_encodedCameraPositionMCLow;

    return vec4(highDifference + lowDifference, 1.0);
}
`;var _Ot=y(x(),1),n1=`/**
 * @private
 */
vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
    // Diffuse from directional light sources at eye (for top-down and horizon views)
    float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);

    if (czm_sceneMode == czm_sceneMode3D) {
        // (and horizon views in 3D)
        diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
    }

    diffuse = clamp(diffuse, 0.0, 1.0);

    float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);

    // Temporary workaround for adding ambient.
    vec3 materialDiffuse = material.diffuse * 0.5;

    vec3 ambient = materialDiffuse;
    vec3 color = ambient + material.emission;
    color += materialDiffuse * diffuse * czm_lightColor;
    color += material.specular * specular * czm_lightColor;

    return vec4(color, material.alpha);
}
`;var ROt=y(x(),1),i1=`/**
 * Returns the transpose of the matrix.  The input <code>matrix</code> can be
 * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.
 *
 * @name czm_transpose
 * @glslFunction
 *
 * @param {} matrix The matrix to transpose.
 *
 * @returns {} The transposed matrix.
 *
 * @example
 * // GLSL declarations
 * mat2 czm_transpose(mat2 matrix);
 * mat3 czm_transpose(mat3 matrix);
 * mat4 czm_transpose(mat4 matrix);
 *
 * // Transpose a 3x3 rotation matrix to find its inverse.
 * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(
 *     positionMC, normalEC);
 * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);
 */
mat2 czm_transpose(mat2 matrix)
{
    return mat2(
        matrix[0][0], matrix[1][0],
        matrix[0][1], matrix[1][1]);
}

mat3 czm_transpose(mat3 matrix)
{
    return mat3(
        matrix[0][0], matrix[1][0], matrix[2][0],
        matrix[0][1], matrix[1][1], matrix[2][1],
        matrix[0][2], matrix[1][2], matrix[2][2]);
}

mat4 czm_transpose(mat4 matrix)
{
    return mat4(
        matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],
        matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],
        matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],
        matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);
}
`;var VOt=y(x(),1),o1=`vec2 getLookupUv(vec2 dimensions, int i) {
    int pixY = i / int(dimensions.x);
    int pixX = i - (pixY * int(dimensions.x));
    float pixelWidth = 1.0 / dimensions.x;
    float pixelHeight = 1.0 / dimensions.y;
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    return vec2(u, v);
}

vec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) {
    vec2 textureDimensions = vec2(textureSize(extentsTexture, 0));
    return texture(extentsTexture, getLookupUv(textureDimensions, index));
}`;var WOt=y(x(),1),r1=`/**
 * Unpacks a vec4 depth value to a float in [0, 1) range.
 *
 * @name czm_unpackDepth
 * @glslFunction
 *
 * @param {vec4} packedDepth The packed depth.
 *
 * @returns {float} The floating-point depth in [0, 1) range.
 */
float czm_unpackDepth(vec4 packedDepth)
{
    // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
    return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
}
`;var BOt=y(x(),1),s1=`/**
 * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.
 *
 * @name czm_unpackFloat
 * @glslFunction
 *
 * @param {vec4} packedFloat The packed float.
 *
 * @returns {float} The floating-point depth in arbitrary range.
 */
float czm_unpackFloat(vec4 packedFloat)
{
    // Convert to [0.0, 255.0] and round to integer
    packedFloat = floor(packedFloat * 255.0 + 0.5);
    float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;
    float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;    
    if (exponent == -127.0)
    {
        return 0.0;
    }
    float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);
    float result = sign * exp2(exponent - 23.0) * mantissa;
    return result;
}
`;var YOt=y(x(),1),a1=`/**
 * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,
 * so the return value is an int.
 * <p>
 * There are also precision limitations in WebGL 1. highp int is still limited
 * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.
 * </p>
 *
 * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.
 *
 * @return {int} The unpacked value.
 */
 int czm_unpackUint(float packedValue) {
   float rounded = czm_round(packedValue * 255.0);
   return int(rounded);
 }

 int czm_unpackUint(vec2 packedValue) {
   vec2 rounded = czm_round(packedValue * 255.0);
   return int(dot(rounded, vec2(1.0, 256.0)));
 }

 int czm_unpackUint(vec3 packedValue) {
   vec3 rounded = czm_round(packedValue * 255.0);
   return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));
 }

 int czm_unpackUint(vec4 packedValue) {
   vec4 rounded = czm_round(packedValue * 255.0);
   return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));
 }
`;var XOt=y(x(),1),c1=`/**
 * Transform metadata values following the EXT_structural_metadata spec
 * by multiplying by scale and adding the offset. Operations are always
 * performed component-wise, even for matrices.
 * 
 * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add
 * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply
 * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.
 *
 * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.
 */
float czm_valueTransform(float offset, float scale, float value) {
  return scale * value + offset;
}

vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {
  return scale * value + offset;
}

vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {
  return scale * value + offset;
}

vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {
  return scale * value + offset;
}

mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {
  return matrixCompMult(scale, value) + offset;
}

mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {
  return matrixCompMult(scale, value) + offset;
}

mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {
  return matrixCompMult(scale, value) + offset;
}
`;var MOt=y(x(),1),l1=`#ifdef LOG_DEPTH
// 1.0 at the near plane, increasing linearly from there.
out float v_depthFromNearPlusOne;
#ifdef SHADOW_MAP
out vec3 v_logPositionEC;
#endif
#endif

vec4 czm_updatePositionDepth(vec4 coords) {
#if defined(LOG_DEPTH)

#ifdef SHADOW_MAP
    vec3 logPositionEC = (czm_inverseProjection * coords).xyz;
    v_logPositionEC = logPositionEC;
#endif

    // With the very high far/near ratios used with the logarithmic depth
    // buffer, floating point rounding errors can cause linear depth values
    // to end up on the wrong side of the far plane, even for vertices that
    // are really nowhere near it. Since we always write a correct logarithmic
    // depth value in the fragment shader anyway, we just need to make sure
    // such errors don't cause the primitive to be clipped entirely before
    // we even get to the fragment shader.
    coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
#endif

    return coords;
}

/**
 * Writes the logarithmic depth to gl_Position using the already computed gl_Position.
 *
 * @name czm_vertexLogDepth
 * @glslFunction
 */
void czm_vertexLogDepth()
{
#ifdef LOG_DEPTH
    v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
    gl_Position = czm_updatePositionDepth(gl_Position);
#endif
}

/**
 * Writes the logarithmic depth to gl_Position using the provided clip coordinates.
 * <p>
 * An example use case for this function would be moving the vertex in window coordinates
 * before converting back to clip coordinates. Use the original vertex clip coordinates.
 * </p>
 * @name czm_vertexLogDepth
 * @glslFunction
 *
 * @param {vec4} clipCoords The vertex in clip coordinates.
 *
 * @example
 * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));
 */
void czm_vertexLogDepth(vec4 clipCoords)
{
#ifdef LOG_DEPTH
    v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
    czm_updatePositionDepth(clipCoords);
#endif
}
`;var DOt=y(x(),1),d1=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
{
    // Reconstruct NDC coordinates
    float x = 2.0 * screenCoordinate.x - 1.0;
    float y = 2.0 * screenCoordinate.y - 1.0;
    float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
    vec4 q = vec4(x, y, z, 1.0);

    // Reverse the perspective division to obtain clip coordinates.
    q /= screenCoordinate.w;

    // Reverse the projection transformation to obtain eye coordinates.
    if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s
    {
        q = czm_inverseProjection * q;
    }
    else
    {
        float top = czm_frustumPlanes.x;
        float bottom = czm_frustumPlanes.y;
        float left = czm_frustumPlanes.z;
        float right = czm_frustumPlanes.w;

        float near = czm_currentFrustum.x;
        float far = czm_currentFrustum.y;

        q.x = (q.x * (right - left) + left + right) * 0.5;
        q.y = (q.y * (top - bottom) + bottom + top) * 0.5;
        q.z = (q.z * (near - far) - near - far) * 0.5;
        q.w = 1.0;
    }

    return q;
}

/**
 * Transforms a position from window to eye coordinates.
 * The transform from window to normalized device coordinates is done using components
 * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating
 * the inverse of <code>czm_viewportTransformation</code>. The transformation from
 * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,
 * which is expected to be the scalar used in the perspective divide. The transformation
 * from clip to eye coordinates is done using {@link czm_inverseProjection}.
 *
 * @name czm_windowToEyeCoordinates
 * @glslFunction
 *
 * @param {vec4} fragmentCoordinate The position in window coordinates to transform.
 *
 * @returns {vec4} The transformed position in eye coordinates.
 *
 * @see czm_modelToWindowCoordinates
 * @see czm_eyeToWindowCoordinates
 * @see czm_inverseProjection
 * @see czm_viewport
 * @see czm_viewportTransformation
 *
 * @example
 * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);
 */
vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)
{
    vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;
    return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));
}

vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)
{
    // See reverseLogDepth.glsl. This is separate to re-use the pow.
#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)
    float near = czm_currentFrustum.x;
    float far = czm_currentFrustum.y;
    float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;
    float depthFromNear = exp2(log2Depth) - 1.0;
    float depthFromCamera = depthFromNear + near;
    vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);
    vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
    eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision
#else
    vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
    vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
#endif
    return eyeCoordinate;
}

/**
 * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.
 * This function produces more accurate results for window positions with log depth than
 * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version
 * of czm_windowToEyeCoordinates.
 *
 * @name czm_windowToEyeCoordinates
 * @glslFunction
 *
 * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.
 * @param {float} depthOrLogDepth A depth or log depth for the fragment.
 *
 * @see czm_modelToWindowCoordinates
 * @see czm_eyeToWindowCoordinates
 * @see czm_inverseProjection
 * @see czm_viewport
 * @see czm_viewportTransformation
 *
 * @returns {vec4} The transformed position in eye coordinates.
 */
vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
{
    vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
    return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
}
`;var kOt=y(x(),1),u1=`// emulated noperspective
#if !defined(LOG_DEPTH)
in float v_WindowZ;
#endif

/**
 * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane
 * by writing the fragment's depth. See czm_depthClamp for more details.
 *
 * @name czm_writeDepthClamp
 * @glslFunction
 *
 * @example
 * out_FragColor = color;
 * czm_writeDepthClamp();
 *
 * @see czm_depthClamp
 */
void czm_writeDepthClamp()
{
#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
    gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);
#endif
}
`;var OOt=y(x(),1),m1=`#ifdef LOG_DEPTH
in float v_depthFromNearPlusOne;

#ifdef POLYGON_OFFSET
uniform vec2 u_polygonOffset;
#endif

#endif

/**
 * Writes the fragment depth to the logarithmic depth buffer.
 * <p>
 * Use this when the vertex shader does not call {@link czm_vertexLogDepth}, for example, when
 * ray-casting geometry using a full screen quad.
 * </p>
 * @name czm_writeLogDepth
 * @glslFunction
 *
 * @param {float} depth The depth coordinate, where 1.0 is on the near plane and
 *                      depth increases in eye-space units from there
 *
 * @example
 * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);
 */
void czm_writeLogDepth(float depth)
{
#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
    // Discard the vertex if it's not between the near and far planes.
    // We allow a bit of epsilon on the near plane comparison because a 1.0
    // from the vertex shader (indicating the vertex should be _on_ the near
    // plane) will not necessarily come here as exactly 1.0.
    if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
        discard;
    }

#ifdef POLYGON_OFFSET
    // Polygon offset: m * factor + r * units
    float factor = u_polygonOffset[0];
    float units = u_polygonOffset[1];

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    // This factor doesn't work in IE 10
    if (factor != 0.0) {
        // m = sqrt(dZdX^2 + dZdY^2);
        float x = dFdx(depth);
        float y = dFdy(depth);
        float m = sqrt(x * x + y * y);

        // Apply the factor before computing the log depth.
        depth += m * factor;
    }
#endif

#endif

    gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;

#ifdef POLYGON_OFFSET
    // Apply the units after the log depth.
    gl_FragDepth += czm_epsilon7 * units;
#endif

#endif
}

/**
 * Writes the fragment depth to the logarithmic depth buffer.
 * <p>
 * Use this when the vertex shader calls {@link czm_vertexLogDepth}.
 * </p>
 *
 * @name czm_writeLogDepth
 * @glslFunction
 */
void czm_writeLogDepth() {
#ifdef LOG_DEPTH
    czm_writeLogDepth(v_depthFromNearPlusOne);
#endif
}
`;var HOt=y(x(),1),h1=`/**
 * Transforms a value for non-perspective interpolation by multiplying
 * it by w, the value used in the perspective divide. This function is
 * intended to be called in a vertex shader to compute the value of a
 * \`varying\` that should not be subject to perspective interpolation.
 * For example, screen-space texture coordinates. The fragment shader
 * must call {@link czm_readNonPerspective} to retrieve the final
 * non-perspective value.
 *
 * @name czm_writeNonPerspective
 * @glslFunction
 *
 * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.
 * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`.
 * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the
 *          fragment shader with {@link czm_readNonPerspective}.
 */
float czm_writeNonPerspective(float value, float w) {
    return value * w;
}

vec2 czm_writeNonPerspective(vec2 value, float w) {
    return value * w;
}

vec3 czm_writeNonPerspective(vec3 value, float w) {
    return value * w;
}

vec4 czm_writeNonPerspective(vec4 value, float w) {
    return value * w;
}
`;var bx={czm_degreesPerRadian:XR,czm_depthRange:PR,czm_epsilon1:MR,czm_epsilon2:UR,czm_epsilon3:DR,czm_epsilon4:vR,czm_epsilon5:kR,czm_epsilon6:QR,czm_epsilon7:OR,czm_infinity:zR,czm_oneOverPi:HR,czm_oneOverTwoPi:KR,czm_passCesium3DTile:JR,czm_passCesium3DTileClassification:jR,czm_passCesium3DTileClassificationIgnoreShow:qR,czm_passCesium3DTileEdges:$R,czm_passClassification:eG,czm_passCompute:tG,czm_passEnvironment:nG,czm_passGaussianSplats:iG,czm_passGlobe:oG,czm_passOpaque:rG,czm_passOverlay:sG,czm_passTerrainClassification:aG,czm_passTranslucent:cG,czm_passVoxels:lG,czm_pi:dG,czm_piOverFour:uG,czm_piOverSix:mG,czm_piOverThree:hG,czm_piOverTwo:fG,czm_radiansPerDegree:pG,czm_sceneMode2D:AG,czm_sceneMode3D:gG,czm_sceneModeColumbusView:bG,czm_sceneModeMorphing:yG,czm_solarRadius:xG,czm_threePiOver2:CG,czm_twoPi:EG,czm_webMercatorMaxLatitude:TG,czm_depthRangeStruct:SG,czm_material:IG,czm_materialInput:_G,czm_modelMaterial:ZG,czm_modelVertexOutput:RG,czm_ray:GG,czm_raySegment:VG,czm_shadowParameters:LG,czm_HSBToRGB:WG,czm_HSLToRGB:FG,czm_RGBToHSB:BG,czm_RGBToHSL:wG,czm_RGBToXYZ:YG,czm_XYZToRGB:NG,czm_acesTonemapping:XG,czm_alphaWeight:PG,czm_antialias:MG,czm_applyHSBShift:UG,czm_approximateSphericalCoordinates:DG,czm_approximateTanh:vG,czm_backFacing:kG,czm_branchFreeTernary:QG,czm_cascadeColor:OG,czm_cascadeDistance:zG,czm_cascadeMatrix:HG,czm_cascadeWeights:KG,czm_clipPolygons:JG,czm_columbusViewMorph:jG,czm_computeAtmosphereColor:qG,czm_computeGroundAtmosphereScattering:$G,czm_computePosition:eV,czm_computeScattering:tV,czm_cosineAndSine:nV,czm_decompressTextureCoordinates:iV,czm_depthClamp:oV,czm_eastNorthUpToEyeCoordinates:rV,czm_ellipsoidContainsPoint:sV,czm_ellipsoidTextureCoordinates:aV,czm_equalsEpsilon:cV,czm_eyeOffset:lV,czm_eyeToWindowCoordinates:dV,czm_fastApproximateAtan:uV,czm_fog:mV,czm_gammaCorrect:hV,czm_geodeticSurfaceNormal:fV,czm_getDefaultMaterial:pV,czm_getDynamicAtmosphereLightDirection:AV,czm_getLambertDiffuse:gV,czm_getSpecular:bV,czm_getWaterNoise:yV,czm_hue:xV,czm_inverseGamma:CV,czm_isEmpty:EV,czm_isFull:TV,czm_latitudeToWebMercatorFraction:SV,czm_lineDistance:IV,czm_linearToSrgb:_V,czm_luminance:ZV,czm_maximumComponent:RV,czm_metersPerPixel:GV,czm_modelToWindowCoordinates:VV,czm_multiplyWithColorBalance:LV,czm_nearFarScalar:WV,czm_octDecode:FV,czm_packDepth:BV,czm_pbrLighting:wV,czm_pbrNeutralTonemapping:YV,czm_phong:NV,czm_planeDistance:XV,czm_pointAlongRay:PV,czm_rayEllipsoidIntersectionInterval:MV,czm_raySphereIntersectionInterval:UV,czm_readDepth:DV,czm_readNonPerspective:vV,czm_reverseLogDepth:kV,czm_round:QV,czm_saturation:OV,czm_shadowDepthCompare:zV,czm_shadowVisibility:HV,czm_signNotZero:KV,czm_sphericalHarmonics:JV,czm_srgbToLinear:jV,czm_tangentToEyeSpaceMatrix:qV,czm_textureCube:$V,czm_transformPlane:e1,czm_translateRelativeToEye:t1,czm_translucentPhong:n1,czm_transpose:i1,czm_unpackClippingExtents:o1,czm_unpackDepth:r1,czm_unpackFloat:s1,czm_unpackUint:a1,czm_valueTransform:c1,czm_vertexLogDepth:l1,czm_windowToEyeCoordinates:d1,czm_writeDepthClamp:u1,czm_writeLogDepth:m1,czm_writeNonPerspective:h1};var RHt=y(x(),1);function IWe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,`
varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable
${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable
${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#endif
${n}`,n=`#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif
${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100
${n}`,n}var f1=IWe;function coe(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=`
`;return i})}function loe(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=coe(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function doe(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&ya._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=loe(i,ya._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),doe(o,t)}}))}function _We(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function ZWe(e){let t=[],n=loe("main",e,t);doe(n,t),_We(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
`;return i.replace(n.glslSource,"")}function uoe(e,t,n){let i="",o=e.sources;if(l(o))for(let g=0;g<o.length;++g)i+=`
#line 0
${o[g]}`;i=coe(i);let r;i=i.replace(/#version\s+(.*?)\n/gm,function(g,f){return r=f,`
`});let s=[];i=i.replace(/#extension.*\n/gm,function(g){return s.push(g),`
`}),i=i.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let a=e.pickColorQualifier;l(a)&&(i=ya.createPickFragmentShaderSource(i,a));let c="",d=s.length;for(let g=0;g<d;g++)c+=s[g];t&&(c+=`
#ifdef GL_FRAGMENT_PRECISION_HIGH
    precision highp float;
    precision highp int;
#else
    precision mediump float;
    precision mediump int;
    #define highp mediump
#endif
`),n.webgl2&&(c+=`precision highp sampler3D;

`);let u=e.defines;if(l(u))for(let g=0,f=u.length;g<f;++g){let b=u[g];b.length!==0&&(c+=`#define ${b}
`)}n.textureFloatLinear&&(c+=`#define OES_texture_float_linear

`),n.floatingPointTexture&&(c+=`#define OES_texture_float

`);let h="";e.includeBuiltIns&&(h=ZWe(i)),c+=`
#line 0
`;let p=h+i;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(p)&&!/czm_out_FragColor/g.test(p)&&/out_FragColor/g.test(p)&&(c+=`layout(location = 0) out vec4 out_FragColor;

`),c+=h,c+=i,n.webgl2?c=`#version 300 es
${c}`:c=f1(c,t),c}function ya(e){e=e??Q.EMPTY_OBJECT;let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=e.includeBuiltIns??!0}ya.prototype.clone=function(){return new ya({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};ya.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};ya.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(`
`);return`${t}:${n}:${i}:${o}`};ya.prototype.createCombinedVertexShader=function(e){return uoe(this,!1,e)};ya.prototype.createCombinedFragmentShader=function(e){return uoe(this,!0,e)};ya._czmBuiltinsAndUniforms={};for(let e in bx)bx.hasOwnProperty(e)&&(ya._czmBuiltinsAndUniforms[e]=bx[e]);for(let e in dA)if(dA.hasOwnProperty(e)){let t=dA[e];typeof t.getDeclaration=="function"&&(ya._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}ya.createPickVertexShaderSource=function(e){return`${ya.replaceMain(e,"czm_old_main")}
in vec4 pickColor; 
out vec4 czm_pickColor; 
void main() 
{ 
    czm_old_main(); 
    czm_pickColor = pickColor; 
}`};ya.createPickFragmentShaderSource=function(e,t){let n=ya.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; 
void main() 
{ 
    czm_old_main(); 
    if (out_FragColor.a == 0.0) { 
       discard; 
    } 
    out_FragColor = czm_pickColor; 
}`;return`${n}
${i}`};function RWe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function moe(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function hoe(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(moe(e,o))return o}}var GWe=["v_normalEC","v_normal"];ya.findNormalVarying=function(e){return moe(e,"#ifdef HAS_NORMALS")?RWe(e,"HAS_NORMALS")?"v_normalEC":void 0:hoe(e,GWe)};var VWe=["v_positionEC"];ya.findPositionVarying=function(e){return hoe(e,VWe)};var ze=ya;function fh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(fh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});fh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function LWe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}fh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new ze({sources:[t]})),typeof n=="string"&&(n=new ze({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?LWe(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let d=this._context,u=t.createCombinedVertexShader(d),h=n.createCombinedFragmentShader(d),p=new cn({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:t,vertexShaderText:u,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};fh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){Xz(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};fh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};fh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new ze({sources:[r]})),typeof s=="string"&&(s=new ze({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),h=new cn({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function Xz(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];Xz(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}fh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];Xz(this,n),--this._numberOfShaders}this._shadersToRelease={}};fh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};fh.prototype.isDestroyed=function(){return!1};fh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return fe(this)};var p1=fh;var eKt=y(x(),1);function ph(e){e=e??Q.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=je.RGBA,pixelDatatype:o=ve.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e,{width:c,height:d}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(d)||(d=n.videoHeight??n.naturalHeight??n.height));let u=e.preMultiplyAlpha||i===je.RGB||i===je.LUMINANCE,h=je.toInternalFormat(i,o,t),p=je.isCompressedFormat(h),g=t._gl,f=p?je.compressedTextureSizeInBytes(i,c,d):je.textureSizeInBytes(i,o,c,d);this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=h,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._dimensions=new M(c,d),this._hasMipmap=!1,this._sizeInBytes=f,this._preMultiplyAlpha=u,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,goe(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?je.isCompressedFormat(h)?WWe(this,n):foe(this,n):l(n.framebuffer)?BWe(this,n):poe(this,n),this._initialized=!0):Aoe(this),g.bindTexture(this._textureTarget,null)}function WWe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,d=a;for(let u=0;u<t.mipLevels.length;++u)c=av(c),d=av(d),i.compressedTexImage2D(o,u+1,r,c,d,0,t.mipLevels[u])}}function foe(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:d,flipY:u}=e,h=je.alignmentInBytes(c,d,s);i.pixelStorei(i.UNPACK_ALIGNMENT,h),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(u&&(p=je.flipY(p,c,d,s,a)),i.texImage2D(o,0,r,s,a,0,c,ve.toWebGLConstant(d,n),p),l(t.mipLevels)){let g=s,f=a;for(let b=0;b<t.mipLevels.length;++b)g=av(g),f=av(f),i.texImage2D(o,b+1,r,g,f,0,c,ve.toWebGLConstant(d,n),t.mipLevels[b])}}function FWe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:d}=e,u=je.alignmentInBytes(c,d,o);a.pixelStorei(a.UNPACK_ALIGNMENT,u),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=je.flipY(t,c,d,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,ve.toWebGLConstant(d,s),t)}function BWe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function poe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,ve.toWebGLConstant(e.pixelDatatype,n),t)}function wWe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,ve.toWebGLConstant(e.pixelDatatype,o),t)}function av(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Aoe(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,ve.toWebGLConstant(e._pixelDatatype,t),null)}ph.create=function(e){return new ph(e)};ph.fromFramebuffer=function(e){e=e??Q.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=je.RGB,framebufferXOffset:i=0,framebufferYOffset:o=0,width:r=t.drawingBufferWidth,height:s=t.drawingBufferHeight,framebuffer:a}=e;return new ph({context:t,width:r,height:s,pixelFormat:n,source:{framebuffer:l(a)?a:t.defaultFramebuffer,xOffset:i,yOffset:o,width:r,height:s}})};Object.defineProperties(ph.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){goe(this,e),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(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function goe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[zt.NEAREST_MIPMAP_NEAREST,zt.NEAREST_MIPMAP_LINEAR,zt.LINEAR_MIPMAP_NEAREST,zt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ve.FLOAT&&!r.textureFloatLinear||a===ve.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?zt.NEAREST_MIPMAP_NEAREST:zt.NEAREST,i=ui.NEAREST),r.webgl2&&je.isDepthFormat(s)&&(n=zt.NEAREST,i=ui.NEAREST);let c=r._gl,d=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(d,e._texture),c.texParameteri(d,c.TEXTURE_MIN_FILTER,n),c.texParameteri(d,c.TEXTURE_MAG_FILTER,i),c.texParameteri(d,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(d,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(d,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(d,null)}ph.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:d}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,d=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,d=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let u=!1;this._initialized||(t===0&&n===0&&c===this._width&&d===this._height?(l(i.arrayBufferView)?foe(this,i):poe(this,i),u=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Aoe(this)),this._initialized=!0),u||(l(i.arrayBufferView)?FWe(this,i.arrayBufferView,t,n,c,d):wWe(this,i,t,n)),s.bindTexture(a,null)};ph.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};ph.prototype.generateMipmap=function(e){e=e??Ju.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};ph.prototype.isDestroyed=function(){return!1};ph.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),fe(this)};var Wt=ph;var oKt=y(x(),1);function yx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(yx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});yx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};yx.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};yx.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};yx.prototype.isDestroyed=function(){return!1};yx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return fe(this)};var A1=yx;var sJt=y(x(),1);var _Kt=y(x(),1);var xKt=y(x(),1);var uKt=y(x(),1);function ju(e){this.planes=e??[]}var g1=[new m,new m,new m];m.clone(m.UNIT_X,g1[0]);m.clone(m.UNIT_Y,g1[1]);m.clone(m.UNIT_Z,g1[2]);var Xb=new m,YWe=new m,boe=new an(new m(1,0,0),0);ju.fromBoundingSphere=function(e,t){l(t)||(t=new ju);let n=g1.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=g1[a],d=i[s],u=i[s+1];l(d)||(d=i[s]=new ce),l(u)||(u=i[s+1]=new ce),m.multiplyByScalar(c,-r,Xb),m.add(o,Xb,Xb),d.x=c.x,d.y=c.y,d.z=c.z,d.w=-m.dot(c,Xb),m.multiplyByScalar(c,r,Xb),m.add(o,Xb,Xb),u.x=-c.x,u.y=-c.y,u.z=-c.z,u.w=-m.dot(m.negate(c,YWe),Xb),s+=2}return t};ju.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(an.fromCartesian4(t[i],boe));if(r===Jt.OUTSIDE)return Jt.OUTSIDE;r===Jt.INTERSECTING&&(n=!0)}return n?Jt.INTERSECTING:Jt.INSIDE};ju.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===ju.MASK_OUTSIDE||t===ju.MASK_INSIDE)return t;let n=ju.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&(t&s)===0)continue;let a=e.intersectPlane(an.fromCartesian4(i[o],boe));if(a===Jt.OUTSIDE)return ju.MASK_OUTSIDE;a===Jt.INTERSECTING&&(n|=s)}return n};ju.MASK_OUTSIDE=4294967295;ju.MASK_INSIDE=0;ju.MASK_INDETERMINATE=2147483647;var Ps=ju;function zf(e){e=e??Q.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new Ps,this._orthographicMatrix=new F}function yoe(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(zf.prototype,{projectionMatrix:{get:function(){return yoe(this),this._orthographicMatrix}}});var NWe=new m,XWe=new m,PWe=new m,Pz=new m;zf.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=m.cross(t,n,NWe);m.normalize(u,u);let h=XWe;m.multiplyByScalar(t,c,h),m.add(e,h,h);let p=PWe;m.multiplyByScalar(u,a,p),m.add(h,p,p);let g=i[0];return l(g)||(g=i[0]=new ce),g.x=u.x,g.y=u.y,g.z=u.z,g.w=-m.dot(u,p),m.multiplyByScalar(u,s,p),m.add(h,p,p),g=i[1],l(g)||(g=i[1]=new ce),g.x=-u.x,g.y=-u.y,g.z=-u.z,g.w=-m.dot(m.negate(u,Pz),p),m.multiplyByScalar(n,r,p),m.add(h,p,p),g=i[2],l(g)||(g=i[2]=new ce),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-m.dot(n,p),m.multiplyByScalar(n,o,p),m.add(h,p,p),g=i[3],l(g)||(g=i[3]=new ce),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-m.dot(m.negate(n,Pz),p),g=i[4],l(g)||(g=i[4]=new ce),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-m.dot(t,h),m.multiplyByScalar(t,d,p),m.add(e,p,p),g=i[5],l(g)||(g=i[5]=new ce),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-m.dot(m.negate(t,Pz),p),this._cullingVolume};zf.prototype.getPixelDimensions=function(e,t,n,i,o){yoe(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};zf.prototype.clone=function(e){return l(e)||(e=new zf),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};zf.prototype.equals=function(e){return l(e)&&e instanceof zf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};zf.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof zf&&V.equalsEpsilon(this.right,e.right,t,n)&&V.equalsEpsilon(this.left,e.left,t,n)&&V.equalsEpsilon(this.top,e.top,t,n)&&V.equalsEpsilon(this.bottom,e.bottom,t,n)&&V.equalsEpsilon(this.near,e.near,t,n)&&V.equalsEpsilon(this.far,e.far,t,n)};var is=zf;function id(e){e=e??Q.EMPTY_OBJECT,this._offCenterFrustum=new is,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}id.packedLength=4;id.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};id.unpack=function(e,t,n){return t=t??0,l(n)||(n=new id),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Pb(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(id.prototype,{projectionMatrix:{get:function(){return Pb(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Pb(this),this._offCenterFrustum}}});id.prototype.computeCullingVolume=function(e,t,n){return Pb(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};id.prototype.getPixelDimensions=function(e,t,n,i,o){return Pb(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};id.prototype.clone=function(e){return l(e)||(e=new id),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};id.prototype.equals=function(e){return!l(e)||!(e instanceof id)?!1:(Pb(this),Pb(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};id.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof id)?!1:(Pb(this),Pb(e),V.equalsEpsilon(this.width,e.width,t,n)&&V.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var hn=id;var wKt=y(x(),1);var Mz={};function MWe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var UWe=32.184,DWe=2451545;function Xoe(e,t){t=j.addSeconds(e,UWe,t);let n=j.totalDays(t)-DWe;return t=j.addSeconds(t,MWe(n),t),t}var cv=new j(2451545,0,oi.TAI),vWe=1e3,qu=V.RADIANS_PER_DEGREE,vd=V.RADIANS_PER_ARCSECOND,fc=14959787e4,xoe=new $;function Poe(e,t,n,i,o,r,s){n<0&&(n=-n,o+=V.PI);let a=e*(1-t),c=i-o,d=o,u=QWe(r-i,t),h=kWe(t,0);JWe(c,n,d,xoe);let p=a*(1+t),g=Math.cos(u),f=Math.sin(u),b=1+t*g,C=p/b;return l(s)?(s.x=C*g,s.y=C*f,s.z=0):s=new m(C*g,C*f,0),$.multiplyByVector(xoe,s,s)}function kWe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function QWe(e,t){let n=HWe(e,t);return KWe(n,t)}var OWe=50,zWe=V.EPSILON8;function HWe(e,t){let n=Math.floor(e/V.TWO_PI);e-=n*V.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<OWe&&Math.abs(o-i)>zWe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*V.TWO_PI,o}function KWe(e,t){let n=Math.floor(e/V.TWO_PI);e-=n*V.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=V.zeroToTwoPi(r),e<0&&(r-=V.TWO_PI),r+=n*V.TWO_PI,r}function JWe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),d=Math.sin(n);return l(i)?(i[0]=c*o-d*r*s,i[1]=d*o+c*r*s,i[2]=r*a,i[3]=-c*r-d*o*s,i[4]=-d*r+c*o*s,i[5]=o*a,i[6]=d*a,i[7]=-c*a,i[8]=s):i=new $(c*o-d*r*s,-c*r-d*o*s,d*a,d*o+c*r*s,-d*r+c*o*s,-c*a,r*a,o*a,s),i}var jWe=1.0000010178*fc,qWe=100.46645683*qu,$We=129597742283429e-5*vd,Coe=16002,Eoe=21863,Toe=32004,Soe=10931,Ioe=14529,_oe=16368,Zoe=15318,Roe=32794,eFe=64*1e-7*fc,tFe=-152*1e-7*fc,nFe=62*1e-7*fc,iFe=-8*1e-7*fc,oFe=32*1e-7*fc,rFe=-41*1e-7*fc,sFe=19*1e-7*fc,aFe=-11*1e-7*fc,cFe=-150*1e-7*fc,lFe=-46*1e-7*fc,dFe=68*1e-7*fc,uFe=54*1e-7*fc,mFe=14*1e-7*fc,hFe=24*1e-7*fc,fFe=-28*1e-7*fc,pFe=22*1e-7*fc,Goe=10,Voe=16002,Loe=21863,Woe=10931,Foe=1473,Boe=32004,woe=4387,Yoe=73,AFe=-325*1e-7,gFe=-322*1e-7,bFe=-79*1e-7,yFe=232*1e-7,xFe=-52*1e-7,CFe=97*1e-7,EFe=55*1e-7,TFe=-41*1e-7,SFe=-105*1e-7,IFe=-137*1e-7,_Fe=258*1e-7,ZFe=35*1e-7,RFe=-116*1e-7,GFe=-88*1e-7,VFe=-112*1e-7,LFe=-80*1e-7,tS=new j(0,0,oi.TAI);function WFe(e,t){Xoe(e,tS);let i=(tS.dayNumber-cv.dayNumber+(tS.secondsOfDay-cv.secondsOfDay)/ai.SECONDS_PER_DAY)/(ai.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=jWe+eFe*Math.cos(Coe*o)+cFe*Math.sin(Coe*o)+tFe*Math.cos(Eoe*o)+lFe*Math.sin(Eoe*o)+nFe*Math.cos(Toe*o)+dFe*Math.sin(Toe*o)+iFe*Math.cos(Soe*o)+uFe*Math.sin(Soe*o)+oFe*Math.cos(Ioe*o)+mFe*Math.sin(Ioe*o)+rFe*Math.cos(_oe*o)+hFe*Math.sin(_oe*o)+sFe*Math.cos(Zoe*o)+fFe*Math.sin(Zoe*o)+aFe*Math.cos(Roe*o)+pFe*Math.sin(Roe*o),s=qWe+$We*i+AFe*Math.cos(Goe*o)+SFe*Math.sin(Goe*o)+gFe*Math.cos(Voe*o)+IFe*Math.sin(Voe*o)+bFe*Math.cos(Loe*o)+_Fe*Math.sin(Loe*o)+yFe*Math.cos(Woe*o)+ZFe*Math.sin(Woe*o)+xFe*Math.cos(Foe*o)+RFe*Math.sin(Foe*o)+CFe*Math.cos(Boe*o)+GFe*Math.sin(Boe*o)+EFe*Math.cos(woe*o)+VFe*Math.sin(woe*o)+TFe*Math.cos(Yoe*o)+LFe*Math.sin(Yoe*o),a=.0167086342-.0004203654*i,c=102.93734808*qu+11612.3529*vd*i,d=469.97289*vd*i,u=174.87317577*qu-8679.27034*vd*i;return Poe(r,a,d,c,u,s,t)}function Moe(e,t){Xoe(e,tS);let i=(tS.dayNumber-cv.dayNumber+(tS.secondsOfDay-cv.secondsOfDay)/ai.SECONDS_PER_DAY)/ai.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,d=5.15668983*qu,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*qu,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*qu,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,b=218.31664563*qu,C=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,E=297.85019547*qu+vd*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),T=93.27209062*qu+vd*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),S=134.96340251*qu+vd*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),_=357.52910918*qu+vd*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),R=310.17137918*qu-vd*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),L=2*E,W=4*E,B=6*E,Y=2*S,N=3*S,A=4*S,I=2*T;a+=3400.4*Math.cos(L)-635.6*Math.cos(L-S)-235.6*Math.cos(S)+218.1*Math.cos(L-_)+181*Math.cos(L+S),c+=.014216*Math.cos(L-S)+.008551*Math.cos(L-Y)-.001383*Math.cos(S)+.001356*Math.cos(L+S)-.001147*Math.cos(W-N)-914e-6*Math.cos(W-Y)+869e-6*Math.cos(L-_-S)-627e-6*Math.cos(L)-394e-6*Math.cos(W-A)+282e-6*Math.cos(L-_-Y)-279e-6*Math.cos(E-S)-236e-6*Math.cos(Y)+231e-6*Math.cos(W)+229e-6*Math.cos(B-A)-201e-6*Math.cos(Y-I),u+=486.26*Math.cos(L-I)-40.13*Math.cos(L)+37.51*Math.cos(I)+25.73*Math.cos(Y-I)+19.97*Math.cos(L-_-I),p+=-55609*Math.sin(L-S)-34711*Math.sin(L-Y)-9792*Math.sin(S)+9385*Math.sin(W-N)+7505*Math.sin(W-Y)+5318*Math.sin(L+S)+3484*Math.sin(W-A)-3417*Math.sin(L-_-S)-2530*Math.sin(B-A)-2376*Math.sin(L)-2075*Math.sin(L-N)-1883*Math.sin(Y)-1736*Math.sin(B-5*S)+1626*Math.sin(_)-1370*Math.sin(B-N),f+=-5392*Math.sin(L-I)-540*Math.sin(_)-441*Math.sin(L)+423*Math.sin(I)-288*Math.sin(Y-I),C+=-3332.9*Math.sin(L)+1197.4*Math.sin(L-S)-662.5*Math.sin(_)+396.3*Math.sin(S)-218*Math.sin(L-_);let Z=2*R,G=3*R;u+=46.997*Math.cos(R)*i-.614*Math.cos(L-I+R)*i+.614*Math.cos(L-I-R)*i-.0297*Math.cos(Z)*o-.0335*Math.cos(R)*o+.0012*Math.cos(L-I+Z)*o-16e-5*Math.cos(R)*r+4e-5*Math.cos(G)*r+4e-5*Math.cos(Z)*r;let w=2.116*Math.sin(R)*i-.111*Math.sin(L-I-R)*i-.0015*Math.sin(R)*o;p+=w,C+=w,f+=-520.77*Math.sin(R)*i+13.66*Math.sin(L-I+R)*i+1.12*Math.sin(L-R)*i-1.06*Math.sin(I-R)*i+.66*Math.sin(Z)*o+.371*Math.sin(R)*o-.035*Math.sin(L-I+Z)*o-.015*Math.sin(L-I+R)*o+.0014*Math.sin(R)*r-.0011*Math.sin(G)*r-9e-4*Math.sin(Z)*r,a*=vWe;let X=d+u*vd,v=h+p*vd,U=b+C*vd,k=g+f*vd;return Poe(a,c,X,v,k,U,t)}var Noe=.012300034,FFe=Noe/(Noe+1)*-1;function BFe(e,t){return t=Moe(e,t),m.multiplyByScalar(t,FFe,t)}var Uoe=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),b1=new m;Mz.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=j.now()),l(t)||(t=new m),b1=WFe(e,b1),t=m.negate(b1,t),BFe(e,b1),m.subtract(t,b1,t),$.multiplyByVector(Uoe,t,t),t};Mz.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=j.now()),t=Moe(e,t),$.multiplyByVector(Uoe,t,t),t};var Mb=Mz;var NKt=y(x(),1),lv={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};lv.getMorphTime=function(e){return e===lv.SCENE3D?1:e===lv.MORPHING?void 0:0};var se=Object.freeze(lv);var UKt=y(x(),1);function wFe(e){e=e??Q.EMPTY_OBJECT,this.color=D.clone(e.color??D.WHITE),this.intensity=e.intensity??2}var CA=wFe;function nS(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.gamma=void 0,this._viewport=new $e,this._viewportCartesian4=new ce,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new M,this._currentFrustum=new M,this._frustumPlanes=new ce,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new ti,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new M,this._eyeEllipsoidNormalEC=new m,this._eyeEllipsoidCurvature=new M,this._modelToEnu=new F,this._enuToModel=new F,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new D,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new m,this._atmosphereRayleighScaleHeight=new m,this._atmosphereMieCoefficient=new m,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(nS.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!$e.equals(e,this._viewport)){$e.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return voe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return voe(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return Dz(this),this._view3D}},viewRotation:{get:function(){return Dz(this),this._viewRotation}},viewRotation3D:{get:function(){return Dz(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Ooe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Ooe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return OFe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return zFe(this),this._modelView}},modelView3D:{get:function(){return HFe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return eBe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return KFe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return JFe(this),this._inverseModelView3D}},viewProjection:{get:function(){return jFe(this),this._viewProjection}},inverseViewProjection:{get:function(){return qFe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return $Fe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return tBe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return nBe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return iBe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return oBe(this),this._normal}},normal3D:{get:function(){return rBe(this),this._normal3D}},inverseNormal:{get:function(){return sBe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return aBe(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}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},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 Qoe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Qoe(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},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}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??ie.default}}});function YFe(e,t){F.clone(t,e._view),F.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function NFe(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function XFe(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function PFe(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Doe=new m,MFe=new F;function UFe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=m.fromRadians(o.longitude,o.latitude,0,n,Doe)):(e._eyeHeight=-n.maximumRadius,m.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=m.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Doe)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Tt.eastNorthUpToFixedFrame(i,n,MFe);e._enuToModel=F.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=F.inverseTransformation(e._enuToModel,e._modelToEnu),V.equalsEpsilon(n._radii.x,n._radii.y,V.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var Uz=new $,DFe=new pe;function vFe(e,t){Tt.computeIcrfToCentralBodyFixedMatrix(t.time,Uz);let n=Mb.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(Uz,n,n),m.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=Mb.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(Uz,n,n),$.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,DFe);i.project(r,e._sunPositionColumbusView)}nS.prototype.updateCamera=function(e){YFe(this,e.viewMatrix),NFe(this,e.inverseViewMatrix),UFe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==se.SCENE2D&&e.frustum instanceof hn};nS.prototype.updateFrustum=function(e){XFe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&PFe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=V.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};nS.prototype.updatePass=function(e){this._pass=e};var kFe=[],QFe=new CA;nS.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===se.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),vFe(this,e);let n=e.light??QFe;n instanceof CA?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=m.multiplyByScalar(o,n.intensity,o);let r=m.maximumComponent(o);r>1?m.divideByScalar(o,r,this._lightColor):m.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??kFe,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=m.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=m.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=m.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Tt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,h;l(d)?u.height>u.width?h=Math.tan(.5*d)*2/u.height:h=Math.tan(.5*d)*2/u.width:h=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,D.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function voe(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function OFe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==se.SCENE2D&&e._mode!==se.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function zFe(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function HFe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function KFe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function JFe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function jFe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function qFe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function $Fe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function eBe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function tBe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function nBe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function iBe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function oBe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function rBe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function sBe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;F.getMatrix3(e.modelView,t),$.transpose(t,t)}}function aBe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;F.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var koe=new m;function Qoe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,koe),ti.fromCartesian(koe,e._encodedCameraPositionMC))}var cBe=new m,lBe=new m,dBe=new m,uBe=new m,mBe=new pe,hBe=new m,fBe=new F;function pBe(e,t,n,i,o,r,s,a){let c=cBe;c.x=e.y,c.y=e.z,c.z=e.x;let d=lBe;d.x=n.y,d.y=n.z,d.z=n.x;let u=dBe;u.x=i.y,u.y=i.z,u.z=i.x;let h=uBe;h.x=t.y,h.y=t.z,h.z=t.x,r===se.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,mBe);p.longitude=V.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=V.clamp(p.latitude,-V.PI_OVER_TWO,V.PI_OVER_TWO);let g=s.ellipsoid,f=g.cartographicToCartesian(p,hBe),b=Tt.eastNorthUpToFixedFrame(f,g,fBe);return F.multiplyByPointAsVector(b,d,d),F.multiplyByPointAsVector(b,u,u),F.multiplyByPointAsVector(b,h,h),l(a)||(a=new F),a[0]=d.x,a[1]=u.x,a[2]=-h.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-h.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-h.z,a[11]=0,a[12]=-m.dot(d,f),a[13]=-m.dot(u,f),a[14]=m.dot(h,f),a[15]=1,a}function Dz(e){e._view3DDirty&&(e._mode===se.SCENE3D?F.clone(e._view,e._view3D):pBe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Ooe(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var y1=nS;function od(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let s=l(n)?n(e,o):ABe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Kn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new p1(this),this._textureCache=new A1;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),Yt._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Yt._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),Yt._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),Yt._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),Yt._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),Yt._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),Yt._maximum3DTextureSize=d.getParameter(d.MAX_3D_TEXTURE_SIZE),Yt._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),Yt._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),Yt._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Yt._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),Yt._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);Yt._minimumAliasedLineWidth=u[0],Yt._maximumAliasedLineWidth=u[1];let h=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);Yt._minimumAliasedPointSize=h[0],Yt._maximumAliasedPointSize=h[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);Yt._maximumViewportWidth=p[0],Yt._maximumViewportHeight=p[1];let g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);Yt._highpFloatSupported=g.precision!==0;let f=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);Yt._highpIntSupported=f.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!Hr(d,["OES_standard_derivatives"]),this._blendMinmax=!!Hr(d,["EXT_blend_minmax"]),this._elementIndexUint=!!Hr(d,["OES_element_index_uint"]),this._depthTexture=!!Hr(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Hr(d,["EXT_frag_depth"]),this._debugShaders=Hr(d,["WEBGL_debug_shaders"]),this._textureFloat=!!Hr(d,["OES_texture_float"]),this._textureHalfFloat=!!Hr(d,["OES_texture_half_float"]),this._textureFloatLinear=!!Hr(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Hr(d,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Hr(d,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Hr(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Hr(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Hr(d,["EXT_color_buffer_half_float"]),this._s3tc=!!Hr(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Hr(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Hr(d,["WEBGL_compressed_texture_astc"]),this._etc=!!Hr(d,["WEBG_compressed_texture_etc"]),this._etc1=!!Hr(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Hr(d,["EXT_texture_compression_bptc"]),nd.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let b=r?Hr(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=b,Yt._maximumTextureFilterAnisotropy=l(b)?d.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let C,E,T,S,_,R,L,W,B,Y;if(c){let Z=this;C=function(){return Z._gl.createVertexArray()},E=function(G){Z._gl.bindVertexArray(G)},T=function(G){Z._gl.deleteVertexArray(G)},S=function(G,w,X,v,U){d.drawElementsInstanced(G,w,X,v,U)},_=function(G,w,X,v){d.drawArraysInstanced(G,w,X,v)},R=function(G,w){d.vertexAttribDivisor(G,w)},L=function(G){d.drawBuffers(G)}}else W=Hr(d,["OES_vertex_array_object"]),l(W)&&(C=function(){return W.createVertexArrayOES()},E=function(Z){W.bindVertexArrayOES(Z)},T=function(Z){W.deleteVertexArrayOES(Z)}),B=Hr(d,["ANGLE_instanced_arrays"]),l(B)&&(S=function(Z,G,w,X,v){B.drawElementsInstancedANGLE(Z,G,w,X,v)},_=function(Z,G,w,X){B.drawArraysInstancedANGLE(Z,G,w,X)},R=function(Z,G){B.vertexAttribDivisorANGLE(Z,G)}),Y=Hr(d,["WEBGL_draw_buffers"]),l(Y)&&(L=function(Z){Y.drawBuffersWEBGL(Z)});this.glCreateVertexArray=C,this.glBindVertexArray=E,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=S,this.glDrawArraysInstanced=_,this.glVertexAttribDivisor=R,this.glDrawBuffers=L,this._vertexArrayObject=!!W,this._instancedArrays=!!B,this._drawBuffers=!!Y,Yt._maximumDrawBuffers=this.drawBuffers?d.getParameter(ne.MAX_DRAW_BUFFERS):1,Yt._maximumColorAttachments=this.drawBuffers?d.getParameter(ne.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new D(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let N=new y1,A=new Bc(this),I=ke.fromCache();this._defaultPassState=A,this._defaultRenderState=I,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=N,this._currentRenderState=I,this._currentPassState=A,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let Z=0;Z<Yt._maximumVertexAttributes;Z++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},ke.apply(d,I,A)}function ABe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new he("The browser does not support WebGL.  Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new he("The browser supports WebGL, but initialization failed.");return r}function gBe(e,t){let n="WebGL Error:  ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function bBe(e,t,n,i){let o=`${gBe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function yBe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new he(bBe(e,t,n,i))}function xBe(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function CBe(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,xBe(e,o,t))}return i}function Hr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var EBe={};Object.defineProperties(od.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}},msaa:{get:function(){return this._webgl2}},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}},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}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},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=CBe(this._originalGLContext,e?yBe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Wt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Wt({context:this,pixelFormat:je.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Wt({context:this,pixelFormat:je.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new zr({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return EBe}}});function zoe(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ke.partialApply(e._gl,o,t,r,n,i)}var vz;typeof WebGLRenderingContext<"u"&&(vz=[ne.BACK]);function dv(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=vz;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var TBe=new li;od.prototype.clear=function(e,t){e=e??TBe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(D.equals(this._clearColor,o)||(D.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;zoe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;dv(this,c),n.clear(i)};function SBe(e,t,n,i,o){dv(e,t),zoe(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function IBe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??F.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;l(d)?(s=s*d.bytesPerIndex,l(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,c===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}od.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,SBe(this,o,t,n,r),IBe(this,e,n,i)};od.prototype.beginFrame=function(){};od.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=vz;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};od.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??Q.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,s=e.framebuffer;if(!this._webgl2)throw new Ae("A WebGL 2 context is required to read pixels using a PBO.");let a=ve.UNSIGNED_BYTE,c=je.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=mt.createPixelBuffer({context:this,sizeInBytes:je.textureSizeInBytes(c,a,o,r),usage:Xe.DYNAMIC_READ});return dv(this,s),d._bind(),t.readPixels(n,i,o,r,c,ve.toWebGLConstant(a,this),0),d._unBind(),d};od.prototype.readPixels=function(e){let t=this._gl;e=e??Q.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,s=e.framebuffer,a=ve.UNSIGNED_BYTE,c=je.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=je.createTypedArray(c,a,o,r);return dv(this,s),t.readPixels(n,i,o,r,je.RGBA,ve.toWebGLConstant(a,this),d),d};var Hoe={position:0,textureCoordinates:1};od.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new pt({attributes:{position:new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Be.TRIANGLES});e=si.fromGeometry({context:this,geometry:t,attributeLocations:Hoe,bufferUsage:Xe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};od.prototype.createViewportQuadCommand=function(e,t){return t=t??Q.EMPTY_OBJECT,new nt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Be.TRIANGLES,renderState:t.renderState,shaderProgram:cn.fromCache({context:this,vertexShaderSource:lx,fragmentShaderSource:e,attributeLocations:Hoe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};od.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};function kz(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(kz.prototype,{object:{get:function(){return this._pickObjects.get(this.key)},set:function(e){this._pickObjects.set(this.key,e)}}});kz.prototype.destroy=function(){this._pickObjects.delete(this.key)};od.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new he("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new kz(this._pickObjects,t,D.fromRgba(t))};od.prototype.isDestroyed=function(){return!1};od.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),fe(this)};var xx=od;var fjt=y(x(),1);var OJt=y(x(),1);function iS(e){e=e??Q.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new Ae("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new Ae("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new ns({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new ns({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}iS.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};iS.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};iS.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};iS.prototype.isDestroyed=function(){return!1};iS.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),fe(this)};var x1=iS;var njt=y(x(),1);var KJt=y(x(),1);var rd={RGBA4:ne.RGBA4,RGBA8:ne.RGBA8,RGBA16F:ne.RGBA16F,RGBA32F:ne.RGBA32F,RGB5_A1:ne.RGB5_A1,RGB565:ne.RGB565,DEPTH_COMPONENT16:ne.DEPTH_COMPONENT16,STENCIL_INDEX8:ne.STENCIL_INDEX8,DEPTH_STENCIL:ne.DEPTH_STENCIL,DEPTH24_STENCIL8:ne.DEPTH24_STENCIL8,validate:function(e){return e===rd.RGBA4||e===rd.RGBA8||e===rd.RGBA16F||e===rd.RGBA32F||e===rd.RGB5_A1||e===rd.RGB565||e===rd.DEPTH_COMPONENT16||e===rd.STENCIL_INDEX8||e===rd.DEPTH_STENCIL||e===rd.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ne.FLOAT?rd.RGBA32F:e===ne.HALF_FLOAT_OES?rd.RGBA16F:rd.RGBA8}},ml=Object.freeze(rd);function C1(e){e=e??Q.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Yt.maximumRenderbufferSize,o=e.format??ml.RGBA4,r=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(C1.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});C1.prototype._getRenderbuffer=function(){return this._renderbuffer};C1.prototype.isDestroyed=function(){return!1};C1.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),fe(this)};var kd=C1;function na(e){e=e??Q.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=e.createDepthAttachments??!0,this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(na.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});na.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};na.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??ve.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??je.RGBA:void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Wt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:Ht.NEAREST}),this._numSamples>1){let a=ml.getColorFormat(o);this._colorRenderbuffers[s]=new kd({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Wt({context:e,width:t,height:n,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:ve.UNSIGNED_INT_24_8,sampler:Ht.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new kd({context:e,width:t,height:n,format:ml.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new kd({context:e,width:t,height:n,format:ml.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Wt({context:e,width:t,height:n,pixelFormat:je.DEPTH_COMPONENT,pixelDatatype:ve.UNSIGNED_INT,sampler:Ht.NEAREST}):this._depthRenderbuffer=new kd({context:e,width:t,height:n,format:ml.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new x1({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new ns({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};na.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};na.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};na.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};na.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};na.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};na.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};na.prototype.getDepthTexture=function(){return this._depthTexture};na.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};na.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};na.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};na.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};na.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};na.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};na.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};na.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};na.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var xi=na;var Fjt=y(x(),1);var Ajt=y(x(),1);var Cx={VERTEX:0,FRAGMENT:1,BOTH:2};Cx.includesVertexShader=function(e){return e===Cx.VERTEX||e===Cx.BOTH};Cx.includesFragmentShader=function(e){return e===Cx.FRAGMENT||e===Cx.BOTH};var be=Object.freeze(Cx);var bjt=y(x(),1);function Qz(e){this.name=e,this.fields=[]}Qz.prototype.addField=function(e,t){let n=`    ${e} ${t};`;this.fields.push(n)};Qz.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=["    float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var E1=Qz;var xjt=y(x(),1);function Oz(e){this.signature=e,this.body=[]}Oz.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(`    ${e[i]}`)}else t.push(`    ${e}`)};Oz.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var T1=Oz;var Tjt=y(x(),1);function _Be(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let o=0;o<n;o++)e[i+o]=t[o]}var ni=_Be;function hl(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(hl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});hl.prototype.addDefine=function(e,t,n){n=n??be.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),be.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),be.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};hl.prototype.addStruct=function(e,t,n){this._structs[e]=new E1(t),be.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),be.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};hl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};hl.prototype.addFunction=function(e,t,n){this._functions[e]=new T1(t),be.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),be.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};hl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};hl.prototype.addUniform=function(e,t,n){n=n??be.BOTH;let i=`uniform ${e} ${t};`;be.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),be.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};hl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};hl.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=RBe(e),i};hl.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};hl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?ni(t,e):t.push(e)};hl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?ni(t,e):t.push(e)};hl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=ZBe(this),i=GBe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
`),r=new ze({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
`),a=new ze({defines:this._fragmentShaderParts.defineLines,sources:[s]});return cn.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};hl.prototype.clone=function(){return Qe(this,!0)};function ZBe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),ni(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),ni(n,a);return{vertexLines:t,fragmentLines:n}}function RBe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function GBe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),ni(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),ni(n,a);return{vertexLines:t,fragmentLines:n}}var EA=hl;var Xjt=y(x(),1);function uv(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new xx(this._canvas,Qe(e?.contextOptions)),this._canvases=[]}uv.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,o=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},r=function(){let c=n._context.canvas,d=this.drawingBufferWidth;c.width<d&&(c.width=d);let u=this.drawingBufferHeight;c.height<u&&(c.height=u)},s=function(){let c=this.drawingBufferWidth,d=this.drawingBufferHeight,u=n._context.canvas.height-d;t.drawImage(n._context.canvas,0,u,c,d,0,0,c,d),n._context.endFrame()};return new Proxy(this._context,{get(c,d,u){if(d==="isDestroyed")return function(){return i};switch(d){case"_canvas":return e;case"destroy":return o;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return r;case"endFrame":return s;default:return Reflect.get(c,d,u)}}})};uv.prototype.destroy=function(){this._context.destroy(),fe(this)};uv.prototype.isDestroyed=function(){return!1};var S1=uv;var Qjt=y(x(),1);function Ex(e){e=e??Q.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new Ae("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(ne.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}Ex.create=function(e){return new Ex(e)};Ex.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ne.SYNC_STATUS)};Ex.prototype.isDestroyed=function(){return!1};Ex.prototype.destroy=function(){return this._gl.deleteSync(this._sync),fe(this)};Ex.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(o,r,s){return()=>{n.getStatus()===ne.SIGNALED?o():s<=0?r(new he("Wait for signal timeout")):e(i(o,r,s-1))}}return new Promise((o,r)=>{e(i(o,r,t))})};var I1=Ex;var r4t=y(x(),1);function Ub(e){e=e??Q.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=je.RGBA,pixelDatatype:o=ve.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new Ae("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:d,depth:u}=e;l(n)&&(l(c)||(c=n.width),l(d)||(d=n.height),l(u)||(u=n.depth));let h=e.preMultiplyAlpha||i===je.RGB||i===je.LUMINANCE,p=je.toInternalFormat(i,o,t),g=je.isCompressedFormat(p),f=t._gl,b=je.texture3DSizeInBytes(i,o,c,d,u);if(this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=f.TEXTURE_3D,this._texture=f.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._depth=u,this._dimensions=new m(c,d,u),this._hasMipmap=!1,this._sizeInBytes=b,this._preMultiplyAlpha=h,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,joe(this,a),f.activeTexture(f.TEXTURE0),f.bindTexture(this._textureTarget,this._texture),l(n)){if(s?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new Ae("For Texture3D, options.source.arrayBufferView must be defined");Koe(this,n),this._initialized=!0}else Joe(this);f.bindTexture(this._textureTarget,null)}function Koe(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:d,pixelDatatype:u,flipY:h}=e,p=je.alignmentInBytes(d,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:g}=t;h&&console.warn("texture3D.flipY is not supported.");let f=1;if(t.mipLevels&&t.mipLevels.length&&(f=t.mipLevels.length+1),i.texStorage3D(o,f,r,s,a,c),i.texSubImage3D(o,0,0,0,0,s,a,c,d,ve.toWebGLConstant(u,n),g),f>1){let b=s,C=a,E=c;for(let T=0;T<t.mipLevels.length;++T)b=zz(b),C=zz(C),E=zz(E),i.texSubImage3D(o,T+1,0,0,0,b,C,E,d,ve.toWebGLConstant(u,n),t.mipLevels[T])}}Ub.prototype.copyFrom=function(e){e=e??Q.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:o=0}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:d,depth:u}=t,h=!1;this._initialized||(n===0&&i===0&&o===0&&c===this._width&&d===this._height&&u===this._depth?(Koe(this,t),h=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Joe(this)),this._initialized=!0),h||VBe(this,t.arrayBufferView,n,i,o,c,d,u),s.bindTexture(a,null)};function VBe(e,t,n,i,o,r,s,a){let c=e._context,d=c._gl,{pixelFormat:u,pixelDatatype:h}=e,p=je.alignmentInBytes(u,h,r);d.pixelStorei(d.UNPACK_ALIGNMENT,p),d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),d.texSubImage3D(e._textureTarget,0,n,i,o,r,s,a,u,ve.toWebGLConstant(h,c),t)}function zz(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Joe(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,ve.toWebGLConstant(e._pixelDatatype,t),null)}Ub.create=function(e){return new Ub(e)};Object.defineProperties(Ub.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){joe(this,e),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}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function joe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[zt.NEAREST_MIPMAP_NEAREST,zt.NEAREST_MIPMAP_LINEAR,zt.LINEAR_MIPMAP_NEAREST,zt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ve.FLOAT&&!r.textureFloatLinear||a===ve.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?zt.NEAREST_MIPMAP_NEAREST:zt.NEAREST,i=ui.NEAREST),je.isDepthFormat(s)&&(n=zt.NEAREST,i=ui.NEAREST);let c=r._gl,d=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(d,e._texture),c.texParameteri(d,c.TEXTURE_MIN_FILTER,n),c.texParameteri(d,c.TEXTURE_MAG_FILTER,i),c.texParameteri(d,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(d,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(d,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(d,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(d,null)}Ub.prototype.generateMipmap=function(e){e=e??Ju.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Ub.prototype.isDestroyed=function(){return!1};Ub.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),fe(this)};var _1=Ub;var S4t=y(x(),1);var l4t=y(x(),1);function Z1({x:e,y:t,width:n,height:i}){this.rectangle=new $e(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function Hz({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new Z1({x:n,y:n,width:e-2*n,height:t-2*n})}Hz.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};Hz.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,o=i.width,r=i.height,s=o-t,a=r-n;if(s<0||a<0)return;if(s===0&&a===0)return e;let c=this._borderPadding;if(s>a){e.childNode1=new Z1({x:i.x,y:i.y,width:t,height:r});let u=s-c;return u>0&&(e.childNode2=new Z1({x:i.x+t+c,y:i.y,width:u,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new Z1({x:i.x,y:i.y,width:o,height:n});let d=a-c;return d>0&&(e.childNode2=new Z1({x:i.x,y:i.y+n+c,width:o,height:d})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var oS=Hz;var qoe=16;function fl(e){e=e??Q.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new M(qoe,qoe);this._pixelFormat=e.pixelFormat??je.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Kn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(fl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});fl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new $e),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,s=i.width,a=i.height,c=i.x,d=i.y,u=this._subRegions.get(e);if(l(u)){let h=this._rectangles[u];c+=h.x,d+=h.y}return t.x=c/o,t.y=d/r,t.width=s/o,t.height=a/r,t};fl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new Wt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,c=s._textureTarget,d=this._texture,u=new ns({context:e,colorTextures:[d],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),u._bind();let h=this.rectangles,p=this._subRegions;for(let g=0;g<h.length;++g){let f=i[g],b=h[g];if(!l(f)||!l(b)||l(p.get(g)))continue;let{x:C,y:E,width:T,height:S}=f;a.copyTexSubImage2D(c,0,C,E,b.x,b.y,T,S)}return a.bindTexture(c,null),s._initialized=!0,u._unBind(),u.destroy(),s};fl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture,s=r.width,a=r.height,c=this._subRegions,d=i.map((C,E)=>new $oe({index:E,image:C})).filter((C,E)=>l(C.image)&&!l(c.get(E))),u=0,h=0,p=0;for(let C=t;C<o.length;++C){let{width:E,height:T}=o[C].image;u=Math.max(u,E),h=Math.max(h,T),p+=E*T,d.push(o[C])}for(s=V.nextPowerOfTwo(Math.max(u,s)),a=V.nextPowerOfTwo(Math.max(h,a));p>=s*a;)s>a?a*=2:s*=2;d.sort(({image:C},{image:E})=>E.height*E.width-C.height*C.width);let g=new Array(this._nextIndex);for(let C of this._subRegions.keys())l(c.get(C))&&(g[C]=i[C]);let f,b=!1;for(;!b;){f=new oS({height:a,width:s,borderPadding:n});let C;for(C=0;C<d.length;++C){let{index:E,image:T}=d[C];if(!l(T))continue;let S=f.pack(E,T);if(!l(S)){s>a?a*=2:s*=2;break}g[E]=S.rectangle}b=C===d.length}this._texturePacker=f,this._texture=this._copyFromTexture(e,s,a,g),r.destroy(),this._rectangles=g,this._guid=Kn()};fl.prototype.getImageIndex=function(e){return this._indexById.get(e)};fl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let o=this._texture,r=this._rectangles[e];try{o.copyFrom({source:t,xOffset:r.x,yOffset:r.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function $oe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}fl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new $oe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};fl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let o=t[n],{image:r,index:s}=o,a=this._texturePacker.pack(s,r);if(!l(a)){try{this._resize(e,n)}catch(c){i=c,l(o.reject)&&o.reject(i)}break}this._rectangles[s]=a.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];l(o)&&o(-1)}return t.length=0,!1}for(let o=0;o<t.length;++o)this._copyImageToTexture(t[o]);return t.length=0,!0};fl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,o=this._sampler,r=this._borderWidthInPixels;this._texture=new Wt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new oS({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function LBe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof Ge)&&(e=Ge.createIfNeeded(e).fetchImage()),e}fl.prototype.addImage=function(e,t,n,i){let o=this._indexPromiseById.get(e),r=this._indexById.get(e);return l(o)?o:l(r)?r:(r=this._nextIndex++,this._indexById.set(e,r),o=(async()=>{let a=await LBe(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(r,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,o),o)};fl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[o,r]of this._subRegions.entries())if(n===r&&this._rectangles[o].equals(t))return i?i.then(a=>a===-1?-1:o):o};fl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new he(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(r=>{if(r===-1)return-1;let s=this._rectangles[r];return i}))};fl.prototype.isDestroyed=function(){return!1};fl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),fe(this)};var Tx=fl;var F4t=y(x(),1);function xa(e,t,n,i){let o=xa._verifyAttributes(t);n=n??0;let r=[],s={},a,c,d=o.length;for(let h=0;h<d;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function u(h,p){return J.getSizeInBytes(p.componentDatatype)-J.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(u);let h=xa._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:xa._createArrayViews(a,h)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}xa._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:o.index??i,enabled:o.enabled??!0,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype??J.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Xe.STATIC_DRAW};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};xa._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*J.getSizeInBytes(a.componentDatatype)}let i=n>0?J.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};xa._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/J.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*J.getSizeInBytes(a)}return n};xa.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];xa._resize(o,this._size),xa._appendWriters(this.writers,o)}Kz(this)};xa._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=J.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var WBe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];xa._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=WBe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};xa.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=FBe(this,i)||t;if(t||!l(this.va)){Kz(this);let s=this.va=[],a=V.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let d=0;d<c;++d){let u=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=d*(i.vertexSizeInBytes*a);xa._appendAttributes(u,i,h,this._instanced)}u=u.concat(this._precreated),s.push({va:new si({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(d!==c-1?a:this._size%a)})}}};function FBe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=mt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}xa._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};xa.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)BBe(n[i],e,t)};function BBe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}xa.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Kz(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}xa.prototype.isDestroyed=function(){return!1};xa.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return Kz(this),fe(this)};var TA=xa;var N4t=y(x(),1);function wBe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Ge.createIfNeeded(t.positiveX).fetchImage(i),Ge.createIfNeeded(t.negativeX).fetchImage(i),Ge.createIfNeeded(t.positiveY).fetchImage(i),Ge.createIfNeeded(t.negativeY).fetchImage(i),Ge.createIfNeeded(t.positiveZ).fetchImage(i),Ge.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new zr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var R1=wBe;var j4t=y(x(),1);var Q4t=y(x(),1);var U4t=y(x(),1);function Db(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Ce,this.setValue(e)}Object.defineProperties(Db.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Db.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Db.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};Db.prototype.equals=function(e){return this===e||e instanceof Db&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Db.prototype.valueOf=function(){return this._value};Db.prototype.toString=function(){return String(this._value)};var mi=Db;function YBe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function NBe(e){return new mi(e)}function XBe(e,t,n){return YBe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??NBe)}var ge=XBe;function G1(e){this._definitionChanged=new Ce,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._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??Q.EMPTY_OBJECT)}Object.defineProperties(G1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),image:ge("image"),scale:ge("scale"),pixelOffset:ge("pixelOffset"),eyeOffset:ge("eyeOffset"),horizontalOrigin:ge("horizontalOrigin"),verticalOrigin:ge("verticalOrigin"),heightReference:ge("heightReference"),color:ge("color"),rotation:ge("rotation"),alignedAxis:ge("alignedAxis"),sizeInMeters:ge("sizeInMeters"),width:ge("width"),height:ge("height"),scaleByDistance:ge("scaleByDistance"),translucencyByDistance:ge("translucencyByDistance"),pixelOffsetScaleByDistance:ge("pixelOffsetScaleByDistance"),imageSubRegion:ge("imageSubRegion"),distanceDisplayCondition:ge("distanceDisplayCondition"),disableDepthTestDistance:ge("disableDepthTestDistance"),splitDirection:ge("splitDirection")});G1.prototype.clone=function(e){return l(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.splitDirection=this._splitDirection,e):new G1(this)};G1.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var wc=G1;var N8t=y(x(),1);var e8t=y(x(),1);function Sx(){this._array=[],this._hash={}}Object.defineProperties(Sx.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Sx.prototype.contains=function(e){return l(this._hash[e])};Sx.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Sx.prototype.get=function(e){return this._hash[e]};Sx.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Sx.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Ft=Sx;var i8t=y(x(),1);function Qd(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Qd.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}}});Qd.packedLength=2;Qd.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Qd.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Qd),n.near=e[t++],n.far=e[t],n};Qd.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Qd.clone=function(e,t){if(l(e))return l(t)||(t=new Qd),t.near=e.near,t.far=e.far,t};Qd.prototype.clone=function(e){return Qd.clone(this,e)};Qd.prototype.equals=function(e){return Qd.equals(this,e)};var Mt=Qd;var s8t=y(x(),1);function $u(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}$u.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new $u(e.near,e.nearValue,e.far,e.farValue)};$u.packedLength=4;$u.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};$u.unpack=function(e,t,n){return t=t??0,l(n)||(n=new $u),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};$u.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};$u.prototype.clone=function(e){return $u.clone(this,e)};$u.prototype.equals=function(e){return $u.equals(this,e)};var kt=$u;var c8t=y(x(),1),Ix={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},tt=Object.freeze(Ix);function em(e){return e===Ix.CLAMP_TO_GROUND||e===Ix.CLAMP_TO_3D_TILE||e===Ix.CLAMP_TO_TERRAIN}function rS(e){return e===Ix.RELATIVE_TO_GROUND||e===Ix.RELATIVE_TO_3D_TILE||e===Ix.RELATIVE_TO_TERRAIN}var d8t=y(x(),1),PBe={CENTER:0,LEFT:1,RIGHT:-1},Bi=Object.freeze(PBe);var m8t=y(x(),1),MBe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},vn=Object.freeze(MBe);var f8t=y(x(),1),UBe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),gt=UBe;var b8t=y(x(),1);function Ah(){Ae.throwInstantiationError()}Object.defineProperties(Ah.prototype,{isConstant:{get:Ae.throwInstantiationError},definitionChanged:{get:Ae.throwInstantiationError}});Ah.prototype.getValue=Ae.throwInstantiationError;Ah.prototype.equals=Ae.throwInstantiationError;Ah.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Ah.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!Ah.equals(e[i],t[i]))return!1;return!0};Ah.isConstant=function(e){return!l(e)||e.isConstant};Ah.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Ah.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Ah.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var K=Ah;var x8t=y(x(),1),DBe={LEFT:-1,NONE:0,RIGHT:1},Br=Object.freeze(DBe);var vBe=D.WHITE,kBe=m.ZERO,QBe=tt.NONE,OBe=M.ZERO,zBe=1,HBe=0,KBe=m.ZERO,JBe=Bi.CENTER,jBe=vn.CENTER,qBe=!1,$Be=Br.NONE,e2e=new m,t2e=new D,n2e=new m,i2e=new M,o2e=new kt,r2e=new kt,s2e=new kt,a2e=new $e,c2e=new Mt;function ere(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function vb(e,t){t.collectionChanged.addEventListener(vb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ft,this._onCollectionChanged(t,t.values,[],[])}vb.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,d=r.billboard,u=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),h;if(u&&(h=K.getValueOrUndefined(s._position,e,e2e),c=K.getValueOrUndefined(a._image,e),u=l(h)&&l(c)),!u){Jz(r,s,n);continue}K.isConstant(s._position)||(n._clusterDirty=!0),l(d)||(d=n.getBillboard(s),d.id=s,r.billboard=d,r.textureValue=void 0),d.show=u,d.position=h,d.color=K.getValueOrDefault(a._color,e,vBe,t2e),d.eyeOffset=K.getValueOrDefault(a._eyeOffset,e,kBe,n2e),d.heightReference=K.getValueOrDefault(a._heightReference,e,QBe),d.pixelOffset=K.getValueOrDefault(a._pixelOffset,e,OBe,i2e),d.scale=K.getValueOrDefault(a._scale,e,zBe),d.rotation=K.getValueOrDefault(a._rotation,e,HBe),d.alignedAxis=K.getValueOrDefault(a._alignedAxis,e,KBe),d.horizontalOrigin=K.getValueOrDefault(a._horizontalOrigin,e,JBe),d.verticalOrigin=K.getValueOrDefault(a._verticalOrigin,e,jBe),d.width=K.getValueOrUndefined(a._width,e),d.height=K.getValueOrUndefined(a._height,e),d.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,o2e),d.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,r2e),d.pixelOffsetScaleByDistance=K.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,s2e),d.sizeInMeters=K.getValueOrDefault(a._sizeInMeters,e,qBe),d.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,c2e),d.disableDepthTestDistance=K.getValueOrUndefined(a._disableDepthTestDistance,e),d.splitDirection=K.getValueOrDefault(a._splitDirection,e,$Be),r.textureValue!==c&&(d.image=c,r.textureValue=c);let p=K.getValueOrUndefined(a._imageSubRegion,e,a2e);l(p)&&d.setImageSubRegion(d.image,p)}return!0};vb.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return gt.FAILED;let i=n.billboard;if(i.heightReference===tt.NONE)t.center=m.clone(i.position,t.center);else{if(!l(i._clampedPosition))return gt.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,gt.DONE};vb.prototype.isDestroyed=function(){return!1};vb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(vb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return fe(this)};vb.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new ere(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new ere(r)):(Jz(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Jz(s.get(r.id),r,a),s.remove(r.id)};function Jz(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var V1=vb;var tun=y(x(),1);var K8t=y(x(),1);var l2e=new m;function Hf(e){e=e??Q.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Hf.fromDimensions=function(e){e=e??Q.EMPTY_OBJECT;let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new Hf({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};Hf.fromAxisAlignedBoundingBox=function(e){return new Hf({minimum:e.minimum,maximum:e.maximum})};Hf.packedLength=2*m.packedLength+1;Hf.pack=function(e,t,n){return n=n??0,m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=e._offsetAttribute??-1,t};var nre=new m,ire=new m,tre={minimum:nre,maximum:ire,offsetAttribute:void 0};Hf.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,nre),o=m.unpack(e,t+m.packedLength,ire),r=e[t+m.packedLength*2];return l(n)?(n._min=m.clone(i,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(tre.offsetAttribute=r===-1?void 0:r,new Hf(tre))};Hf.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new yn,o=new Uint16Array(24),r=new Float64Array(24);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=m.subtract(n,t,l2e),a=m.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===mn.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new pt({attributes:i,indices:o,primitiveType:Be.LINES,boundingSphere:new ue(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var gh=Hf;var e7t=y(x(),1);function sS(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([D.floatToByte(e),D.floatToByte(t),D.floatToByte(n),D.floatToByte(i)])}Object.defineProperties(sS.prototype,{componentDatatype:{get:function(){return J.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});sS.fromColor=function(e){return new sS(e.red,e.green,e.blue,e.alpha)};sS.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};sS.equals=function(e,t){return e===t||l(e)&&l(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]};var qt=sS;var o7t=y(x(),1);function L1(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(L1.prototype,{componentDatatype:{get:function(){return J.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});L1.fromDistanceDisplayCondition=function(e){return new L1(e.near,e.far)};L1.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var jn=L1;var c7t=y(x(),1);function d2e(e){e=e??Q.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Bt=d2e;var b7t=y(x(),1);var f7t=y(x(),1);function br(e){e=e??Q.EMPTY_OBJECT,this.start=l(e.start)?j.clone(e.start):new j,this.stop=l(e.stop)?j.clone(e.stop):new j,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(br.prototype,{isEmpty:{get:function(){let e=j.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var aS={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};br.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new Ae("options.iso8601 is an invalid ISO 8601 interval.");let i=j.fromIso8601(n[0]),o=j.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(aS.start=i,aS.stop=o,aS.isStartIncluded=r,aS.isStopIncluded=s,aS.data=a,new br(aS))};br.toIso8601=function(e,t){return`${j.toIso8601(e.start,t)}/${j.toIso8601(e.stop,t)}`};br.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new br(e)};br.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&j.equals(e.start,t.start)&&j.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};br.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&j.equalsEpsilon(e.start,t.start,n)&&j.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};br.intersect=function(e,t,n,i){if(!l(t))return br.clone(br.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=j.greaterThanOrEquals(s,o)&&j.greaterThanOrEquals(r,s),d=!c&&j.lessThanOrEquals(s,o)&&j.lessThanOrEquals(o,a);if(!c&&!d)return br.clone(br.EMPTY,n);let u=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,f=j.lessThan(r,a);return l(n)||(n=new br),n.start=c?s:o,n.isStartIncluded=u&&p||!j.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?h:h&&g||!j.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};br.contains=function(e,t){if(e.isEmpty)return!1;let n=j.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=j.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};br.prototype.clone=function(e){return br.clone(this,e)};br.prototype.equals=function(e,t){return br.equals(this,e,t)};br.prototype.equalsEpsilon=function(e,t,n){return br.equalsEpsilon(this,e,t,n)};br.prototype.toString=function(){return br.toIso8601(this)};br.EMPTY=Object.freeze(new br({start:new j,stop:new j,isStartIncluded:!1,isStopIncluded:!1}));var Wn=br;var ore=Object.freeze(j.fromIso8601("0000-01-01T00:00:00Z")),rre=Object.freeze(j.fromIso8601("9999-12-31T24:00:00Z")),u2e=Object.freeze(new Wn({start:ore,stop:rre})),m2e={MINIMUM_VALUE:ore,MAXIMUM_VALUE:rre,MAXIMUM_INTERVAL:u2e},Ke=m2e;var E7t=y(x(),1);function W1(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(W1.prototype,{componentDatatype:{get:function(){return J.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});W1.fromCartesian3=function(e){return new W1(e.x,e.y,e.z)};W1.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var go=W1;var _7t=y(x(),1);function mv(e){e=e??!0,this.value=mv.toValue(e)}Object.defineProperties(mv.prototype,{componentDatatype:{get:function(){return J.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});mv.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Zn=mv;var Uqt=y(x(),1);var R7t=y(x(),1),F1=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec3 v_tangentEC;
in vec3 v_bitangentEC;
in vec2 v_st;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;
    mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.tangentToEyeMatrix = tangentToEyeMatrix;
    materialInput.positionToEyeEC = positionToEyeEC;
    materialInput.st = v_st;
    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var V7t=y(x(),1),B1=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec3 tangent;
in vec3 bitangent;
in vec2 st;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;
out vec3 v_tangentEC;
out vec3 v_bitangentEC;
out vec2 v_st;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates
    v_tangentEC = czm_normal * tangent;                       // tangent in eye coordinates
    v_bitangentEC = czm_normal * bitangent;                   // bitangent in eye coordinates
    v_st = st;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var W7t=y(x(),1),w1=`in vec3 v_positionEC;
in vec3 v_normalEC;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = positionToEyeEC;
    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var B7t=y(x(),1),Y1=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var Y7t=y(x(),1),N1=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec2 v_st;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = positionToEyeEC;
    materialInput.st = v_st;
    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var X7t=y(x(),1),X1=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec2 st;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;
out vec2 v_st;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates
    v_st = st;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var r6t=y(x(),1);var H7t=y(x(),1);var U7t=y(x(),1);var h2e={ADD:ne.FUNC_ADD,SUBTRACT:ne.FUNC_SUBTRACT,REVERSE_SUBTRACT:ne.FUNC_REVERSE_SUBTRACT,MIN:ne.MIN,MAX:ne.MAX},pc=Object.freeze(h2e);var k7t=y(x(),1);var f2e={ZERO:ne.ZERO,ONE:ne.ONE,SOURCE_COLOR:ne.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ne.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ne.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ne.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ne.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ne.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ne.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ne.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ne.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ne.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ne.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ne.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ne.SRC_ALPHA_SATURATE},zo=Object.freeze(f2e);var p2e={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:zo.SOURCE_ALPHA,functionSourceAlpha:zo.ONE,functionDestinationRgb:zo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:zo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:zo.ONE,functionSourceAlpha:zo.ONE,functionDestinationRgb:zo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:zo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:zo.SOURCE_ALPHA,functionSourceAlpha:zo.ONE,functionDestinationRgb:zo.ONE,functionDestinationAlpha:zo.ONE})},fn=Object.freeze(p2e);var j7t=y(x(),1);var A2e={FRONT:ne.FRONT,BACK:ne.BACK,FRONT_AND_BACK:ne.FRONT_AND_BACK},wi=Object.freeze(A2e);function cS(e){e=e??Q.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(cS.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}}});cS.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
`)};cS.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};cS.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Qe(this.renderState,!1);return e?(t.depthMask=!1,t.blending=fn.ALPHA_BLEND):t.depthMask=!0,t};cS.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=fn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:wi.BACK}),l(n)&&(i=Rt(n,i,!0)),i};var Co=cS;var Rqt=y(x(),1);var a6t=y(x(),1),P1=`uniform sampler2D image;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));
    rampColor = czm_gammaCorrect(rampColor);
    material.diffuse = rampColor.rgb;
    material.alpha = rampColor.a;
    return material;
}
`;var l6t=y(x(),1),M1=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

    vec2 centerPixel = fract(repeat * st);
    float centerBump = texture(image, centerPixel).channel;

    float imageWidth = float(imageDimensions.x);
    vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));
    float rightBump = texture(image, rightPixel).channel;

    float imageHeight = float(imageDimensions.y);
    vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));
    float topBump = texture(image, leftPixel).channel;

    vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));
    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;

    material.normal = normalEC;
    material.diffuse = vec3(0.01);

    return material;
}
`;var u6t=y(x(),1),U1=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
    float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);  // 0.0 or 1.0

    // Find the distance from the closest separator (region between two colors)
    float scaledWidth = fract(repeat.s * st.s);
    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
    float scaledHeight = fract(repeat.t * st.t);
    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
    float value = min(scaledWidth, scaledHeight);

    vec4 currentColor = mix(lightColor, darkColor, b);
    vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);

    color = czm_gammaCorrect(color);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var h6t=y(x(),1),D1=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
    float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));  // 0.0 or 1.0

    vec4 color = mix(lightColor, darkColor, b);
    color = czm_gammaCorrect(color);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var p6t=y(x(),1),v1=`uniform sampler2D heights;
uniform sampler2D colors;

// This material expects heights to be sorted from lowest to highest.

float getHeight(int idx, float invTexSize)
{
    vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
#ifdef OES_texture_float
    return texture(heights, uv).x;
#else
    return czm_unpackFloat(texture(heights, uv));
#endif
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    float height = materialInput.height;
    float invTexSize = 1.0 / float(heightsDimensions.x);

    float minHeight = getHeight(0, invTexSize);
    float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);

    // early-out when outside the height range
    if (height < minHeight || height > maxHeight) {
        material.diffuse = vec3(0.0);
        material.alpha = 0.0;
        return material;
    }

    // Binary search to find heights above and below.
    int idxBelow = 0;
    int idxAbove = heightsDimensions.x;
    float heightBelow = minHeight;
    float heightAbove = maxHeight;

    // while loop not allowed, so use for loop with max iterations.
    // maxIterations of 16 supports a texture size up to 65536 (2^16).
    const int maxIterations = 16;
    for (int i = 0; i < maxIterations; i++) {
        if (idxBelow >= idxAbove - 1) {
            break;
        }

        int idxMid = (idxBelow + idxAbove) / 2;
        float heightTex = getHeight(idxMid, invTexSize);

        if (height > heightTex) {
            idxBelow = idxMid;
            heightBelow = heightTex;
        } else {
            idxAbove = idxMid;
            heightAbove = heightTex;
        }
    }

    float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
    vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
    vec4 color = texture(colors, colorUv);

    // undo preumultiplied alpha
    if (color.a > 0.0) 
    {
        color.rgb /= color.a;
    }
    
    color.rgb = czm_gammaCorrect(color.rgb);

    material.diffuse = color.rgb;
    material.alpha = color.a;
    return material;
}
`;var g6t=y(x(),1),k1=`uniform vec4 color;
uniform float spacing;
uniform float width;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    float distanceToContour = mod(materialInput.height, spacing);

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    float dxc = abs(dFdx(materialInput.height));
    float dyc = abs(dFdy(materialInput.height));
    float dF = max(dxc, dyc) * czm_pixelRatio * width;
    float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
#else
    // If no derivatives available (IE 10?), use pixel ratio
    float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
#endif

    vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));
    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;

    return material;
}
`;var y6t=y(x(),1),Q1=`uniform sampler2D image;
uniform float minimumHeight;
uniform float maximumHeight;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);
    vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));
    rampColor = czm_gammaCorrect(rampColor);
    material.diffuse = rampColor.rgb;
    material.alpha = rampColor.a;
    return material;
}
`;var C6t=y(x(),1),O1=`uniform vec4 fadeInColor;
uniform vec4 fadeOutColor;
uniform float maximumDistance;
uniform bool repeat;
uniform vec2 fadeDirection;
uniform vec2 time;

float getTime(float t, float coord)
{
    float scalar = 1.0 / maximumDistance;
    float q  = distance(t, coord) * scalar;
    if (repeat)
    {
        float r = distance(t, coord + 1.0) * scalar;
        float s = distance(t, coord - 1.0) * scalar;
        q = min(min(r, s), q);
    }
    return clamp(q, 0.0, 1.0);
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;
    float s = getTime(time.x, st.s) * fadeDirection.s;
    float t = getTime(time.y, st.t) * fadeDirection.t;

    float u = length(vec2(s, t));
    vec4 color = mix(fadeInColor, fadeOutColor, u);

    color = czm_gammaCorrect(color);
    material.emission = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var T6t=y(x(),1),z1=`uniform vec4 color;
uniform float cellAlpha;
uniform vec2 lineCount;
uniform vec2 lineThickness;
uniform vec2 lineOffset;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

    float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);
    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
    float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);
    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));

    float value;

    // Fuzz Factor - Controls blurriness of lines
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    const float fuzz = 1.2;
    vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;

    // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.
    vec2 dx = abs(dFdx(st));
    vec2 dy = abs(dFdy(st));
    vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;
    value = min(
        smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
        smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
#else
    // If no derivatives available (IE 10?), revert to view-dependent fuzz
    const float fuzz = 0.05;

    vec2 range = 0.5 - (lineThickness * 0.05);
    value = min(
        1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),
        1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));
#endif

    // Edges taken from RimLightingMaterial.glsl
    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
    float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));
    float sRim = smoothstep(0.8, 1.0, dRim);
    value *= (1.0 - sRim);

    vec4 halfColor;
    halfColor.rgb = color.rgb * 0.5;
    halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));
    halfColor = czm_gammaCorrect(halfColor);
    material.diffuse = halfColor.rgb;
    material.emission = halfColor.rgb;
    material.alpha = halfColor.a;

    return material;
}
`;var I6t=y(x(),1),H1=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    
    vec4 textureValue = texture(image, fract(repeat * materialInput.st));
    vec3 normalTangentSpace = textureValue.channels;
    normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;
    normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);
    normalTangentSpace = normalize(normalTangentSpace);
    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
    
    material.normal = normalEC;
    
    return material;
}
`;var Z6t=y(x(),1),K1=`uniform vec4 color;

float getPointOnLine(vec2 p0, vec2 p1, float x)
{
    float slope = (p0.y - p1.y) / (p0.x - p1.x);
    return slope * (x - p0.x) + p0.y;
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
#else
     // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head
    float base = 0.975;
#endif

    vec2 center = vec2(1.0, 0.5);
    float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);
    float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);

    float halfWidth = 0.15;
    float s = step(0.5 - halfWidth, st.t);
    s *= 1.0 - step(0.5 + halfWidth, st.t);
    s *= 1.0 - step(base, st.s);

    float t = step(base, materialInput.st.s);
    t *= 1.0 - step(ptOnUpperLine, st.t);
    t *= step(ptOnLowerLine, st.t);

    // Find the distance from the closest separator (region between two colors)
    float dist;
    if (st.s < base)
    {
        float d1 = abs(st.t - (0.5 - halfWidth));
        float d2 = abs(st.t - (0.5 + halfWidth));
        dist = min(d1, d2);
    }
    else
    {
        float d1 = czm_infinity;
        if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)
        {
            d1 = abs(st.s - base);
        }
        float d2 = abs(st.t - ptOnUpperLine);
        float d3 = abs(st.t - ptOnLowerLine);
        dist = min(min(d1, d2), d3);
    }

    vec4 outsideColor = vec4(0.0);
    vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));
    vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);

    outColor = czm_gammaCorrect(outColor);
    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;
    return material;
}
`;var G6t=y(x(),1),J1=`uniform vec4 color;
uniform vec4 gapColor;
uniform float dashLength;
uniform float dashPattern;
in float v_polylineAngle;

const float maskLength = 16.0;

mat2 rotate(float rad) {
    float c = cos(rad);
    float s = sin(rad);
    return mat2(
        c, s,
        -s, c
    );
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;

    // Get the relative position within the dash from 0 to 1
    float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
    // Figure out the mask index.
    float maskIndex = floor(dashPosition * maskLength);
    // Test the bit mask.
    float maskTest = floor(dashPattern / pow(2.0, maskIndex));
    vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
    if (fragColor.a < 0.005) {   // matches 0/255 and 1/255
        discard;
    }

    fragColor = czm_gammaCorrect(fragColor);
    material.emission = fragColor.rgb;
    material.alpha = fragColor.a;
    return material;
}
`;var L6t=y(x(),1),j1=`uniform vec4 color;
uniform float glowPower;
uniform float taperPower;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;
    float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);

    if (taperPower <= 0.99999) {
        glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));
    }

    vec4 fragColor;
    fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
    fragColor.a = clamp(0.0, 1.0, glow) * color.a;
    fragColor = czm_gammaCorrect(fragColor);

    material.emission = fragColor.rgb;
    material.alpha = fragColor.a;

    return material;
}
`;var F6t=y(x(),1),q1=`uniform vec4 color;
uniform vec4 outlineColor;
uniform float outlineWidth;

in float v_width;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;
    float halfInteriorWidth =  0.5 * (v_width - outlineWidth) / v_width;
    float b = step(0.5 - halfInteriorWidth, st.t);
    b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);

    // Find the distance from the closest separator (region between two colors)
    float d1 = abs(st.t - (0.5 - halfInteriorWidth));
    float d2 = abs(st.t - (0.5 + halfInteriorWidth));
    float dist = min(d1, d2);

    vec4 currentColor = mix(outlineColor, color, b);
    vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
    outColor = czm_gammaCorrect(outColor);

    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;

    return material;
}
`;var w6t=y(x(),1),$1=`uniform vec4 color;
uniform vec4 rimColor;
uniform float width;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
    float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));
    float s = smoothstep(1.0 - width, 1.0, d);

    vec4 outColor = czm_gammaCorrect(color);
    vec4 outRimColor = czm_gammaCorrect(rimColor);

    material.diffuse = outColor.rgb;
    material.emission = outRimColor.rgb * s;
    material.alpha = mix(outColor.a, outRimColor.a, s);

    return material;
}
`;var N6t=y(x(),1),eL=`uniform sampler2D image;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
    rampColor = czm_gammaCorrect(rampColor);
    material.diffuse = rampColor.rgb;
    material.alpha = rampColor.a;
    return material;
}
`;var P6t=y(x(),1),tL=`uniform vec4 evenColor;
uniform vec4 oddColor;
uniform float offset;
uniform float repeat;
uniform bool horizontal;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    // Based on the Stripes Fragment Shader in the Orange Book (11.1.2)
    float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));
    float value = fract((coord - offset) * (repeat * 0.5));
    float dist = min(value, min(abs(value - 0.5), 1.0 - value));

    vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));
    vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);
    color = czm_gammaCorrect(color);

    material.diffuse = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var U6t=y(x(),1),nL=`uniform vec4 waterColor;
uniform vec4 landColor;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec4 outColor = mix(landColor, waterColor, materialInput.waterMask);
    outColor = czm_gammaCorrect(outColor);

    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;

    return material;
}
`;var v6t=y(x(),1),iL=`// Thanks for the contribution Jonas
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog

uniform sampler2D specularMap;
uniform sampler2D normalMap;
uniform vec4 baseWaterColor;
uniform vec4 blendColor;
uniform float frequency;
uniform float animationSpeed;
uniform float amplitude;
uniform float specularIntensity;
uniform float fadeFactor;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    float time = czm_frameNumber * animationSpeed;

    // fade is a function of the distance from the fragment and the frequency of the waves
    float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);

    float specularMapValue = texture(specularMap, materialInput.st).r;

    // note: not using directional motion at this time, just set the angle to 0.0;
    vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
    vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));

    // fade out the normal perturbation as we move further from the water surface
    normalTangentSpace.xy /= fade;

    // attempt to fade out the normal perturbation as we approach non water areas (low specular map value)
    normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);

    normalTangentSpace = normalize(normalTangentSpace);

    // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane
    float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);

    // fade out water effect as specular map value decreases
    material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;

    // base color is a blend of the water and non-water color based on the value from the specular map
    // may need a uniform blend factor to better control this
    material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);

    // diffuse highlights are based on how perturbed the normal is
    material.diffuse += (0.1 * tsPerturbationRatio);

    material.diffuse = material.diffuse;

    material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);

    material.specular = specularIntensity;
    material.shininess = 10.0;

    return material;
}
`;function qe(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=e.minificationFilter??zt.LINEAR,this._magnificationFilter=e.magnificationFilter??ui.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._initializationPromises=[],this._initializationError=void 0,g2e(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(qe._uniformList[this.type])||(qe._uniformList[this.type]=Object.keys(this._uniforms))}qe._uniformList={};qe.fromType=function(e,t){let n=new qe({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};qe.fromTypeAsync=async function(e,t){let n=[],i=new qe({fabric:{type:e,uniforms:t}});if(cre(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function cre(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];cre(o,t)}}qe.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};qe.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let d=c.image,u;Array.isArray(d)&&(u=d.slice(1,d.length).map(function(b){return b.bufferView}),d=d[0]);let h=new Ht({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(d.internalFormat)?p=new Wt({context:e,pixelFormat:d.internalFormat,width:d.width,height:d.height,source:{arrayBufferView:d.bufferView,mipLevels:u},sampler:h}):p=new Wt({context:e,source:d,sampler:h});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let f=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(f)){let b=this.uniforms[f];b.x=p._width,b.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let d=c.images,u=new zr({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]},sampler:new Ht({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=u}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};qe.prototype.isDestroyed=function(){return!1};qe.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return fe(this)};function g2e(e,t){e=e??Q.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Qe(e.fabric??Q.EMPTY_OBJECT),t.fabric=Qe(e.fabric??Q.EMPTY_OBJECT),t._template.uniforms=Qe(t._template.uniforms??Q.EMPTY_OBJECT),t._template.materials=Qe(t._template.materials??Q.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Kn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=qe._materialCache.getMaterial(t.type);if(l(i)){let r=Qe(i.fabric,!0);t._template=Rt(t._template,r,!0),n=i.translucent}C2e(t),T2e(t),Z2e(t),G2e(t),l(i)||qe._materialCache.addMaterial(t.type,t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=n??o,n=e.translucent??n,l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function jz(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function sre(e,t){}function b2e(e,t){}var y2e=["type","materials","uniforms","components","source"],x2e=["diffuse","specular","shininess","normal","emission","alpha"];function C2e(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;jz(t,y2e,sre,!0),jz(o,x2e,sre,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);jz(n,r,b2e,!1)}function E2e(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function T2e(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
{
`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&E2e(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; 
`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; 
`:e.shaderSource+=`material.${o} = ${t[o]};
`}e.shaderSource+=`return material;
}
`}}var are={mat2:ki,mat3:$,mat4:F},S2e=/\.ktx2$/i;function I2e(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===qe.DefaultImageId;t=r;let c=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let h=new Ht({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Wt({context:i,source:r,sampler:h}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Wt&&r!==c){n._texturePaths[e]=void 0;let h=n._textures[e];l(h)&&h!==n._defaultTexture&&h.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),!a){if((r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof ImageBitmap||r instanceof OffscreenCanvas)&&r!==n._texturePaths[e]){n._loadedImages.push({id:e,image:r}),n._texturePaths[e]=r;return}lre(n,e)}}}function lre(e,t){let i=e.uniforms[t];if(i===qe.DefaultImageId)return Promise.resolve();let o=Ge.createIfNeeded(i);if(!(o instanceof Ge))return Promise.resolve();let r=Ge.createIfNeeded(e._texturePaths[t]);if(!(!l(r)||r.url!==o.url))return Promise.resolve();let a;return S2e.test(o.url)?a=nd(o.url):a=o.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let d=e._textures[t];l(d)&&d!==e._defaultTexture&&d.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function _2e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof zr){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),dre(t,e)}}function dre(e,t){let i=e.uniforms[t];if(i===qe.DefaultCubeMapId)return Promise.resolve();let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o===e._texturePaths[t])return Promise.resolve();let r=[Ge.createIfNeeded(i.positiveX).fetchImage(),Ge.createIfNeeded(i.negativeX).fetchImage(),Ge.createIfNeeded(i.positiveY).fetchImage(),Ge.createIfNeeded(i.negativeY).fetchImage(),Ge.createIfNeeded(i.positiveZ).fetchImage(),Ge.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(r);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=o,s}function Z2e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&ure(e,n)}function ure(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=R2e(o),s;if(r==="channels")s=oL(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;V2e(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},ure(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let c=`${t}_${e._count++}`;if(s=oL(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(I2e(t)),e._initializationPromises.push(lre(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(_2e(t)),e._initializationPromises.push(dre(e,t));else if(r.indexOf("mat")!==-1){let d=new are[r];e._uniforms[c]=function(){return are[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function R2e(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Ge||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===qe.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function G2e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new qe({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=Rt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;oL(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=oL(e,i,a)}}function oL(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,d,u){return d||u?c:(o+=1,n)}),o}function V2e(e,t,n){return oL(e,t,t,n)}qe._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};qe.DefaultImageId="czm_defaultImage";qe.DefaultCubeMapId="czm_defaultCubeMap";qe.ColorType="Color";qe._materialCache.addMaterial(qe.ColorType,{fabric:{type:qe.ColorType,uniforms:{color:new D(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});qe.ImageType="Image";qe._materialCache.addMaterial(qe.ImageType,{fabric:{type:qe.ImageType,uniforms:{image:qe.DefaultImageId,repeat:new M(1,1),color:new D(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});qe.DiffuseMapType="DiffuseMap";qe._materialCache.addMaterial(qe.DiffuseMapType,{fabric:{type:qe.DiffuseMapType,uniforms:{image:qe.DefaultImageId,channels:"rgb",repeat:new M(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});qe.AlphaMapType="AlphaMap";qe._materialCache.addMaterial(qe.AlphaMapType,{fabric:{type:qe.AlphaMapType,uniforms:{image:qe.DefaultImageId,channel:"a",repeat:new M(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});qe.SpecularMapType="SpecularMap";qe._materialCache.addMaterial(qe.SpecularMapType,{fabric:{type:qe.SpecularMapType,uniforms:{image:qe.DefaultImageId,channel:"r",repeat:new M(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});qe.EmissionMapType="EmissionMap";qe._materialCache.addMaterial(qe.EmissionMapType,{fabric:{type:qe.EmissionMapType,uniforms:{image:qe.DefaultImageId,channels:"rgb",repeat:new M(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});qe.BumpMapType="BumpMap";qe._materialCache.addMaterial(qe.BumpMapType,{fabric:{type:qe.BumpMapType,uniforms:{image:qe.DefaultImageId,channel:"r",strength:.8,repeat:new M(1,1)},source:M1},translucent:!1});qe.NormalMapType="NormalMap";qe._materialCache.addMaterial(qe.NormalMapType,{fabric:{type:qe.NormalMapType,uniforms:{image:qe.DefaultImageId,channels:"rgb",strength:.8,repeat:new M(1,1)},source:H1},translucent:!1});qe.GridType="Grid";qe._materialCache.addMaterial(qe.GridType,{fabric:{type:qe.GridType,uniforms:{color:new D(0,1,0,1),cellAlpha:.1,lineCount:new M(8,8),lineThickness:new M(1,1),lineOffset:new M(0,0)},source:z1},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});qe.StripeType="Stripe";qe._materialCache.addMaterial(qe.StripeType,{fabric:{type:qe.StripeType,uniforms:{horizontal:!0,evenColor:new D(1,1,1,.5),oddColor:new D(0,0,1,.5),offset:0,repeat:5},source:tL},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});qe.CheckerboardType="Checkerboard";qe._materialCache.addMaterial(qe.CheckerboardType,{fabric:{type:qe.CheckerboardType,uniforms:{lightColor:new D(1,1,1,.5),darkColor:new D(0,0,0,.5),repeat:new M(5,5)},source:U1},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});qe.DotType="Dot";qe._materialCache.addMaterial(qe.DotType,{fabric:{type:qe.DotType,uniforms:{lightColor:new D(1,1,0,.75),darkColor:new D(0,1,1,.75),repeat:new M(5,5)},source:D1},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});qe.WaterType="Water";qe._materialCache.addMaterial(qe.WaterType,{fabric:{type:qe.WaterType,uniforms:{baseWaterColor:new D(.2,.3,.6,1),blendColor:new D(0,1,.699,1),specularMap:qe.DefaultImageId,normalMap:qe.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:iL},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});qe.RimLightingType="RimLighting";qe._materialCache.addMaterial(qe.RimLightingType,{fabric:{type:qe.RimLightingType,uniforms:{color:new D(1,0,0,.7),rimColor:new D(1,1,1,.4),width:.3},source:$1},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});qe.FadeType="Fade";qe._materialCache.addMaterial(qe.FadeType,{fabric:{type:qe.FadeType,uniforms:{fadeInColor:new D(1,0,0,1),fadeOutColor:new D(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new M(.5,.5)},source:O1},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});qe.PolylineArrowType="PolylineArrow";qe._materialCache.addMaterial(qe.PolylineArrowType,{fabric:{type:qe.PolylineArrowType,uniforms:{color:new D(1,1,1,1)},source:K1},translucent:!0});qe.PolylineDashType="PolylineDash";qe._materialCache.addMaterial(qe.PolylineDashType,{fabric:{type:qe.PolylineDashType,uniforms:{color:new D(1,0,1,1),gapColor:new D(0,0,0,0),dashLength:16,dashPattern:255},source:J1},translucent:!0});qe.PolylineGlowType="PolylineGlow";qe._materialCache.addMaterial(qe.PolylineGlowType,{fabric:{type:qe.PolylineGlowType,uniforms:{color:new D(0,.5,1,1),glowPower:.25,taperPower:1},source:j1},translucent:!0});qe.PolylineOutlineType="PolylineOutline";qe._materialCache.addMaterial(qe.PolylineOutlineType,{fabric:{type:qe.PolylineOutlineType,uniforms:{color:new D(1,1,1,1),outlineColor:new D(1,0,0,1),outlineWidth:1},source:q1},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});qe.ElevationContourType="ElevationContour";qe._materialCache.addMaterial(qe.ElevationContourType,{fabric:{type:qe.ElevationContourType,uniforms:{spacing:100,color:new D(1,0,0,1),width:1},source:k1},translucent:!1});qe.ElevationRampType="ElevationRamp";qe._materialCache.addMaterial(qe.ElevationRampType,{fabric:{type:qe.ElevationRampType,uniforms:{image:qe.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:Q1},translucent:!1});qe.SlopeRampMaterialType="SlopeRamp";qe._materialCache.addMaterial(qe.SlopeRampMaterialType,{fabric:{type:qe.SlopeRampMaterialType,uniforms:{image:qe.DefaultImageId},source:eL},translucent:!1});qe.AspectRampMaterialType="AspectRamp";qe._materialCache.addMaterial(qe.AspectRampMaterialType,{fabric:{type:qe.AspectRampMaterialType,uniforms:{image:qe.DefaultImageId},source:P1},translucent:!1});qe.ElevationBandType="ElevationBand";qe._materialCache.addMaterial(qe.ElevationBandType,{fabric:{type:qe.ElevationBandType,uniforms:{heights:qe.DefaultImageId,colors:qe.DefaultImageId},source:v1},translucent:!0});qe.WaterMaskType="WaterMask";qe._materialCache.addMaterial(qe.WaterMaskType,{fabric:{type:qe.WaterMaskType,source:nL,uniforms:{waterColor:new D(1,1,1,1),landColor:new D(0,0,0,0)}},translucent:!1});var ho=qe;function _x(e){e=e??Q.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??_x.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:ho.fromType(ho.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Co.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(_x.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}}});_x.prototype.getFragmentShaderSource=Co.prototype.getFragmentShaderSource;_x.prototype.isTranslucent=Co.prototype.isTranslucent;_x.prototype.getRenderState=Co.prototype.getRenderState;_x.MaterialSupport={BASIC:Object.freeze({vertexFormat:we.POSITION_AND_NORMAL,vertexShaderSource:Y1,fragmentShaderSource:w1}),TEXTURED:Object.freeze({vertexFormat:we.POSITION_NORMAL_AND_ST,vertexShaderSource:X1,fragmentShaderSource:N1}),ALL:Object.freeze({vertexFormat:we.ALL,vertexShaderSource:B1,fragmentShaderSource:F1})};var Io=_x;var o$t=y(x(),1);var vqt=y(x(),1),rL=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec4 v_color;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    vec4 color = czm_gammaCorrect(v_color);

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = positionToEyeEC;
    czm_material material = czm_getDefaultMaterial(materialInput);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
}
`;var Qqt=y(x(),1),sL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec4 color;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;
out vec4 v_color;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates
    v_color = color;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var zqt=y(x(),1),Zx=`in vec4 v_color;

void main()
{
    out_FragColor = czm_gammaCorrect(v_color);
}
`;var Kqt=y(x(),1),aL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec4 color;
in float batchId;

out vec4 v_color;

void main()
{
    vec4 p = czm_computePosition();

    v_color = color;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function SA(e){e=e??Q.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?aL:sL,r=i?Zx:rL,s=i?SA.FLAT_VERTEX_FORMAT:SA.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=Co.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(SA.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}}});SA.VERTEX_FORMAT=we.POSITION_AND_NORMAL;SA.FLAT_VERTEX_FORMAT=we.POSITION_ONLY;SA.prototype.getFragmentShaderSource=Co.prototype.getFragmentShaderSource;SA.prototype.isTranslucent=Co.prototype.isTranslucent;SA.prototype.getRenderState=Co.prototype.getRenderState;var pn=SA;var m$t=y(x(),1);function lS(e){this._definitionChanged=new Ce,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(lS.prototype,{isConstant:{get:function(){return K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ge("color")});lS.prototype.getType=function(e){return"Color"};var L2e=new j;lS.prototype.getValue=function(e,t){return l(e)||(e=j.now(L2e)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,D.WHITE,t.color),t};lS.prototype.equals=function(e){return this===e||e instanceof lS&&K.equals(this._color,e._color)};var Kt=lS;var kin=y(x(),1);var Tin=y(x(),1);var F$t=y(x(),1);var C$t=y(x(),1);function kb(e){e=e??Q.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._rectangle=e.rectangle??de.MAX_VALUE,this._projection=new vi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(kb.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});kb.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};kb.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};kb.prototype.rectangleToNativeRectangle=function(e,t){let n=V.toDegrees(e.west),i=V.toDegrees(e.south),o=V.toDegrees(e.east),r=V.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new de(n,i,o,r)};kb.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=V.toDegrees(o.west),o.south=V.toDegrees(o.south),o.east=V.toDegrees(o.east),o.north=V.toDegrees(o.north),o};kb.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,d=(e+1)*a+o.west,u=o.height/s,h=o.north-t*u,p=o.north-(t+1)*u;return l(i)||(i=new de(c,p,d,h)),i.west=c,i.south=p,i.east=d,i.north=h,i};kb.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!de.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=V.TWO_PI);let d=(c-i.west)/s|0;d>=o&&(d=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),l(n)?(n.x=d,n.y=u,n):new M(d,u)};var Qi=kb;var mre=new m,hre=new m,fre=new pe,qz=new m,W2e=new m,pre=new ue,F2e=new Qi,cL=[new pe,new pe,new pe,new pe],lL=new M,Ts={};Ts.initialize=function(){let e=Ts._initPromise;return l(e)||(e=Ge.fetchJson(en("Assets/approximateTerrainHeights.json")).then(function(t){Ts._terrainHeights=t}),Ts._initPromise=e),e};Ts.getMinimumMaximumHeights=function(e,t){t=t??ie.default;let n=Are(e),i=Ts._defaultMinTerrainHeight,o=Ts._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ts._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(de.northeast(e,fre),mre),t.cartographicToCartesian(de.southwest(e,fre),hre),m.midpoint(hre,mre,qz);let a=t.scaleToGeodeticSurface(qz,W2e);if(l(a)){let c=m.distance(qz,a);i=Math.min(i,-c)}else i=Ts._defaultMinTerrainHeight}return i=Math.max(Ts._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Ts.getBoundingSphere=function(e,t){t=t??ie.default;let n=Are(e),i=Ts._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ts._terrainHeights[r];l(s)&&(i=s[1])}let o=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,pre),ue.union(o,pre,o)};function Are(e){pe.fromRadians(e.east,e.north,0,cL[0]),pe.fromRadians(e.west,e.north,0,cL[1]),pe.fromRadians(e.east,e.south,0,cL[2]),pe.fromRadians(e.west,e.south,0,cL[3]);let t=0,n=0,i=0,o=0,r=Ts._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=cL[c];if(F2e.positionToTileXY(d,s,lL),c===0)i=lL.x,o=lL.y;else if(i!==lL.x||o!==lL.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Ts._terrainHeightsMaxLevel=6;Ts._defaultMaxTerrainHeight=9e3;Ts._defaultMinTerrainHeight=-1e5;Ts._terrainHeights=void 0;Ts._initPromise=void 0;Object.defineProperties(Ts,{initialized:{get:function(){return l(Ts._terrainHeights)}}});var Zi=Ts;var hen=y(x(),1);var j$t=y(x(),1);var X$t=y(x(),1);function va(e,t,n){this.minimum=m.clone(e??m.ZERO),this.maximum=m.clone(t??m.ZERO),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}va.fromCorners=function(e,t,n){return l(n)||(n=new va),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};va.fromPoints=function(e,t){if(l(t)||(t=new va),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let h=1;h<c;h++){let p=e[h],g=p.x,f=p.y,b=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(f,i),s=Math.max(f,s),o=Math.min(b,o),a=Math.max(b,a)}let d=t.minimum;d.x=n,d.y=i,d.z=o;let u=t.maximum;return u.x=r,u.y=s,u.z=a,t.center=m.midpoint(d,u,t.center),t};va.clone=function(e,t){if(l(e))return l(t)?(t.minimum=m.clone(e.minimum,t.minimum),t.maximum=m.clone(e.maximum,t.maximum),t.center=m.clone(e.center,t.center),t):new va(e.minimum,e.maximum,e.center)};va.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&m.equals(e.minimum,t.minimum)&&m.equals(e.maximum,t.maximum)};var hv=new m;va.intersectPlane=function(e,t){hv=m.subtract(e.maximum,e.minimum,hv);let n=m.multiplyByScalar(hv,.5,hv),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=m.dot(e.center,i)+t.distance;return r-o>0?Jt.INSIDE:r+o<0?Jt.OUTSIDE:Jt.INTERSECTING};va.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};va.prototype.clone=function(e){return va.clone(this,e)};va.prototype.intersectPlane=function(e){return va.intersectPlane(this,e)};va.prototype.intersectAxisAlignedBoundingBox=function(e){return va.intersectAxisAlignedBoundingBox(this,e)};va.prototype.equals=function(e){return va.equals(this,e)};var Od=va;var $z=new ce;function Kf(e,t){t=t??ie.default,e=t.scaleToGeodeticSurface(e);let n=Tt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(F.getColumn(n,0,$z)),this._yAxis=m.fromCartesian4(F.getColumn(n,1,$z));let i=m.fromCartesian4(F.getColumn(n,2,$z));this._plane=an.fromPointNormal(e,i)}Object.defineProperties(Kf.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 B2e=new Od;Kf.fromPoints=function(e,t){let n=Od.fromPoints(e,B2e);return new Kf(n.center,t)};var gre=new xn,fv=new m;Kf.prototype.projectPointOntoPlane=function(e,t){let n=gre;n.origin=e,m.normalize(e,n.direction);let i=di.rayPlane(n,this._plane,fv);if(l(i)||(m.negate(n.direction,n.direction),i=di.rayPlane(n,this._plane,fv)),l(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new M(r,s)}};Kf.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};Kf.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new M);let n=gre;n.origin=e,m.clone(this._plane.normal,n.direction);let i=di.rayPlane(n,this._plane,fv);l(i)||(m.negate(n.direction,n.direction),i=di.rayPlane(n,this._plane,fv));let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return t.x=r,t.y=s,t};Kf.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var w2e=new m;Kf.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new m);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=w2e;return m.multiplyByScalar(o,e.x,s),t=m.add(i,s,t),m.multiplyByScalar(r,e.y,s),m.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Kf.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Ss=Kf;function $i(e,t){this.center=m.clone(e??m.ZERO),this.halfAxes=$.clone(t??$.ZERO)}$i.packedLength=m.packedLength+$.packedLength;$i.pack=function(e,t,n){return n=n??0,m.pack(e.center,t,n),$.pack(e.halfAxes,t,n+m.packedLength),t};$i.unpack=function(e,t,n){return t=t??0,l(n)||(n=new $i),m.unpack(e,t,n.center),$.unpack(e,t+m.packedLength,n.halfAxes),n};var Y2e=new m,N2e=new m,X2e=new m,P2e=new m,M2e=new m,U2e=new m,D2e=new $,v2e={unitary:new $,diagonal:new $};$i.fromPoints=function(e,t){if(l(t)||(t=new $i),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=m.ZERO,t;let n,i=e.length,o=m.clone(e[0],Y2e);for(n=1;n<i;n++)m.add(o,e[n],o);let r=1/i;m.multiplyByScalar(o,r,o);let s=0,a=0,c=0,d=0,u=0,h=0,p;for(n=0;n<i;n++)p=m.subtract(e[n],o,N2e),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,d+=p.y*p.y,u+=p.y*p.z,h+=p.z*p.z;s*=r,a*=r,c*=r,d*=r,u*=r,h*=r;let g=D2e;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=d,g[5]=u,g[6]=c,g[7]=u,g[8]=h;let f=$.computeEigenDecomposition(g,v2e),b=$.clone(f.unitary,t.halfAxes),C=$.getColumn(b,0,P2e),E=$.getColumn(b,1,M2e),T=$.getColumn(b,2,U2e),S=-Number.MAX_VALUE,_=-Number.MAX_VALUE,R=-Number.MAX_VALUE,L=Number.MAX_VALUE,W=Number.MAX_VALUE,B=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],S=Math.max(m.dot(C,p),S),_=Math.max(m.dot(E,p),_),R=Math.max(m.dot(T,p),R),L=Math.min(m.dot(C,p),L),W=Math.min(m.dot(E,p),W),B=Math.min(m.dot(T,p),B);C=m.multiplyByScalar(C,.5*(L+S),C),E=m.multiplyByScalar(E,.5*(W+_),E),T=m.multiplyByScalar(T,.5*(B+R),T);let Y=m.add(C,E,t.center);m.add(Y,T,Y);let N=X2e;return N.x=S-L,N.y=_-W,N.z=R-B,m.multiplyByScalar(N,.5,N),$.multiplyByScale(t.halfAxes,N,t.halfAxes),t};var Tre=new m,k2e=new m;function bre(e,t,n,i,o,r,s,a,c,d,u){l(u)||(u=new $i);let h=u.halfAxes;$.setColumn(h,0,t,h),$.setColumn(h,1,n,h),$.setColumn(h,2,i,h);let p=Tre;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+d)/2;let g=k2e;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(d-c)/2;let f=u.center;return p=$.multiplyByVector(h,p,p),m.add(e,p,f),$.multiplyByScale(h,g,h),u}var yre=new pe,Q2e=new m,O2e=new pe,z2e=new pe,H2e=new pe,K2e=new pe,J2e=new pe,j2e=new m,xre=new m,q2e=new m,Cre=new m,$2e=new m,ewe=new M,twe=new M,nwe=new M,iwe=new M,owe=new M,rwe=new m,swe=new m,awe=new m,cwe=new m,lwe=new M,dwe=new m,uwe=new m,mwe=new m,hwe=new an(m.UNIT_X,0);$i.fromRectangle=function(e,t,n,i,o){t=t??0,n=n??0,i=i??ie.default;let r,s,a,c,d,u,h;if(e.width<=V.PI){let W=de.center(e,yre),B=i.cartographicToCartesian(W,Q2e),Y=new Ss(B,i);h=Y.plane;let N=W.longitude,A=e.south<0&&e.north>0?0:W.latitude,I=pe.fromRadians(N,e.north,n,O2e),Z=pe.fromRadians(e.west,e.north,n,z2e),G=pe.fromRadians(e.west,A,n,H2e),w=pe.fromRadians(e.west,e.south,n,K2e),X=pe.fromRadians(N,e.south,n,J2e),v=i.cartographicToCartesian(I,j2e),U=i.cartographicToCartesian(Z,xre),k=i.cartographicToCartesian(G,q2e),P=i.cartographicToCartesian(w,Cre),O=i.cartographicToCartesian(X,$2e),H=Y.projectPointToNearestOnPlane(v,ewe),ee=Y.projectPointToNearestOnPlane(U,twe),z=Y.projectPointToNearestOnPlane(k,nwe),te=Y.projectPointToNearestOnPlane(P,iwe),q=Y.projectPointToNearestOnPlane(O,owe);return r=Math.min(ee.x,z.x,te.x),s=-r,c=Math.max(ee.y,H.y),a=Math.min(te.y,q.y),Z.height=w.height=t,U=i.cartographicToCartesian(Z,xre),P=i.cartographicToCartesian(w,Cre),d=Math.min(an.getPointDistance(h,U),an.getPointDistance(h,P)),u=n,bre(Y.origin,Y.xAxis,Y.yAxis,Y.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,g=e.north<0,f=p?e.south:g?e.north:0,b=de.center(e,yre).longitude,C=m.fromRadians(b,f,n,i,rwe);C.z=0;let T=Math.abs(C.x)<V.EPSILON10&&Math.abs(C.y)<V.EPSILON10?m.UNIT_X:m.normalize(C,swe),S=m.UNIT_Z,_=m.cross(T,S,awe);h=an.fromPointNormal(C,T,hwe);let R=m.fromRadians(b+V.PI_OVER_TWO,f,n,i,cwe);s=m.dot(an.projectPointOntoPlane(h,R,lwe),_),r=-s,c=m.fromRadians(0,e.north,g?t:n,i,dwe).z,a=m.fromRadians(0,e.south,p?t:n,i,uwe).z;let L=m.fromRadians(e.east,f,n,i,mwe);return d=an.getPointDistance(h,L),u=0,bre(C,_,S,T,r,s,a,c,d,u,o)};$i.fromTransformation=function(e,t){return l(t)||(t=new $i),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};$i.clone=function(e,t){if(l(e))return l(t)?(m.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new $i(e.center,e.halfAxes)};$i.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),d=m.dot(i,n)+t.distance;return d<=-c?Jt.OUTSIDE:d>=c?Jt.INSIDE:Jt.INTERSECTING};var Sre=new m,Ire=new m,_re=new m,fwe=new m,Ere=new m,pwe=new m;$i.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,Tre),i=e.halfAxes,o=$.getColumn(i,0,Sre),r=$.getColumn(i,1,Ire),s=$.getColumn(i,2,_re),a=m.magnitude(o),c=m.magnitude(r),d=m.magnitude(s),u=!0,h=!0,p=!0;a>0?m.divideByScalar(o,a,o):u=!1,c>0?m.divideByScalar(r,c,r):h=!1,d>0?m.divideByScalar(s,d,s):p=!1;let g=!u+!h+!p,f,b,C;if(g===1){let _=o;f=r,b=s,h?p||(_=s,b=o):(_=r,f=o),C=m.cross(f,b,Ere),_===o?o=C:_===r?r=C:_===s&&(s=C)}else if(g===2){f=o,h?f=r:p&&(f=s);let _=m.UNIT_Y;_.equalsEpsilon(f,V.EPSILON3)&&(_=m.UNIT_X),b=m.cross(f,_,fwe),m.normalize(b,b),C=m.cross(f,b,Ere),m.normalize(C,C),f===o?(r=b,s=C):f===r?(s=b,o=C):f===s&&(o=b,r=C)}else g===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let E=pwe;E.x=m.dot(n,o),E.y=m.dot(n,r),E.z=m.dot(n,s);let T=0,S;return E.x<-a?(S=E.x+a,T+=S*S):E.x>a&&(S=E.x-a,T+=S*S),E.y<-c?(S=E.y+c,T+=S*S):E.y>c&&(S=E.y-c,T+=S*S),E.z<-d?(S=E.z+d,T+=S*S):E.z>d&&(S=E.z-d,T+=S*S),T};var Awe=new m,gwe=new m;$i.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Or);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,Sre),d=$.getColumn(a,1,Ire),u=$.getColumn(a,2,_re),h=m.add(c,d,Awe);m.add(h,u,h),m.add(h,s,h);let p=m.subtract(h,t,gwe),g=m.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var bwe=new m,ywe=new m,xwe=new m;$i.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,bwe),r=$.getColumn(i,1,ywe),s=$.getColumn(i,2,xwe);return m.clone(n,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],o,t[1]),m.subtract(t[1],r,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],o,t[2]),m.add(t[2],r,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],o,t[3]),m.add(t[3],r,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],o,t[4]),m.subtract(t[4],r,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],o,t[5]),m.subtract(t[5],r,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],o,t[6]),m.add(t[6],r,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],o,t[7]),m.add(t[7],r,t[7]),m.add(t[7],s,t[7]),t};var Cwe=new $;$i.computeTransformation=function(e,t){l(t)||(t=new F);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,Cwe);return F.fromRotationTranslation(i,n,t)};var Ewe=new ue;$i.isOccluded=function(e,t){let n=ue.fromOrientedBoundingBox(e,Ewe);return!t.isBoundingSphereVisible(n)};$i.prototype.intersectPlane=function(e){return $i.intersectPlane(this,e)};$i.prototype.distanceSquaredTo=function(e){return $i.distanceSquaredTo(this,e)};$i.prototype.computePlaneDistances=function(e,t,n){return $i.computePlaneDistances(this,e,t,n)};$i.prototype.computeCorners=function(e){return $i.computeCorners(this,e)};$i.prototype.computeTransformation=function(e){return $i.computeTransformation(this,e)};$i.prototype.isOccluded=function(e){return $i.isOccluded(this,e)};$i.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};$i.prototype.clone=function(e){return $i.clone(this,e)};$i.prototype.equals=function(e){return $i.equals(this,e)};var tn=$i;var ben=y(x(),1);var pv={};pv.getHeight=function(e,t,n){return(e-n)*t+n};var Twe=new pe;pv.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,Twe);if(!l(r))return m.clone(e,o);let s=pv.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var Eo=pv;var rin=y(x(),1);var xen=y(x(),1),dL=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;

#ifdef EXTRUDED_GEOMETRY
in vec3 extrudeDirection;

uniform float u_globeMinimumAltitude;
#endif // EXTRUDED_GEOMETRY

#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif // PER_INSTANCE_COLOR

#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
out vec4 v_sphericalExtents;
#else // SPHERICAL
out vec2 v_inversePlaneExtents;
out vec4 v_westPlane;
out vec4 v_southPlane;
#endif // SPHERICAL
out vec3 v_uvMinAndSphericalLongitudeRotation;
out vec3 v_uMaxAndInverseDistance;
out vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES

void main()
{
    vec4 position = czm_computePosition();

#ifdef EXTRUDED_GEOMETRY
    float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));
    delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;

    //extrudeDirection is zero for the top layer
    position = position + vec4(extrudeDirection * delta, 0.0);
#endif

#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
    v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);
    v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);
#else // SPHERICAL
#ifdef COLUMBUS_VIEW_2D
    vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);
    vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);

    // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):
    // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)
    // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)
    // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)
    vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));
    bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;
    planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);
    planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);

    // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)
    // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)
    // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)
    idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;
    idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));
    planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);
    planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);

    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;
    vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;
    vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;
#else // COLUMBUS_VIEW_2D
    // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction
    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;
    vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;
    vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;
#endif // COLUMBUS_VIEW_2D

    vec3 eastWard = southEastCorner - southWestCorner;
    float eastExtent = length(eastWard);
    eastWard /= eastExtent;

    vec3 northWard = northWestCorner - southWestCorner;
    float northExtent = length(northWard);
    northWard /= northExtent;

    v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));
    v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));
    v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);
#endif // SPHERICAL
    vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);
    vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);

    v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);
    v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);
    v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;
#endif // TEXTURE_COORDINATES

#ifdef PER_INSTANCE_COLOR
    v_color = czm_batchTable_color(batchId);
#endif

    gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
}
`;var Een=y(x(),1),Qb=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

void main(void)
{
#ifdef VECTOR_TILE
    out_FragColor = czm_gammaCorrect(u_highlightColor);
#else
    out_FragColor = vec4(1.0);
#endif
    czm_writeDepthClamp();
}
`;var Sen=y(x(),1),Zre={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};Zre.NUMBER_OF_CLASSIFICATION_TYPES=3;var qn=Object.freeze(Zre);var Zen=y(x(),1);var Swe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},ka=Object.freeze(Swe);var nnn=y(x(),1);var Gen=y(x(),1);function Iwe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var uL=Iwe;var ven=y(x(),1);function IA(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=_we(t),o=e.floatingPointTexture,r=i===ve.FLOAT&&!o,s=Zwe(t,r),a=Rwe(s,t,r),c=Math.floor(Yt.maximumTextureSize/a),d=Math.min(n,c),u=a*d,h=Math.ceil(n/d),p=1/u,g=p*.5,f=1/h,b=f*.5;this._textureDimensions=new M(u,h),this._textureStep=new ce(p,g,f,b),this._pixelDatatype=r?ve.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let C=4*u*h;this._batchValues=i===ve.FLOAT&&!r?new Float32Array(C):new Uint8Array(C),this._batchValuesDirty=!1}Object.defineProperties(IA.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function _we(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==J.UNSIGNED_BYTE){t=!0;break}return t?ve.FLOAT:ve.UNSIGNED_BYTE}function Gre(e,t){let n=e[t].componentsPerAttribute;return n===2?M:n===3?m:n===4?ce:Number}function Zwe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==J.UNSIGNED_BYTE&&t?i+=4:++i}return n}function Rwe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==J.UNSIGNED_BYTE&&n?o+4:o+1}var mL=new ce;function Gwe(e,t,n){let i=ce.unpack(e,t,mL),o=ce.unpackFloat(i);i=ce.unpack(e,t+4,mL);let r=ce.unpackFloat(i);i=ce.unpack(e,t+8,mL);let s=ce.unpackFloat(i);i=ce.unpack(e,t+12,mL);let a=ce.unpackFloat(i);return ce.fromElements(o,r,s,a,n)}function Vwe(e,t,n){let i=ce.packFloat(e.x,mL);ce.pack(i,t,n),i=ce.packFloat(e.y,i),ce.pack(i,t,n+4),i=ce.packFloat(e.z,i),ce.pack(i,t,n+8),i=ce.packFloat(e.w,i),ce.pack(i,t,n+12)}var Rre=new ce;IA.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==ve.UNSIGNED_BYTE?a=Gwe(this._batchValues,s,Rre):a=ce.unpack(this._batchValues,s,Rre);let c=Gre(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var Lwe=[void 0,void 0,new M,new m,new ce],Wwe=new ce;IA.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=Lwe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Gre(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=Wwe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let d=this._offsets[t],h=4*this._stride*e+4*d;this._packFloats&&i[t].componentDatatype!==ve.UNSIGNED_BYTE?Vwe(c,this._batchValues,h):ce.pack(c,this._batchValues,h),this._batchValuesDirty=!0};function Fwe(e,t){let n=e._textureDimensions;e._texture=new Wt({context:t,pixelFormat:je.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Ht.NEAREST,flipY:!1})}function Bwe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}IA.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||Fwe(this,e.context),Bwe(this))};IA.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Rt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function wwe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; 
vec2 computeSt(float batchId) 
{ 
    float stepX = batchTextureStep.x; 
    float centerX = batchTextureStep.y; 
    float numberOfAttributes = float(${t}); 
    return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); 
} 
`:`uniform vec4 batchTextureStep; 
uniform vec2 batchTextureDimensions; 
vec2 computeSt(float batchId) 
{ 
    float stepX = batchTextureStep.x; 
    float centerX = batchTextureStep.y; 
    float stepY = batchTextureStep.z; 
    float centerY = batchTextureStep.w; 
    float numberOfAttributes = float(${t}); 
    float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); 
    float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); 
    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); 
} 
`}function Ywe(e){return e===1?"float":`vec${e}`}function Nwe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function Xwe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=Ywe(o),a=Nwe(o),c=e._offsets[t],d=`${s} ${r}(float batchId) 
{ 
    vec2 st = computeSt(batchId); 
    st.x += batchTextureStep.x * float(${c}); 
`;return e._packFloats&&i.componentDatatype!==ve.UNSIGNED_BYTE?d+=`vec4 textureValue; 
textureValue.x = czm_unpackFloat(texture(batchTexture, st)); 
textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); 
textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); 
textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); 
`:d+=`    vec4 textureValue = texture(batchTexture, st); 
`,d+=`    ${s} value = textureValue${a}; 
`,e._pixelDatatype===ve.UNSIGNED_BYTE&&i.componentDatatype===J.UNSIGNED_BYTE&&!i.normalize?d+=`value *= 255.0; 
`:e._pixelDatatype===ve.FLOAT&&i.componentDatatype===J.UNSIGNED_BYTE&&i.normalize&&(d+=`value /= 255.0; 
`),d+=`    return value; 
} 
`,d}IA.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; 
`;t+=`${wwe(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=Xwe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
${t}
${s}`}};IA.prototype.isDestroyed=function(){return!1};IA.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),fe(this)};var Rx=IA;var utn=y(x(),1);var Jen=y(x(),1);function sd(e){this._ellipsoid=e??ie.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(sd.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});sd.mercatorAngleToGeodeticLatitude=function(e){return V.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};sd.geodeticLatitudeToMercatorAngle=function(e){e>sd.MaximumLatitude?e=sd.MaximumLatitude:e<-sd.MaximumLatitude&&(e=-sd.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};sd.MaximumLatitude=sd.mercatorAngleToGeodeticLatitude(Math.PI);sd.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=sd.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};sd.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=sd.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new pe(i,o,r)};var hi=sd;function Pwe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Dn.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function eH(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new We({componentDatatype:J.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function Mwe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?eH(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(eH(i.westHemisphereGeometry,n),eH(i.eastHemisphereGeometry,n))}}function Uwe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,d,u,h=t.length;for(c=0;c<h;++c)if(l(t[c].geometry)){u=t[c].geometry.primitiveType;break}if(Pwe(t,a,o),!o)for(c=0;c<h;++c)l(t[c].geometry)&&Dn.splitLongitude(t[c]);if(Mwe(t),r)for(c=0;c<h;++c){let g=t[c];l(g.geometry)?(Dn.reorderForPostVertexCache(g.geometry),Dn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Dn.reorderForPostVertexCache(g.westHemisphereGeometry),Dn.reorderForPreVertexCache(g.westHemisphereGeometry),Dn.reorderForPostVertexCache(g.eastHemisphereGeometry),Dn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Dn.combineInstances(t);for(h=p.length,c=0;c<h;++c){d=p[c];let g=d.attributes;if(o)for(let f in g)g.hasOwnProperty(f)&&g[f].componentDatatype===J.DOUBLE&&Dn.encodeAttribute(d,f,`${f}3DHigh`,`${f}3DLow`);else for(let f in g)if(g.hasOwnProperty(f)&&g[f].componentDatatype===J.DOUBLE){let b=`${f}3D`,C=`${f}2D`;Dn.projectTo2D(d,f,b,C,n),l(d.boundingSphere)&&f==="position"&&(d.boundingSphereCV=ue.fromVertices(d.attributes.position2D.values)),Dn.encodeAttribute(d,b,`${b}High`,`${b}Low`),Dn.encodeAttribute(d,C,`${C}High`,`${C}Low`)}s&&Dn.compressVertices(d)}if(!i){let g=[];for(h=p.length,c=0;c<h;++c)d=p[c],g=g.concat(Dn.fitToUnsignedShortIndices(d));p=g}return p}function tH(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;d<c;++d){let h=e[d][t];if(!l(h))continue;let p=h.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function Dwe(e,t){let n=[];return tH(e,"geometry",t,n),tH(e,"westHemisphereGeometry",t,n),tH(e,"eastHemisphereGeometry",t,n),n}var _A={};_A.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=Uwe(e),t.length>0&&(n=Dn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=Dwe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u<o;++u){let h=i[u],p=h.geometry;l(p)&&(c[u]=p.boundingSphere,d[u]=p.boundingSphereCV,a&&(s[u]=h.geometry.offsetAttribute));let g=h.eastHemisphereGeometry,f=h.westHemisphereGeometry;l(g)&&l(f)&&(l(g.boundingSphere)&&l(f.boundingSphere)&&(c[u]=ue.union(g.boundingSphere,f.boundingSphere)),l(g.boundingSphereCV)&&l(f.boundingSphereCV)&&(d[u]=ue.union(g.boundingSphereCV,f.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:d}};function vwe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function kwe(e,t){let n=e.length;for(let i=0;i<n;++i)vwe(e[i],t)}function Qwe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*ue.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}_A.packCreateGeometryResults=function(e,t){let n=new Float64Array(Qwe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],d=l(c);if(n[s++]=d?1:0,!d)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let u=l(c.boundingSphere)?1:0;n[s++]=u,u&&ue.pack(c.boundingSphere,n,s),s+=ue.packedLength;let h=l(c.boundingSphereCV)?1:0;n[s++]=h,h&&ue.pack(c.boundingSphereCV,n,s),s+=ue.packedLength;let p=c.attributes,g=[];for(let b in p)p.hasOwnProperty(b)&&l(p[b])&&(g.push(b),l(o[b])||(o[b]=i.length,i.push(b)));n[s++]=g.length;for(let b=0;b<g.length;b++){let C=g[b],E=p[C];n[s++]=o[C],n[s++]=E.componentDatatype,n[s++]=E.componentsPerAttribute,n[s++]=E.normalize?1:0,n[s++]=E.values.length,n.set(E.values,s),s+=E.values.length}let f=l(c.indices)?c.indices.length:0;n[s++]=f,f>0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};_A.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],d=n[s++],u=n[s++];u===-1&&(u=void 0);let h,p;n[s++]===1&&(h=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.packedLength;let b,C,E,T=new yn,S=n[s++];for(i=0;i<S;i++){let R=t[n[s++]],L=n[s++];E=n[s++];let W=n[s++]!==0;b=n[s++],C=J.createTypedArray(L,b);for(let B=0;B<b;B++)C[B]=n[s++];T[R]=new We({componentDatatype:L,componentsPerAttribute:E,normalize:W,values:C})}let _;if(b=n[s++],b>0){let R=C.length/E;for(_=Pe.createTypedArray(R,b),i=0;i<b;i++)_[i]=n[s++]}o[r++]=new pt({primitiveType:c,geometryType:d,boundingSphere:h,boundingSphereCV:p,indices:_,attributes:T,offsetAttribute:u})}return o};function Owe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(F.pack(s.modelMatrix,i,o),o+=F.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function zwe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,l(t[o])&&(s={offset:new go(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}_A.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:Owe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof vi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};_A.unpackCombineGeometryParameters=function(e){let t=zwe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=_A.unpackCreateGeometryResults(n[a]),d=c.length;for(let u=0;u<d;u++){let h=c[u],p=t[o];p.geometry=h,++o}}let r=ie.clone(e.ellipsoid),s=e.isGeographic?new vi(r):new hi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Vre(e){let t=e.length,n=1+(ue.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,ue.pack(e[r],i,o)):i[o++]=0,o+=ue.packedLength}return i}function Lre(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}_A.packCombineGeometryResults=function(e,t){l(e.geometries)&&kwe(e.geometries,t);let n=Vre(e.boundingSpheres),i=Vre(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};_A.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Lre(e.boundingSpheres),boundingSpheresCV:Lre(e.boundingSpheresCV)}};var Gx=_A;var htn=y(x(),1),Hwe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Kr=Object.freeze(Hwe);var ptn=y(x(),1),zd={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};zd.NUMBER_OF_SHADOW_MODES=4;zd.castShadows=function(e){return e===zd.ENABLED||e===zd.CAST_ONLY};zd.receiveShadows=function(e){return e===zd.ENABLED||e===zd.RECEIVE_ONLY};zd.fromCastReceive=function(e,t){return e&&t?zd.ENABLED:e?zd.CAST_ONLY:t?zd.RECEIVE_ONLY:zd.DISABLED};var Rn=Object.freeze(zd);function Jr(e){e=e??Q.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Rn.DISABLED,this._translucent=void 0,this._state=Kr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,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._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._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}Object.defineProperties(Jr.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}}});function Kwe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var Jwe=new M,jwe=new m,Mre=new ce;function Ure(e){let t=e.length;if(t===1)return e[0];if(t===2)return M.unpack(e,0,Jwe);if(t===3)return m.unpack(e,0,jwe);if(t===4)return ce.unpack(e,0,Mre)}function qwe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=Kwe(i),s=r.length,a=[],c={},d={},u,p=i[0].attributes,g,f,b;for(g=0;g<s;++g)f=r[g],b=p[f],c[f]=g,a.push({functionName:`czm_batchTable_${f}`,componentDatatype:b.componentDatatype,componentsPerAttribute:b.componentsPerAttribute,normalize:b.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:J.FLOAT,componentsPerAttribute:1}),d.center3DHigh=a.length-5,d.center3DLow=a.length-4,d.center2DHigh=a.length-3,d.center2DLow=a.length-2,d.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:J.FLOAT,componentsPerAttribute:3}),u=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let C=a.length,E=new Rx(t,a,o);for(g=0;g<o;++g){let T=i[g];p=T.attributes;for(let W=0;W<s;++W){f=r[W],b=p[f];let B=Ure(b.value),Y=c[f];E.setBatchedAttribute(g,Y,B)}let S={primitive:T.pickPrimitive??e};l(T.id)&&(S.id=T.id);let _=t.createPickId(S);e._pickIds.push(_);let R=_.color,L=Mre;L.x=D.floatToByte(R.red),L.y=D.floatToByte(R.green),L.z=D.floatToByte(R.blue),L.w=D.floatToByte(R.alpha),E.setBatchedAttribute(g,C-1,L)}e._batchTable=E,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=d,e._batchTableOffsetAttribute2DIndex=u}function $we(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new We({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function eYe(e){let t=e.attributes,n=new yn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=$we(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new pt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ue.clone(e.boundingSphere)})}function tYe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var nYe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Jr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=nYe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
`,r+=`in vec4 position;
`,s+=`${c}
{
    return u_modifiedModelView * position;
}

`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c}
{
    return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
}

`:(r+=`in vec3 ${a}2DHigh;
in vec3 ${a}2DLow;
`,s+=`${c}
{
    vec4 p;
    if (czm_morphTime == 1.0)
    {
        p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
    }
    else if (czm_morphTime == 0.0)
    {
        p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy);
    }
    else
    {
        p = czm_columbusViewMorph(
                czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy),
                czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow),
                czm_morphTime);
    }
    return p;
}

`)}return[o,r,t,s].join(`
`)};Jr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${ze.replaceMain(t,"czm_non_show_main")}
void main() 
{ 
    czm_non_show_main(); 
    gl_Position *= czm_batchTable_show(batchId); 
}`:t};Jr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function Wre(e){return`${ze.replaceMain(e,"czm_non_pick_main")}
out vec4 v_pickColor; 
void main() 
{ 
    czm_non_pick_main(); 
    v_pickColor = czm_batchTable_pickColor(batchId); 
}`}function Fre(e){return`in vec4 v_pickColor;
${e}`}Jr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};Jr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition();
`;return o+=`    if (czm_sceneMode == czm_sceneMode3D)
`,o+=`    {
`,o+="        $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=`    }
`,o+=`    else
`,o+=`    {
`,o+="        $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=`    }
`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};Jr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=ze.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() 
{ 
    czm_non_distanceDisplayCondition_main(); 
    vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
    vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
    vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
    float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
`;return n?o+=`    vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
`:o+=`    vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
    vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
    vec4 centerRTE;
    if (czm_morphTime == 1.0)
    {
        centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
    }
    else if (czm_morphTime == 0.0)
    {
        centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
    }
    else
    {
        centerRTE = czm_columbusViewMorph(
                czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
                czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
                czm_morphTime);
    }
`,o+=`    float radiusSq = boundingSphereRadius * boundingSphereRadius; 
    float distanceSq; 
    if (czm_sceneMode == czm_sceneMode2D) 
    { 
        distanceSq = czm_eyeHeight2D.y - radiusSq; 
    } 
    else 
    { 
        distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; 
    } 
    distanceSq = max(distanceSq, 0.0); 
    float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; 
    float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; 
    float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; 
    gl_Position *= show; 
}`,`${i}
${o}`};function Bre(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",d=`in ${a} ${c};`,u="",h="";if(i){u+=`vec2 st;
`;let f=s>1?`${c}.x`:c;h+=`    st = czm_decompressTextureCoordinates(${f});
`}n&&o&&r?(u+=`vec3 normal;
vec3 tangent;
vec3 bitangent;
`,h+=`    czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
`):(n&&(u+=`vec3 normal;
`,h+=`    normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""});
`),o&&(u+=`vec3 tangent;
`,h+=`    tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`),r&&(u+=`vec3 bitangent;
`,h+=`    bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=ze.replaceMain(p,"czm_non_compressed_main");let g=`void main() 
{ 
${h}    czm_non_compressed_main(); 
}`;return[d,u,p,g].join(`
`)}function iYe(e){let t=ze.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
    czm_non_depth_clamp_main();
    gl_Position = czm_depthClamp(gl_Position);}
`,t}function oYe(e){let t=ze.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
    czm_non_depth_clamp_main();
    #if defined(LOG_DEPTH)
        czm_writeLogDepth();
    #else
        czm_writeDepthClamp();
    #endif
}
`,t}function wre(e,t){let n=e.vertexAttributes}function rYe(e,t){return function(){return e[t]}}var nH=Math.max(rn.hardwareConcurrency-1,1),Av,sYe=new Jn("combineGeometry");function aYe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Kr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),d.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(Av))for(Av=new Array(nH),o=0;o<nH;o++)Av[o]=new Jn("createGeometry");let u;for(d=uL(d,nH),o=0;o<d.length;o++){let h=0,p=d[o],g=p.length;for(r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(u.offset=h,h+=i.constructor.packedLength??i.packedLength);let f;if(h>0){let b=new Float64Array(h);for(f=[b.buffer],r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,b,u.offset),u.geometry=b)}c.push(Av[o].scheduleTask({subTasks:d[o]},f))}e._state=Kr.CREATING,Promise.all(c).then(function(h){e._createGeometryResults=h,e._state=Kr.CREATED}).catch(function(h){fL(e,t,Kr.FAILED,h)})}else if(e._state===Kr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,d=t.mapProjection,u=sYe.scheduleTask(Gx.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Kr.COMBINING,Promise.resolve(u).then(function(h){let p=Gx.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Kr.COMBINED):fL(e,t,Kr.FAILED,void 0)}).catch(function(h){fL(e,t,Kr.FAILED,h)})}}function cYe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=eYe(p):g=p.constructor.createGeometry(p),o[c++]=tYe(s,g),r.push(s.id)}o.length=c;let d=t.scene3DOnly,u=t.mapProjection,h=Gx.combineGeometry({instances:o,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=F.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Kr.COMBINED):fL(e,t,Kr.FAILED,void 0)}function lYe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ue;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let b=a[i],C=e._batchTable.getBatchedAttribute(i,n,new m);b=r[i].clone(b),Qre(b,C,o[i])}let c=[],d=[],u=[];for(i=0;i<s;++i){let b=a[i];b.center.x-b.radius>0||ue.intersectPlane(b,an.ORIGIN_ZX_PLANE)!==Jt.INTERSECTING?c.push(b):(d.push(b),u.push(b))}let h=c[0],p=u[0],g=d[0];for(i=1;i<c.length;i++)h=ue.union(h,c[i]);for(i=1;i<u.length;i++)p=ue.union(p,u[i]);for(i=1;i<d.length;i++)g=ue.union(g,d[i]);let f=[];for(l(h)&&f.push(h),l(p)&&f.push(p),l(g)&&f.push(g),i=0;i<f.length;i++){let b=f[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=b,e._boundingSphereCV[i]=ue.projectTo2D(b,t.mapProjection,e._boundingSphereCV[i])}Jr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Yre=new ti,Dre=new pe,vre=new m,kre=new ue;function dYe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,d=t.mapProjection,u=d.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let f=0;f<g;++f){let b=p[f];if(!l(b))continue;let C=e.modelMatrix;l(C)&&(b=ue.transform(b,C,kre));let E=b.center,T=b.radius,S=ti.fromCartesian(E,Yre);if(h.setBatchedAttribute(f,o,S.high),h.setBatchedAttribute(f,r,S.low),!t.scene3DOnly){let _=u.cartesianToCartographic(E,Dre),R=d.project(_,vre);S=ti.fromCartesian(R,Yre),h.setBatchedAttribute(f,s,S.high),h.setBatchedAttribute(f,a,S.low)}h.setBatchedAttribute(f,c,T)}e._batchTableBoundingSpheresUpdated=!0}var iH=new m,uYe=new m;function Nre(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let d=0;d<c;++d){let u=a[d];if(!l(u))continue;let h=s.getBatchedAttribute(d,e._batchTableAttributeIndices.offset);if(m.equals(h,m.ZERO)){s.setBatchedAttribute(d,i,m.ZERO);continue}let p=e.modelMatrix;l(p)&&(u=ue.transform(u,p,kre));let g=u.center;g=r.scaleToGeodeticSurface(g,uYe);let f=r.cartesianToCartographic(g,Dre),b=o.project(f,vre),C=m.add(h,g,iH);f=r.cartesianToCartographic(C,f);let E=o.project(f,iH),T=m.subtract(E,b,iH),S=T.x;T.x=T.z,T.z=T.y,T.y=S,s.setBatchedAttribute(d,i,T)}e._batchTableOffsetsUpdated=!0}function mYe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let d=i[c];if(s.push(si.fromGeometry({context:r,geometry:d,attributeLocations:n,bufferUsage:Xe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,d);else if(e._boundingSpheres.push(ue.clone(d.boundingSphere)),e._boundingSphereWC.push(new ue),!o){let u=d.boundingSphereCV.center,h=u.x,p=u.y,g=u.z;u.x=g,u.y=h,u.z=p,e._boundingSphereCV.push(ue.clone(d.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,fL(e,t,Kr.COMPLETE,void 0)}function hYe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Qe(o,!1),r.cull={enabled:!0,face:wi.BACK},e._frontFaceRS=ke.fromCache(r),r.cull.face=wi.FRONT,e._backFaceRS=ke.fromCache(r)):(e._frontFaceRS=ke.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Qe(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Qe(o,!1),r.depthTest.func=ka.GREATER,i?(r.cull={enabled:!0,face:wi.BACK},e._frontFaceDepthFailRS=ke.fromCache(r),r.cull.face=wi.FRONT,e._backFaceDepthFailRS=ke.fromCache(r)):(e._frontFaceDepthFailRS=ke.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function fYe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Jr._appendOffsetToShader(e,r),r=Jr._appendShowToShader(e,r),r=Jr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Wre(r),r=Jr._updateColorAttribute(e,r,!1),r=Bre(e,r),r=Jr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Fre(s),e._sp=cn.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),wre(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Jr._appendShowToShader(e,r),r=Jr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Wre(r),r=Jr._updateColorAttribute(e,r,!0),r=Bre(e,r),r=Jr._modifyShaderPosition(e,r,t.scene3DOnly),r=iYe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=Fre(s),s=oYe(s),e._spDepthFail=cn.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),wre(e._spDepthFail,o))}var hL=new F,Xre=new m;function Pre(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=rYe(s,c));let a=Rt(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return F.multiply(c,e._modelMatrix,hL),F.multiplyByPoint(hL,e.rtcCenter,Xre),F.setTranslation(hL,Xre,hL),hL}),a}function pYe(e,t,n,i,o,r,s,a){let c=Pre(e,t,n,a),d;l(e._depthFailAppearance)&&(d=Pre(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let u=i?Ve.TRANSLUCENT:Ve.OPAQUE,h=o?2:1;h*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,g=0;for(let f=0;f<p;++f){let b;o&&(b=r[f],l(b)||(b=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),b.vertexArray=e._va[g],b.renderState=e._backFaceRS,b.shaderProgram=e._sp,b.uniformMap=c,b.pass=u,++f),b=r[f],l(b)||(b=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),b.vertexArray=e._va[g],b.renderState=e._frontFaceRS,b.shaderProgram=e._sp,b.uniformMap=c,b.pass=u,l(e._depthFailAppearance)&&(o&&(++f,b=r[f],l(b)||(b=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),b.vertexArray=e._va[g],b.renderState=e._backFaceDepthFailRS,b.shaderProgram=e._spDepthFail,b.uniformMap=d,b.pass=u),++f,b=r[f],l(b)||(b=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),b.vertexArray=e._va[g],b.renderState=e._frontFaceDepthFailRS,b.shaderProgram=e._spDepthFail,b.uniformMap=d,b.pass=u),++g}}Jr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=ue.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ue.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphereMorph[o]=ue.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],u=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+u}};function AYe(e,t,n,i,o,r,s,a){Jr._updateBoundingVolumes(e,t,o);let c;t.mode===se.SCENE3D?c=e._boundingSphereWC:t.mode===se.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===se.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let d=t.commandList,u=t.passes;if(u.render||u.pick){let h=e.allowPicking,p=Rn.castShadows(e.shadows),g=Rn.receiveShadows(e.shadows),f=n.length,b=a?2:1;b*=l(e._depthFailAppearance)?2:1;for(let C=0;C<f;++C){let E=Math.floor(C/b),T=n[C];T.modelMatrix=o,T.boundingVolume=c[E],T.cull=r,T.debugShowBoundingVolume=s,T.castShadows=p,T.receiveShadows=g,h?T.pickId="v_pickColor":T.pickId=void 0,d.push(T)}}}Jr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==se.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Kr.FAILED)return;let t=e.context;if(l(this._batchTable)||qwe(this,t),this._batchTable.attributes.length>0){if(Yt.maximumVertexTextureImageUnits===0)throw new he("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!==Kr.COMPLETE&&this._state!==Kr.COMBINED&&(this.asynchronous?aYe(this,e):cYe(this,e)),this._state===Kr.COMBINED&&(dYe(this,e),Nre(this,e),mYe(this,e)),!this.show||this._state!==Kr.COMPLETE)return;this._batchTableOffsetsUpdated||Nre(this,e),this._recomputeBoundingSpheres&&lYe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let d=n.closed&&c;o&&(this._createRenderStatesFunction??hYe)(this,t,n,d),r&&(this._createShaderProgramFunction??fYe)(this,e,n),(o||r)&&(this._createCommandsFunction??pYe)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??AYe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var gYe=new ue,bYe=new ue;function Qre(e,t,n){if(n===mn.TOP){let i=ue.clone(e,gYe),o=ue.clone(e,bYe);o.center=m.add(o.center,t,o.center),e=ue.union(i,o,e)}else n===mn.ALL&&(e.center=m.add(e.center,t,e.center));return e}function yYe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=J.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function xYe(e,t,n,i,o){return function(r){let s=Ure(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var CYe=new m;function EYe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&Qre(i,m.fromArray(r.get(),0,CYe),e._offsetInstanceExtend[n]),l(o)&&(i=ue.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function TYe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Jr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d<r;++d){let u=(i+d)%r;if(e===o[u]){n=u;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let d in a)if(a.hasOwnProperty(d)){let u=a[d];c[d]={get:yYe(s,n,u),set:xYe(s,n,u,this,d)}}return EYe(this,c,n),TYe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Jr.prototype.isDestroyed=function(){return!1};Jr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,fe(this)};function fL(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===Kr.COMPLETE||e._state===Kr.FAILED,!0})}var Nn=Jr;var Tnn=y(x(),1);var rnn=y(x(),1);function SYe(e){e=e??Q.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Yc=SYe;var ann=y(x(),1),dS=`#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
in vec4 v_sphericalExtents;
#else // SPHERICAL
in vec2 v_inversePlaneExtents;
in vec4 v_westPlane;
in vec4 v_southPlane;
#endif // SPHERICAL
in vec3 v_uvMinAndSphericalLongitudeRotation;
in vec3 v_uMaxAndInverseDistance;
in vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES

#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif

#ifdef NORMAL_EC
vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {
    vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);
    return eyeCoordinate.xyz / eyeCoordinate.w;
}

vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {
    vec2 glFragCoordXY = gl_FragCoord.xy;
    // Sample depths at both offset and negative offset
    float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
    float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
    // Explicitly evaluate both paths
    // Necessary for multifrustum and for edges of the screen
    bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);
    float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);
    float useDownOrLeft = float(useUpOrRight == 0.0);
    vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);
    vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);
    return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;
}
#endif // NORMAL_EC

void main(void)
{
#ifdef REQUIRES_EC
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));
    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
#endif

#ifdef REQUIRES_WC
    vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;
    vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;
#endif

#ifdef TEXTURE_COORDINATES
    vec2 uv;
#ifdef SPHERICAL
    // Treat world coords as a sphere normal for spherical coordinates
    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);
    sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;
    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
    uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;
    uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;
#else // SPHERICAL
    // Unpack planes and transform to eye space
    uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;
    uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;
#endif // SPHERICAL
#endif // TEXTURE_COORDINATES

#ifdef CULL_FRAGMENTS
    // When classifying translucent geometry, logDepthOrDepth == 0.0
    // indicates a region that should not be classified, possibly due to there
    // being opaque pixels there in another buffer.
    if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
        discard;
    }
#endif

#ifdef PICK
    out_FragColor.a = 1.0; // Explicitly set the alpha, otherwise this may be discarded by ShaderSource.createPickFragmentShaderSource
#ifdef CULL_FRAGMENTS
    czm_writeDepthClamp();
#endif // CULL_FRAGMENTS
#else // PICK

#ifdef NORMAL_EC
    // Compute normal by sampling adjacent pixels in 2x2 block in screen space
    vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));
    vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));
    vec3 normalEC = normalize(cross(leftRight, downUp));
#endif


#ifdef PER_INSTANCE_COLOR

    vec4 color = czm_gammaCorrect(v_color);
#ifdef FLAT
    out_FragColor = color;
#else // FLAT
    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = -eyeCoordinate.xyz;
    czm_material material = czm_getDefaultMaterial(materialInput);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT

    // Premultiply alpha. Required for classification primitives on translucent globe.
    out_FragColor.rgb *= out_FragColor.a;

#else // PER_INSTANCE_COLOR

    // Material support.
    // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or
    // dependencies for culling but might not actually be used by the material.

    czm_materialInput materialInput;

#ifdef USES_NORMAL_EC
    materialInput.normalEC = normalEC;
#endif

#ifdef USES_POSITION_TO_EYE_EC
    materialInput.positionToEyeEC = -eyeCoordinate.xyz;
#endif

#ifdef USES_TANGENT_TO_EYE
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);
#endif

#ifdef USES_ST
    // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired
    // texture coordinate system, which typically forms a tight oriented bounding box around the geometry.
    // Shader is provided a set of reference points for remapping.
    materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;
    materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;
#endif

    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else // FLAT
    out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT

    // Premultiply alpha. Required for classification primitives on translucent globe.
    out_FragColor.rgb *= out_FragColor.a;

#endif // PER_INSTANCE_COLOR
    czm_writeDepthClamp();
#endif // PICK
}
`;function tm(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new oH;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new oH;if(o.requiresTextureCoordinates=e,n instanceof pn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource}
${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}tm.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof pn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof pn||(o=t.material.shaderSource),new ze({defines:i,sources:[o,dS]})};tm.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new ze({defines:n,sources:[dS],pickColorQualifier:"in"})};tm.prototype.createVertexShader=function(e,t,n,i){return $re(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};tm.prototype.createPickVertexShader=function(e,t,n,i){return $re(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Ore=new m,zre=new pe,Hre={high:0,low:0};function $re(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=zre;d.longitude=V.PI,d.latitude=0,d.height=0;let u=s.project(d,Ore),h=ti.encode(u.x,Hre);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=zre;p.longitude=-V.PI,p.latitude=0,p.height=0;let g=s.project(p,Ore);h=ti.encode(g.x,Hre),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof pn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new ze({defines:c,sources:[o]})}function oH(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(oH.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}}});function Kre(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/M.distance(t,e)}var IYe=[new M,new M,new M,new M];function ese(e,t){let n=IYe,i=M.unpack(t,0,n[0]),o=M.unpack(t,2,n[1]),r=M.unpack(t,4,n[2]);e.uMaxVmax=new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Kre(i,o,r),a=1/Kre(i,r,o);e.uvMinAndExtents=new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var tse=new pe,nse=new m,_Ye=new m,ZYe=new m,gv={high:0,low:0};function ise(e,t,n){let i=tse;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,nse);i.latitude=e.north;let r=t.project(i,_Ye);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,ZYe),a=[0,0,0,0],c=[0,0,0,0],d=ti.encode(o.x,gv);a[0]=d.high,c[0]=d.low,d=ti.encode(o.y,gv),a[1]=d.high,c[1]=d.low,d=ti.encode(r.y,gv),a[2]=d.high,c[2]=d.low,d=ti.encode(s.x,gv),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var RYe=new F,GYe=new F,Jre=new m,VYe=new pe,LYe=[new pe,new pe,new pe,new pe,new pe,new pe,new pe,new pe];function WYe(e,t,n,i,o,r){let s=de.center(e,VYe);s.height=n;let a=pe.toCartesian(s,t,Jre),c=Tt.eastNorthUpToFixedFrame(a,t,RYe),d=F.inverse(c,GYe),u=e.west,h=e.east,p=e.north,g=e.south,f=LYe;f[0].latitude=g,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=h,f[3].latitude=g,f[3].longitude=h;let b=(u+h)*.5,C=(p+g)*.5;f[4].latitude=g,f[4].longitude=b,f[5].latitude=p,f[5].longitude=b,f[6].latitude=C,f[6].longitude=u,f[7].latitude=C,f[7].longitude=h;let E=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,S=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(let B=0;B<8;B++){f[B].height=n;let Y=pe.toCartesian(f[B],t,Jre);F.multiplyByPoint(d,Y,Y),Y.z=0,E=Math.min(E,Y.x),T=Math.max(T,Y.x),S=Math.min(S,Y.y),_=Math.max(_,Y.y)}let R=i;R.x=E,R.y=S,R.z=0,F.multiplyByPoint(c,R,R);let L=o;L.x=T,L.y=S,L.z=0,F.multiplyByPoint(c,L,L),m.subtract(L,R,o);let W=r;W.x=E,W.y=_,W.z=0,F.multiplyByPoint(c,W,W),m.subtract(W,R,r)}var FYe=new m,BYe=new m,wYe=new ti;tm.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=nse,s=FYe,a=BYe;WYe(e,n,o??0,r,s,a);let c={};ese(c,t);let d=ti.fromCartesian(r,wYe);return c.southWest_HIGH=new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.high,[0,0,0])}),c.southWest_LOW=new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.low,[0,0,0])}),c.eastward=new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),ise(e,i,c),c};var YYe=new m;function jre(e,t,n,i){let o=tse;o.latitude=e,o.longitude=t,o.height=0;let r=pe.toCartesian(o,n,YYe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=V.fastApproximateAtan2(s,r.z),c=V.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var qre=new M;tm.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=jre(e.south,e.west,n,qre),r=o.x,s=o.y,a=jre(e.north,e.east,n,qre),c=a.x,d=a.y,u=0;s>d&&(u=V.PI-s,s=-V.PI,d+=u),r-=V.EPSILON5,s-=V.EPSILON5,c+=V.EPSILON5,d+=V.EPSILON5;let h=1/(d-s),p=1/(c-r),g={sphericalExtents:new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new Yc({componentDatatype:J.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return ese(g,t),ise(e,i,g),g};tm.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};tm.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function NYe(e){return Math.max(e.width,e.height)>tm.MAX_WIDTH_FOR_PLANAR_EXTENTS}tm.shouldUseSphericalCoordinates=function(e){return NYe(e)};tm.MAX_WIDTH_FOR_PLANAR_EXTENTS=V.toRadians(1);var Hd=tm;var Fnn=y(x(),1);var _nn=y(x(),1);var XYe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},$n=Object.freeze(XYe);var Gnn=y(x(),1);var PYe={ZERO:ne.ZERO,KEEP:ne.KEEP,REPLACE:ne.REPLACE,INCREMENT:ne.INCR,DECREMENT:ne.DECR,INVERT:ne.INVERT,INCREMENT_WRAP:ne.INCR_WRAP,DECREMENT_WRAP:ne.DECR_WRAP},Ct=Object.freeze(PYe);var bv={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};bv.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:$n.ALWAYS,frontOperation:{fail:Ct.KEEP,zFail:Ct.KEEP,zPass:Ct.REPLACE},backFunction:$n.ALWAYS,backOperation:{fail:Ct.KEEP,zFail:Ct.KEEP,zPass:Ct.REPLACE},reference:bv.CESIUM_3D_TILE_MASK,mask:bv.CESIUM_3D_TILE_MASK}};var Qt=Object.freeze(bv);function Vx(e){e=e??Q.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??qn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=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._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:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Vx.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}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Vx.isSupported=function(e){return e.context.stencilBuffer};function uS(e,t){let n=t?$n.EQUAL:$n.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Ct.KEEP,zFail:Ct.DECREMENT_WRAP,zPass:Ct.KEEP},backFunction:n,backOperation:{fail:Ct.KEEP,zFail:Ct.INCREMENT_WRAP,zPass:Ct.KEEP},reference:Qt.CESIUM_3D_TILE_MASK,mask:Qt.CESIUM_3D_TILE_MASK},stencilMask:Qt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL},depthMask:!1}}function sH(e){return{stencilTest:{enabled:e,frontFunction:$n.NOT_EQUAL,frontOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},backFunction:$n.NOT_EQUAL,backOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},reference:0,mask:Qt.CLASSIFICATION_MASK},stencilMask:Qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND}}var MYe={stencilTest:{enabled:!0,frontFunction:$n.NOT_EQUAL,frontOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},backFunction:$n.NOT_EQUAL,backOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},reference:0,mask:Qt.CLASSIFICATION_MASK},stencilMask:Qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function UYe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ke.fromCache(uS(o,!1)),e._rsStencilDepthPass3DTiles=ke.fromCache(uS(o,!0)),e._rsColorPass=ke.fromCache(sH(o,!1)),e._rsPickPass=ke.fromCache(MYe)}function DYe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
`,r=`    extrudeDirection = czm_octDecode(${n}, 65535.0);
`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=ze.replaceMain(s,"czm_non_compressed_main");let a=`void main() 
{ 
${r}    czm_non_compressed_main(); 
}`;return[i,o,s,a].join(`
`)}}function vYe(e,t){let n=t.context,i=e._primitive,o=dL;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Nn._appendDistanceDisplayConditionToShader(i,o),o=Nn._modifyShaderPosition(e,o,t.scene3DOnly),o=Nn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=DYe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new ze({defines:[a],sources:[o]}),d=new ze({sources:[Qb]}),u=e._primitive._attributeLocations,h=new Hd(s,r,e.appearance);if(e._spStencil=cn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=ze.createPickVertexShaderSource(o);f=Nn._appendShowToShader(i,f),f=Nn._updatePickColorAttribute(f);let b=h.createPickFragmentShader(!1),C=h.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=cn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:C,fragmentShaderSource:b,attributeLocations:u}),s){let E=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(E)){let T=h.createPickFragmentShader(!0),S=h.createPickVertexShader([a],f,!0,t.mapProjection);E=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:S,fragmentShaderSource:T,attributeLocations:u})}e._spPick2D=E}}else e._spPick=cn.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=Nn._appendShowToShader(i,o),c=new ze({defines:[a],sources:[o]}),e._sp=cn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=cn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let b=h.createFragmentShader(!0),C=h.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:C,fragmentShaderSource:b,attributeLocations:u})}e._spColor2D=f}}function kYe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],l(r)||(r=t[o]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Ve.TERRAIN_CLASSIFICATION,s=nt.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Ve.TERRAIN_CLASSIFICATION;let b=e.appearance.material;if(l(b)&&(c=Rt(c,b._uniforms)),r.uniformMap=c,s=nt.shallowClone(r,r.derivedCommands.tileset),s.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,d){let C=nt.shallowClone(r,r.derivedCommands.appearance2D);C.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=C,C=nt.shallowClone(s,s.derivedCommands.appearance2D),C.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=C}}let u=e._commandsIgnoreShow,h=e._spStencil,p=0;i=u.length=i/2;for(let g=0;g<i;++g){let f=u[g]=nt.shallowClone(t[p],u[g]);f.shaderProgram=h,f.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function QYe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,d,u,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<o;c+=2){let f=i._va[h++];if(n&&(a=r[s++],f=i._va[a.index]),d=t[c],l(d)||(d=t[c]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=p,d.pass=Ve.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=nt.shallowClone(d,d.derivedCommands.tileset),u.renderState=e._rsStencilDepthPass3DTiles,u.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,d=t[c+1],l(d)||(d=t[c+1]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=p,d.pass=Ve.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=nt.shallowClone(d,d.derivedCommands.tileset),u.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,g){let b=nt.shallowClone(d,d.derivedCommands.pick2D);b.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=b,b=nt.shallowClone(u,u.derivedCommands.pick2D),b.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=b}}}function OYe(e,t,n,i,o,r,s){kYe(e,r),QYe(e,s)}function ose(e,t){return Math.floor(e%t/2)}function rH(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function rse(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function zYe(e,t,n,i,o,r,s,a){let c=e._primitive;Nn._updateBoundingVolumes(c,t,o);let d;t.mode===se.SCENE3D?d=c._boundingSphereWC:t.mode===se.COLUMBUS_VIEW?d=c._boundingSphereCV:t.mode===se.SCENE2D&&l(c._boundingSphere2D)?d=c._boundingSphere2D:l(c._boundingSphereMorph)&&(d=c._boundingSphereMorph);let u=e.classificationType,h=u!==qn.CESIUM_3D_TILE,p=u!==qn.TERRAIN,g=t.passes,f,b,C;if(g.render){let E=n.length;for(f=0;f<E;++f)b=d[ose(f,E)],h&&(C=n[f],rH(C,t,o,r,b,s)),p&&(C=n[f].derivedCommands.tileset,rH(C,t,o,r,b,s));if(t.invertClassification){let T=e._commandsIgnoreShow,S=T.length;for(f=0;f<S;++f)b=d[f],C=T[f],rH(C,t,o,r,b,s)}}if(g.pick){let E=i.length,T=c._pickOffsets;for(f=0;f<E;++f){let S=T[ose(f,E)];b=d[S.index],h&&(C=i[f],rse(C,t,o,r,b)),p&&(C=i[f].derivedCommands.tileset,rse(C,t,o,r,b))}}}Vx.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,d=!1,u=!0,h,p=!1,g=!1;for(r>0&&(c=o[0].attributes,p=Hd.hasAttributesForSphericalExtents(c),g=Hd.hasAttributesForTextureCoordinatePlanes(c),h=c.color),s=0;s<r;s++){a=o[s];let b=a.attributes.color;l(b)&&(d=!0),u=u&&l(b)&&qt.equals(h,b)}if(!u&&!p&&!g)throw new Ae("All GeometryInstances must have the same color attribute except via GroundPrimitives");d&&!l(t)&&(t=new pn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=d;let f=new Array(r);for(s=0;s<r;++s)a=o[s],f[s]=new Bt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=f,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(b,C){n._createBoundingVolumeFunction(b,C)}),i._createRenderStatesFunction=function(b,C,E,T){UYe(n,C)},i._createShaderProgramFunction=function(b,C,E){vYe(n,C)},i._createCommandsFunction=function(b,C,E,T,S,_,R){OYe(n,void 0,void 0,!0,!1,_,R)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(b,C,E,T,S,_,R,L){n._updateAndQueueCommandsFunction(b,C,E,T,S,_,R,L)}:i._updateAndQueueCommandsFunction=function(b,C,E,T,S,_,R,L){zYe(n,C,E,T,S,_,R,L)},this._primitive=new Nn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ke.fromCache(uS(!1,!1)),this._rsStencilDepthPass3DTiles=ke.fromCache(uS(!1,!0)),this._rsColorPass=ke.fromCache(sH(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ke.fromCache(uS(!0,!1)),this._rsStencilDepthPass3DTiles=ke.fromCache(uS(!0,!0)),this._rsColorPass=ke.fromCache(sH(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Vx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Vx.prototype.isDestroyed=function(){return!1};Vx.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,fe(this)};var mS=Vx;var HYe={u_globeMinimumAltitude:function(){return 55e3}};function ad(e){e=e??Q.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new pn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??qn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Zi._defaultMaxTerrainHeight,this._minTerrainHeight=Zi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:HYe}}Object.defineProperties(ad.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}}});ad.isSupported=mS.isSupported;function sse(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function ase(e){return function(t,n){return e._minHeight}}var KYe=new m,JYe=new m,jYe=new m,qYe=new pe,$Ye=new de;function yv(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=m.unpack(i,h,KYe),g=m.unpack(o,h,JYe),f=m.add(p,g,jYe),b=n.cartesianToCartographic(f,qYe),C=b.latitude,E=b.longitude;s=Math.min(s,C),a=Math.min(a,E),c=Math.max(c,C),d=Math.max(d,E)}let u=$Ye;return u.north=c,u.south=s,u.east=d,u.west=a,u}function eNe(e,t,n){let i=Zi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function tNe(e,t,n){let i=t.mapProjection.ellipsoid,o=yv(t,n),r=tn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ue.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);m.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function aH(e,t){return Math.floor(e%t/2)}function cH(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==se.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function cse(e,t,n,i,o,r){let s=e._primitive;n.mode!==se.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function nNe(e,t,n,i,o,r,s,a){let c;t.mode===se.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let d=e.classificationType,u=d!==qn.CESIUM_3D_TILE,h=d!==qn.TERRAIN,p=t.passes,g=e._primitive,f,b,C;if(p.render){let E=n.length;for(f=0;f<E;++f)b=c[aH(f,E)],u&&(C=n[f],cH(e,C,t,o,r,b,s)),h&&(C=n[f].derivedCommands.tileset,cH(e,C,t,o,r,b,s));if(t.invertClassification){let T=g._commandsIgnoreShow,S=T.length;for(f=0;f<S;++f)b=c[f],C=T[f],cH(e,C,t,o,r,b,s)}}if(p.pick){let E=i.length,T;for(e._useFragmentCulling||(T=g._primitive._pickOffsets),f=0;f<E;++f){if(b=c[aH(f,E)],!e._useFragmentCulling){let S=T[aH(f,E)];b=c[S.index]}u&&(C=i[f],cse(e,C,t,o,r,b)),h&&(C=i[f].derivedCommands.tileset,cse(e,C,t,o,r,b))}}}ad.initializeTerrainHeights=function(){return Zi.initialize()};ad.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Zi.initialized){ad.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,d=new Array(c),u,h;for(u=0;u<c;++u){o=a[u],r=o.geometry;let b=yv(e,r);l(h)?l(b)&&de.union(h,b,h):h=de.clone(b);let C=o.id;if(l(C)&&l(b)){let E=Zi.getBoundingSphere(b,i);this._boundingSpheresKeys.push(C),this._boundingSpheres.push(E)}s=r.constructor,!l(s)||l(s.createShadowVolume)}eNe(this,h,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Eo.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Eo.getHeight(this._maxTerrainHeight,p,g);let f=ad._supportsMaterials(e.context);if(this._useFragmentCulling=f,f){let b,C=!0;for(u=0;u<c;++u)if(o=a[u],r=o.geometry,h=yv(e,r),Hd.shouldUseSphericalCoordinates(h)){C=!1;break}for(u=0;u<c;++u){o=a[u],r=o.geometry,s=r.constructor;let E=yv(e,r),T=r.textureCoordinateRotationPoints;C?b=Hd.getPlanarTextureCoordinateAttributes(E,T,i,e.mapProjection,this._maxHeight):b=Hd.getSphericalExtentGeometryInstanceAttributes(E,T,i,e.mapProjection);let S=o.attributes;for(let _ in S)S.hasOwnProperty(_)&&(b[_]=S[_]);d[u]=new Bt({geometry:s.createShadowVolume(r,ase(this),sse(this)),attributes:b,id:o.id})}}else for(u=0;u<c;++u)o=a[u],r=o.geometry,s=r.constructor,d[u]=new Bt({geometry:s.createShadowVolume(r,ase(this),sse(this)),attributes:o.attributes,id:o.id});n.geometryInstances=d,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(b,C){tNe(t,b,C)},n._updateAndQueueCommandsFunction=function(b,C,E,T,S,_,R,L){nNe(t,C,E,T,S,_,R,L)},this._primitive=new mS(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};ad.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};ad.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};ad.prototype.isDestroyed=function(){return!1};ad.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};ad._supportsMaterials=function(e){return e.depthTexture};ad.supportsMaterials=function(e){return ad._supportsMaterials(e.frameState.context)};var pl=ad;var Vin=y(x(),1);function hS(){Ae.throwInstantiationError()}Object.defineProperties(hS.prototype,{isConstant:{get:Ae.throwInstantiationError},definitionChanged:{get:Ae.throwInstantiationError}});hS.prototype.getType=Ae.throwInstantiationError;hS.prototype.getValue=Ae.throwInstantiationError;hS.prototype.equals=Ae.throwInstantiationError;var iNe=new j;hS.getValue=function(e,t,n){let i;return l(e)||(e=j.now(iNe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=ho.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==ho.ColorType)&&(n=ho.fromType(ho.ColorType)),D.clone(D.WHITE,n.uniforms.color),n)};var yr=hS;function Lx(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Lx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!K.getValueOrDefault(t.show,n,!0)};Lx.prototype._setOptions=Ae.throwInstantiationError;Lx.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof Kt,h,p=t._getIsClosed(c);if(u)h=new pn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=yr.getValue(e,d,this._material);this._material=g,h=new Io({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=pn.VERTEX_FORMAT,this._primitive=o.add(new pl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),K.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);u&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Nn({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=K.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Nn({geometryInstances:d,appearance:new pn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};Lx.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ue.clone(o.boundingSphere,e),gt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ue.clone(o.boundingSphere,e),gt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?gt.PENDING:gt.FAILED};Lx.prototype.isDestroyed=function(){return!1};Lx.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),fe(this)};var Ci=Lx;var ddn=y(x(),1);var zin=y(x(),1);var lse={};function pL(e,t){l(lse[e])||(lse[e]=!0,console.warn(t??e))}pL.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.";pL.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined.  zIndex will be ignored";pL.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height.  heightReference will be ignored";pL.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight.  extrudedHeightReference will be ignored";var At=pL;var Hln=y(x(),1);var Kin=y(x(),1),oNe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},ZA=Object.freeze(oNe);var Jrn=y(x(),1);var Mon=y(x(),1);var jin=y(x(),1),rNe={NONE:0,GEODESIC:1,RHUMB:2},ln=Object.freeze(rNe);var ton=y(x(),1);var dse=V.EPSILON10;function sNe(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,h=-1;for(s=1;s<r;++s)c=e[s],t(a,c,dse)?(l(d)||(d=e.slice(0,s),u=s-1,h=0),o&&i.push(s)):(l(d)&&(d.push(c),u=s,o&&(h=i.length)),a=c);return n&&t(e[0],e[r-1],dse)&&(o&&(l(d)?i.splice(h,0,u):i.push(r-1)),l(d)?d.length-=1:d=e.slice(0,-1)),l(d)?d:e}var Mo=sNe;var con=y(x(),1);function aNe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),d=c*a,u=Math.atan2(a,r),h=c*s,p=h*h,g=1-p,f=Math.sqrt(g),b=t/4,C=b*b,E=C*b,T=C*C,S=1+b-3*C/4+5*E/4-175*T/64,_=1-b+15*C/8-35*E/8,R=1-3*b+35*C/4,L=1-5*b,W=S*u-_*Math.sin(2*u)*b/2-R*Math.sin(4*u)*C/16-L*Math.sin(6*u)*E/48-Math.sin(8*u)*5*T/512,B=e._constants;B.a=n,B.b=i,B.f=o,B.cosineHeading=r,B.sineHeading=s,B.tanU=a,B.cosineU=c,B.sineU=d,B.sigma=u,B.sineAlpha=h,B.sineSquaredAlpha=p,B.cosineSquaredAlpha=g,B.cosineAlpha=f,B.u2Over4=b,B.u4Over16=C,B.u6Over64=E,B.u8Over256=T,B.a0=S,B.a1=_,B.a2=R,B.a3=L,B.distanceRatio=W}function cNe(e,t){return e*t*(4+e*(4-3*t))/16}function use(e,t,n,i,o,r,s){let a=cNe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function lNe(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,d=Math.atan((1-a)*Math.tan(o)),u=Math.atan((1-a)*Math.tan(s)),h=Math.cos(d),p=Math.sin(d),g=Math.cos(u),f=Math.sin(u),b=h*g,C=h*f,E=p*f,T=p*g,S=c,_=V.TWO_PI,R=Math.cos(S),L=Math.sin(S),W,B,Y,N,A;do{R=Math.cos(S),L=Math.sin(S);let P=C-T*R;Y=Math.sqrt(g*g*L*L+P*P),B=E+b*R,W=Math.atan2(Y,B);let O;Y===0?(O=0,N=1):(O=b*L/Y,N=1-O*O),_=S,A=B-2*E/N,isFinite(A)||(A=0),S=c+use(a,O,N,W,Y,B,A)}while(Math.abs(S-_)>V.EPSILON12);let I=N*(t*t-n*n)/(n*n),Z=1+I*(4096+I*(I*(320-175*I)-768))/16384,G=I*(256+I*(I*(74-47*I)-128))/1024,w=A*A,X=G*Y*(A+G*(B*(2*w-1)-G*A*(4*Y*Y-3)*(4*w-3)/6)/4),v=n*Z*(W-X),U=Math.atan2(g*L,C-T*R),k=Math.atan2(h*L,C*R-T);e._distance=v,e._startHeading=U,e._endHeading=k,e._uSquared=I}var dNe=new m,lH=new m;function mse(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,lH),dNe),r=m.normalize(i.cartographicToCartesian(n,lH),lH);lNe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=pe.clone(t,e._start),e._end=pe.clone(n,e._end),e._start.height=0,e._end.height=0,aNe(e)}function AL(e,t,n){let i=n??ie.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&mse(this,e,t,i)}Object.defineProperties(AL.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});AL.prototype.setEndPoints=function(e,t){mse(this,e,t,this._ellipsoid)};AL.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};AL.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),h=i*i,p=i*h,g=n.u8Over256,f=n.u2Over4,b=n.u6Over64,C=n.u4Over16,E=2*p*g*o/3+i*(1-f+7*C/4-15*b/4+579*g/64-(C-15*b/4+187*g/16)*o-(5*b/4-115*g/16)*r-29*g*s/16)+(f/2-C+71*b/32-85*g/16)*a+(5*C/16-5*b/4+383*g/96)*c-h*((b-11*g/2)*a+5*g*c/2)+(29*b/96-29*g/16)*d+539*g*u/1536,T=Math.asin(Math.sin(E)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(T));E=E-n.sigma;let _=Math.cos(2*n.sigma+E),R=Math.sin(E),L=Math.cos(E),W=n.cosineU*L,B=n.sineU*R,N=Math.atan2(R*n.sineHeading,W-B*n.cosineHeading)-use(n.f,n.sineAlpha,n.cosineSquaredAlpha,E,R,L,_);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=S,t.height=0,t):new pe(this._start.longitude+N,S,0)};var RA=AL;var pon=y(x(),1);function uH(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,d=n,u=Math.sin(2*d),h=Math.sin(4*d),p=Math.sin(6*d),g=Math.sin(8*d),f=Math.sin(10*d),b=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*b)}function uNe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,d=c*c,u=d*c,h=u*c,p=h*c,g=p*c,f=Math.sin(2*i),b=Math.cos(2*i),C=Math.sin(4*i),E=Math.cos(4*i),T=Math.sin(6*i),S=Math.cos(6*i),_=Math.sin(8*i),R=Math.cos(8*i),L=Math.sin(10*i),W=Math.cos(10*i),B=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*h/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*b+(21*i*u/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*E+(151*i*h/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*S+(1097*i*p/65536+42783*i*g/1048576)*R+8011*i*g/1048576*W+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*f+(21*d/256+21*u/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*C+(151*u/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*T+(1097*h/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*_+(8011*p/2621440+8011*g/1048576)*L+293393*g/251658240*B}function fS(e,t){if(e===0)return Math.log(Math.tan(.5*(V.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(V.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function mNe(e,t,n,i,o){let r=fS(e._ellipticity,n),s=fS(e._ellipticity,o);return Math.atan2(V.negativePiToPi(i-t),s-r)}function hNe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d=0;if(V.equalsEpsilon(Math.abs(a),V.PI_OVER_TWO,V.EPSILON8))if(t===n)d=t*Math.cos(o)*V.negativePiToPi(c);else{let u=Math.sin(o);d=t*Math.cos(o)*V.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=uH(e._ellipticity,t,o);d=(uH(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var fNe=new m,dH=new m;function hse(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,dH),fNe),r=m.normalize(i.cartographicToCartesian(n,dH),dH),s=i.maximumRadius,a=i.minimumRadius,c=s*s,d=a*a;e._ellipticitySquared=(c-d)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=pe.clone(t,e._start),e._start.height=0,e._end=pe.clone(n,e._end),e._end.height=0,e._heading=mNe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=hNe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function fse(e,t,n,i,o,r){if(n===0)return pe.clone(e,r);let s=o*o,a,c,d;if(Math.abs(V.PI_OVER_TWO-Math.abs(t))>V.EPSILON8){let u=uH(o,i,e.latitude),h=n*Math.cos(t),p=u+h;if(c=uNe(p,o,i),Math.abs(t)<V.EPSILON10)a=V.negativePiToPi(e.longitude);else{let g=fS(o,e.latitude),f=fS(o,c);d=Math.tan(t)*(f-g),a=V.negativePiToPi(e.longitude+d)}}else{c=e.latitude;let u;if(o===0)u=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);u=i*Math.cos(e.latitude)/Math.sqrt(1-s*h*h)}d=n/u,t>0?a=V.negativePiToPi(e.longitude+d):a=V.negativePiToPi(e.longitude-d)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new pe(a,c,0)}function GA(e,t,n){let i=n??ie.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&hse(this,e,t,i)}Object.defineProperties(GA.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});GA.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??ie.default,s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=V.negativePiToPi(t);let h=fse(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new GA(e,h,r):(o.setEndPoints(e,h),o)};GA.prototype.setEndPoints=function(e,t){hse(this,e,t,this._ellipsoid)};GA.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};GA.prototype.interpolateUsingSurfaceDistance=function(e,t){return fse(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};GA.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=V.negativePiToPi(e),V.equalsEpsilon(Math.abs(e),Math.PI,V.EPSILON14)&&(e=V.sign(r.longitude)*Math.PI),l(t)||(t=new pe),Math.abs(V.PI_OVER_TWO-o)<=V.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(V.equalsEpsilon(Math.abs(V.PI_OVER_TWO-o),V.PI_OVER_TWO,V.EPSILON8))return V.equalsEpsilon(e,r.longitude,V.EPSILON12)?void 0:(t.longitude=e,t.latitude=V.PI_OVER_TWO*V.sign(V.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(V.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,h;do{h=u;let p=n*Math.sin(h),g=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(g/d,n/2))-V.PI_OVER_TWO}while(!V.equalsEpsilon(u,h,V.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};GA.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(V.equalsEpsilon(Math.abs(i),V.PI_OVER_TWO,V.EPSILON8))return;let r=fS(n,o.latitude),s=fS(n,e),a=Math.tan(i)*(s-r),c=V.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new pe(c,e,0)};var Ac=GA;var yH=[vi,hi],pNe=yH.length,Bse=Math.cos(V.toRadians(30)),pse=Math.cos(V.toRadians(150)),wse=0,Yse=1e3;function zb(e){e=e??Q.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??ln.GEODESIC,this._ellipsoid=ie.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(zb.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ie.packedLength+1+1}}});zb.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<pNe;i++)if(t instanceof yH[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var ANe=new m,Ase=new m,gse=new m;function bH(e,t,n,i,o){let r=Al(i,e,0,ANe),s=Al(i,e,n,Ase),a=Al(i,t,0,gse),c=VA(s,r,Ase),d=VA(a,r,gse);return m.cross(d,c,o),m.normalize(o,o)}var gNe=new pe,bNe=new m,yNe=new m,xNe=new m;function mH(e,t,n,i,o,r,s,a,c,d,u){if(o===0)return;let h;r===ln.GEODESIC?h=new RA(e,t,s):r===ln.RHUMB&&(h=new Ac(e,t,s));let p=h.surfaceDistance;if(p<o)return;let g=bH(e,t,i,s,xNe),f=Math.ceil(p/o),b=p/f,C=b,E=f-1,T=a.length;for(let S=0;S<E;S++){let _=h.interpolateUsingSurfaceDistance(C,gNe),R=Al(s,_,n,bNe),L=Al(s,_,i,yNe);m.pack(g,a,T),m.pack(R,c,T),m.pack(L,d,T),u.push(_.latitude),u.push(_.longitude),T+=3,C+=b}}var hH=new pe;function Al(e,t,n,i){return pe.clone(t,hH),hH.height=n,pe.toCartesian(hH,e,i)}zb.pack=function(e,t,n){let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];m.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ie.pack(e._ellipsoid,t,i),i+=ie.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};zb.unpack=function(e,t,n){let i=t??0,o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=m.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],d=ie.unpack(e,i);i+=ie.packedLength;let u=e[i++],h=e[i++]===1;return l(n)||(n=new zb({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=d,n._projectionIndex=u,n._scene3DOnly=h,n};function VA(e,t,n){return m.subtract(e,t,n),m.normalize(n,n),n}function bse(e,t,n,i){return i=VA(e,t,i),i=m.cross(i,n,i),i=m.normalize(i,i),i=m.cross(n,i,i),i}var CNe=new m,ENe=new m,TNe=new m,Nse=new m,SNe=0,INe=-1;function fH(e,t,n,i,o){let r=VA(n,t,Nse),s=bse(e,t,r,CNe),a=bse(i,t,r,ENe);if(V.equalsEpsilon(m.dot(s,a),INe,V.EPSILON5))return o=m.cross(r,s,o),o=m.normalize(o,o),o;o=m.add(a,s,o),o=m.normalize(o,o);let c=m.cross(r,o,TNe);return m.dot(a,c)<SNe&&(o=m.negate(o,o)),o}var Tv=an.fromPointNormal(m.ZERO,m.UNIT_Y),_Ne=new m,ZNe=new m,RNe=new m,GNe=new m,VNe=new m,xv=new m,Cv=new pe,yse=new pe,xse=new pe;zb.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new yH[e._projectionIndex](i),a=wse,c=Yse,d,u,h=e._positions,p=h.length;p===2&&(n=!1);let g,f,b,C,E=new Ac(void 0,void 0,i),T,S,_,R=[h[0]];for(u=0;u<p-1;u++)g=h[u],f=h[u+1],T=di.lineSegmentPlane(g,f,Tv,xv),l(T)&&!m.equalsEpsilon(T,g,V.EPSILON7)&&!m.equalsEpsilon(T,f,V.EPSILON7)&&(e.arcType===ln.GEODESIC?R.push(m.clone(T)):e.arcType===ln.RHUMB&&(_=i.cartesianToCartographic(T,Cv).longitude,b=i.cartesianToCartographic(g,Cv),C=i.cartesianToCartographic(f,yse),E.setEndPoints(b,C),S=E.findIntersectionWithLongitude(_,xse),T=i.cartographicToCartesian(S,xv),l(T)&&!m.equalsEpsilon(T,g,V.EPSILON7)&&!m.equalsEpsilon(T,f,V.EPSILON7)&&R.push(m.clone(T)))),R.push(f);n&&(g=h[p-1],f=h[0],T=di.lineSegmentPlane(g,f,Tv,xv),l(T)&&!m.equalsEpsilon(T,g,V.EPSILON7)&&!m.equalsEpsilon(T,f,V.EPSILON7)&&(e.arcType===ln.GEODESIC?R.push(m.clone(T)):e.arcType===ln.RHUMB&&(_=i.cartesianToCartographic(T,Cv).longitude,b=i.cartesianToCartographic(g,Cv),C=i.cartesianToCartographic(f,yse),E.setEndPoints(b,C),S=E.findIntersectionWithLongitude(_,xse),T=i.cartographicToCartesian(S,xv),l(T)&&!m.equalsEpsilon(T,g,V.EPSILON7)&&!m.equalsEpsilon(T,f,V.EPSILON7)&&R.push(m.clone(T)))));let L=R.length,W=new Array(L);for(u=0;u<L;u++){let H=pe.fromCartesian(R[u],i);H.height=0,W[u]=H}if(W=Mo(W,pe.equalsEpsilon),L=W.length,L<2)return;let B=[],Y=[],N=[],A=[],I=_Ne,Z=ZNe,G=RNe,w=GNe,X=VNe,v=W[0],U=W[1],k=W[L-1];for(I=Al(i,k,a,I),w=Al(i,U,a,w),Z=Al(i,v,a,Z),G=Al(i,v,c,G),n?X=fH(I,Z,G,w,X):X=bH(v,U,c,i,X),m.pack(X,Y,0),m.pack(Z,N,0),m.pack(G,A,0),B.push(v.latitude),B.push(v.longitude),mH(v,U,a,c,o,r,i,Y,N,A,B),u=1;u<L-1;++u){I=m.clone(Z,I),Z=m.clone(w,Z);let H=W[u];Al(i,H,c,G),Al(i,W[u+1],a,w),fH(I,Z,G,w,X),d=Y.length,m.pack(X,Y,d),m.pack(Z,N,d),m.pack(G,A,d),B.push(H.latitude),B.push(H.longitude),mH(W[u],W[u+1],a,c,o,r,i,Y,N,A,B)}let P=W[L-1],O=W[L-2];if(Z=Al(i,P,a,Z),G=Al(i,P,c,G),n){let H=W[0];I=Al(i,O,a,I),w=Al(i,H,a,w),X=fH(I,Z,G,w,X)}else X=bH(O,P,c,i,X);if(d=Y.length,m.pack(X,Y,d),m.pack(Z,N,d),m.pack(G,A,d),B.push(P.latitude),B.push(P.longitude),n){for(mH(P,v,a,c,o,r,i,Y,N,A,B),d=Y.length,u=0;u<3;++u)Y[d+u]=Y[u],N[d+u]=N[u],A[d+u]=A[u];B.push(v.latitude),B.push(v.longitude)}return nXe(n,s,N,A,Y,B,t)};var LNe=new m,WNe=new $,FNe=new Me;function Cse(e,t,n,i){let o=VA(n,t,LNe),r=m.dot(o,e);if(r>Bse||r<pse){let s=VA(i,n,Nse),a=r<pse?V.PI_OVER_TWO:-V.PI_OVER_TWO,c=Me.fromAxisAngle(s,a,FNe),d=$.fromQuaternion(c,WNe);return $.multiplyByVector(d,e,e),!0}return!1}var Ese=new pe,BNe=new m,Tse=new m;function gL(e,t,n,i,o){let r=pe.toCartesian(t,e._ellipsoid,BNe),s=m.add(r,n,Tse),a=!1,c=e._ellipsoid,d=c.cartesianToCartographic(s,Ese);Math.abs(t.longitude-d.longitude)>V.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,Tse),d=c.cartesianToCartographic(s,Ese)),d.height=0;let u=e.project(d,o);return o=m.subtract(u,i,o),o.z=0,o=m.normalize(o,o),a&&m.negate(o,o),o}var wNe=new m,Sse=new m;function Ise(e,t,n,i,o,r){let s=m.subtract(t,e,wNe);m.normalize(s,s);let a=n-wse,c=m.multiplyByScalar(s,a,Sse);m.add(e,c,o);let d=i-Yse;c=m.multiplyByScalar(s,d,Sse),m.add(t,c,r)}var YNe=new m;function Ev(e,t){let n=an.getPointDistance(Tv,e),i=an.getPointDistance(Tv,t),o=YNe;V.equalsEpsilon(n,0,V.EPSILON2)?(o=VA(t,e,o),m.multiplyByScalar(o,V.EPSILON2,o),m.add(e,o,e)):V.equalsEpsilon(i,0,V.EPSILON2)&&(o=VA(e,t,o),m.multiplyByScalar(o,V.EPSILON2,o),m.add(t,o,t))}function NNe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(V.equalsEpsilon(n,V.PI,V.EPSILON11)){let o=V.sign(t.longitude);return e.longitude=o*(n-V.EPSILON11),1}else if(V.equalsEpsilon(i,V.PI,V.EPSILON11)){let o=V.sign(e.longitude);return t.longitude=o*(i-V.EPSILON11),2}return 0}var Xse=new pe,Pse=new pe,_se=new m,pH=new m,Zse=new m,Rse=new m,XNe=new m,Gse=new m,PNe=[Xse,Pse],MNe=new de,UNe=new m,DNe=new m,vNe=new m,kNe=new m,QNe=new m,ONe=new m,AH=new m,gH=new m,zNe=new m,HNe=new m,KNe=new m,Vse=new m,JNe=new m,jNe=new m,qNe=new ti,$Ne=new ti,Lse=new m,eXe=new m,Wse=new m,tXe=[new ue,new ue],Mse=[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],Fse=Mse.length;function nXe(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,h=u*8,p=h*4,g=u*36,f=h>65535?new Uint32Array(g):new Uint16Array(g),b=new Float64Array(h*3),C=new Float32Array(p),E=new Float32Array(p),T=new Float32Array(p),S=new Float32Array(p),_=new Float32Array(p),R,L,W,B;s&&(R=new Float32Array(p),L=new Float32Array(p),W=new Float32Array(p),B=new Float32Array(h*2));let Y=r.length/2,N=0,A=Xse;A.height=0;let I=Pse;I.height=0;let Z=_se,G=pH;if(s)for(c=0,a=1;a<Y;a++)A.latitude=r[c],A.longitude=r[c+1],I.latitude=r[c+2],I.longitude=r[c+3],Z=t.project(A,Z),G=t.project(I,G),N+=m.distance(Z,G),c+=2;let w=i.length/3;G=m.unpack(i,0,G);let X=0;for(c=3,a=1;a<w;a++)Z=m.clone(G,Z),G=m.unpack(i,c,G),X+=m.distance(Z,G),c+=3;let v;c=3;let U=0,k=0,P=0,O=0,H=!1,ee=m.unpack(n,0,Rse),z=m.unpack(i,0,pH),te=m.unpack(o,0,Gse);if(e){let Se=m.unpack(n,n.length-6,Zse);Cse(te,Se,ee,z)&&(te=m.negate(te,te))}let q=0,me=0,ye=0;for(a=0;a<u;a++){let Se=m.clone(ee,Zse),Fe=m.clone(z,_se),Ue=m.clone(te,XNe);H&&(Ue=m.negate(Ue,Ue)),ee=m.unpack(n,c,Rse),z=m.unpack(i,c,pH),te=m.unpack(o,c,Gse),H=Cse(te,Se,ee,z),A.latitude=r[U],A.longitude=r[U+1],I.latitude=r[U+2],I.longitude=r[U+3];let De,Je,St,Oe;if(s){let Vn=NNe(A,I);De=t.project(A,QNe),Je=t.project(I,ONe);let Qo=VA(Je,De,Lse);Qo.y=Math.abs(Qo.y),St=AH,Oe=gH,Vn===0||m.dot(Qo,m.UNIT_Y)>Bse?(St=gL(t,A,Ue,De,AH),Oe=gL(t,I,te,Je,gH)):Vn===1?(Oe=gL(t,I,te,Je,gH),St.x=0,St.y=V.sign(A.longitude-Math.abs(I.longitude)),St.z=0):(St=gL(t,A,Ue,De,AH),Oe.x=0,Oe.y=V.sign(A.longitude-I.longitude),Oe.z=0)}let it=m.distance(Fe,z),yt=ti.fromCartesian(Se,qNe),Ot=m.subtract(ee,Se,zNe),Mn=m.normalize(Ot,Vse),sn=m.subtract(Fe,Se,HNe);sn=m.normalize(sn,sn);let ut=m.cross(Mn,sn,Vse);ut=m.normalize(ut,ut);let Nt=m.cross(sn,Ue,JNe);Nt=m.normalize(Nt,Nt);let In=m.subtract(z,ee,KNe);In=m.normalize(In,In);let lt=m.cross(te,In,jNe);lt=m.normalize(lt,lt);let fi=it/X,ao=q/X,po=0,ri,co,lo,Di=0,Wi=0;if(s){po=m.distance(De,Je),ri=ti.fromCartesian(De,$Ne),co=m.subtract(Je,De,Lse),lo=m.normalize(co,eXe);let Vn=lo.x;lo.x=lo.y,lo.y=-Vn,Di=po/N,Wi=me/N}for(v=0;v<8;v++){let Vn=O+v*4,Qo=k+v*2,Oo=Vn+3,$s=v<4?1:-1,Fi=v===2||v===3||v===6||v===7?1:-1;m.pack(yt.high,C,Vn),C[Oo]=Ot.x,m.pack(yt.low,E,Vn),E[Oo]=Ot.y,m.pack(Nt,T,Vn),T[Oo]=Ot.z,m.pack(lt,S,Vn),S[Oo]=fi*$s,m.pack(ut,_,Vn);let Wo=ao*Fi;Wo===0&&Fi<0&&(Wo=9),_[Oo]=Wo,s&&(R[Vn]=ri.high.x,R[Vn+1]=ri.high.y,R[Vn+2]=ri.low.x,R[Vn+3]=ri.low.y,W[Vn]=-St.y,W[Vn+1]=St.x,W[Vn+2]=Oe.y,W[Vn+3]=-Oe.x,L[Vn]=co.x,L[Vn+1]=co.y,L[Vn+2]=lo.x,L[Vn+3]=lo.y,B[Qo]=Di*$s,Wo=Wi*Fi,Wo===0&&Fi<0&&(Wo=9),B[Qo+1]=Wo)}let Qn=vNe,uo=kNe,vo=UNe,hr=DNe,Vr=de.fromCartographicArray(PNe,MNe),qs=Zi.getMinimumMaximumHeights(Vr,d),xs=qs.minimumTerrainHeight,Na=qs.maximumTerrainHeight;ye+=Math.abs(xs),ye+=Math.abs(Na),Ise(Se,Fe,xs,Na,Qn,vo),Ise(ee,z,xs,Na,uo,hr);let Ao=m.multiplyByScalar(ut,V.EPSILON5,Wse);m.add(Qn,Ao,Qn),m.add(uo,Ao,uo),m.add(vo,Ao,vo),m.add(hr,Ao,hr),Ev(Qn,uo),Ev(vo,hr),m.pack(Qn,b,P),m.pack(uo,b,P+3),m.pack(hr,b,P+6),m.pack(vo,b,P+9),Ao=m.multiplyByScalar(ut,-2*V.EPSILON5,Wse),m.add(Qn,Ao,Qn),m.add(uo,Ao,uo),m.add(vo,Ao,vo),m.add(hr,Ao,hr),Ev(Qn,uo),Ev(vo,hr),m.pack(Qn,b,P+12),m.pack(uo,b,P+15),m.pack(hr,b,P+18),m.pack(vo,b,P+21),U+=2,c+=3,k+=16,P+=24,O+=32,q+=it,me+=po}c=0;let oe=0;for(a=0;a<u;a++){for(v=0;v<Fse;v++)f[c+v]=Mse[v]+oe;oe+=8,c+=Fse}let xe=tXe;ue.fromVertices(n,m.ZERO,3,xe[0]),ue.fromVertices(i,m.ZERO,3,xe[1]);let Ee=ue.fromBoundingSpheres(xe);Ee.radius+=ye/(u*2);let Le={position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,normalize:!1,values:b}),startHiAndForwardOffsetX:Ob(C),startLoAndForwardOffsetY:Ob(E),startNormalAndForwardOffsetZ:Ob(T),endNormalAndTextureCoordinateNormalizationX:Ob(S),rightNormalAndTextureCoordinateNormalizationY:Ob(_)};return s&&(Le.startHiLo2D=Ob(R),Le.offsetAndRight2D=Ob(L),Le.startEndNormals2D=Ob(W),Le.texcoordNormalization2D=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,normalize:!1,values:B})),new pt({attributes:Le,indices:f,boundingSphere:Ee})}function Ob(e){return new We({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}zb._projectNormal=gL;var Wx=zb;var Don=y(x(),1),bL=`in vec4 v_startPlaneNormalEcAndHalfWidth;
in vec4 v_endPlaneNormalEcAndBatchId;
in vec4 v_rightPlaneEC; // Technically can compute distance for this here
in vec4 v_endEcAndStartEcX;
in vec4 v_texcoordNormalizationAndStartEcYZ;

#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif

void main(void)
{
    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
    vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);

    // Discard for sky
    if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
    eyeCoordinate /= eyeCoordinate.w;

    float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
    // Check distance of the eye coordinate against the right-facing plane
    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);

    // Check eye coordinate against the mitering planes
    float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
    float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);

    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }

    // Check distance of the eye coordinate against start and end planes with normals in the right plane.
    // For computing unskewed lengthwise texture coordinate.
    // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.

    // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"
    vec3 alignedPlaneNormal;

    // start aligned plane
    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
    distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);

    // end aligned plane
    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);
    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
    distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);

#ifdef PER_INSTANCE_COLOR
    out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
    // Clamp - distance to aligned planes may be negative due to mitering,
    // so fragment texture coordinate might be out-of-bounds.
    float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);
    s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;
    float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);

    czm_materialInput materialInput;

    materialInput.s = s;
    materialInput.st = vec2(s, t);
    materialInput.str = vec3(s, t, 0.0);

    czm_material material = czm_getMaterial(materialInput);
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR

    // Premultiply alpha. Required for classification primitives on translucent globe.
    out_FragColor.rgb *= out_FragColor.a;

    czm_writeDepthClamp();
}
`;var kon=y(x(),1),yL=`in vec3 v_forwardDirectionEC;
in vec3 v_texcoordNormalizationAndHalfWidth;
in float v_batchId;

#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#else
in vec2 v_alignedPlaneDistances;
in float v_texcoordT;
#endif

float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {
    // We don't expect the ray to ever be parallel to the plane
    return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);
}

void main(void)
{
    vec4 eyeCoordinate = gl_FragCoord;
    eyeCoordinate /= eyeCoordinate.w;

#ifdef PER_INSTANCE_COLOR
    out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
    // Use distances for planes aligned with segment to prevent skew in dashing
    float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);
    float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);

    // Clamp - distance to aligned planes may be negative due to mitering
    distanceFromStart = max(0.0, distanceFromStart);
    distanceFromEnd = max(0.0, distanceFromEnd);

    float s = distanceFromStart / (distanceFromStart + distanceFromEnd);
    s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;

    czm_materialInput materialInput;

    materialInput.s = s;
    materialInput.st = vec2(s, v_texcoordT);
    materialInput.str = vec3(s, v_texcoordT, 0.0);

    czm_material material = czm_getMaterial(materialInput);
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR
}
`;var Oon=y(x(),1),xL=`in vec3 position3DHigh;
in vec3 position3DLow;

in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;

in float batchId;

out vec3 v_forwardDirectionEC;
out vec3 v_texcoordNormalizationAndHalfWidth;
out float v_batchId;

// For materials
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif

#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#else
out vec2 v_alignedPlaneDistances;
out float v_texcoordT;
#endif

// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.
// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.
void main()
{
    v_batchId = batchId;

    // Start position
    vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
    vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
    vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
    vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
    vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
    vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;

    // Start plane
    vec4 startPlane2D;
    vec4 startPlane3D;
    startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
    startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
    startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
    startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);

    // Right plane
    vec4 rightPlane2D;
    vec4 rightPlane3D;
    rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
    rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
    rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
    rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);

    // End position
    posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
    posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
    posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
    posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
    posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
    vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
    vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
    vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));

    // End plane
    vec4 endPlane2D;
    vec4 endPlane3D;
    endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
    endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
    endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
    endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);

    // Forward direction
    v_forwardDirectionEC = normalize(endEC - startEC);

    vec2 cleanTexcoordNormalization2D;
    cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
    cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
    vec2 cleanTexcoordNormalization3D;
    cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
    cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
    cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));

    v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);

#ifdef PER_INSTANCE_COLOR
    v_color = czm_batchTable_color(batchId);
#else // PER_INSTANCE_COLOR
    // For computing texture coordinates

    v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
    v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
#endif // PER_INSTANCE_COLOR

#ifdef WIDTH_VARYING
    float width = czm_batchTable_width(batchId);
    float halfWidth = width * 0.5;
    v_width = width;
    v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#else
    float halfWidth = 0.5 * czm_batchTable_width(batchId);
    v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#endif

    // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
    // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
    // Since this is morphing, compute both 3D and 2D positions and then blend.

    // ****** 3D ******
    // Check distance to the end plane and start plane, pick the plane that is closer
    vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition
    float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
    float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
    vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
    vec3 normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.

    // Nudge the top vertex upwards to prevent flickering
    vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
    geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
    positionEc3D.xyz += geodeticSurfaceNormal;

    // Determine if this vertex is on the "left" or "right"
    normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);

    // A "perfect" implementation would push along normals according to the angle against forward.
    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
    positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)

    // ****** 2D ******
    // Check distance to the end plane and start plane, pick the plane that is closer
    vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition
    absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
    absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
    planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
    upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
    normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.

    // Nudge the top vertex upwards to prevent flickering
    geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
    geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
    positionEc2D.xyz += geodeticSurfaceNormal;

    // Determine if this vertex is on the "left" or "right"
    normalEC *= sign(texcoordNormalization2D.x);
#ifndef PER_INSTANCE_COLOR
    // Use vertex's sidedness to compute its texture coordinate.
    v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
#endif

    // A "perfect" implementation would push along normals according to the angle against forward.
    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
    positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)

    // Blend for actual position
    gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);

#ifdef ANGLE_VARYING
    // Approximate relative screen space direction of the line.
    vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var Hon=y(x(),1),CL=`in vec3 position3DHigh;
in vec3 position3DLow;

// In 2D and in 3D, texture coordinate normalization component signs encodes:
// * X sign - sidedness relative to right plane
// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume
#ifndef COLUMBUS_VIEW_2D
in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
#else
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;
#endif

in float batchId;

out vec4 v_startPlaneNormalEcAndHalfWidth;
out vec4 v_endPlaneNormalEcAndBatchId;
out vec4 v_rightPlaneEC;
out vec4 v_endEcAndStartEcX;
out vec4 v_texcoordNormalizationAndStartEcYZ;

// For materials
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif

#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif

void main()
{
#ifdef COLUMBUS_VIEW_2D
    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;

    vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);
    vec3 ecEnd = forwardDirectionEC + ecStart;
    forwardDirectionEC = normalize(forwardDirectionEC);

    // Right plane
    v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);

    // start plane
    vec4 startPlaneEC;
    startPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.xy);
    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);

    // end plane
    vec4 endPlaneEC;
    endPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.zw);
    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);

    v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);
    v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;

#else // COLUMBUS_VIEW_2D
    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;
    vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);
    vec3 ecEnd = ecStart + offset;

    vec3 forwardDirectionEC = normalize(offset);

    // start plane
    vec4 startPlaneEC;
    startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);

    // end plane
    vec4 endPlaneEC;
    endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);

    // Right plane
    v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);

    v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
    v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;

#endif // COLUMBUS_VIEW_2D

    v_endEcAndStartEcX.xyz = ecEnd;
    v_endEcAndStartEcX.w = ecStart.x;
    v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;

#ifdef PER_INSTANCE_COLOR
    v_color = czm_batchTable_color(batchId);
#endif // PER_INSTANCE_COLOR

    // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
    // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
    vec4 positionRelativeToEye = czm_computePosition();

    // Check distance to the end plane and start plane, pick the plane that is closer
    vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition
    float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));
    float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));
    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);
    vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
    vec3 normalEC = normalize(cross(planeDirection, upOrDown));           // In practice, the opposite seems to work too.

    // Extrude bottom vertices downward for far view distances, like for GroundPrimitives
    upOrDown = cross(forwardDirectionEC, normalEC);
    upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;
    upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;
    upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;
    positionEC.xyz += upOrDown;

    v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));

    // Determine distance along normalEC to push for a volume of appropriate width.
    // Make volumes about double pixel width for a conservative fit - in practice the
    // extra cost here is minimal compared to the loose volume heights.
    //
    // N = normalEC (guaranteed "right-facing")
    // R = rightEC
    // p = angle between N and R
    // w = distance to push along R if R == N
    // d = distance to push along N
    //
    //   N   R
    //  {  p| }      * cos(p) = dot(N, R) = w / d
    //  d  |  |w    * d = w / dot(N, R)
    //    { | }
    //       o---------- polyline segment ---->
    //
    float width = czm_batchTable_width(batchId);
#ifdef WIDTH_VARYING
    v_width = width;
#endif

    v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;
    v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;

    v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;
    v_endPlaneNormalEcAndBatchId.w = batchId;

    width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R
    width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N

    // Determine if this vertex is on the "left" or "right"
#ifdef COLUMBUS_VIEW_2D
        normalEC *= sign(texcoordNormalization2D.x);
#else
        normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
#endif

    positionEC.xyz += width * normalEC;
    gl_Position = czm_depthClamp(czm_projection * positionEC);

#ifdef ANGLE_VARYING
    // Approximate relative screen space direction of the line.
    vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));
    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var srn=y(x(),1);var Jon=y(x(),1),EL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec4 color;
in float batchId;

out vec4 v_color;

void main()
{
    float expandDir = expandAndWidth.x;
    float width = abs(expandAndWidth.y) + 0.5;
    bool usePrev = expandAndWidth.y < 0.0;

    vec4 p = czm_computePosition();
    vec4 prev = czm_computePrevPosition();
    vec4 next = czm_computeNextPosition();

    float angle;
    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
    gl_Position = czm_viewportOrthographic * positionWC;

    v_color = color;
}
`;var qon=y(x(),1),Kd=`void clipLineSegmentToNearPlane(
    vec3 p0,
    vec3 p1,
    out vec4 positionWC,
    out bool clipped,
    out bool culledByNearPlane,
    out vec4 clippedPositionEC)
{
    culledByNearPlane = false;
    clipped = false;

    vec3 p0ToP1 = p1 - p0;
    float magnitude = length(p0ToP1);
    vec3 direction = normalize(p0ToP1);

    // Distance that p0 is behind the near plane. Negative means p0 is
    // in front of the near plane.
    float endPoint0Distance =  czm_currentFrustum.x + p0.z;

    // Camera looks down -Z.
    // When moving a point along +Z: LESS VISIBLE
    //   * Points in front of the camera move closer to the camera.
    //   * Points behind the camrea move farther away from the camera.
    // When moving a point along -Z: MORE VISIBLE
    //   * Points in front of the camera move farther away from the camera.
    //   * Points behind the camera move closer to the camera.

    // Positive denominator: -Z, becoming more visible
    // Negative denominator: +Z, becoming less visible
    // Nearly zero: parallel to near plane
    float denominator = -direction.z;

    if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
    {
        // p0 is behind the near plane and the line to p1 is nearly parallel to
        // the near plane, so cull the segment completely.
        culledByNearPlane = true;
    }
    else if (endPoint0Distance > 0.0)
    {
        // p0 is behind the near plane, and the line to p1 is moving distinctly
        // toward or away from it.

        // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)
        float t = endPoint0Distance / denominator;
        if (t < 0.0 || t > magnitude)
        {
            // Near plane intersection is not between the two points.
            // We already confirmed p0 is behind the naer plane, so now
            // we know the entire segment is behind it.
            culledByNearPlane = true;
        }
        else
        {
            // Segment crosses the near plane, update p0 to lie exactly on it.
            p0 = p0 + t * direction;

            // Numerical noise might put us a bit on the wrong side of the near plane.
            // Don't let that happen.
            p0.z = min(p0.z, -czm_currentFrustum.x);

            clipped = true;
        }
    }

    clippedPositionEC = vec4(p0, 1.0);
    positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);
}

vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)
{
    // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.

#ifdef POLYLINE_DASH
    // Compute the window coordinates of the points.
    vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
    vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
    vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);

    // Determine the relative screen space direction of the line.
    vec2 lineDir;
    if (usePrevious) {
        lineDir = normalize(positionWindow.xy - previousWindow.xy);
    }
    else {
        lineDir = normalize(nextWindow.xy - positionWindow.xy);
    }
    angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)

    // Quantize the angle so it doesn't change rapidly between segments.
    angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;
#endif

    vec4 clippedPrevWC, clippedPrevEC;
    bool prevSegmentClipped, prevSegmentCulled;
    clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);

    vec4 clippedNextWC, clippedNextEC;
    bool nextSegmentClipped, nextSegmentCulled;
    clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);

    bool segmentClipped, segmentCulled;
    vec4 clippedPositionWC, clippedPositionEC;
    clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);

    if (segmentCulled)
    {
        return vec4(0.0, 0.0, 0.0, 1.0);
    }

    vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);
    vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);

    // If a segment was culled, we can't use the corresponding direction
    // computed above. We should never see both of these be true without
    // \`segmentCulled\` above also being true.
    if (prevSegmentCulled)
    {
        directionToPrevWC = -directionToNextWC;
    }
    else if (nextSegmentCulled)
    {
        directionToNextWC = -directionToPrevWC;
    }

    vec2 thisSegmentForwardWC, otherSegmentForwardWC;
    if (usePrevious)
    {
        thisSegmentForwardWC = -directionToPrevWC;
        otherSegmentForwardWC = directionToNextWC;
    }
    else
    {
        thisSegmentForwardWC = directionToNextWC;
        otherSegmentForwardWC =  -directionToPrevWC;
    }

    vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);

    vec2 leftWC = thisSegmentLeftWC;
    float expandWidth = width * 0.5;

    // When lines are split at the anti-meridian, the position may be at the
    // same location as the next or previous position, and we need to handle
    // that to avoid producing NaNs.
    if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))
    {
        vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);

        vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;
        float leftSumLength = length(leftSumWC);
        leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);

        // The sine of the angle between the two vectors is given by the formula
        //         |a x b| = |a||b|sin(theta)
        // which is
        //     float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));
        // Because the z components of both vectors are zero, the x and y coordinate will be zero.
        // Therefore, the sine of the angle is just the z component of the cross product.
        vec2 u = -thisSegmentForwardWC;
        vec2 v = leftWC;
        float sinAngle = abs(u.x * v.y - u.y * v.x);
        expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);
    }

    vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
    return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;
}

vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)
{
    vec4 positionEC = czm_modelViewRelativeToEye * position;
    vec4 prevEC = czm_modelViewRelativeToEye * previous;
    vec4 nextEC = czm_modelViewRelativeToEye * next;
    return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
}
`;var iXe=`#define CLIP_POLYLINE 
${Kd}
${EL}`,oXe=Zx;function Fx(e){e=e??Q.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Fx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??iXe,this._fragmentShaderSource=e.fragmentShaderSource??oXe,this._renderState=Co.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Fx.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}}});Fx.VERTEX_FORMAT=we.POSITION_ONLY;Fx.prototype.getFragmentShaderSource=Co.prototype.getFragmentShaderSource;Fx.prototype.isTranslucent=Co.prototype.isTranslucent;Fx.prototype.getRenderState=Co.prototype.getRenderState;var Is=Fx;var xrn=y(x(),1);var crn=y(x(),1),TL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec2 st;
in float batchId;

out float v_width;
out vec2 v_st;
out float v_polylineAngle;

void main()
{
    float expandDir = expandAndWidth.x;
    float width = abs(expandAndWidth.y) + 0.5;
    bool usePrev = expandAndWidth.y < 0.0;

    vec4 p = czm_computePosition();
    vec4 prev = czm_computePrevPosition();
    vec4 next = czm_computeNextPosition();

    float angle;
    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
    gl_Position = czm_viewportOrthographic * positionWC;

    v_width = width;
    v_st.s = st.s;
    v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
    v_polylineAngle = angle;
}
`;var drn=y(x(),1),Bx=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

in vec2 v_st;

void main()
{
    czm_materialInput materialInput;

    vec2 st = v_st;
    st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);

    materialInput.s = st.s;
    materialInput.st = st;
    materialInput.str = vec3(st, 0.0);

    czm_material material = czm_getMaterial(materialInput);
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#ifdef VECTOR_TILE
    out_FragColor *= u_highlightColor;
#endif

    czm_writeLogDepth();
}
`;var rXe=`#define CLIP_POLYLINE 
${Kd}
${TL}`,sXe=Bx;function wx(e){e=e??Q.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=wx.VERTEX_FORMAT;this.material=l(e.material)?e.material:ho.fromType(ho.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??rXe,this._fragmentShaderSource=e.fragmentShaderSource??sXe,this._renderState=Co.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(wx.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});wx.VERTEX_FORMAT=we.POSITION_AND_ST;wx.prototype.getFragmentShaderSource=Co.prototype.getFragmentShaderSource;wx.prototype.isTranslucent=Co.prototype.isTranslucent;wx.prototype.getRenderState=Co.prototype.getRenderState;var Qa=wx;function LA(e){e=e??Q.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new Qa),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??qn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Use(!1),this._renderState3DTiles=Use(!0),this._renderStateMorph=ke.fromCache({cull:{enabled:!0,face:wi.FRONT},depthTest:{enabled:!0},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(LA.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}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});LA.initializeTerrainHeights=function(){return Zi.initialize()};function aXe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(CL);s=Nn._appendShowToShader(o,s),s=Nn._appendDistanceDisplayConditionToShader(o,s),s=Nn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(xL);a=Nn._appendShowToShader(o,a),a=Nn._appendDistanceDisplayConditionToShader(o,a),a=Nn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(bL),d=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",h="";l(n.material)?(h=l(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],g=new ze({defines:d,sources:[s]}),f=new ze({defines:p,sources:[h,c]});e._sp=cn.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:f,attributeLocations:r});let b=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(b)){let E=new ze({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:E,fragmentShaderSource:f,attributeLocations:r})}e._sp2D=b;let C=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(C)){let E=new ze({defines:d.concat([`MAX_TERRAIN_HEIGHT ${Zi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(yL);let T=new ze({defines:p,sources:[h,c]});C=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:E,fragmentShaderSource:T,attributeLocations:r})}e._spMorph=C}function Use(e){return ke.fromCache({cull:{enabled:!0},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:$n.EQUAL,frontOperation:{fail:Ct.KEEP,zFail:Ct.KEEP,zPass:Ct.KEEP},backFunction:$n.EQUAL,backOperation:{fail:Ct.KEEP,zFail:Ct.KEEP,zPass:Ct.KEEP},reference:Qt.CESIUM_3D_TILE_MASK,mask:Qt.CESIUM_3D_TILE_MASK}})}function cXe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof Is?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let h=0;h<a;h++){let p=s._va[h],g=o[h];l(g)||(g=o[h]=new nt({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=u,g.pass=Ve.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let f=nt.shallowClone(g,g.derivedCommands.tileset);f.renderState=e._renderState3DTiles,f.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=f;let b=nt.shallowClone(g,g.derivedCommands.color2D);b.shaderProgram=e._sp2D,g.derivedCommands.color2D=b;let C=nt.shallowClone(f,f.derivedCommands.color2D);C.shaderProgram=e._sp2D,f.derivedCommands.color2D=C;let E=nt.shallowClone(g,g.derivedCommands.colorMorph);E.renderState=e._renderStateMorph,E.shaderProgram=e._spMorph,E.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=E}}function Dse(e,t,n,i,o,r,s){n.mode===se.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==se.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function lXe(e,t,n,i,o,r,s){let a=e._primitive;Nn._updateBoundingVolumes(a,t,o);let c;t.mode===se.SCENE3D?c=a._boundingSphereWC:t.mode===se.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===se.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let d=t.mode===se.MORPHING,u=e.classificationType,h=u!==qn.CESIUM_3D_TILE,p=u!==qn.TERRAIN&&!d,g,f=t.passes;if(f.render||f.pick&&a.allowPicking){let b=n.length;for(let C=0;C<b;++C){let E=c[C];h&&(g=n[C],Dse(e,g,t,o,r,E,s)),p&&(g=n[C].derivedCommands.tileset,Dse(e,g,t,o,r,E,s))}}}LA.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Zi.initialized){LA.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let d=c.attributes;for(let u in d)d.hasOwnProperty(u)&&(a[u]=d[u]);l(a.width)||(a.width=new Yc({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,Wx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Bt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,d,u){aXe(n,d,u)},i._createCommandsFunction=function(c,d,u,h,p,g,f){cXe(n,d,u,h,g,f)},i._updateAndQueueCommandsFunction=function(c,d,u,h,p,g,f,b){lXe(n,d,u,h,p,g,f)},this._primitive=new Nn(i)}if(this.appearance instanceof Is&&!this._hasPerInstanceColors)throw new Ae("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),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};LA.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};LA.isSupported=function(e){return e.frameState.context.depthTexture};LA.prototype.isDestroyed=function(){return!1};LA.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,fe(this)};var bh=LA;var xsn=y(x(),1);var hsn=y(x(),1);var ssn=y(x(),1);var dXe=new M(1,1),uXe=!1,mXe=D.WHITE;function pS(e){e=e??Q.EMPTY_OBJECT,this._definitionChanged=new Ce,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(pS.prototype,{isConstant:{get:function(){return K.isConstant(this._image)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:ge("image"),repeat:ge("repeat"),color:ge("color"),transparent:ge("transparent")});pS.prototype.getType=function(e){return"Image"};var hXe=new j;pS.prototype.getValue=function(e,t){return l(e)||(e=j.now(hXe)),l(t)||(t={}),t.image=K.getValueOrUndefined(this._image,e),t.repeat=K.getValueOrClonedDefault(this._repeat,e,dXe,t.repeat),t.color=K.getValueOrClonedDefault(this._color,e,mXe,t.color),K.getValueOrDefault(this._transparent,e,uXe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};pS.prototype.equals=function(e){return this===e||e instanceof pS&&K.equals(this._image,e._image)&&K.equals(this._repeat,e._repeat)&&K.equals(this._color,e._color)&&K.equals(this._transparent,e._transparent)};var Hb=pS;function fXe(e){if(e instanceof D)return new Kt(e);if(typeof e=="string"||e instanceof Ge||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Hb;return t.image=e,t}}function pXe(e,t){return ge(e,t,fXe)}var er=pXe;function SL(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(SL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),dimensions:ge("dimensions"),heightReference:ge("heightReference"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition")});SL.prototype.clone=function(e){return l(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 SL(this)};SL.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Yx=SL;var Xsn=y(x(),1);var Esn=y(x(),1),AXe={FIXED:0,INERTIAL:1},eo=Object.freeze(AXe);var Vsn=y(x(),1);function AS(){Ae.throwInstantiationError()}Object.defineProperties(AS.prototype,{isConstant:{get:Ae.throwInstantiationError},definitionChanged:{get:Ae.throwInstantiationError},referenceFrame:{get:Ae.throwInstantiationError}});AS.prototype.getValue=Ae.throwInstantiationError;AS.prototype.getValueInReferenceFrame=Ae.throwInstantiationError;AS.prototype.equals=Ae.throwInstantiationError;var vse=new $;AS.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new m),n===i)return m.clone(t,o);let r=Tt.computeIcrfToCentralBodyFixedMatrix(e,vse);if(n===eo.INERTIAL)return $.multiplyByVector(r,t,o);if(n===eo.FIXED)return $.multiplyByVector($.transpose(r,vse),t,o)};var yh=AS;function Nx(e,t){this._definitionChanged=new Ce,this._value=m.clone(e),this._referenceFrame=t??eo.FIXED}Object.defineProperties(Nx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===eo.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var gXe=new j;Nx.prototype.getValue=function(e,t){return l(e)||(e=j.now(gXe)),this.getValueInReferenceFrame(e,eo.FIXED,t)};Nx.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Nx.prototype.getValueInReferenceFrame=function(e,t,n){return yh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Nx.prototype.equals=function(e){return this===e||e instanceof Nx&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var gl=Nx;var Qsn=y(x(),1);function IL(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(IL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),positions:ge("positions"),width:ge("width"),height:ge("height"),heightReference:ge("heightReference"),extrudedHeight:ge("extrudedHeight"),extrudedHeightReference:ge("extrudedHeightReference"),cornerType:ge("cornerType"),granularity:ge("granularity"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition"),classificationType:ge("classificationType"),zIndex:ge("zIndex")});IL.prototype.clone=function(e){return l(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 IL(this)};IL.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Xx=IL;var Hsn=y(x(),1);function bXe(e){return e}function yXe(e,t){return ge(e,t,bXe)}var bl=yXe;var tan=y(x(),1);function _L(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(_L.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),length:ge("length"),topRadius:ge("topRadius"),bottomRadius:ge("bottomRadius"),heightReference:ge("heightReference"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),numberOfVerticalLines:ge("numberOfVerticalLines"),slices:ge("slices"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition")});_L.prototype.clone=function(e){return l(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 _L(this)};_L.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Px=_L;var can=y(x(),1);function ZL(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(ZL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),semiMajorAxis:ge("semiMajorAxis"),semiMinorAxis:ge("semiMinorAxis"),height:ge("height"),heightReference:ge("heightReference"),extrudedHeight:ge("extrudedHeight"),extrudedHeightReference:ge("extrudedHeightReference"),rotation:ge("rotation"),stRotation:ge("stRotation"),granularity:ge("granularity"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),numberOfVerticalLines:ge("numberOfVerticalLines"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition"),classificationType:ge("classificationType"),zIndex:ge("zIndex")});ZL.prototype.clone=function(e){return l(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 ZL(this)};ZL.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Mx=ZL;var pan=y(x(),1);function RL(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(RL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),radii:ge("radii"),innerRadii:ge("innerRadii"),minimumClock:ge("minimumClock"),maximumClock:ge("maximumClock"),minimumCone:ge("minimumCone"),maximumCone:ge("maximumCone"),heightReference:ge("heightReference"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),stackPartitions:ge("stackPartitions"),slicePartitions:ge("slicePartitions"),subdivisions:ge("subdivisions"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition")});RL.prototype.clone=function(e){return l(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 RL(this)};RL.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Ux=RL;var Can=y(x(),1);function GL(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(GL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),text:ge("text"),font:ge("font"),style:ge("style"),scale:ge("scale"),showBackground:ge("showBackground"),backgroundColor:ge("backgroundColor"),backgroundPadding:ge("backgroundPadding"),pixelOffset:ge("pixelOffset"),eyeOffset:ge("eyeOffset"),horizontalOrigin:ge("horizontalOrigin"),verticalOrigin:ge("verticalOrigin"),heightReference:ge("heightReference"),fillColor:ge("fillColor"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),translucencyByDistance:ge("translucencyByDistance"),pixelOffsetScaleByDistance:ge("pixelOffsetScaleByDistance"),scaleByDistance:ge("scaleByDistance"),distanceDisplayCondition:ge("distanceDisplayCondition"),disableDepthTestDistance:ge("disableDepthTestDistance")});GL.prototype.clone=function(e){return l(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 GL(this)};GL.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var xh=GL;var jan=y(x(),1);var wan=y(x(),1);var _an=y(x(),1);var xXe=new m(1,1,1),CXe=m.ZERO,EXe=Me.IDENTITY;function kse(e,t,n){this.translation=m.clone(e??CXe),this.rotation=Me.clone(t??EXe),this.scale=m.clone(n??xXe)}kse.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&Me.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var Kb=kse;var xH=new Kb;function VL(e){e=e??Q.EMPTY_OBJECT,this._definitionChanged=new Ce,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(VL.prototype,{isConstant:{get:function(){return K.isConstant(this._translation)&&K.isConstant(this._rotation)&&K.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:ge("translation"),rotation:ge("rotation"),scale:ge("scale")});var TXe=new j;VL.prototype.getValue=function(e,t){return l(e)||(e=j.now(TXe)),l(t)||(t=new Kb),t.translation=K.getValueOrClonedDefault(this._translation,e,xH.translation,t.translation),t.rotation=K.getValueOrClonedDefault(this._rotation,e,xH.rotation,t.rotation),t.scale=K.getValueOrClonedDefault(this._scale,e,xH.scale,t.scale),t};VL.prototype.equals=function(e){return this===e||e instanceof VL&&K.equals(this._translation,e._translation)&&K.equals(this._rotation,e._rotation)&&K.equals(this._scale,e._scale)};var Dx=VL;var van=y(x(),1);function WA(e,t){this._propertyNames=[],this._definitionChanged=new Ce,l(e)&&this.merge(e,t)}Object.defineProperties(WA.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!K.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});WA.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function SXe(e){return new mi(e)}WA.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,ge(e,!0,n??SXe)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};WA.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var IXe=new j;WA.prototype.getValue=function(e,t){l(e)||(e=j.now(IXe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=K.getValueOrUndefined(this[r],e,t[r])}return t};WA.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function _Xe(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!K.equals(e[s],t[s]))return!1}return!0}WA.prototype.equals=function(e){return this===e||e instanceof WA&&_Xe(this,e)};var yl=WA;function Qse(e){return new Dx(e)}function ZXe(e){return new yl(e,Qse)}function RXe(e){return new yl(e)}function GXe(e){return new yl(e)}function LL(e){this._definitionChanged=new Ce,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=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._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=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._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(e??Q.EMPTY_OBJECT)}Object.defineProperties(LL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),uri:ge("uri"),scale:ge("scale"),enableVerticalExaggeration:ge("enableVerticalExaggeration"),minimumPixelSize:ge("minimumPixelSize"),maximumScale:ge("maximumScale"),incrementallyLoadTextures:ge("incrementallyLoadTextures"),runAnimations:ge("runAnimations"),clampAnimations:ge("clampAnimations"),shadows:ge("shadows"),heightReference:ge("heightReference"),silhouetteColor:ge("silhouetteColor"),silhouetteSize:ge("silhouetteSize"),color:ge("color"),colorBlendMode:ge("colorBlendMode"),colorBlendAmount:ge("colorBlendAmount"),imageBasedLightingFactor:ge("imageBasedLightingFactor"),environmentMapOptions:ge("environmentMapOptions",void 0,GXe),lightColor:ge("lightColor"),distanceDisplayCondition:ge("distanceDisplayCondition"),nodeTransformations:ge("nodeTransformations",void 0,ZXe),articulations:ge("articulations",void 0,RXe),clippingPlanes:ge("clippingPlanes"),customShader:ge("customShader")});LL.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new LL(this)};LL.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new yl(t,Qse)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new yl(n)}};var FA=LL;var icn=y(x(),1);function WL(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(WL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),uri:ge("uri"),maximumScreenSpaceError:ge("maximumScreenSpaceError")});WL.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new WL(this)};WL.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var vx=WL;var dcn=y(x(),1);function FL(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(FL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),leadTime:ge("leadTime"),trailTime:ge("trailTime"),width:ge("width"),resolution:ge("resolution"),material:er("material"),distanceDisplayCondition:ge("distanceDisplayCondition")});FL.prototype.clone=function(e){return l(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 FL(this)};FL.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var BA=FL;var gcn=y(x(),1);function BL(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(BL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),plane:ge("plane"),dimensions:ge("dimensions"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition")});BL.prototype.clone=function(e){return l(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 BL(this)};BL.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var wL=BL;var Tcn=y(x(),1);function YL(e){this._definitionChanged=new Ce,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._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??Q.EMPTY_OBJECT)}Object.defineProperties(YL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),pixelSize:ge("pixelSize"),heightReference:ge("heightReference"),color:ge("color"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),scaleByDistance:ge("scaleByDistance"),translucencyByDistance:ge("translucencyByDistance"),distanceDisplayCondition:ge("distanceDisplayCondition"),disableDepthTestDistance:ge("disableDepthTestDistance"),splitDirection:ge("splitDirection")});YL.prototype.clone=function(e){return l(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.splitDirection=this.splitDirection,e):new YL(this)};YL.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var kx=YL;var wcn=y(x(),1);var _cn=y(x(),1);function VXe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var gc=VXe;function LXe(e){return Array.isArray(e)&&(e=new gc(e)),new mi(e)}function NL(e){this._definitionChanged=new Ce,this._show=void 0,this._showSubscription=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._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._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=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._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(e??Q.EMPTY_OBJECT)}Object.defineProperties(NL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),hierarchy:ge("hierarchy",void 0,LXe),height:ge("height"),heightReference:ge("heightReference"),extrudedHeight:ge("extrudedHeight"),extrudedHeightReference:ge("extrudedHeightReference"),stRotation:ge("stRotation"),granularity:ge("granularity"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),perPositionHeight:ge("perPositionHeight"),closeTop:ge("closeTop"),closeBottom:ge("closeBottom"),arcType:ge("arcType"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition"),classificationType:ge("classificationType"),zIndex:ge("zIndex"),textureCoordinates:ge("textureCoordinates")});NL.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,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.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new NL(this)};NL.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var Ch=NL;var Dcn=y(x(),1);function XL(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(XL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),positions:ge("positions"),width:ge("width"),granularity:ge("granularity"),material:er("material"),depthFailMaterial:er("depthFailMaterial"),arcType:ge("arcType"),clampToGround:ge("clampToGround"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition"),classificationType:ge("classificationType"),zIndex:ge("zIndex")});XL.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,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 XL(this)};XL.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Nc=XL;var Kcn=y(x(),1);function PL(e){this._definitionChanged=new Ce,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=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._distanceDisplayConditionSubsription=void 0,this.merge(e??Q.EMPTY_OBJECT)}Object.defineProperties(PL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),positions:ge("positions"),shape:ge("shape"),cornerType:ge("cornerType"),granularity:ge("granularity"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition")});PL.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,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):new PL(this)};PL.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Qx=PL;var nln=y(x(),1);function ML(e){this._definitionChanged=new Ce,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(e??Q.EMPTY_OBJECT)}Object.defineProperties(ML.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),coordinates:ge("coordinates"),height:ge("height"),heightReference:ge("heightReference"),extrudedHeight:ge("extrudedHeight"),extrudedHeightReference:ge("extrudedHeightReference"),rotation:ge("rotation"),stRotation:ge("stRotation"),granularity:ge("granularity"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition"),classificationType:ge("classificationType"),zIndex:ge("zIndex")});ML.prototype.clone=function(e){return l(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 ML(this)};ML.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Eh=ML;var lln=y(x(),1);function UL(e){this._definitionChanged=new Ce,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.merge(e??Q.EMPTY_OBJECT)}Object.defineProperties(UL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ge("show"),positions:ge("positions"),minimumHeights:ge("minimumHeights"),maximumHeights:ge("maximumHeights"),granularity:ge("granularity"),fill:ge("fill"),material:er("material"),outline:ge("outline"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth"),shadows:ge("shadows"),distanceDisplayCondition:ge("distanceDisplayCondition")});UL.prototype.clone=function(e){return l(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):new UL(this)};UL.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var wA=UL;var WXe=new pe,CH=[];function FXe(e){return new gl(e)}function BXe(e){return ge(e,void 0,FXe)}function Ca(e,t){return ge(e,void 0,function(n){return n instanceof t?n:new t(n)})}function nm(e){e=e??Q.EMPTY_OBJECT;let t=e.id;l(t)||(t=Kn()),this._availability=void 0,this._id=t,this._definitionChanged=new Ce,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??ZA.AUTODETECT,this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...CH],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._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function EH(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&EH(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(nm.prototype,{availability:bl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:bl("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&EH(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:bl("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&EH(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ca("billboard",wc),box:Ca("box",Yx),corridor:Ca("corridor",Xx),cylinder:Ca("cylinder",Px),description:ge("description"),ellipse:Ca("ellipse",Mx),ellipsoid:Ca("ellipsoid",Ux),label:Ca("label",xh),model:Ca("model",FA),tileset:Ca("tileset",vx),orientation:ge("orientation"),path:Ca("path",BA),plane:Ca("plane",wL),point:Ca("point",kx),polygon:Ca("polygon",Ch),polyline:Ca("polyline",Nc),polylineVolume:Ca("polylineVolume",Qx),properties:Ca("properties",yl),position:BXe("position"),rectangle:Ca("rectangle",Eh),viewFrom:ge("viewFrom"),wall:Ca("wall",wA)});nm.registerEntityType=function(e,t){Object.defineProperties(nm.prototype,{[e]:Ca(e,t)}),CH.includes(e)||CH.push(e)};nm.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};nm.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,bl(e,!0))};nm.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};nm.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var Ose=new $,zse=new m,Hse=new Me;nm.prototype.computeModelMatrix=function(e,t){let n=K.getValueOrUndefined(this._position,e,zse);if(!l(n))return;let i=K.getValueOrUndefined(this._orientation,e,Hse);return l(i)?t=F.fromRotationTranslation($.fromQuaternion(i,Ose),n,t):t=Tt.eastNorthUpToFixedFrame(n,void 0,t),t};nm.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=K.getValueOrDefault(t,e,tt.NONE),s=K.getValueOrUndefined(this._position,e,zse);if(r===tt.NONE||!l(s)||m.equalsEpsilon(s,m.ZERO,V.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,WXe);em(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=K.getValueOrUndefined(this._orientation,e,Hse);return l(c)?o=F.fromRotationTranslation($.fromQuaternion(c,Ose),s,o):o=Tt.eastNorthUpToFixedFrame(s,void 0,o),o};nm.supportsMaterialsforEntitiesOnTerrain=function(e){return pl.supportsMaterials(e)};nm.supportsPolylinesOnTerrain=function(e){return bh.isSupported(e)};var xr=nm;var wXe=new Kt(D.WHITE),YXe=new mi(!0),NXe=new mi(!0),XXe=new mi(!1),PXe=new mi(D.BLACK),MXe=new mi(Rn.DISABLED),UXe=new mi(new Mt),DXe=new mi(qn.BOTH);function xl(e){let t=e.entity,n=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 Ce,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=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=xr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(xl.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||!l(this._entity.availability)&&K.isConstant(this._showProperty)&&K.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&K.isConstant(this._showProperty)&&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}}});xl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};xl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};xl.prototype.createFillGeometryInstance=Ae.throwInstantiationError;xl.prototype.createOutlineGeometryInstance=Ae.throwInstantiationError;xl.prototype.isDestroyed=function(){return!1};xl.prototype.destroy=function(){fe(this)};xl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Ke.MINIMUM_VALUE)};xl.prototype._isOnTerrain=function(e,t){return!1};xl.prototype._getIsClosed=function(e){return!0};xl.prototype._isDynamic=Ae.throwInstantiationError;xl.prototype._setStaticOptions=Ae.throwInstantiationError;xl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(Ke.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Ke.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let d=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??wXe,this._fillProperty=r??NXe,this._showProperty=d??YXe,this._showOutlineProperty=o.outline??XXe,this._outlineColorProperty=c?o.outlineColor??PXe:void 0,this._shadowsProperty=o.shadows??MXe,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??UXe,this._classificationTypeProperty=o.classificationType??DXe,this._fillEnabled=s;let u=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Kt);if(c&&u&&(At(At.geometryOutlines),c=!1),this._onTerrain=u,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let h=o.outlineWidth;this._outlineWidth=l(h)?h.getValue(Ke.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};xl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Ei=xl;var Fdn=y(x(),1);var pdn=y(x(),1);function gS(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new Ce,this.setCallback(e,t)}Object.defineProperties(gS.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var vXe=new j;gS.prototype.getValue=function(e,t){return l(e)||(e=j.now(vXe)),this._callback(e,t)};gS.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};gS.prototype.equals=function(e){return this===e||e instanceof gS&&this._callback===e._callback&&this._isConstant===e._isConstant};var Th=gS;var Zdn=y(x(),1);var Kse=new m;function bS(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new m,this._cartographicPosition=new pe,this._normal=new m,this._definitionChanged=new Ce,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Ke.MINIMUM_VALUE,Kse);if(!l(r)||m.equals(r,m.ZERO)||!l(e.globe))return;this._position=m.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(bS.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});bS.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(m.equals(t,m.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var kXe=new j;bS.prototype.getValue=function(e,t){l(e)||(e=j.now(kXe));let n=K.getValueOrDefault(this._heightReference,e,tt.NONE),i=K.getValueOrDefault(this._extrudedHeightReference,e,tt.NONE);if(n===tt.NONE&&!rS(i))return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Kse);if(!l(r)||m.equals(r,m.ZERO)||!l(o.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,r,V.EPSILON10))return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return m.multiplyByScalar(s,this._terrainHeight,t)};bS.prototype.isDestroyed=function(){return!1};bS.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),fe(this)};var Ox=bS;function QXe(e,t,n,i){if(Ei.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new Th(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Ox(this._scene,s,r)}}var YA=QXe;var Jse=m.ZERO,jse=new m,OXe=new m,qse=new D;function zXe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Jd(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new zXe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Jd.prototype=Object.create(Ei.prototype),Jd.prototype.constructor=Jd);Object.defineProperties(Jd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Jd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=jn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,qse)),l(a)||(a=D.WHITE),s.color=qt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Jse,jse))),new Bt({id:t,geometry:hc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Jd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,qse),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(i),distanceDisplayCondition:jn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Jse,jse))),new Bt({id:t,geometry:gh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Jd.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};Jd.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Ei.prototype._isHidden.call(this,e,t)};Jd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.dimensions.isConstant||!K.isConstant(t.outlineWidth)};Jd.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,tt.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ke.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==tt.NONE?mn.ALL:void 0};Jd.prototype._onEntityPropertyChanged=YA;Jd.DynamicGeometryUpdater=yS;function yS(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(yS.prototype=Object.create(Ci.prototype),yS.prototype.constructor=yS);yS.prototype._isHidden=function(e,t,n){let i=K.getValueOrUndefined(e.position,n,OXe),o=this._options.dimensions;return!l(i)||!l(o)||Ci.prototype._isHidden.call(this,e,t,n)};yS.prototype._setOptions=function(e,t,n){let i=K.getValueOrDefault(t.heightReference,n,tt.NONE),o=this._options;o.dimensions=K.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==tt.NONE?mn.ALL:void 0};var DL=Jd;var cun=y(x(),1);function zx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??eo.FIXED,this._definitionChanged=new Ce,this.setCallback(e,t)}Object.defineProperties(zx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var HXe=new j;zx.prototype.getValue=function(e,t){return l(e)||(e=j.now(HXe)),this.getValueInReferenceFrame(e,eo.FIXED,t)};zx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};zx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return yh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};zx.prototype.equals=function(e){return this===e||e instanceof zx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var vL=zx;var tri=y(x(),1);var koi=y(x(),1);var fun=y(x(),1);var dun=y(x(),1);/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */var{entries:aae,setPrototypeOf:$se,isFrozen:KXe,getPrototypeOf:JXe,getOwnPropertyDescriptor:jXe}=Object,{freeze:El,seal:im,create:GH}=Object,{apply:VH,construct:LH}=typeof Reflect<"u"&&Reflect;El||(El=function(t){return t});im||(im=function(t){return t});VH||(VH=function(t,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];return t.apply(n,o)});LH||(LH=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return new t(...i)});var Sv=Tl(Array.prototype.forEach),qXe=Tl(Array.prototype.lastIndexOf),eae=Tl(Array.prototype.pop),kL=Tl(Array.prototype.push),$Xe=Tl(Array.prototype.splice),_v=Tl(String.prototype.toLowerCase),TH=Tl(String.prototype.toString),SH=Tl(String.prototype.match),QL=Tl(String.prototype.replace),ePe=Tl(String.prototype.indexOf),tPe=Tl(String.prototype.trim),Sh=Tl(Object.prototype.hasOwnProperty),Cl=Tl(RegExp.prototype.test),OL=nPe(TypeError);function Tl(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return VH(e,t,i)}}function nPe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return LH(e,n)}}function Xi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_v;$se&&$se(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(KXe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function iPe(e){for(let t=0;t<e.length;t++)Sh(e,t)||(e[t]=null);return e}function Jf(e){let t=GH(null);for(let[n,i]of aae(e))Sh(e,n)&&(Array.isArray(i)?t[n]=iPe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=Jf(i):t[n]=i);return t}function zL(e,t){for(;e!==null;){let i=jXe(e,t);if(i){if(i.get)return Tl(i.get);if(typeof i.value=="function")return Tl(i.value)}e=JXe(e)}function n(){return null}return n}var tae=El(["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","dialog","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","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","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"]),IH=El(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_H=El(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),oPe=El(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ZH=El(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),rPe=El(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nae=El(["#text"]),iae=El(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),RH=El(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","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","exponent","fill","fill-opacity","fill-rule","filter","filterunits","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","intercept","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","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","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"]),oae=El(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","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"]),Iv=El(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sPe=im(/\{\{[\w\W]*|[\w\W]*\}\}/gm),aPe=im(/<%[\w\W]*|[\w\W]*%>/gm),cPe=im(/\$\{[\w\W]*/gm),lPe=im(/^data-[\-\w.\u00B7-\uFFFF]+$/),dPe=im(/^aria-[\-\w]+$/),cae=im(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),uPe=im(/^(?:\w+script|data):/i),mPe=im(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lae=im(/^html$/i),hPe=im(/^[a-z][.\w]*(-[.\w]+)+$/i),rae=Object.freeze({__proto__:null,ARIA_ATTR:dPe,ATTR_WHITESPACE:mPe,CUSTOM_ELEMENT:hPe,DATA_ATTR:lPe,DOCTYPE_NAME:lae,ERB_EXPR:aPe,IS_ALLOWED_URI:cae,IS_SCRIPT_OR_DATA:uPe,MUSTACHE_EXPR:sPe,TMPLIT_EXPR:cPe}),HL={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},fPe=function(){return typeof window>"u"?null:window},pPe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},sae=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function dae(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fPe(),t=An=>dae(An);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==HL.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:g}=e,f=c.prototype,b=zL(f,"cloneNode"),C=zL(f,"remove"),E=zL(f,"nextSibling"),T=zL(f,"childNodes"),S=zL(f,"parentNode");if(typeof s=="function"){let An=n.createElement("template");An.content&&An.content.ownerDocument&&(n=An.content.ownerDocument)}let _,R="",{implementation:L,createNodeIterator:W,createDocumentFragment:B,getElementsByTagName:Y}=n,{importNode:N}=i,A=sae();t.isSupported=typeof aae=="function"&&typeof S=="function"&&L&&L.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:I,ERB_EXPR:Z,TMPLIT_EXPR:G,DATA_ATTR:w,ARIA_ATTR:X,IS_SCRIPT_OR_DATA:v,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:k}=rae,{IS_ALLOWED_URI:P}=rae,O=null,H=Xi({},[...tae,...IH,..._H,...ZH,...nae]),ee=null,z=Xi({},[...iae,...RH,...oae,...Iv]),te=Object.seal(GH(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,me=null,ye=Object.seal(GH(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),oe=!0,xe=!0,Ee=!1,Le=!0,Se=!1,Fe=!0,Ue=!1,De=!1,Je=!1,St=!1,Oe=!1,it=!1,yt=!0,Ot=!1,Mn="user-content-",sn=!0,ut=!1,Nt={},In=null,lt=Xi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),fi=null,ao=Xi({},["audio","video","img","source","image","track"]),po=null,ri=Xi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),co="http://www.w3.org/1998/Math/MathML",lo="http://www.w3.org/2000/svg",Di="http://www.w3.org/1999/xhtml",Wi=Di,Qn=!1,uo=null,vo=Xi({},[co,lo,Di],TH),hr=Xi({},["mi","mo","mn","ms","mtext"]),Vr=Xi({},["annotation-xml"]),qs=Xi({},["title","style","font","a","script"]),xs=null,Na=["application/xhtml+xml","text/html"],Ao="text/html",Vn=null,Qo=null,Oo=n.createElement("form"),$s=function(Re){return Re instanceof RegExp||Re instanceof Function},Fi=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Qo&&Qo===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=Jf(Re),xs=Na.indexOf(Re.PARSER_MEDIA_TYPE)===-1?Ao:Re.PARSER_MEDIA_TYPE,Vn=xs==="application/xhtml+xml"?TH:_v,O=Sh(Re,"ALLOWED_TAGS")?Xi({},Re.ALLOWED_TAGS,Vn):H,ee=Sh(Re,"ALLOWED_ATTR")?Xi({},Re.ALLOWED_ATTR,Vn):z,uo=Sh(Re,"ALLOWED_NAMESPACES")?Xi({},Re.ALLOWED_NAMESPACES,TH):vo,po=Sh(Re,"ADD_URI_SAFE_ATTR")?Xi(Jf(ri),Re.ADD_URI_SAFE_ATTR,Vn):ri,fi=Sh(Re,"ADD_DATA_URI_TAGS")?Xi(Jf(ao),Re.ADD_DATA_URI_TAGS,Vn):ao,In=Sh(Re,"FORBID_CONTENTS")?Xi({},Re.FORBID_CONTENTS,Vn):lt,q=Sh(Re,"FORBID_TAGS")?Xi({},Re.FORBID_TAGS,Vn):Jf({}),me=Sh(Re,"FORBID_ATTR")?Xi({},Re.FORBID_ATTR,Vn):Jf({}),Nt=Sh(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,oe=Re.ALLOW_ARIA_ATTR!==!1,xe=Re.ALLOW_DATA_ATTR!==!1,Ee=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Se=Re.SAFE_FOR_TEMPLATES||!1,Fe=Re.SAFE_FOR_XML!==!1,Ue=Re.WHOLE_DOCUMENT||!1,St=Re.RETURN_DOM||!1,Oe=Re.RETURN_DOM_FRAGMENT||!1,it=Re.RETURN_TRUSTED_TYPE||!1,Je=Re.FORCE_BODY||!1,yt=Re.SANITIZE_DOM!==!1,Ot=Re.SANITIZE_NAMED_PROPS||!1,sn=Re.KEEP_CONTENT!==!1,ut=Re.IN_PLACE||!1,P=Re.ALLOWED_URI_REGEXP||cae,Wi=Re.NAMESPACE||Di,hr=Re.MATHML_TEXT_INTEGRATION_POINTS||hr,Vr=Re.HTML_INTEGRATION_POINTS||Vr,te=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&$s(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(te.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&$s(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(te.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(te.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Se&&(xe=!1),Oe&&(St=!0),Nt&&(O=Xi({},nae),ee=[],Nt.html===!0&&(Xi(O,tae),Xi(ee,iae)),Nt.svg===!0&&(Xi(O,IH),Xi(ee,RH),Xi(ee,Iv)),Nt.svgFilters===!0&&(Xi(O,_H),Xi(ee,RH),Xi(ee,Iv)),Nt.mathMl===!0&&(Xi(O,ZH),Xi(ee,oae),Xi(ee,Iv))),Re.ADD_TAGS&&(typeof Re.ADD_TAGS=="function"?ye.tagCheck=Re.ADD_TAGS:(O===H&&(O=Jf(O)),Xi(O,Re.ADD_TAGS,Vn))),Re.ADD_ATTR&&(typeof Re.ADD_ATTR=="function"?ye.attributeCheck=Re.ADD_ATTR:(ee===z&&(ee=Jf(ee)),Xi(ee,Re.ADD_ATTR,Vn))),Re.ADD_URI_SAFE_ATTR&&Xi(po,Re.ADD_URI_SAFE_ATTR,Vn),Re.FORBID_CONTENTS&&(In===lt&&(In=Jf(In)),Xi(In,Re.FORBID_CONTENTS,Vn)),Re.ADD_FORBID_CONTENTS&&(In===lt&&(In=Jf(In)),Xi(In,Re.ADD_FORBID_CONTENTS,Vn)),sn&&(O["#text"]=!0),Ue&&Xi(O,["html","head","body"]),O.table&&(Xi(O,["tbody"]),delete q.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw OL('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw OL('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=Re.TRUSTED_TYPES_POLICY,R=_.createHTML("")}else _===void 0&&(_=pPe(g,o)),_!==null&&typeof R=="string"&&(R=_.createHTML(""));El&&El(Re),Qo=Re}},Wo=Xi({},[...IH,..._H,...oPe]),dc=Xi({},[...ZH,...rPe]),ea=function(Re){let Gt=S(Re);(!Gt||!Gt.tagName)&&(Gt={namespaceURI:Wi,tagName:"template"});let gn=_v(Re.tagName),fr=_v(Gt.tagName);return uo[Re.namespaceURI]?Re.namespaceURI===lo?Gt.namespaceURI===Di?gn==="svg":Gt.namespaceURI===co?gn==="svg"&&(fr==="annotation-xml"||hr[fr]):!!Wo[gn]:Re.namespaceURI===co?Gt.namespaceURI===Di?gn==="math":Gt.namespaceURI===lo?gn==="math"&&Vr[fr]:!!dc[gn]:Re.namespaceURI===Di?Gt.namespaceURI===lo&&!Vr[fr]||Gt.namespaceURI===co&&!hr[fr]?!1:!dc[gn]&&(qs[gn]||!Wo[gn]):!!(xs==="application/xhtml+xml"&&uo[Re.namespaceURI]):!1},Lr=function(Re){kL(t.removed,{element:Re});try{S(Re).removeChild(Re)}catch{C(Re)}},Wr=function(Re,Gt){try{kL(t.removed,{attribute:Gt.getAttributeNode(Re),from:Gt})}catch{kL(t.removed,{attribute:null,from:Gt})}if(Gt.removeAttribute(Re),Re==="is")if(St||Oe)try{Lr(Gt)}catch{}else try{Gt.setAttribute(Re,"")}catch{}},rh=function(Re){let Gt=null,gn=null;if(Je)Re="<remove></remove>"+Re;else{let Cs=SH(Re,/^[\r\n\t ]+/);gn=Cs&&Cs[0]}xs==="application/xhtml+xml"&&Wi===Di&&(Re='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Re+"</body></html>");let fr=_?_.createHTML(Re):Re;if(Wi===Di)try{Gt=new p().parseFromString(fr,xs)}catch{}if(!Gt||!Gt.documentElement){Gt=L.createDocument(Wi,"template",null);try{Gt.documentElement.innerHTML=Qn?R:fr}catch{}}let Pa=Gt.body||Gt.documentElement;return Re&&gn&&Pa.insertBefore(n.createTextNode(gn),Pa.childNodes[0]||null),Wi===Di?Y.call(Gt,Ue?"html":"body")[0]:Ue?Gt.documentElement:Pa},ws=function(Re){return W.call(Re.ownerDocument||Re,Re,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Xa=function(Re){return Re instanceof h&&(typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||!(Re.attributes instanceof u)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function")},Yf=function(Re){return typeof a=="function"&&Re instanceof a};function Fo(An,Re,Gt){Sv(An,gn=>{gn.call(t,Re,Gt,Qo)})}let Jl=function(Re){let Gt=null;if(Fo(A.beforeSanitizeElements,Re,null),Xa(Re))return Lr(Re),!0;let gn=Vn(Re.nodeName);if(Fo(A.uponSanitizeElement,Re,{tagName:gn,allowedTags:O}),Fe&&Re.hasChildNodes()&&!Yf(Re.firstElementChild)&&Cl(/<[/\w!]/g,Re.innerHTML)&&Cl(/<[/\w!]/g,Re.textContent)||Re.nodeType===HL.progressingInstruction||Fe&&Re.nodeType===HL.comment&&Cl(/<[/\w]/g,Re.data))return Lr(Re),!0;if(!(ye.tagCheck instanceof Function&&ye.tagCheck(gn))&&(!O[gn]||q[gn])){if(!q[gn]&&pa(gn)&&(te.tagNameCheck instanceof RegExp&&Cl(te.tagNameCheck,gn)||te.tagNameCheck instanceof Function&&te.tagNameCheck(gn)))return!1;if(sn&&!In[gn]){let fr=S(Re)||Re.parentNode,Pa=T(Re)||Re.childNodes;if(Pa&&fr){let Cs=Pa.length;for(let Zc=Cs-1;Zc>=0;--Zc){let Nd=b(Pa[Zc],!0);Nd.__removalCount=(Re.__removalCount||0)+1,fr.insertBefore(Nd,E(Re))}}}return Lr(Re),!0}return Re instanceof c&&!ea(Re)||(gn==="noscript"||gn==="noembed"||gn==="noframes")&&Cl(/<\/no(script|embed|frames)/i,Re.innerHTML)?(Lr(Re),!0):(Se&&Re.nodeType===HL.text&&(Gt=Re.textContent,Sv([I,Z,G],fr=>{Gt=QL(Gt,fr," ")}),Re.textContent!==Gt&&(kL(t.removed,{element:Re.cloneNode()}),Re.textContent=Gt)),Fo(A.afterSanitizeElements,Re,null),!1)},jl=function(Re,Gt,gn){if(yt&&(Gt==="id"||Gt==="name")&&(gn in n||gn in Oo))return!1;if(!(xe&&!me[Gt]&&Cl(w,Gt))){if(!(oe&&Cl(X,Gt))){if(!(ye.attributeCheck instanceof Function&&ye.attributeCheck(Gt,Re))){if(!ee[Gt]||me[Gt]){if(!(pa(Re)&&(te.tagNameCheck instanceof RegExp&&Cl(te.tagNameCheck,Re)||te.tagNameCheck instanceof Function&&te.tagNameCheck(Re))&&(te.attributeNameCheck instanceof RegExp&&Cl(te.attributeNameCheck,Gt)||te.attributeNameCheck instanceof Function&&te.attributeNameCheck(Gt,Re))||Gt==="is"&&te.allowCustomizedBuiltInElements&&(te.tagNameCheck instanceof RegExp&&Cl(te.tagNameCheck,gn)||te.tagNameCheck instanceof Function&&te.tagNameCheck(gn))))return!1}else if(!po[Gt]){if(!Cl(P,QL(gn,U,""))){if(!((Gt==="src"||Gt==="xlink:href"||Gt==="href")&&Re!=="script"&&ePe(gn,"data:")===0&&fi[Re])){if(!(Ee&&!Cl(v,QL(gn,U,"")))){if(gn)return!1}}}}}}}return!0},pa=function(Re){return Re!=="annotation-xml"&&SH(Re,k)},Bo=function(Re){Fo(A.beforeSanitizeAttributes,Re,null);let{attributes:Gt}=Re;if(!Gt||Xa(Re))return;let gn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0},fr=Gt.length;for(;fr--;){let Pa=Gt[fr],{name:Cs,namespaceURI:Zc,value:Nd}=Pa,Ib=Vn(Cs),nR=Nd,Aa=Cs==="value"?nR:tPe(nR);if(gn.attrName=Ib,gn.attrValue=Aa,gn.keepAttr=!0,gn.forceKeepAttr=void 0,Fo(A.uponSanitizeAttribute,Re,gn),Aa=gn.attrValue,Ot&&(Ib==="id"||Ib==="name")&&(Wr(Cs,Re),Aa=Mn+Aa),Fe&&Cl(/((--!?|])>)|<\/(style|title|textarea)/i,Aa)){Wr(Cs,Re);continue}if(Ib==="attributename"&&SH(Aa,"href")){Wr(Cs,Re);continue}if(gn.forceKeepAttr)continue;if(!gn.keepAttr){Wr(Cs,Re);continue}if(!Le&&Cl(/\/>/i,Aa)){Wr(Cs,Re);continue}Se&&Sv([I,Z,G],rD=>{Aa=QL(Aa,rD," ")});let oD=Vn(Re.nodeName);if(!jl(oD,Ib,Aa)){Wr(Cs,Re);continue}if(_&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Zc)switch(g.getAttributeType(oD,Ib)){case"TrustedHTML":{Aa=_.createHTML(Aa);break}case"TrustedScriptURL":{Aa=_.createScriptURL(Aa);break}}if(Aa!==nR)try{Zc?Re.setAttributeNS(Zc,Cs,Aa):Re.setAttribute(Cs,Aa),Xa(Re)?Lr(Re):eae(t.removed)}catch{Wr(Cs,Re)}}Fo(A.afterSanitizeAttributes,Re,null)},ql=function An(Re){let Gt=null,gn=ws(Re);for(Fo(A.beforeSanitizeShadowDOM,Re,null);Gt=gn.nextNode();)Fo(A.uponSanitizeShadowNode,Gt,null),Jl(Gt),Bo(Gt),Gt.content instanceof r&&An(Gt.content);Fo(A.afterSanitizeShadowDOM,Re,null)};return t.sanitize=function(An){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Gt=null,gn=null,fr=null,Pa=null;if(Qn=!An,Qn&&(An="<!-->"),typeof An!="string"&&!Yf(An))if(typeof An.toString=="function"){if(An=An.toString(),typeof An!="string")throw OL("dirty is not a string, aborting")}else throw OL("toString is not a function");if(!t.isSupported)return An;if(De||Fi(Re),t.removed=[],typeof An=="string"&&(ut=!1),ut){if(An.nodeName){let Nd=Vn(An.nodeName);if(!O[Nd]||q[Nd])throw OL("root node is forbidden and cannot be sanitized in-place")}}else if(An instanceof a)Gt=rh("<!---->"),gn=Gt.ownerDocument.importNode(An,!0),gn.nodeType===HL.element&&gn.nodeName==="BODY"||gn.nodeName==="HTML"?Gt=gn:Gt.appendChild(gn);else{if(!St&&!Se&&!Ue&&An.indexOf("<")===-1)return _&&it?_.createHTML(An):An;if(Gt=rh(An),!Gt)return St?null:it?R:""}Gt&&Je&&Lr(Gt.firstChild);let Cs=ws(ut?An:Gt);for(;fr=Cs.nextNode();)Jl(fr),Bo(fr),fr.content instanceof r&&ql(fr.content);if(ut)return An;if(St){if(Oe)for(Pa=B.call(Gt.ownerDocument);Gt.firstChild;)Pa.appendChild(Gt.firstChild);else Pa=Gt;return(ee.shadowroot||ee.shadowrootmode)&&(Pa=N.call(i,Pa,!0)),Pa}let Zc=Ue?Gt.outerHTML:Gt.innerHTML;return Ue&&O["!doctype"]&&Gt.ownerDocument&&Gt.ownerDocument.doctype&&Gt.ownerDocument.doctype.name&&Cl(lae,Gt.ownerDocument.doctype.name)&&(Zc="<!DOCTYPE "+Gt.ownerDocument.doctype.name+`>
`+Zc),Se&&Sv([I,Z,G],Nd=>{Zc=QL(Zc,Nd," ")}),_&&it?_.createHTML(Zc):Zc},t.setConfig=function(){let An=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fi(An),De=!0},t.clearConfig=function(){Qo=null,De=!1},t.isValidAttribute=function(An,Re,Gt){Qo||Fi({});let gn=Vn(An),fr=Vn(Re);return jl(gn,fr,Gt)},t.addHook=function(An,Re){typeof Re=="function"&&kL(A[An],Re)},t.removeHook=function(An,Re){if(Re!==void 0){let Gt=qXe(A[An],Re);return Gt===-1?void 0:$Xe(A[An],Gt,1)[0]}return eae(A[An])},t.removeHooks=function(An){A[An]=[]},t.removeAllHooks=function(){A=sae()},t}var uae=dae();var APe=0,WH={};function jf(e,t){let n,i=e;l(WH[i])?n=WH[i]:(n=APe++,WH[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(jf.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=uae.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});jf.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};jf.prototype.equals=function(e){return jf.equals(this,e)};jf.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};jf.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new jf(e.html,t)};jf.clone=function(e){if(l(e))return new jf(e.html,e.showOnScreen)};var bt=jf;var gun=y(x(),1);function gPe(e,t){At(e,t)}var Ms=gPe;var wun=y(x(),1);var Run=y(x(),1);function Hx(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new Ce}Object.defineProperties(Hx.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});Hx.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function FH(e){e._cubeMapBuffers=void 0}Hx.prototype.update=function(e){let{context:t}=e;if(!Hx.isSupported(t))return;if(l(this._texture)){FH(this);return}if(!l(this._texture)&&!this._loading){let u=t.textureCache.getTexture(this._url);l(u)&&(FH(this),this._texture=u,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let u=this;nd(this._url).then(function(h){u._cubeMapBuffers=h,u._loading=!1}).catch(function(h){u.isDestroyed()||u._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?ve.HALF_FLOAT:ve.FLOAT);let o=je.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let u={};Object.values(zr.FaceName).forEach(h=>{u[h]=void 0});for(let h=r;h<a;h++)n.push(u)}let c=new Ht({minificationFilter:zt.LINEAR_MIPMAP_LINEAR}),d=new zr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});d.loadMipmaps(n.slice(1)),this._texture=d,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Hx.prototype.isDestroyed=function(){return!1};Hx.prototype.destroy=function(){return FH(this),this._texture=this._texture&&this._texture.destroy(),fe(this)};var Ih=Hx;function KL(e){e=e??Q.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?M.clone(e.imageBasedLightingFactor):new M(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousFrameContext=void 0,this._previousImageBasedLightingFactor=M.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(KL.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=M.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=M.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function bPe(e,t){if(Ih.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Ih(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}KL.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;M.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=M.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(bPe(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};KL.prototype.isDestroyed=function(){return!1};KL.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),fe(this)};var Kx=KL;var Hun=y(x(),1),wH=y(Md(),1);var Mun=y(x(),1);var BH,mae="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlZWVkZjhjNC01NjdhLTQwNTctOTExMy02MThlYjIxM2U4OTkiLCJpZCI6MjU5LCJpYXQiOjE3NzAwNTUxOTV9.aJTRjsRlsJwPC0Nfcq4xscYc2lPJcGFku_PVxp1ZPyQ",Zv={};Zv.defaultAccessToken=mae;Zv.defaultServer=new Ge({url:"https://api.cesium.com/"});Zv.getDefaultTokenCredit=function(e){if(e===mae){if(!l(BH)){let t=`<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 <a href="https://cesium.com">https://cesium.com</a>.</b>`;BH=new bt(t,!0)}return BH}};var _h=Zv;function Sl(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:yPe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new he("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ge.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new wH.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o,this.refreshCallback=void 0}l(Object.create)&&(Sl.prototype=Object.create(Ge.prototype),Sl.prototype.constructor=Sl);Sl.fromAssetId=function(e,t){let n=Sl._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Sl(i,n)})};Object.defineProperties(Sl.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Sl.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Sl.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(bt.getIonCredit),i=_h.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(bt.clone(i)),n};Sl.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new Sl(t._ionEndpoint,t._ionEndpointResource)),e=Ge.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Sl.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ge.prototype.fetchImage.call(this,e)};Sl.prototype._makeRequest=function(e){return this._isExternal||new wH.default(this.url).authority()!==this._ionEndpointDomain?Ge.prototype._makeRequest.call(this,e):(e.headers=hae(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,Ge.prototype._makeRequest.call(this,e))};Sl._createEndpointResource=function(e,t){t=t??Q.EMPTY_OBJECT;let n=t.server??_h.defaultServer,i=t.accessToken??_h.defaultAccessToken;n=Ge.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),l(t.queryParameters)&&(o.queryParameters={...o.queryParameters,...t.queryParameters}),o.headers=hae(o.headers),n.getDerivedResource(o)};function hae(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}function yPe(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,r),n._ionEndpoint=r,n._ionEndpoint}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var os=Sl;var Jun=y(x(),1);function qf(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(qf.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});qf.prototype.get=function(e){return this._array[e]};qf.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};qf.prototype.peek=function(){return this._array[this._length-1]};qf.prototype.push=function(e){let t=this.length++;this._array[t]=e};qf.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};qf.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};qf.prototype.resize=function(e){this.length=e};qf.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Il=qf;var emn=y(x(),1);var NA={X:0,Y:1,Z:2};NA.Y_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));NA.Z_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));NA.X_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));NA.Z_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));NA.X_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));NA.Y_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));NA.fromName=function(e){return NA[e]};var to=Object.freeze(NA);var Kti=y(x(),1);var imn=y(x(),1);function fae(e){e=e??Q.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(fae.prototype,{metadata:{get:function(){return this._metadata}}});var Jx=fae;var Z6n=y(x(),1);var Amn=y(x(),1);var lmn=y(x(),1);var smn=y(x(),1);function Jb(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),Jb.decode(e)}Jb.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};Jb.decodeWithFromCharCode=function(e){let t="",n=xPe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function JL(e,t,n){return t<=e&&e<=n}function xPe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let d=e[c];if(i===0){if(JL(d,0,127)){s.push(d);continue}if(JL(d,194,223)){i=1,t=d&31;continue}if(JL(d,224,239)){d===224&&(o=160),d===237&&(r=159),i=2,t=d&15;continue}if(JL(d,240,244)){d===240&&(o=144),d===244&&(r=143),i=3,t=d&7;continue}throw new he("String decoding failed.")}if(!JL(d,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|d&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?Jb.decode=Jb.decodeWithTextDecoder:Jb.decode=Jb.decodeWithFromCharCode;var cd=Jb;function CPe(e,t){return t=t??0,cd(e,t,Math.min(4,e.length))}var Zh=CPe;function om(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(om.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var jL=Uint32Array.BYTES_PER_ELEMENT;om.fromTileType=async function(e,t,n,i,o,r){o=o??0;let s=new Uint8Array(i),a=new DataView(i);o+=jL;let c=a.getUint32(o,!0);if(c!==1)throw new he(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=jL,o+=jL;let d=a.getUint32(o,!0);o+=jL;let u=n.queryParameters.compositeIndex;l(u)?u=`${u}_`:u="";let h=[];h.length=d;for(let f=0;f<d;++f){let b=Zh(s,o),C=a.getUint32(o+jL*2,!0),E=r[b],T=`${u}${f}`,S=n.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(E))h[f]=Promise.resolve(E(e,t,S,i,o));else throw new he(`Unknown tile content type, ${b}, inside Composite tile`);o+=C}let p=await Promise.all(h);return new om(e,t,n,p)};om.prototype.hasProperty=function(e,t){return!1};om.prototype.getFeature=function(e){};om.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};om.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};om.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};om.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=m.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};om.prototype.isDestroyed=function(){return!1};om.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var qL=om;var Ofn=y(x(),1);var ymn=y(x(),1);function EPe(e,t,n){return JSON.parse(cd(e,t,n))}var Cr=EPe;var Shn=y(x(),1);var Wmn=y(x(),1);function Xc(e){this._id=Kn();let t=e.featuresLength;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=[];let n,i;if(t>0){let o=Math.min(t,Yt.maximumTextureSize),r=Math.ceil(t/Yt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new M(o,r),i=new ce(s,a,c,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Xc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Xc.DEFAULT_COLOR_VALUE=D.WHITE;Xc.DEFAULT_SHOW_VALUE=!0;function pae(e){let t=e._textureDimensions;return t.x*t.y*4}function Aae(e){if(!l(e._batchValues)){let t=pae(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function gae(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Xc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=gae(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Aae(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Xc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Xc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var TPe=new Array(4);Xc.prototype.setColor=function(e,t){if(D.equals(t,Xc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(TPe),i=n[3],o=Aae(this),r=e*4,s=gae(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,d=s[a]!==0;o[r+3]=d?i:0,s[a+1]=i;let u=i!==255;u&&!c?++this._translucentFeaturesLength:!u&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Xc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Xc.prototype.getColor=function(e,t){if(!l(this._batchValues))return D.clone(Xc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return D.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Xc.prototype.getPickColor=function(e){return this._pickIds[e]};function bae(e,t,n){let i=e._textureDimensions;return new Wt({context:t,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Ht.NEAREST})}function SPe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=pae(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let d=t.createPickId(s.getFeature(c));i.push(d);let u=d.color,h=c*4;r[h]=D.floatToByte(u.red),r[h+1]=D.floatToByte(u.green),r[h+2]=D.floatToByte(u.blue),r[h+3]=D.floatToByte(u.alpha)}e._pickTexture=bae(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function IPe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Xc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&SPe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=bae(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),IPe(this))};Xc.prototype.isDestroyed=function(){return!1};Xc.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var _l=Xc;var Jmn=y(x(),1);var Umn=y(x(),1);var _Pe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ZPe={SCALAR:void 0,VEC2:M,VEC3:m,VEC4:ce,MAT2:ki,MAT3:$,MAT4:F};function RPe(e){let t=e.componentType,n;typeof t=="string"?n=J.fromName(t):n=t;let i=_Pe[e.type],o=ZPe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return J.createArrayBufferView(n,r,s,i*a)}}}var rm=RPe;function XA(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,GPe(this,e.extension,e.binaryBody)}Object.defineProperties(XA.prototype,{byteLength:{get:function(){return this._byteLength}}});function GPe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,d=t.parentCounts,u=t.parentIds,h=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??J.UNSIGNED_SHORT,c.type=Ut.SCALAR,r=rm(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(d)){for(l(d.byteOffset)&&(d.componentType=d.componentType??J.UNSIGNED_SHORT,d.type=Ut.SCALAR,r=rm(d),d=r.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,s),p+=d.byteLength),g=new Uint16Array(s),h=0,i=0;i<s;++i)g[i]=h,h+=d[i];p+=g.byteLength}l(u)&&l(u.byteOffset)&&(u.componentType=u.componentType??J.UNSIGNED_SHORT,u.type=Ut.SCALAR,r=rm(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,h),p+=u.byteLength);let f=a.length;for(i=0;i<f;++i){let E=a[i].length,T=a[i].instances,S=Rh.getBinaryProperties(E,T,n);p+=VPe(S),a[i].instances=Rt(S,T)}let b=new Array(f).fill(0),C=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],C[i]=b[o],++b[o];p+=C.byteLength,e._classes=a,e._classIds=c,e._classIndexes=C,e._parentCounts=d,e._parentIndexes=g,e._parentIds=u,e._byteLength=p}function VPe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var LPe=[],WPe=[],FPe=0;function BPe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=LPe;c.length=Math.max(c.length,a);let d=++FPe,u=WPe;for(u.length=0,u.push(t);u.length>0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let h=n(e,t);if(l(h))return h;let p=o[t],g=s[t];for(let f=0;f<p;++f){let b=r[g+f];b!==t&&u.push(b)}}}function wPe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function $L(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return BPe(e,t,n)}else return n(e,t);return wPe(e,t,n)}XA.prototype.hasProperty=function(e,t){let n=$L(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};XA.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};XA.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,$L(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};XA.prototype.getProperty=function(e,t){return $L(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?YPe(a,s):Qe(a[s],!0)})};function YPe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}XA.prototype.setProperty=function(e,t,n){let i=$L(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],d=a.instances[t];if(l(d))return l(d.typedArray)?NPe(d,c,n):d[c]=Qe(n,!0),!0});return l(i)};function NPe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}XA.prototype.isClass=function(e,t){let n=$L(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};XA.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var jx=XA;var qmn=y(x(),1),XPe={HIGHLIGHT:0,REPLACE:1,MIX:2},ld=Object.freeze(XPe);var YH=_l.DEFAULT_COLOR_VALUE,NH=_l.DEFAULT_SHOW_VALUE;function Uo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=r??{};let s=PPe(n);this._properties=s,this._batchTableHierarchy=MPe(this,n,i);let a=xae(t,s,i);this._binaryPropertiesByteLength=UPe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new _l({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}Uo._deprecationWarning=Ms;Object.defineProperties(Uo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function PPe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Qe(e[n],!0));return t}function MPe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(Uo._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"]=o,i=o),!!l(i))return new jx({extension:i,binaryBody:n})}function xae(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new he("componentType is required.");if(!l(c))throw new he("type is required.");if(!l(n))throw new he(`Property ${o} requires a batch table binary.`);let d=rm(r),u=d.componentsPerAttribute,h=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:h}}}return i}function UPe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Uo.getBinaryProperties=function(e,t,n){return xae(e,t,n)};Uo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Uo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Uo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Uo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Uo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Uo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Uo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var DPe=new D;Uo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(YH),this.setAllShow(NH);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?e.color.evaluateColor(o,DPe)??YH:YH,s=l(e.show)?e.show.evaluate(o)??NH:NH;this.setColor(i,r),this.setShow(i,s)}};function vPe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function kPe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Uo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Uo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Uo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Uo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Uo.prototype.hasPropertyBySemantic=function(){return!1};Uo.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(ni(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);ni(t,i)}return t};Uo.prototype.getPropertyBySemantic=function(e,t){};Uo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return vPe(i,e)}let n=this._properties[t];if(l(n))return Qe(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Uo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){kPe(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Qe(n,!0)};function QPe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; 
vec2 computeSt(float batchId) 
{ 
    float stepX = tile_textureStep.x; 
    float centerX = tile_textureStep.y; 
    return vec2(centerX + (batchId * stepX), 0.5); 
} 
`:`uniform vec4 tile_textureStep; 
uniform vec2 tile_textureDimensions; 
vec2 computeSt(float batchId) 
{ 
    float stepX = tile_textureStep.x; 
    float centerX = tile_textureStep.y; 
    float stepY = tile_textureStep.z; 
    float centerY = tile_textureStep.w; 
    float xId = mod(batchId, tile_textureDimensions.x); 
    float yId = floor(batchId / tile_textureDimensions.x); 
    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); 
} 
`}Uo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Cae(o,n,!1),s;return Yt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; 
`),s+=`uniform sampler2D tile_batchTexture; 
out vec4 tile_featureColor; 
out vec2 tile_featureSt; 
void main() 
{ 
    vec2 st = computeSt(${t}); 
    vec4 featureProperties = texture(tile_batchTexture, st); 
    tile_color(featureProperties); 
    float show = ceil(featureProperties.a); 
    gl_Position *= show; 
`,e&&(s+=`    bool isStyleTranslucent = (featureProperties.a != 1.0); 
    if (czm_pass == czm_passTranslucent) 
    { 
        if (!isStyleTranslucent && !tile_translucentCommand) 
        { 
            gl_Position *= 0.0; 
        } 
    } 
    else 
    { 
        if (isStyleTranslucent) 
        { 
            gl_Position *= 0.0; 
        } 
    } 
`),s+=`    tile_featureColor = featureProperties; 
    tile_featureSt = st; 
}`):s=`out vec2 tile_featureSt; 
void main() 
{ 
    tile_color(vec4(1.0)); 
    tile_featureSt = computeSt(${t}); 
}`,`${r}
${QPe(i)}${s}`}};function yae(e,t){return e=ze.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; 
void tile_color(vec4 tile_featureColor) 
{ 
    tile_main(); 
    tile_featureColor = czm_gammaCorrect(tile_featureColor); 
    out_FragColor.a *= tile_featureColor.a; 
    float highlight = ceil(tile_colorBlend); 
    out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); 
} 
`:`${e}void tile_color(vec4 tile_featureColor) 
{ 
    tile_main(); 
} 
`}function OPe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d<e.length;++d){let u=e.charAt(d);if(u==="(")++s;else if(u===")"&&(--s,s===0)){r=d+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function Cae(e,t,n){if(!l(t))return yae(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return yae(e,n);let r=o[0],s=o[2];e=ze.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) 
{ 
    return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); 
} 
vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) 
{ 
    vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); 
    vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; 
    return vec4(diffuse.rgb, sourceDiffuse.a); 
} 
`,c=`    tile_featureColor = czm_gammaCorrect(tile_featureColor); 
    out_FragColor.a *= tile_featureColor.a; 
    float highlight = ceil(tile_colorBlend); 
    out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); 
`,d;if(s==="vec3"||s==="vec4"){let u=s==="vec3"?`vec4(${t}, 1.0)`:t,h=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,h),d=`    vec4 source = ${u}; 
    tile_diffuse = tile_diffuse_final(source, tile_featureColor); 
    tile_main(); 
`}else s==="sampler2D"&&(e=OPe(e,t),d=`    tile_diffuse = tile_featureColor; 
    tile_main(); 
`);return e=`uniform float tile_colorBlend; 
vec4 tile_diffuse = vec4(1.0); 
${a}${r}
${e}
void tile_color(vec4 tile_featureColor) 
{ 
${d}`,n&&(e+=c),e+=`} 
`,e}Uo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Cae(i,t,!0),Yt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; 
in vec2 tile_featureSt; 
in vec4 tile_featureColor; 
void main() 
{ 
    tile_color(tile_featureColor); 
`,n&&(i+=`    out_FragColor.rgb *= out_FragColor.a; 
`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; 
`),i+=`uniform sampler2D tile_pickTexture; 
uniform sampler2D tile_batchTexture; 
in vec2 tile_featureSt; 
void main() 
{ 
    vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); 
    if (featureProperties.a == 0.0) { 
        discard; 
    } 
`,e&&(i+=`    bool isStyleTranslucent = (featureProperties.a != 1.0); 
    if (czm_pass == czm_passTranslucent) 
    { 
        if (!isStyleTranslucent && !tile_translucentCommand) 
        { 
            discard; 
        } 
    } 
    else 
    { 
        if (isStyleTranslucent) 
        { 
            discard; 
        } 
    } 
`),i+=`    tile_color(featureProperties); 
`,n&&(i+=`    out_FragColor.rgb *= out_FragColor.a; 
`),i+=`} 
`),i}};function zPe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===ld.HIGHLIGHT)return 0;if(n===ld.REPLACE)return 1;if(n===ld.MIX)return V.clamp(i,V.EPSILON4,1)}Uo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Rt(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return zPe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Uo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var jb={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Uo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=HPe(this);for(let d=t;d<i;++d){let u=n[d];if(u.pass===Ve.COMPUTE)continue;let h=u.derivedCommands.tileset;(!l(h)||u.dirty)&&(h={},u.derivedCommands.tileset=h,h.originalCommand=KPe(u),u.dirty=!1);let p=h.originalCommand;c!==jb.ALL_OPAQUE&&u.pass!==Ve.TRANSLUCENT&&(l(h.translucent)||(h.translucent=JPe(p))),c!==jb.ALL_TRANSLUCENT&&u.pass!==Ve.TRANSLUCENT&&(l(h.opaque)||(h.opaque=jPe(p)),a&&(r||(l(h.zback)||(h.zback=$Pe(e.context,p)),s._backfaceCommands.push(h.zback)),(!l(h.stencil)||o._selectionDepth!==tMe(h.stencil))&&(u.renderState.depthMask?h.stencil=eMe(p,o._selectionDepth):h.stencil=h.opaque)));let g=a?h.stencil:h.opaque,f=h.translucent;u.pass!==Ve.TRANSLUCENT?(c===jb.ALL_OPAQUE&&(n[d]=g),c===jb.ALL_TRANSLUCENT&&(n[d]=f),c===jb.OPAQUE_AND_TRANSLUCENT&&(n[d]=g,n.push(f))):n[d]=p}};function HPe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?jb.ALL_OPAQUE:t===e.featuresLength?jb.ALL_TRANSLUCENT:jb.OPAQUE_AND_TRANSLUCENT}function KPe(e){let t=nt.shallowClone(e),n=t.pass===Ve.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function JPe(e){let t=nt.shallowClone(e);return t.pass=Ve.TRANSLUCENT,t.renderState=nMe(e.renderState),t}function jPe(e){let t=nt.shallowClone(e);return t.renderState=iMe(e.renderState),t}function qPe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function $Pe(e,t){let n=nt.shallowClone(t),i=Qe(n.renderState,!0);i.cull.enabled=!0,i.cull.face=wi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Qt.setCesium3DTileBit(),i.stencilMask=Qt.CESIUM_3D_TILE_MASK,n.renderState=ke.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Qe(t.uniformMap);let o=new M(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=qPe(e,t.shaderProgram),n}function eMe(e,t){let n=nt.shallowClone(e),i=Qe(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Qt.SKIP_LOD_MASK,i.stencilTest.reference=Qt.CESIUM_3D_TILE_MASK|t<<Qt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=$n.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Ct.REPLACE,i.stencilTest.backFunction=$n.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=Ct.REPLACE,i.stencilMask=Qt.CESIUM_3D_TILE_MASK|Qt.SKIP_LOD_MASK,n.renderState=ke.fromCache(i),n}function tMe(e){return(e.renderState.stencilTest.reference&Qt.SKIP_LOD_MASK)>>>Qt.SKIP_LOD_BIT_SHIFT}function nMe(e){let t=Qe(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=fn.ALPHA_BLEND,t.stencilTest=Qt.setCesium3DTileBit(),t.stencilMask=Qt.CESIUM_3D_TILE_MASK,ke.fromCache(t)}function iMe(e){let t=Qe(e,!0);return t.stencilTest=Qt.setCesium3DTileBit(),t.stencilMask=Qt.CESIUM_3D_TILE_MASK,ke.fromCache(t)}Uo.prototype.update=function(e,t){this._batchTexture.update(e,t)};Uo.prototype.isDestroyed=function(){return!1};Uo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),fe(this)};var Rh=Uo;var Yfn=y(x(),1);var _hn=y(x(),1);function oMe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var $f=oMe;var Sfn=y(x(),1);var Rhn=y(x(),1),xS=`in vec3 position;
in float a_batchId;

uniform mat4 u_modifiedModelViewProjection;

void main()
{
    gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;var Whn=y(x(),1);function sm(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(sm.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 l(this._color)||(this._color=new D),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});sm.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};sm.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};sm.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};sm.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let d=e.tileset.metadata;if(l(d)){if(d.hasPropertyBySemantic(n))return d.getPropertyBySemantic(n);if(d.hasProperty(n))return d.getProperty(n)}};sm.prototype.getPropertyInherited=function(e){return sm.getPropertyInherited(this._content,this._batchId,e)};sm.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};sm.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};sm.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};sm.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ea=sm;var Hhn=y(x(),1);var whn=y(x(),1),XH=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},PH=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},dd=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,d;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},d=n;let u=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=`
`;break;case"r":t+="\r";break;case"t":t+="	";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},rMe=new XH;Object.assign(dd,{hooks:rMe,plugins:new PH(dd),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});dd.max_unop_len=dd.getMaxKeyLen(dd.unary_ops);dd.max_binop_len=dd.getMaxKeyLen(dd.binary_ops);var qb=e=>new dd(e).parse(),sMe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(dd).filter(e=>!sMe.includes(e)&&qb[e]===void 0).forEach(e=>{qb[e]=dd[e]});qb.Jsep=dd;var aMe="ConditionalExpression",cMe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:aMe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};qb.plugins.register(cMe);var Nhn=y(x(),1),lMe={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},It=Object.freeze(lMe);function Gh(e,t){this._expression=e,e=EMe(e,t),e=SMe(TMe(e)),qb.addBinaryOp("=~",0),qb.addBinaryOp("!~",0);let n;try{n=qb(e)}catch(i){throw new he(i)}this._runtimeAst=Pi(this,n)}Object.defineProperties(Gh.prototype,{expression:{get:function(){return this._expression}}});var Un={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new M],cartesian3Array:[new m],cartesian4Array:[new ce],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new M),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ce),this.cartesian4Array[this.cartesian4Index++]}};Gh.prototype.evaluate=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return t instanceof D&&n instanceof ce?D.fromCartesian4(n,t):n instanceof M||n instanceof m||n instanceof ce?n.clone(t):n};Gh.prototype.evaluateColor=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return D.fromCartesian4(n,t)};Gh.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
{
    return ${o};
}
`,o};Gh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Gh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var dMe=["!","-","+"],Eae=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],eW=/\${(.*?)}/g,uMe=/\\/g,mMe="@#%",hMe=/@#%/g,Vv=new D,Lv={abs:Ta(Math.abs),sqrt:Ta(Math.sqrt),cos:Ta(Math.cos),sin:Ta(Math.sin),tan:Ta(Math.tan),acos:Ta(Math.acos),asin:Ta(Math.asin),atan:Ta(Math.atan),radians:Ta(V.toRadians),degrees:Ta(V.toDegrees),sign:Ta(V.sign),floor:Ta(Math.floor),ceil:Ta(Math.ceil),round:Ta(Math.round),exp:Ta(Math.exp),exp2:Ta(pMe),log:Ta(Math.log),log2:Ta(AMe),fract:Ta(fMe),length:gMe,normalize:bMe},Wv={atan2:Rv(Math.atan2,!1),pow:Rv(Math.pow,!1),min:Rv(Math.min,!0),max:Rv(Math.max,!0),distance:yMe,dot:xMe,cross:CMe},DH={clamp:Tae(V.clamp,!0),mix:Tae(V.lerp,!0)};function fMe(e){return e-Math.floor(e)}function pMe(e){return Math.pow(2,e)}function AMe(e){return V.log2(e)}function Ta(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof M)return M.fromElements(e(n.x),e(n.y),Un.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),Un.getCartesian3());if(n instanceof ce)return ce.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Un.getCartesian4());throw new he(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function Rv(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof M)return M.fromElements(e(i.x,o),e(i.y,o),Un.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Un.getCartesian3());if(i instanceof ce)return ce.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Un.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof M&&o instanceof M)return M.fromElements(e(i.x,o.x),e(i.y,o.y),Un.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Un.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Un.getCartesian4());throw new he(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Tae(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof M&&o instanceof M)return M.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Un.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Un.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Un.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof M&&o instanceof M&&r instanceof M)return M.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Un.getCartesian2());if(i instanceof m&&o instanceof m&&r instanceof m)return m.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Un.getCartesian3());if(i instanceof ce&&o instanceof ce&&r instanceof ce)return ce.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Un.getCartesian4());throw new he(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function gMe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof M)return M.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof ce)return ce.magnitude(t);throw new he(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function bMe(e,t){if(typeof t=="number")return 1;if(t instanceof M)return M.normalize(t,Un.getCartesian2());if(t instanceof m)return m.normalize(t,Un.getCartesian3());if(t instanceof ce)return ce.normalize(t,Un.getCartesian4());throw new he(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function yMe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof M&&n instanceof M)return M.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof ce&&n instanceof ce)return ce.distance(t,n);throw new he(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function xMe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof M&&n instanceof M)return M.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof ce&&n instanceof ce)return ce.dot(t,n);throw new he(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function CMe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Un.getCartesian3());throw new he(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Vt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,BMe(this)}function EMe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function TMe(e){return e.replace(uMe,mMe)}function UH(e){return e.replace(hMe,"\\")}function SMe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new he("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function IMe(e){let t=typeof e.value;if(e.value===null)return new Vt(It.LITERAL_NULL,null);if(t==="boolean")return new Vt(It.LITERAL_BOOLEAN,e.value);if(t==="number")return new Vt(It.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Vt(It.VARIABLE_IN_STRING,e.value):new Vt(It.LITERAL_STRING,UH(e.value))}function _Me(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new he(`${o} is not a function.`);return i===0?o==="test"?new Vt(It.LITERAL_BOOLEAN,!1):new Vt(It.LITERAL_NULL,null):(s=Pi(e,c),a=Pi(e,n[0]),new Vt(It.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Pi(e,c),new Vt(It.FUNCTION_CALL,o,r);throw new he(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Vt(It.LITERAL_COLOR,o);if(r=Pi(e,n[0]),l(n[1])){let c=Pi(e,n[1]);return new Vt(It.LITERAL_COLOR,o,[r,c])}return new Vt(It.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new he(`${o} requires three arguments.`);return r=[Pi(e,n[0]),Pi(e,n[1]),Pi(e,n[2])],new Vt(It.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new he(`${o} requires four arguments.`);return r=[Pi(e,n[0]),Pi(e,n[1]),Pi(e,n[2]),Pi(e,n[3])],new Vt(It.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Pi(e,n[c]);return new Vt(It.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Vt(It.LITERAL_BOOLEAN,!0):new Vt(It.LITERAL_BOOLEAN,!1):(r=Pi(e,n[0]),new Vt(It.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new he(`${o} requires exactly one argument.`);return r=Pi(e,n[0]),new Vt(It.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new he(`${o} does not take any argument.`);return new Vt(It.UNARY,o)}else if(l(Lv[o])){if(i!==1)throw new he(`${o} requires exactly one argument.`);return r=Pi(e,n[0]),new Vt(It.UNARY,o,r)}else if(l(Wv[o])){if(i!==2)throw new he(`${o} requires exactly two arguments.`);return s=Pi(e,n[0]),a=Pi(e,n[1]),new Vt(It.BINARY,o,s,a)}else if(l(DH[o])){if(i!==3)throw new he(`${o} requires exactly three arguments.`);s=Pi(e,n[0]),a=Pi(e,n[1]);let c=Pi(e,n[2]);return new Vt(It.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Vt(It.LITERAL_BOOLEAN,!1):(r=Pi(e,n[0]),new Vt(It.UNARY,o,r));if(o==="Number")return i===0?new Vt(It.LITERAL_NUMBER,0):(r=Pi(e,n[0]),new Vt(It.UNARY,o,r));if(o==="String")return i===0?new Vt(It.LITERAL_STRING,""):(r=Pi(e,n[0]),new Vt(It.UNARY,o,r));if(o==="regExp")return ZMe(e,t)}}throw new he(`Unexpected function call "${o}".`)}function ZMe(e,t){let n=t.arguments;if(n.length===0)return new Vt(It.LITERAL_REGEX,new RegExp);let i=Pi(e,n[0]),o;if(n.length>1){let r=Pi(e,n[1]);if(MH(i)&&MH(r)){try{o=new RegExp(UH(String(i._value)),r._value)}catch(s){throw new he(s)}return new Vt(It.LITERAL_REGEX,o)}return new Vt(It.REGEX,i,r)}if(MH(i)){try{o=new RegExp(UH(String(i._value)))}catch(r){throw new he(r)}return new Vt(It.LITERAL_REGEX,o)}return new Vt(It.REGEX,i)}function RMe(e){if(WMe(e.name)){let t=FMe(e.name);return t.substr(0,8)==="tiles3d_"?new Vt(It.BUILTIN_VARIABLE,t):new Vt(It.VARIABLE,t)}else{if(e.name==="NaN")return new Vt(It.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Vt(It.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Vt(It.LITERAL_UNDEFINED,void 0)}throw new he(`${e.name} is not defined.`)}function GMe(e){let t=e.property.name;if(t==="PI")return new Vt(It.LITERAL_NUMBER,Math.PI);if(t==="E")return new Vt(It.LITERAL_NUMBER,Math.E)}function VMe(e){if(e.property.name==="POSITIVE_INFINITY")return new Vt(It.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function LMe(e,t){if(t.object.name==="Math")return GMe(t);if(t.object.name==="Number")return VMe(t);let n,i=Pi(e,t.object);return t.computed?(n=Pi(e,t.property),new Vt(It.MEMBER,"brackets",i,n)):(n=new Vt(It.LITERAL_STRING,t.property.name),new Vt(It.MEMBER,"dot",i,n))}function MH(e){return e._type>=It.LITERAL_NULL}function WMe(e){return e.substr(0,4)==="czm_"}function FMe(e){return e.substr(4)}function Pi(e,t){let n,i,o,r;if(t.type==="Literal")n=IMe(t);else if(t.type==="CallExpression")n=_Me(e,t);else if(t.type==="Identifier")n=RMe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Pi(e,t.argument);if(dMe.indexOf(i)>-1)n=new Vt(It.UNARY,i,s);else throw new he(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Pi(e,t.left),r=Pi(e,t.right),Eae.indexOf(i)>-1)n=new Vt(It.BINARY,i,o,r);else throw new he(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Pi(e,t.left),r=Pi(e,t.right),Eae.indexOf(i)>-1&&(n=new Vt(It.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Pi(e,t.test);o=Pi(e,t.consequent),r=Pi(e,t.alternate),n=new Vt(It.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=LMe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Pi(e,t.elements[a]);n=new Vt(It.ARRAY,s)}else throw t.type==="Compound"?new he("Provide exactly one expression."):new he("Cannot parse expression.");return n}function BMe(e){e._type===It.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===It.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===It.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(Lv[e._value])&&(e.evaluate=YMe(e._value)):e._type===It.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:l(Wv[e._value])&&(e.evaluate=NMe(e._value)):e._type===It.TERNARY?e.evaluate=XMe(e._value):e._type===It.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===It.ARRAY?e.evaluate=e._evaluateArray:e._type===It.VARIABLE?e.evaluate=e._evaluateVariable:e._type===It.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===It.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===It.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===It.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===It.REGEX?e.evaluate=e._evaluateRegExp:e._type===It.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=wMe):e.evaluate=e._evaluateLiteral}function wMe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function YMe(e){let t=Lv[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function NMe(e){let t=Wv[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function XMe(e){let t=DH[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function Fv(e,t){if(l(e))return e.getPropertyInherited(t)}Vt.prototype._evaluateLiteral=function(){return this._value};Vt.prototype._evaluateLiteralColor=function(e){let t=Vv,n=this._left;if(this._value==="color")l(n)?n.length>1?(D.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):D.fromCssColorString(n[0].evaluate(e),t):D.fromBytes(255,255,255,255,t);else if(this._value==="rgb")D.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;D.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?D.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&D.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ce.fromColor(t,Un.getCartesian4())};Vt.prototype._evaluateLiteralVector=function(e){let t=Un.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof M)t.push(c.x,c.y);else if(c instanceof m)t.push(c.x,c.y,c.z);else if(c instanceof ce)t.push(c.x,c.y,c.z,c.w);else throw new he(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new he(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new he(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new he(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return M.fromArray(t,0,Un.getCartesian2());if(n==="vec3")return m.fromArray(t,0,Un.getCartesian3());if(n==="vec4")return ce.fromArray(t,0,Un.getCartesian4())};Vt.prototype._evaluateLiteralString=function(){return this._value};Vt.prototype._evaluateVariableString=function(e){let t=this._value,n=eW.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=Fv(e,o);l(r)||(r=""),t=t.replace(i,r),eW.lastIndex+=r.length-i.length,n=eW.exec(t)}return t};Vt.prototype._evaluateVariable=function(e){return Fv(e,this._value)};function qx(e){return e._value==="feature"}Vt.prototype._evaluateMemberDot=function(e){if(qx(this._left))return Fv(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof M||t instanceof m||t instanceof ce){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Vt.prototype._evaluateMemberBrackets=function(e){if(qx(this._left))return Fv(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof M||t instanceof m||t instanceof ce){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Vt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Vt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new he(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Vt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof M)return M.negate(t,Un.getCartesian2());if(t instanceof m)return m.negate(t,Un.getCartesian3());if(t instanceof ce)return ce.negate(t,Un.getCartesian4());if(typeof t=="number")return-t;throw new he(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Vt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof M||t instanceof m||t instanceof ce||typeof t=="number"))throw new he(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Vt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new he(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Vt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new he(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Vt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new he(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Vt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new he(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Vt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new he(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new he(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Vt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new he(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new he(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Vt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof M&&t instanceof M)return M.add(t,n,Un.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Un.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.add(t,n,Un.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new he(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof M&&t instanceof M)return M.subtract(t,n,Un.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Un.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.subtract(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new he(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof M&&t instanceof M)return M.multiplyComponents(t,n,Un.getCartesian2());if(n instanceof M&&typeof t=="number")return M.multiplyByScalar(n,t,Un.getCartesian2());if(t instanceof M&&typeof n=="number")return M.multiplyByScalar(t,n,Un.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,Un.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Un.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Un.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.multiplyComponents(t,n,Un.getCartesian4());if(n instanceof ce&&typeof t=="number")return ce.multiplyByScalar(n,t,Un.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.multiplyByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new he(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof M&&t instanceof M)return M.divideComponents(t,n,Un.getCartesian2());if(t instanceof M&&typeof n=="number")return M.divideByScalar(t,n,Un.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,Un.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Un.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.divideComponents(t,n,Un.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.divideByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new he(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof M&&t instanceof M)return M.fromElements(t.x%n.x,t.y%n.y,Un.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Un.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new he(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof M&&t instanceof M||n instanceof m&&t instanceof m||n instanceof ce&&t instanceof ce?t.equals(n):t===n};Vt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof M&&t instanceof M||n instanceof m&&t instanceof m||n instanceof ce&&t instanceof ce?!t.equals(n):t!==n};Vt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new he(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Vt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Vt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Vt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Vt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Vt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Vt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Vt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new he(o)}return i};Vt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new he(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Vt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new he(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new he(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new he(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Vt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof M||t instanceof m||t instanceof ce)return String(t);throw new he(`Unexpected function call "${this._value}".`)};function Sae(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==It.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return D.fromHsl(i,o,r,s,Vv)}function Iae(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==It.LITERAL_NUMBER)return;let i=Vv;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function $b(e){return e%1===0?e.toFixed(1):e.toString()}function PMe(e){let t=$b(e.red),n=$b(e.green),i=$b(e.blue);return`vec3(${t}, ${n}, ${i})`}function Gv(e){let t=$b(e.red),n=$b(e.green),i=$b(e.blue),o=$b(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function _ae(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function Zae(e,t){return l(t[e])?t[e]:Gh.NULL_SENTINEL}Gh.NULL_SENTINEL="czm_infinity";Vt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=_ae(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=_ae(this._value,e,t,this));let d,u,h;switch(a){case It.VARIABLE:return qx(this)?void 0:Zae(c,e);case It.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(Lv[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new he(`Error generating style shader: "${c}" is not supported.`);return c+o;case It.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(Wv[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case It.TERNARY:if(l(DH[c]))return`${c}(${o}, ${r}, ${s})`;break;case It.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case It.MEMBER:return qx(this._left)?Zae(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case It.FUNCTION_CALL:throw new he(`Error generating style shader: "${c}" is not supported.`);case It.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new he("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case It.REGEX:throw new he("Error generating style shader: Regular expressions are not supported.");case It.VARIABLE_IN_STRING:throw new he("Error generating style shader: Converting a variable to a string is not supported.");case It.LITERAL_NULL:return Gh.NULL_SENTINEL;case It.LITERAL_BOOLEAN:return c?"true":"false";case It.LITERAL_NUMBER:return $b(c);case It.LITERAL_STRING:if(l(n)&&n._type===It.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||qx(n._left)))return c;if(i=D.fromCssColorString(c,Vv),l(i))return PMe(i);throw new he("Error generating style shader: String literals are not supported.");case It.LITERAL_COLOR:if(d=o,c==="color"){if(l(d)){if(d.length>1){let p=d[0],g=d[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=Iae(this),l(i)?Gv(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(c==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=Iae(this),l(i)?Gv(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=Sae(this),l(i)?Gv(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=Sae(this),l(i)?(i.alpha!==1&&(t.translucent=!0),Gv(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case It.LITERAL_VECTOR:u=o.length,h=`${c}(`;for(let p=0;p<u;++p)h+=o[p],p<u-1&&(h+=", ");return h+=")",h;case It.LITERAL_REGEX:throw new he("Error generating style shader: Regular expressions are not supported.");case It.LITERAL_UNDEFINED:return Gh.NULL_SENTINEL;case It.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Vt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case It.VARIABLE:qx(this)||e.push(s);break;case It.VARIABLE_IN_STRING:for(a=eW.exec(s);a!==null;)e.push(a[1]),a=eW.exec(s);break;case It.LITERAL_STRING:l(t)&&t._type===It.MEMBER&&qx(t._left)&&e.push(s);break}};var am=Gh;function PA(e){e=e??Q.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=e.center??m.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=D.clone(D.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=e.classificationType??qn.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={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(PA.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var MMe={position:0,a_batchId:1};function UMe(e,t){if(l(e._va))return;let n=mt.createVertexBuffer({context:t,typedArray:e._positions,usage:Xe.STATIC_DRAW}),i=mt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Xe.STATIC_DRAW}),o=mt.createIndexBuffer({context:t,typedArray:e._indices,usage:Xe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Pe.UNSIGNED_SHORT:Pe.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:J.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:J.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new si({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new si({context:t,attributes:r,indexBuffer:mt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Xe.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function DMe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??MMe,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=cn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=ze.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() 
{ 
    czm_non_pick_main(); 
    out_FragColor = ${o}; 
} 
`,e._spPick=cn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(xS),c=n.getFragmentShaderCallback(!1,void 0,!0)(Qb);o=n.getPickId();let d=new ze({sources:[a]}),u=new ze({defines:["VECTOR_TILE"],sources:[c]});e._sp=cn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),d=new ze({sources:[xS]}),u=new ze({defines:["VECTOR_TILE"],sources:[Qb]}),e._spStencil=cn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),c=ze.replaceMain(c,"czm_non_pick_main"),c=`${c}
void main() 
{ 
    czm_non_pick_main(); 
    out_FragColor = ${o}; 
} 
`;let h=new ze({sources:[a]}),p=new ze({defines:["VECTOR_TILE"],sources:[c]});e._spPick=cn.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function Rae(e){let t=e?$n.EQUAL:$n.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Ct.KEEP,zFail:Ct.DECREMENT_WRAP,zPass:Ct.KEEP},backFunction:t,backOperation:{fail:Ct.KEEP,zFail:Ct.INCREMENT_WRAP,zPass:Ct.KEEP},reference:Qt.CESIUM_3D_TILE_MASK,mask:Qt.CESIUM_3D_TILE_MASK},stencilMask:Qt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL},depthMask:!1}}var vMe={stencilTest:{enabled:!0,frontFunction:$n.NOT_EQUAL,frontOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},backFunction:$n.NOT_EQUAL,backOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},reference:0,mask:Qt.CLASSIFICATION_MASK},stencilMask:Qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND},kMe={stencilTest:{enabled:!0,frontFunction:$n.NOT_EQUAL,frontOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},backFunction:$n.NOT_EQUAL,backOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},reference:0,mask:Qt.CLASSIFICATION_MASK},stencilMask:Qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function QMe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ke.fromCache(Rae(!1)),e._rsStencilDepthPass3DTiles=ke.fromCache(Rae(!0)),e._rsColorPass=ke.fromCache(vMe),e._rsPickPass=ke.fromCache(kMe))}var $x=new F,Gae=new m;function OMe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,$x),F.multiplyByPoint($x,e._center,Gae),F.setTranslation($x,Gae,$x),F.multiply(o,$x,$x),$x},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function vH(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let d=0;d<c;++d){let u=r[d],h=s[u],p=i[h],g=o[h],f=new e.constructor(e.buffer,a*p,g);t.set(f,n),i[h]=n,n+=g}return n}function zMe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],d=vH(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=d;t.length>0;){let u=t.pop();if(D.equals(u.color,a.color))d=vH(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let h=d;d=vH(n,s,d,i,o,u.batchIds,r),u.offset=h,u.count=d-h,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function kH(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d<c;++d){let u=r[d],h=s[u],p=i[h],g=o[h];t.copyFromBuffer(e,p*a,n*a,g*a),i[h]=n,n+=g}return n}function HMe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,d=kH(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=d;t.length>0;){let h=t.pop();if(D.equals(h.color,r.color))d=kH(a,c,d,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=d-r.offset;else{let p=d;d=kH(a,c,d,n,i,h.batchIds,o),h.offset=p,h.count=d-p,s.push(h),r=h}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function KMe(e,t){return t.color.toRgba()-e.color.toRgba()}function JMe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(KMe),t.webgl2?HMe(e,n):zMe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function jMe(e,t){let n=JMe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,d=e._modelMatrix??F.IDENTITY,u=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,f=o[p].count,b=i[p*2];l(b)||(b=i[p*2]=new nt({owner:e})),b.vertexArray=a,b.modelMatrix=d,b.offset=g,b.count=f,b.renderState=e._rsStencilDepthPass,b.shaderProgram=c,b.uniformMap=u,b.boundingVolume=h,b.cull=!1,b.pass=Ve.TERRAIN_CLASSIFICATION;let C=nt.shallowClone(b,b.derivedCommands.tileset);C.renderState=e._rsStencilDepthPass3DTiles,C.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=C;let E=i[p*2+1];l(E)||(E=i[p*2+1]=new nt({owner:e})),E.vertexArray=a,E.modelMatrix=d,E.offset=g,E.count=f,E.renderState=e._rsColorPass,E.shaderProgram=c,E.uniformMap=u,E.boundingVolume=h,E.cull=!1,E.pass=Ve.TERRAIN_CLASSIFICATION;let T=nt.shallowClone(E,E.derivedCommands.tileset);T.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,E.derivedCommands.tileset=T}e._commandsDirty=!0}function qMe(e,t){if(e.classificationType===qn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let d=i[c]=nt.shallowClone(n[a],i[c]);d.shaderProgram=o,d.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function $Me(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=e._modelMatrix??F.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let d=e._indexOffsets[c],u=e._indexCounts[c],h=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new nt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=d,p.count=u,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=h,p.pass=Ve.TERRAIN_CLASSIFICATION;let g=nt.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let f=n[c*2+1];l(f)||(f=n[c*2+1]=new nt({owner:e,pickOnly:!0})),f.vertexArray=i,f.modelMatrix=s,f.offset=d,f.count=u,f.renderState=e._rsPickPass,f.shaderProgram=r,f.uniformMap=a,f.boundingVolume=h,f.pass=Ve.TERRAIN_CLASSIFICATION;let b=nt.shallowClone(f,f.derivedCommands.tileset);b.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=b}e._pickCommandsDirty=!1}PA.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ea(e,r)}};PA.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function eUe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=D.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=D.clone(D.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var tUe=new D,nUe=D.WHITE,iUe=!0,oUe=/\$/;PA.prototype.applyStyle=function(e,t){if(!l(e)){eUe(this,t);return}let n=e.color,i=n instanceof am&&!oUe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,tUe):nUe,c.show=l(e.show)?e.show.evaluate(c):iUe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=D.clone(D.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};PA.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,d=c.length,u;for(u=0;u<d;++u){let b=c[u].offset,C=c[u].count;if(s>=b&&s<b+C)break}c.push(new $f({color:D.clone(t),offset:s,count:a,batchIds:[e]}));let h=[],p=[],g=c[u].batchIds,f=g.length;for(let b=0;b<f;++b){let C=g[b];if(C===e)continue;let E=n[C];o[E]<s?h.push(C):p.push(C)}p.length!==0&&c.push(new $f({color:D.clone(c[u].color),offset:s+a,count:c[u].offset+c[u].count-(s+a),batchIds:p})),h.length!==0?(c[u].count=s-c[u].offset,c[u].batchIds=h):c.splice(u,1),this._batchDirty=!0};function Vae(e,t,n,i){let o=e.classificationType,r=o!==qn.CESIUM_3D_TILE,s=o!==qn.TERRAIN,a=t.commandList,c=n.length,d,u;for(u=0;u<c;++u)r&&(d=n[u],d.pass=Ve.TERRAIN_CLASSIFICATION,a.push(d)),s&&(d=n[u].derivedCommands.tileset,d.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,a.push(d));if(!(!t.invertClassification||!l(i)))for(c=i.length,u=0;u<c;++u)a.push(i[u])}function rUe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Ve.OPAQUE,n.push(r)}}function sUe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=ke.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Be.LINES):(n=e._rsColorPass,i=Be.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}PA.prototype.update=function(e){let t=e.context;UMe(this,t),DMe(this,t),QMe(this),OMe(this,t);let n=e.passes;n.render&&(jMe(this,t),qMe(this,e),sUe(this),this._debugWireframe?rUe(e,this._commands):Vae(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&($Me(this),Vae(this,e,this._pickCommands))};PA.prototype.isDestroyed=function(){return!1};PA.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(),fe(this)};var eC=PA;function jd(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,l(this._center)||(l(this._boundingVolume)?this._center=m.clone(this._boundingVolume.center):this._center=m.clone(m.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._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=qn.BOTH}Object.defineProperties(jd.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});jd.packedBoxLength=F.packedLength+m.packedLength;jd.packedCylinderLength=F.packedLength+2;jd.packedEllipsoidLength=F.packedLength+m.packedLength;jd.packedSphereLength=m.packedLength+1;function aUe(e){let t=new Float64Array(F.packedLength+m.packedLength),n=0;return m.pack(e._center,t,n),n+=m.packedLength,F.pack(e._modelMatrix,t,n),t}function cUe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=ue.unpack(t,n),n+=ue.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let d=D.unpack(t,n);n+=D.packedLength;let u=t[n++],h=t[n++],p=t[n++],g=new Array(p);for(let f=0;f<p;++f)g[f]=t[n++];a[c]=new $f({color:d,offset:u,count:h,batchIds:g})}return i}var lUe=new Jn("createVectorTileGeometries",5),dUe=new D;function uUe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,d=e._batchTableColors,u=e._packedBuffer;if(!l(d)){let f=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),f+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),f+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),f+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),f+=c.length),d=e._batchTableColors=new Uint32Array(f);let b=e._batchTable;for(let C=0;C<f;++C){let E=b.getColor(C,dUe);d[C]=E.toRgba()}u=e._packedBuffer=aUe(e)}let h=[];l(t)&&h.push(t.buffer,n.buffer),l(i)&&h.push(i.buffer,o.buffer),l(r)&&h.push(r.buffer,s.buffer),l(a)&&h.push(a.buffer,c.buffer),h.push(d.buffer,u.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:d.buffer,packedBuffer:u.buffer},g=e._verticesPromise=lUe.scheduleTask(p,h);return l(g)?g.then(function(f){if(e.isDestroyed())return;let b=new Float64Array(f.packedBuffer);cUe(e,b)===2?e._indices=new Uint16Array(f.indices):e._indices=new Uint32Array(f.indices),e._indexOffsets=new Uint32Array(f.indexOffsets),e._indexCounts=new Uint32Array(f.indexCounts),e._positions=new Float32Array(f.positions),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds),e._batchIds=new Uint16Array(f.batchIds),mUe(e),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)}):void 0}}function mUe(e){l(e._primitive)||(e._primitive=new eC({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: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)}jd.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};jd.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};jd.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};jd.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};jd.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=uUe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};jd.prototype.isDestroyed=function(){return!1};jd.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var MA=jd;function ep(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,pUe(this,i,o)}Object.defineProperties(ep.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function hUe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function fUe(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,d=e.ELLIPSOIDS_LENGTH??0,u=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(d>0&&l(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,d)}if(u>0&&l(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let h=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||d>0&&!l(o)||u>0&&!l(r);if(h&&p)throw new he("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let f=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=f++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=f++;if(!l(o)&&d>0)for(o=new Uint16Array(d),s=0;s<d;++s)o[s]=f++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=f++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var tC=Uint32Array.BYTES_PER_ELEMENT;function pUe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=tC;let r=o.getUint32(n,!0);if(r!==1)throw new he(`Only Geometry tile version 1 is supported.  Version ${r} is not.`);n+=tC;let s=o.getUint32(n,!0);if(n+=tC,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=tC,a===0)throw new he("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=tC;let d=o.getUint32(n,!0);n+=tC;let u=o.getUint32(n,!0);n+=tC;let h=Cr(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,f;d>0&&(g=Cr(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let b=h.BOXES_LENGTH??0,C=h.CYLINDERS_LENGTH??0,E=h.ELLIPSOIDS_LENGTH??0,T=h.SPHERES_LENGTH??0,S=b+C+E+T,_=new Rh(e,S,g,f,hUe(e));if(e._batchTable=_,S===0)return;let R=e.tile.computedTransform,L;l(h.RTC_CENTER)&&(L=m.unpack(h.RTC_CENTER),F.multiplyByPoint(R,L,L));let W=fUe(h,p);if(b>0||C>0||E>0||T>0){let B,Y,N,A;if(b>0){let I=p.byteOffset+h.BOXES.byteOffset;B=new Float32Array(p.buffer,I,MA.packedBoxLength*b)}if(C>0){let I=p.byteOffset+h.CYLINDERS.byteOffset;Y=new Float32Array(p.buffer,I,MA.packedCylinderLength*C)}if(E>0){let I=p.byteOffset+h.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,I,MA.packedEllipsoidLength*E)}if(T>0){let I=p.byteOffset+h.SPHERES.byteOffset;A=new Float32Array(p.buffer,I,MA.packedSphereLength*T)}return e._geometries=new MA({boxes:B,boxBatchIds:W.boxes,cylinders:Y,cylinderBatchIds:W.cylinders,ellipsoids:N,ellipsoidBatchIds:W.ellipsoids,spheres:A,sphereBatchIds:W.spheres,center:L,modelMatrix:R,batchTable:_,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Lae(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}ep.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};ep.prototype.getFeature=function(e){return Lae(this),this._features[e]};ep.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};ep.prototype.applyStyle=function(e){Lae(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};ep.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};ep.prototype.pick=function(e,t,n){};ep.prototype.isDestroyed=function(){return!1};ep.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),fe(this)};var tW=ep;var wEn=y(x(),1);var Hfn=y(x(),1);var QH={};QH.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),Wae(i,o,r,s);return c};QH.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),Wae(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function Wae(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var CS=QH;var tpn=y(x(),1);var nC=30,AUe=1<<nC,gUe=1<<nC+1>>>0,OH=2*nC+1,e0=4,wae=[],Yae=[],bUe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],t0=1,ES=2,Bv=[t0,0,0,t0|ES];function _s(e){if(!rn.supportsBigInt())throw new he("S2 required BigInt support");this._cellId=e,this._level=_s.getLevel(e)}_s.fromToken=function(e){return new _s(_s.getIdFromToken(e))};_s.isValidId=function(e){return!(e<=0||e>>BigInt(OH)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};_s.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?_s.isValidId(_s.getIdFromToken(e)):!1};_s.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};_s.getTokenFromId=function(e){let t=Math.floor(RUe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};_s.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return nC-(t>>1)};_s.prototype.getChild=function(e){let t=Pae(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new _s(n)};_s.prototype.getParent=function(){let e=Pae(this._cellId)<<BigInt(2);return new _s(this._cellId&~e+BigInt(1)|e)};_s.prototype.getParentAtLevel=function(e){let t=_Ue(e);return new _s(this._cellId&-t|t)};_s.prototype.getCenter=function(e){e=e??ie.WGS84;let t=yUe(this._cellId,this._level);t=m.normalize(t,t);let n=new pe.fromCartesian(t,ie.UNIT_SPHERE);return pe.toCartesian(n,e,new m)};_s.prototype.getVertex=function(e,t){t=t??ie.WGS84;let n=xUe(this._cellId,this._level,e);n=m.normalize(n,n);let i=new pe.fromCartesian(n,ie.UNIT_SPHERE);return pe.toCartesian(i,t,new m)};_s.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(OH-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new _s(a)};function yUe(e,t){let n=CUe(e,t);return EUe(n[0],n[1],n[2])}function xUe(e,t,n){let i=Nae(e,t),o=TUe([i[1],i[2]],t),r=n>>1&1;return Xae(i[0],o[0][r^n&1],o[1][r])}function CUe(e,t){let n=Nae(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,d=(o<<1)+c,u=(r<<1)+c;return[i,d,u]}function Nae(e){wae.length===0&&IUe();let t=Number(e>>BigInt(OH)),n=t&t0,i=(1<<e0)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?nC-7*e0:e0))-1;n+=Number(e>>BigInt(s*2*e0+1)&BigInt(c))<<2,n=Yae[n];let d=s*e0;o+=n>>e0+2<<d,r+=(n>>2&i)<<d,n&=t0|ES}return[t,o,r]}function EUe(e,t,n){let i=Fae(t),o=Fae(n),r=wv(i),s=wv(o);return Xae(e,r,s)}function Xae(e,t,n){switch(e){case 0:return new m(1,t,n);case 1:return new m(-t,1,n);case 2:return new m(-t,-n,1);case 3:return new m(-1,-n,-t);case 4:return new m(n,-1,-t);default:return new m(n,t,-1)}}function wv(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Fae(e){return 1/gUe*e}function TUe(e,t){let n=[[],[]],i=SUe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=wv(Bae(r)),n[o][1]=wv(Bae(s))}return n}function SUe(e){return 1<<nC-e>>>0}function Bae(e){return 1/AUe*e}function n0(e,t,n,i,o,r){if(e===e0){let s=(t<<e0)+n;wae[(s<<2)+i]=(o<<2)+r,Yae[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=bUe[r];n0(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^Bv[0]),n0(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^Bv[1]),n0(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^Bv[2]),n0(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^Bv[3])}}function IUe(){n0(0,0,0,0,0,0),n0(0,0,0,t0,0,t0),n0(0,0,0,ES,0,ES),n0(0,0,0,t0|ES,0,t0|ES)}function Pae(e){return e&~e+BigInt(1)}function _Ue(e){return BigInt(1)<<BigInt(2*(nC-e))}var ZUe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function RUe(e){return ZUe[(-e&e)%BigInt(67)]}var UA=_s;var fEn=y(x(),1);var opn=y(x(),1);function GUe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var Ti=GUe;var cpn=y(x(),1);function zH(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new he(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!l(n)&&s&&(n=VUe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function VUe(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(zH.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});zH.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var TS=zH;var upn=y(x(),1);function DA(e){e=e??Q.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(DA.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});DA.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};DA.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};DA.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};DA.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};DA.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};DA.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};DA.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var SS=DA;var hpn=y(x(),1);var Yv={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};Yv.getBranchingFactor=function(e){switch(e){case Yv.OCTREE:return 8;case Yv.QUADTREE:return 4}};var Zs=Object.freeze(Yv);var Tpn=y(x(),1);var bpn=y(x(),1);function Oa(){}Object.defineProperties(Oa.prototype,{class:{get:function(){Ae.throwInstantiationError()}}});Oa.prototype.hasProperty=function(e){Ae.throwInstantiationError()};Oa.prototype.hasPropertyBySemantic=function(e){Ae.throwInstantiationError()};Oa.prototype.getPropertyIds=function(e){Ae.throwInstantiationError()};Oa.prototype.getProperty=function(e){Ae.throwInstantiationError()};Oa.prototype.setProperty=function(e,t){Ae.throwInstantiationError()};Oa.prototype.getPropertyBySemantic=function(e){Ae.throwInstantiationError()};Oa.prototype.setPropertyBySemantic=function(e,t){Ae.throwInstantiationError()};Oa.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};Oa.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};Oa.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};Oa.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Qe(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};Oa.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};Oa.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return Oa.getProperty(o.id,t,n)};Oa.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?Oa.setProperty(r.id,t,n,i):!1};var zn=Oa;function vA(e){e=e??Q.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(vA.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});vA.prototype.hasProperty=function(e){return zn.hasProperty(e,this._properties,this._class)};vA.prototype.hasPropertyBySemantic=function(e){return zn.hasPropertyBySemantic(e,this._properties,this._class)};vA.prototype.getPropertyIds=function(e){return zn.getPropertyIds(this._properties,this._class,e)};vA.prototype.getProperty=function(e){return zn.getProperty(e,this._properties,this._class)};vA.prototype.setProperty=function(e,t){return zn.setProperty(e,t,this._properties,this._class)};vA.prototype.getPropertyBySemantic=function(e){return zn.getPropertyBySemantic(e,this._properties,this._class)};vA.prototype.setPropertyBySemantic=function(e,t){return zn.setPropertyBySemantic(e,t,this._properties,this._class)};var nW=vA;var pAn=y(x(),1);var cAn=y(x(),1);var Rpn=y(x(),1);var Dt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Dt.getMinimum=function(e){switch(e){case Dt.INT8:return-128;case Dt.UINT8:return 0;case Dt.INT16:return-32768;case Dt.UINT16:return 0;case Dt.INT32:return-2147483648;case Dt.UINT32:return 0;case Dt.INT64:return rn.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Dt.UINT64:return rn.supportsBigInt()?BigInt(0):0;case Dt.FLOAT32:return-34028234663852886e22;case Dt.FLOAT64:return-Number.MAX_VALUE}};Dt.getMaximum=function(e){switch(e){case Dt.INT8:return 127;case Dt.UINT8:return 255;case Dt.INT16:return 32767;case Dt.UINT16:return 65535;case Dt.INT32:return 2147483647;case Dt.UINT32:return 4294967295;case Dt.INT64:return rn.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Dt.UINT64:return rn.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Dt.FLOAT32:return 34028234663852886e22;case Dt.FLOAT64:return Number.MAX_VALUE}};Dt.isIntegerType=function(e){switch(e){case Dt.INT8:case Dt.UINT8:case Dt.INT16:case Dt.UINT16:case Dt.INT32:case Dt.UINT32:case Dt.INT64:case Dt.UINT64:return!0;default:return!1}};Dt.isUnsignedIntegerType=function(e){switch(e){case Dt.UINT8:case Dt.UINT16:case Dt.UINT32:case Dt.UINT64:return!0;default:return!1}};Dt.isVectorCompatible=function(e){switch(e){case Dt.INT8:case Dt.UINT8:case Dt.INT16:case Dt.UINT16:case Dt.INT32:case Dt.UINT32:case Dt.FLOAT32:case Dt.FLOAT64:return!0;default:return!1}};Dt.normalize=function(e,t){return Math.max(Number(e)/Number(Dt.getMaximum(t)),-1)};Dt.unnormalize=function(e,t){let n=Dt.getMaximum(t),i=Dt.isUnsignedIntegerType(t)?0:-n;return e=V.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Dt.INT64||t===Dt.UINT64)&&rn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Dt.applyValueTransform=function(e,t,n){return n*e+t};Dt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Dt.getSizeInBytes=function(e){switch(e){case Dt.INT8:case Dt.UINT8:return 1;case Dt.INT16:case Dt.UINT16:return 2;case Dt.INT32:case Dt.UINT32:return 4;case Dt.INT64:case Dt.UINT64:return 8;case Dt.FLOAT32:return 4;case Dt.FLOAT64:return 8}};Dt.fromComponentDatatype=function(e){switch(e){case J.BYTE:return Dt.INT8;case J.UNSIGNED_BYTE:return Dt.UINT8;case J.SHORT:return Dt.INT16;case J.UNSIGNED_SHORT:return Dt.UINT16;case J.INT:return Dt.INT32;case J.UNSIGNED_INT:return Dt.UINT32;case J.FLOAT:return Dt.FLOAT32;case J.DOUBLE:return Dt.FLOAT64}};Dt.toComponentDatatype=function(e){switch(e){case Dt.INT8:return J.BYTE;case Dt.UINT8:return J.UNSIGNED_BYTE;case Dt.INT16:return J.SHORT;case Dt.UINT16:return J.UNSIGNED_SHORT;case Dt.INT32:return J.INT;case Dt.UINT32:return J.UNSIGNED_INT;case Dt.FLOAT32:return J.FLOAT;case Dt.FLOAT64:return J.DOUBLE}};var jt=Object.freeze(Dt);var Kpn=y(x(),1);var Ypn=y(x(),1);var sr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};sr.isVectorType=function(e){switch(e){case sr.VEC2:case sr.VEC3:case sr.VEC4:return!0;default:return!1}};sr.isMatrixType=function(e){switch(e){case sr.MAT2:case sr.MAT3:case sr.MAT4:return!0;default:return!1}};sr.getComponentCount=function(e){switch(e){case sr.SCALAR:case sr.STRING:case sr.ENUM:case sr.BOOLEAN:return 1;case sr.VEC2:return 2;case sr.VEC3:return 3;case sr.VEC4:return 4;case sr.MAT2:return 4;case sr.MAT3:return 9;case sr.MAT4:return 16}};sr.getMathType=function(e){switch(e){case sr.VEC2:return M;case sr.VEC3:return m;case sr.VEC4:return ce;case sr.MAT2:return ki;case sr.MAT3:return $;case sr.MAT4:return F;default:return}};var Et=Object.freeze(sr);function bc(e){e=e??Q.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&jt.isIntegerType(i)&&(e.normalized??!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Qe(e.min,!0),this._max=Qe(e.max,!0),this._normalized=r;let s=Qe(e.offset,!0),a=Qe(e.scale,!0),c=l(s)||l(a),d=!0;l(s)||(s=this.expandConstant(0,d)),l(a)||(a=this.expandConstant(1,d)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Qe(e.noData,!0),this._default=Qe(e.default,!0),this._required=e.required??!0,this._extras=Qe(e.extras,!0),this._extensions=Qe(e.extensions,!0)}bc.fromJson=function(e){e=e??Q.EMPTY_OBJECT;let t=e.id,n=e.property,i=LUe(n),o=WUe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new bc({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(bc.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function LUe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===Et.SCALAR||Et.isMatrixType(t)||Et.isVectorType(t))return!1;if(l(jt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function WUe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===Et.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===Et.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===Et.SCALAR||Et.isMatrixType(n)||Et.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===Et.BOOLEAN||n===Et.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===Et.BOOLEAN||i===Et.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(jt[i]))return{type:Et.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(jt[n]))return{type:Et.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}bc.prototype.normalize=function(e){return this._normalized?HH(e,this._valueType,jt.normalize):e};bc.prototype.unnormalize=function(e){return this._normalized?HH(e,this._valueType,jt.unnormalize):e};bc.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:bc.valueTransformInPlace(e,this._offset,this._scale,jt.applyValueTransform)};bc.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:bc.valueTransformInPlace(e,this._offset,this._scale,jt.unapplyValueTransform)};bc.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=Et.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};bc.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!vae(e,t))return e};function vae(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!vae(e[n],t[n]))return!1;return!0}bc.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=Et.getMathType(this._type),i=this._isArray,o=Et.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};bc.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=Et.getMathType(this._type),i=this._isArray,o=Et.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};bc.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?FUe(this,e):kae(this,e)};function FUe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=kae(e,t[i]);if(l(o))return o}}function kae(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return Et.isVectorType(n)?BUe(t,n,i):Et.isMatrixType(n)?wUe(t,n,i):n===Et.STRING?YUe(t):n===Et.BOOLEAN?NUe(t):n===Et.ENUM?XUe(t,o):PUe(t,i,r)}function BUe(e,t,n){if(!jt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===Et.VEC2&&!(e instanceof M))return`vector value ${e} must be a Cartesian2`;if(t===Et.VEC3&&!(e instanceof m))return`vector value ${e} must be a Cartesian3`;if(t===Et.VEC4&&!(e instanceof ce))return`vector value ${e} must be a Cartesian4`}function wUe(e,t,n){if(!jt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===Et.MAT2&&!(e instanceof ki))return`matrix value ${e} must be a Matrix2`;if(t===Et.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===Et.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function YUe(e){if(typeof e!="string")return Nv(e,Et.STRING)}function NUe(e){if(typeof e!="boolean")return Nv(e,Et.BOOLEAN)}function XUe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function PUe(e,t,n){let i=typeof e;switch(t){case jt.INT8:case jt.UINT8:case jt.INT16:case jt.UINT16:case jt.INT32:case jt.UINT32:case jt.FLOAT32:case jt.FLOAT64:return i!=="number"?Nv(e,t):isFinite(e)?Uae(e,t,n):Dae(e,t);case jt.INT64:case jt.UINT64:return i!=="number"&&i!=="bigint"?Nv(e,t):i==="number"&&!isFinite(e)?Dae(e,t):Uae(e,t,n)}}function Nv(e,t){return`value ${e} does not match type ${t}`}function Mae(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Uae(e,t,n){if(n){let i=jt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Mae(e,t,n):void 0}if(e<jt.getMinimum(t)||e>jt.getMaximum(t))return Mae(e,t,n)}function Dae(e,t){return`value ${e} of type ${t} must be finite`}function HH(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=HH(e[i],t,n);return e}bc.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=bc.valueTransformInPlace(e[o],t[o],n[o],i);return e};var tp=bc;function iW(e){e=e??Q.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,d=i.enumType,u=r===Et.STRING,h=r===Et.BOOLEAN,p=0,g;if(a){let A=n.arrayOffsetType??n.offsetType;A=jt[A]??jt.UINT32;let I=n.arrayOffsets??n.arrayOffsetBufferView;g=new KH(o[I],A,t+1),p+=g.typedArray.byteLength}let f=Et.getComponentCount(r),b;a?b=g.get(t)-g.get(0):s?b=t*i.arrayLength:b=t;let C=f*b,E;if(u){let A=n.stringOffsetType??n.offsetType;A=jt[A]??jt.UINT32;let I=n.stringOffsets??n.stringOffsetBufferView;E=new KH(o[I],A,C+1),p+=E.typedArray.byteLength}(u||h)&&(c=jt.UINT8);let T;u?T=E.get(C)-E.get(0):h?T=Math.ceil(C/8):T=C;let S=n.values??n.bufferView,_=new KH(o[S],c,T);p+=_.typedArray.byteLength;let R=n.offset,L=n.scale,W=i.hasValueTransform||l(R)||l(L);R=R??i.offset,L=L??i.scale,R=Qae(R),L=Qae(L);let B,Y,N=this;u?B=function(A){return DUe(A,N._values,N._stringOffsets)}:h?(B=function(A){return vUe(A,N._values)},Y=function(A,I){kUe(A,N._values,I)}):l(d)?(B=function(A){let I=N._values.get(A);return d.namesByValue[I]},Y=function(A,I){let Z=d.valuesByName[I];N._values.set(A,Z)}):(B=function(A){return N._values.get(A)},Y=function(A,I){N._values.set(A,I)}),this._arrayOffsets=g,this._stringOffsets=E,this._values=_,this._classProperty=i,this._count=t,this._vectorComponentCount=f,this._min=n.min,this._max=n.max,this._offset=R,this._scale=L,this._hasValueTransform=W,this._getValue=B,this._setValue=Y,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(iW.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});iW.prototype.get=function(e){let t=MUe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=qUe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};iW.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=$Ue(this,t),t=n.unnormalize(t),UUe(this,e,t)};iW.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Qae(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?ni(t,i):t.push(i)}return t}function MUe(e,t){zae(e)&&Hae(e);let n=e._classProperty,i=n.isArray,o=n.type,r=Et.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Qe(s,!0):s}return!i&&r===1?e._getValue(t):Oae(e,n,t)}function Oae(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=Et.getComponentCount(t.type);i*=s,o*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function UUe(e,t,n){JUe(e,t,n)&&Hae(e);let i=e._classProperty,o=i.isArray,r=i.type,s=Et.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Qe(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let u=(i.arrayLength??1)*e._vectorComponentCount;a=t*u,c=u}for(let d=0;d<c;++d)e._setValue(a+d,n[d])}function DUe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return cd(t.typedArray,i,o)}function vUe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function kUe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function QUe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function OUe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function zUe(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function HUe(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function KUe(e){switch(e){case jt.INT8:return J.BYTE;case jt.UINT8:return J.UNSIGNED_BYTE;case jt.INT16:return J.SHORT;case jt.UINT16:return J.UNSIGNED_SHORT;case jt.INT32:return J.INT;case jt.UINT32:return J.UNSIGNED_INT;case jt.FLOAT32:return J.FLOAT;case jt.FLOAT64:return J.DOUBLE}}function zae(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===Et.STRING||i===jt.INT64&&!rn.supportsBigInt64Array()||i===jt.UINT64&&!rn.supportsBigUint64Array()}function JUe(e,t,n){if(zae(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function Hae(e){e._unpackedValues=jUe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function jUe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=Et.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=Oae(e,i,a);return n}function qUe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:tp.valueTransformInPlace(t,e._offset,e._scale,jt.applyValueTransform)}function $Ue(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:tp.valueTransformInPlace(t,e._offset,e._scale,jt.unapplyValueTransform)}function KH(e,t,n){let i=this,o,r,s;if(t===jt.INT64)rn.supportsBigInt()?rn.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return OUe(a,i)}):(At("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return QUe(a,i)});else if(t===jt.UINT64)rn.supportsBigInt()?rn.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return HUe(a,i)}):(At("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return zUe(a,i)});else{let a=KUe(t);o=J.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,d){i.typedArray[c]=d}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var oW=iW;function Vh(e){e=e??Q.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new oW({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(Vh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Vh.prototype.hasProperty=function(e){return zn.hasProperty(e,this._properties,this._class)};Vh.prototype.hasPropertyBySemantic=function(e){return zn.hasPropertyBySemantic(e,this._properties,this._class)};Vh.prototype.getPropertyIds=function(e){return zn.getPropertyIds(this._properties,this._class,e)};Vh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=eDe(this._class,t),i};Vh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Vh.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};Vh.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};Vh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Vh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function eDe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=Qe(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var cm=Vh;var tEn=y(x(),1);var GAn=y(x(),1);var CAn=y(x(),1);function i0(){}Object.defineProperties(i0.prototype,{cacheKey:{get:function(){Ae.throwInstantiationError()}}});i0.prototype.load=function(){Ae.throwInstantiationError()};i0.prototype.unload=function(){};i0.prototype.process=function(e){return!1};i0.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=`
${t.message}`);let n=new he(e);return l(t)&&(n.stack=`Original stack:
${t.stack}
Handler stack:
${n.stack}`),n};i0.prototype.isDestroyed=function(){return!1};i0.prototype.destroy=function(){return this.unload(),fe(this)};var Oi=i0;var TAn=y(x(),1),tDe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},ft=Object.freeze(tDe);function kA(e){e=e??Q.EMPTY_OBJECT;let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(kA.prototype=Object.create(Oi.prototype),kA.prototype.constructor=kA);Object.defineProperties(kA.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});kA.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=nDe(this),this._promise)};async function nDe(e){let t=e._resource;e._state=ft.LOADING;try{let n=await kA._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=ft.READY,e)}catch(n){if(e.isDestroyed())return;e._state=ft.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}kA._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};kA.prototype.unload=function(){this._typedArray=void 0};var iC=kA;var egn=y(x(),1);var DAn=y(x(),1);var WAn=y(x(),1),VAn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuec;G:Qdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:p28Adbk:Bhdhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;m:kjjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8AarcUf9cb83ibarc8Wf9cb83ibarcyf9cb83ibarcaf9cb83ibarcKf9cb83ibarczf9cb83ibar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzarc;qofcKfhHarc;qofczfhOcbhAincdhCcbhodnavci6mbaH9cb83ibaO9cb83ibar9cb83i;yoar9cb83i;qoadaAfgoybbhXcbhQincbhwcbhLdninaoalfhKaoybbgYaX7aLVhLawcP0meaKhoaYhXawcefgwaQfai6mbkkcbhXarc;qofhwincwh8AcwhEdnaLaX93gocFeGg3cs0mbclhEa3ci0mba3cb9hcethEkdnaocw4cFeGg3cs0mbclh8Aa3ci0mba3cb9hceth8Aka8AaEfh3awydbh5cwh8AcwhEdnaocz4cFeGg8Ecs0mbclhEa8Eci0mba8Ecb9hcethEka3a5fh3dnaocFFFFb0mbclh8AaocFFF8F0mbaocFFFr0ceth8Akawa3aEfa8AfBdbawclfhwaXcefgXcw9hmbkaKhoaYhXaQczfgQai6mbkcbhocehwazhLinawaoaLydbarc;qofaocdtfydb6EhoaLclfhLawcefgwcw9hmbkcihCkcbh3arc;qlfcbcjdz:xjjjb8Aarc;alfcwfcbBdbar9cb83i;alaoclth8Fadhaaqhhakh5inarc;qlfadcba3cufgoaoa30Eal2falz:wjjjb8Aaiahaiah6Ehgdnaqaia39Ra3aqfai6EgYcsfc9WGgoaY9nmbarc;qofaYfcbaoaY9Rz:xjjjb8Akada3al2fh8Jcbh8Kina8Ka8FVcl4hQarc;alfa8Kcdtfh8LaAh8Mcbh8Nina8NaAfhwdndndndndndna8KPldebidkasa8Mc98GgLfhoa5aLfh8Aarc;qlfawc98GgLfRbbhXcwhwinaoRbbawtaXVhXaocefhoawcwfgwca9hmbkaYTmla8Ncith8Ea8JaLfhEcbhKinaERbbhLcwhoa8AhwinawRbbaotaLVhLawcefhwaocwfgoca9hmbkarc;qofaKfaLaX7aQ93a8E486bba8Aalfh8AaEalfhEaLhXaKcefgKaY9hmbxlkkaYTmia8Mc9:Ghoa8NcitcwGhEarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhLarc;qofhwaghXinawa5aofRbbcwtaaaofRbbVg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbaoalfhoawcefhwa8AhLa3aXcufgX9hmbxikkaYTmda8Jawfhoarc;qlfawfRbbhLarc;qofhwaghXinawaoRbbg8AaL9RgLcetaLcKtcK91cr4786bbawcefhwaoalfhoa8AhLa3aXcufgX9hmbxdkkaYTmeka8LydbhEcbhKarc;qofhoincdhLcbhwinaLaoawfRbbcb9hfhLawcefgwcz9hmbkclhXcbhwinaXaoawfRbbcd0fhXawcefgwcz9hmbkcwh8Acbhwina8AaoawfRbbcP0fh8Aawcefgwcz9hmbkaLaXaLaX6Egwa8Aawa8A6Egwczawcz6EaEfhEaoczfhoaKczfgKaY6mbka8LaEBdbka8Mcefh8Ma8Ncefg8Ncl9hmbka8Kcefg8KaC9hmbkaaamfhaahaxfhha5amfh5a3axfg3ai6mbkcbhocehwaPhLinawaoaLydbarc;alfaocdtfydb6EhoaLclfhLawcefgXhwaCaX9hmbkaraAcd4fa8FcdVaoaocdSE86bbaAclfgAal6mbkkabaefh8Kabcefhoalcd4gecbaDEhkadcefhOarc;abfceVhHcbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aa8Kao9Rak6mdadamal2gwfhxcbh8JaOawfhzaocbakz:xjjjbghakfh5aqaiam9Ramaqfai6Egscsfgocl4cifcd4hCaoc9WGg8LThPindndndndndndndndndndnaDTmbara8Jcd4fRbbgLciGPlbedlbkasTmdaxa8Jfhoarc;abfa8JfRbbhLarc;qofhwashXinawaoRbbg8AaL9RgLcetaLcKtcK91cr4786bbawcefhwaoalfhoa8AhLaXcufgXmbxikkasTmia8JcitcwGhEarc;abfa8JceVfRbbcwtarc;abfa8Jc9:GgofRbbVhLaxaofhoarc;qofhwashXinawao8Vbbg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbawcefhwaoalfhoa8AhLaXcufgXmbxdkkaHa8Jc98GgEfhoazaEfh8Aarc;abfaEfRbbhXcwhwinaoRbbawtaXVhXaocefhoawcwfgwca9hmbkasTmbaLcl4hYa8JcitcKGh3axaEfhEcbhKinaERbbhLcwhoa8AhwinawRbbaotaLVhLawcefhwaocwfgoca9hmbkarc;qofaKfaLaX7aY93a3486bba8Aalfh8AaEalfhEaLhXaKcefgKas9hmbkkaDmbcbhoxlka8LTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8L9pmdxbkkdnavmbcehoxikcbhEaChKaChYinarc;qofaEfgocwf8Pibhyao8Pibh8PcdhLcbhwinaLaoawfRbbcb9hfhLawcefgwcz9hmbkclhXcbhwinaXaoawfRbbcd0fhXawcefgwcz9hmbkcwh8Acbhwina8AaoawfRbbcP0fh8Aawcefgwcz9hmbkaLaXaLaX6Egoa8Aaoa8A6Egoczaocz6EaYfhYaocucbaya8P:e9cb9sEgwaoaw6EaKfhKaEczfgEa8L9pmdxbkkaha8Jcd4fgoaoRbbcda8JcetcoGtV86bbxikdnaKas6mbaYas6mbaha8Jcd4fgoaoRbbcia8JcetcoGtV86bba8Ka59Ras6mra5arc;qofasz:wjjjbasfh5xikaKaY9phokaha8Jcd4fgwawRbbaoa8JcetcoGtV86bbka8Ka59RaC6mla5cbaCz:xjjjbgAaCfhYdndna8LmbaPhoxekdna8KaY9RcK9pmbaPhoxekaocdtc:q1jjbfcj1jjbaDEg5ydxggcetc;:FFFeGh8Fcuh3cuagtcu7cFeGhacbh8Marc;qofhLinarc;qofa8MfhQczhEdndndnagPDbeeeeeeedekcucbaQcwf8PibaQ8Pib:e9cb9sEhExekcbhoa8FhEinaEaaaLaofRbb9nfhEaocefgocz9hmbkkcih8Ecbh8Ainczhwdndndna5a8AcdtfydbgKPDbeeeeeeedekcucbaQcwf8PibaQ8Pib:e9cb9sEhwxekaKcetc;:FFFeGhwcuaKtcu7cFeGhXcbhoinawaXaLaofRbb9nfhwaocefgocz9hmbkkdndnawaE6mbaKa39hmeawaE9hmea5a8EcdtfydbcwSmeka8Ah8EawhEka8Acefg8Aci9hmbkaAa8Mco4fgoaoRbba8Ea8Mci4coGtV86bbdndndna5a8Ecdtfydbg3PDdbbbbbbbebkdncwa39Tg8ETmbcua3tcu7hwdndna3ceSmbcbh8NaLhQinaQhoa8Eh8AcbhXinaoRbbgEawcFeGgKaEaK6EaXa3tVhXaocefhoa8Acufg8AmbkaYaX86bbaQa8EfhQaYcefhYa8Na8Efg8Ncz6mbxdkkcbh8NaLhQinaQhoa8Eh8AcbhXinaoRbbgEawcFeGgKaEaK6EaXcetVhXaocefhoa8Acufg8AmbkaYaX:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaQa8EfhQaYcefhYa8Na8Efg8Ncz6mbkkcbhoinaYaLaofRbbgX86bbaYaXawcFeG9pfhYaocefgocz9hmbxikkdna3ceSmbinaYcb86bbaYcefhYxbkkinaYcb86bbaYcefhYxbkkaYaQ8Pbb83bbaYcwfaQcwf8Pbb83bbaYczfhYka8Mczfg8Ma8L9pgomeaLczfhLa8KaY9RcK9pmbkkaoTmlaYh5aYTmlka8Jcefg8Jal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma5hoa5mbkcbhwxdkdna8Kao9RakalfgwcKcaaDEgLawaL0EgX9pmbcbhwxdkdnawaL9pmbaocbaXaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoaraez:wjjjbaefhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;m:kjjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;m:kjjbk:Ese5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd;q:kjjbgrc;GeV86bbalc;abfcFecjez:xjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc;i1jjbfydbcdtfydbh3aLaoc;e1jjbfydbcdtfydbh8AaLaoc;a1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc;a1jjbfydbcdtfydbgKTaLavc;e1jjbfydbcdtfydbg8AceSGaLavc;i1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavc:W1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkdnaeaP9nmbcbhvxekcbhvinaeavfavc:W1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;q:kjjbk:Adewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb;q:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkdnaoar9nmbcbskaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b0Ec:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A0Ec:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk:Ylvdud99due99iudnaeTmbceaicufgvthocuaitcu7:Zhrcuavtcu7:Zhwcbhvadcl9hhDcbhqindndnalcwfIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEarNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikdndnalIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEarNJbbbZMgk:lJbbb9p9DTmbak:Ohdxekcjjjj94hdkadai9Rcd9TgxaifhidndnalclfIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEarNJbbbZMgk:lJbbb9p9DTmbak:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEawNJbbbZMgk:lJbbb9p9DTmbak:Ohmxekcjjjj94hmkadaifhiaoamVhmdndnaDmbabavfgPai86bbaPcifam86bbaPcdfad86bbaPcefax86bbxekabaqfgPai87ebaPcofam87ebaPclfad87ebaPcdfax87ebkalczfhlavclfhvaqcwfhqaecufgembkkk;YqdXui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AcbhodnadTmbcbhoaiTmbdndnabaeSmbaehrxekavcuadcdtgwadcFFFFi0Ecbyd;u:kjjbHjjjjbbgrBd:SeavceBd:mdaraeawz:wjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaradaiavc:Sefz:pjjjbavyd:GehDadci9Ugqcbyd;u:kjjbHjjjjbbheavc:Sefavyd:mdgkcdtfaeBdbavakcefgwBd:mdaecbaqz:xjjjbhxavc:SefawcdtfcuaicdtaicFFFFi0Ecbyd;u:kjjbHjjjjbbgmBdbavakcdfgPBd:mdalc;ebfhsaDheamhwinawalIdbasaeydbgzcwazcw6EcdtfIdbMUdbaeclfheawclfhwaicufgimbkavc:SefaPcdtfcuaqcdtadcFFFF970Ecbyd;u:kjjbHjjjjbbgPBdbdnadci6mbarheaPhwaqhiinawamaeydbcdtfIdbamaeclfydbcdtfIdbMamaecwfydbcdtfIdbMUdbaecxfheawclfhwaicufgimbkkakcifhoalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhzcbhwcbhXcehQinaehLcihkarawci2gKcdtfgeydbhsaeclfydbhdabaXcx2fgicwfaecwfydbgYBdbaiclfadBdbaiasBdbaxawfce86bbaOaYBdwaOadBdlaOasBdbaPawcdtfcbBdbdnazTmbcihkaLhiinaOakcdtfaiydbgeBdbakaeaY9haeas9haead9hGGfhkaiclfhiazcufgzmbkkaXcefhXcbhzinaCaAarazaKfcdtfydbcdtgifydbcdtfgYheaDaifgdydbgshidnasTmbdninaeydbawSmeaeclfheaicufgiTmdxbkkaeaYascdtfc98fydbBdbadadydbcufBdbkazcefgzci9hmbkdndnakTmbcuhwJbbbbh8Acbhdavyd:KehYavyd:OehKindndnaDaOadcdtfydbcdtgzfydbgembadcefhdxekadcs0hiamazfgsIdbhEasalcbadcefgdaiEcdtfIdbaHaecwaecw6EcdtfIdbMg3Udba3aE:th3aecdthiaKaYazfydbcdtfheinaPaeydbgzcdtfgsa3asIdbMgEUdbaEa8Aa8AaE9DgsEh8AazawasEhwaeclfheaic98fgimbkkadak9hmbkawcu9hmekaQaq9pmdindnaxaQfRbbmbaQhwxdkaqaQcefgQ9hmbxikkakczakcz6EhzaOheaLhOawcu9hmbkkaocdtavc:Seffc98fhedninaoTmeaeydbcbyd;y:kjjbH:bjjjbbaec98fheaocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd;u:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;u:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;u:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic;K1jjbz:ojjjbkQbabaeadaic;m:jjjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:Vvioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;u:kjjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;u:kjjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkclhvdninavc98Smealcxfavfydbcbyd;y:kjjbH:bjjjbbavc98fhvxbkkalc;Waf8Kjjjjbk:Jwliuo99iud9:cbhv8Jjjjjbca9Rgoczfcwfcbyd:8:kjjbBdbaocb8Pd:0:kjjb83izaocwfcbyd;i:kjjbBdbaocb8Pd;a:kjjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;C:kjjbgeabcifc98GfgbBd;C:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;C:kjjbgeabcrfc94GfgbBd;C:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;C:kjjbge9Rcifc98GaefgbBd;C:kjjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Uddbcjwk;mdbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;mqkCebbbebbbebbbdbbb9G:vbb",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(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var f=new Uint8Array(g.length),b=0;b<g.length;++b){var C=g.charCodeAt(b);f[b]=C>96?C-97:C>64?C-39:C+4}for(var E=0,b=0;b<g.length;++b)f[E++]=f[b]<60?t[f[b]]:(f[b]-60)*64+f[++b];return f.buffer.slice(0,E)}function r(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,f,b,C){var E=n.exports.sbrk,T=E(f.length*4),S=E(b*4),_=new Uint8Array(n.exports.memory.buffer),R=s(f);_.set(R,T),C&&C(T,T,f.length,b);var L=g(S,T,f.length,b);_=new Uint8Array(n.exports.memory.buffer);var W=new Uint32Array(b);new Uint8Array(W.buffer).set(_.subarray(S,S+b*4)),R.set(_.subarray(T,T+f.length*4)),E(T-E(0));for(var B=0;B<f.length;++B)f[B]=W[f[B]];return[W,L]}function c(g,f,b,C){var E=n.exports.sbrk,T=E(b*4),S=E(b*C),_=new Uint8Array(n.exports.memory.buffer);_.set(s(f),S),g(T,S,b,C),_=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(b);return new Uint8Array(R.buffer).set(_.subarray(T,T+b*4)),E(T-E(0)),R}function d(g,f,b,C,E,T,S){var _=n.exports.sbrk,R=_(f),L=_(C*E),W=new Uint8Array(n.exports.memory.buffer);W.set(s(b),L);var B=g(R,f,L,C,E,T,S),Y=new Uint8Array(B);return Y.set(W.subarray(R,R+B)),_(R-_(0)),Y}function u(g){for(var f=0,b=0;b<g.length;++b){var C=g[b];f=f<C?C:f}return f}function h(g,f){if(r(f==2||f==4),f==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var b=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(b)}function p(g,f,b,C,E,T,S){var _=n.exports.sbrk,R=_(b*C),L=_(b*T),W=new Uint8Array(n.exports.memory.buffer);W.set(s(f),L),g(R,b,C,E,L,S);var B=new Uint8Array(b*C);return B.set(W.subarray(R,R+b*C)),_(R-_(0)),B}return{ready:i,supported:!0,reorderMesh:function(g,f,b){var C=f?b?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,u(g)+1,C)},reorderPoints:function(g,f){return r(g instanceof Float32Array),r(g.length%f==0),r(f>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/f,f*4)},encodeVertexBuffer:function(g,f,b){r(b>0&&b<=256),r(b%4==0);var C=n.exports.meshopt_encodeVertexBufferBound(f,b);return d(n.exports.meshopt_encodeVertexBuffer,C,g,f,b)},encodeVertexBufferLevel:function(g,f,b,C,E){r(b>0&&b<=256),r(b%4==0),r(C>=0&&C<=3),r(E===void 0||E==0||E==1);var T=n.exports.meshopt_encodeVertexBufferBound(f,b);return d(n.exports.meshopt_encodeVertexBufferLevel,T,g,f,b,C,E===void 0?-1:E)},encodeIndexBuffer:function(g,f,b){r(b==2||b==4),r(f%3==0);var C=h(g,b),E=n.exports.meshopt_encodeIndexBufferBound(f,u(C)+1);return d(n.exports.meshopt_encodeIndexBuffer,E,C,f,4)},encodeIndexSequence:function(g,f,b){r(b==2||b==4);var C=h(g,b),E=n.exports.meshopt_encodeIndexSequenceBound(f,u(C)+1);return d(n.exports.meshopt_encodeIndexSequence,E,C,f,4)},encodeGltfBuffer:function(g,f,b,C,E){var T={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(T[C]),T[C](g,f,b,2,E===void 0?0:E)},encodeFilterOct:function(g,f,b,C){return r(b==4||b==8),r(C>=2&&C<=16),p(n.exports.meshopt_encodeFilterOct,g,f,b,C,16)},encodeFilterQuat:function(g,f,b,C){return r(b==8),r(C>=4&&C<=16),p(n.exports.meshopt_encodeFilterQuat,g,f,b,C,16)},encodeFilterExp:function(g,f,b,C,E){r(b>0&&b%4==0),r(C>=1&&C<=24);var T={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,f,b,C,b,E?T[E]:1)},encodeFilterColor:function(g,f,b,C){return r(b==4||b==8),r(C>=2&&C<=16),p(n.exports.meshopt_encodeFilterColor,g,f,b,C,16)}}})();var BAn=y(x(),1),o0=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuec:W:Odkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;lZkdbk;jYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbhodnawTmbaxa8Acd4fRbbhokaocFeGh5cbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q1jjbfcj1jjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bbarcwf9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfag9c8F1:NghcKtc8F91aicdfa8J9c8N1:Nfg8KRbbG86bbarcVfcba8KahcjeGcr4fghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fag9c8F1:NgicKtc8F91aha8J9c8N1:NfghRbbG86bbarc96fcbahaicjeGcr4fgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbb83bbarcwfaicwf8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbcbaocl49Rh8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E93aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:XseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk::ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxabaiarcefciGfcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGfgkcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabaiarcufciGfcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkabakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K1jjbgeabcifc98GfgbBd:K1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk81dbcjwk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:Kwkl8WNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuec:q:6dkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:Ctklbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:183lYud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxavaialfgmar9Rgoad;8qbbcj;abad9Uc;WFbGcjdadca0EhPdndndnadTmbaoadfhscbhzinaeaz9nmdamax9RaD6miabazad2fhHaxaDfhOaPaeaz9RazaPfae6EgAcsfgocl4cifcd4hCavcj;cbfaoc9WGgXcetfhQavcj;cbfaXci2fhLavcj;cbfaXfhKcbhYaoc;ab6h8AincbhodnawTmbaxaYcd4fRbbhokaocFeGhEcbh3avcj;cbfh5indndndndnaEa3cet4ciGgoc9:fPdebdkamaO9RaX6mwavcj;cbfa3aX2faOaX;8qbbaOaAfhOxdkavcj;cbfa3aX2fcbaX;8kbxekamaO9RaC6moaoclVcbawEhraOaCfhocbhidna8Ambamao9Rc;Gb6mbcbhlina5alfhidndndndndndnaOalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiczfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaicafaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaoclffaqc:q:yjjbfRbbfhoxikaic8Wfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaocwffaqc:q:yjjbfRbbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitc:q1jjbfpbibaic:q:yjjbfRbbgipsaoRbegqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqc:q:yjjbfRbbfhokalc;abfhialcjefaX0meaihlamao9Rc;Fb0mbkkdnaiaX9pmbaici4hlinamao9RcK6mwa5aifhqdndndndndndnaOaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaoclffahc:q:yjjbfRbbfhoxikaqaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaocwffahc:q:yjjbfRbbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpkbbaaaocdffahc:q:yjjbfRbbfhokalcdfhlaiczfgiaX6mbkkaohOaoTmoka5aXfh5a3cefg3cl9hmbkdndndndnawTmbasaYcd4fRbbglciGPlbedwbkaXTmdavcjdfaYfhlavaYfpbdbhgcbhoinalavcj;cbfaofpblbg8JaKaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaQaofpblbg8MaLaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Ecep9Ta8Epxeeeeeeeeeeeeeeeeg8Fp9op9Hp9rg8Eagp9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8LaypmwDKYqk8AExm35Ps8E8Fg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Ug8Fp9Abbbaladfgla8Fa8Ea8Epmlvorlvorlvorlvorp9Ug8Fp9Abbbaladfgla8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9Ug8Fp9Abbbaladfgla8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9AbbbaladfhlaoczfgoaX6mbxikkaXTmeavcjdfaYfhlavaYfpbdbhgcbhoinalavcj;cbfaofpblbg8JaKaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaQaofpblbg8MaLaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Ecep:nea8Epxebebebebebebebebg8Fp9op:bep9rg8Eagp:oeggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp:oeggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp:oeggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9Abbbaladfglaga8LaypmwDKYqk8AExm35Ps8E8Fg8Ecep:nea8Ea8Fp9op:bep9rg8Ep:oeggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp:oeggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp:oeggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9Abbbaladfglaga8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Ecep:nea8Ea8Fp9op:bep9rg8Ep:oeggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp:oeggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp:oeggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9Abbbaladfglaga8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Ecep:nea8Ea8Fp9op:bep9rg8Ep:oeg8Fp9Abbbaladfgla8Fa8Ea8Epmlvorlvorlvorlvorp:oeg8Fp9Abbbaladfgla8Fa8Ea8EpmwDqkwDqkwDqkwDqkp:oeg8Fp9Abbbaladfgla8Fa8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9AbbbaladfhlaoczfgoaX6mbxdkkaXTmbcbhocbalcl4gl9Rc8FGhiavcjdfaYfhravaYfpbdbh8Finaravcj;cbfaofpblbggaKaofpblbg8JpmbzeHdOiAlCvXoQrLg8KaQaofpblbg8LaLaofpblbg8MpmbzeHdOiAlCvXoQrLg8NpmbezHdiOAlvCXorQLg8Eaip:Rea8Ealp:Sep9qg8Ea8Fp9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Fa8Ka8NpmwDKYqk8AExm35Ps8E8Fg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Faga8JpmwKDYq8AkEx3m5P8Es8Fgga8La8MpmwKDYq8AkEx3m5P8Es8Fg8JpmbezHdiOAlvCXorQLg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Faga8JpmwDKYqk8AExm35Ps8E8Fg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9AbbbaradfhraoczfgoaX6mbkkaYclfgYad6mbkaHavcjdfaAad2;8qbbavavcjdfaAcufad2fad;8qbbaAazfhzc9:hoaOhxaOmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdaPaeao9RaoaPfae6Eaofgoae6mbkaial9Rhxkcbc99amax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbk:TseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:2Pliur97eue978Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskaipxFubbFubbFubbFubbgxpklbdnalTmbcbhvabhdinadczfgmampbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblbaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgopklbaiaopklbaiabalcitfgdaeciGglcitgv;8qbbaiaxpkladnalTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblaaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkadaiav;8qbbkk:Iwllue97euo978Jjjjjbca9Rhidnaec98GglTmbcbhvabhoinaocKfpx:ji:1S:ji:1S:ji:1S:ji:1SaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qgxp;6ep;Negmaxaxp:1ep;7egxaxp;KearaDpmbediwDqkzHOAKY8AEgxczp:Reczp:Sep;6egrarp;Meaxczp:Sep;6egDaDp;Meaqczp:Reczp:Sep;6egqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gxp;KepxFFbbFFbbFFbbFFbbgPp9oamaDp;Meaxp;Keczp:Rep9qgDamarp;Meaxp;KeaPp9oamaqp;Meaxp;Keczp:Rep9qgxpmwDKYqk8AExm35Ps8E8Fgrp5eakclp:RegmpEi:T:j83ibawarp5bampEd:T:j83ibaocwfaDaxpmbezHdiOAlvCXorQLgxp5eampEe:T:j83ibaoaxp5bampEb:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiczfpxbbbbbbbbbbbbbbbbgmpklbaiampklbaiabalcitfgoaeciGgvcitgw;8qbbdnavTmbaipx:ji:1S:ji:1S:ji:1S:ji:1SaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qgxp;6ep;Negmaxaxp:1ep;7egxaxp;KearaDpmbediwDqkzHOAKY8AEgxczp:Reczp:Sep;6egrarp;Meaxczp:Sep;6egDaDp;Meaqczp:Reczp:Sep;6egqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gxp;KepxFFbbFFbbFFbbFFbbgPp9oamaDp;Meaxp;Keczp:Rep9qgDamarp;Meaxp;KeaPp9oamaqp;Meaxp;Keczp:Rep9qgxpmwDKYqk8AExm35Ps8E8Fgrp5eakclp:RegmpEi:T:j83iKaiarp5bampEd:T:j83izaiaDaxpmbezHdiOAlvCXorQLgxp5eampEe:T:j83iwaiaxp5bampEb:T:j83ibkaoaiaw;8qbbkk;uddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaic8WfpxbbbbbbbbbbbbbbbbgopklbaicafaopklbaiczfaopklbaiaopklbaiabavcdtfgdalciGgecdtgv;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkadaiav;8qbbkk:CPvdue97euw97eu8Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadpbbbhradpxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpkbbadczfhdaoclfgoal6mbkkalaeSmeaiavpklaaicafabalcdtfgdaeciGglcdtgo;8qbbaiavpklbdnalTmbaipblahraipxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpklakadaicafao;8qbbskaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadczfgspxbFu9hbFu9hbFu9hbFu9hadpbbbgDaspbbbgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblbp9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpkbbadaxarpmbezHdiOAlvCXorQLpkbbadcafhdaoclfgoal6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgrpklbaiarpklbaiabalcitfgdaeciGglcitgo;8qbbaiavpkladnalTmbaipxbFu9hbFu9hbFu9hbFu9haipblbgDaipblzgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblap9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpklzaiaxarpmbezHdiOAlvCXorQLpklbkadaiao;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=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]),i=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(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(E){r=E.instance,r.exports.__wasm_call_ctors()});function a(E){for(var T=new Uint8Array(E.length),S=0;S<E.length;++S){var _=E.charCodeAt(S);T[S]=_>96?_-97:_>64?_-39:_+4}for(var R=0,S=0;S<E.length;++S)T[R++]=T[S]<60?i[T[S]]:(T[S]-60)*64+T[++S];return T.buffer.slice(0,R)}function c(E,T,S,_,R,L,W){var B=E.exports.sbrk,Y=_+3&-4,N=B(Y*R),A=B(L.length),I=new Uint8Array(E.exports.memory.buffer);I.set(L,A);var Z=T(N,_,R,A,L.length);if(Z==0&&W&&W(N,Y,R),S.set(I.subarray(N,N+_*R)),B(N-B(0)),Z!=0)throw new Error("Malformed buffer data: "+Z)}var d={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},u={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function g(E){var T={object:new Worker(E),pending:0,requests:{}};return T.object.onmessage=function(S){var _=S.data;T.pending-=_.count,T.requests[_.id][_.action](_.value),delete T.requests[_.id]},T}function f(E){for(var T="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+C.name+";"+c.toString()+C.toString(),S=new Blob([T],{type:"text/javascript"}),_=URL.createObjectURL(S),R=h.length;R<E;++R)h[R]=g(_);for(var R=E;R<h.length;++R)h[R].object.postMessage({});h.length=E,URL.revokeObjectURL(_)}function b(E,T,S,_,R){for(var L=h[0],W=1;W<h.length;++W)h[W].pending<L.pending&&(L=h[W]);return new Promise(function(B,Y){var N=new Uint8Array(S),A=++p;L.pending+=E,L.requests[A]={resolve:B,reject:Y},L.object.postMessage({id:A,count:E,size:T,source:N,mode:_,filter:R},[N.buffer])})}function C(E){var T=E.data;if(!T.id)return self.close();self.ready.then(function(S){try{var _=new Uint8Array(T.count*T.size);c(S,S.exports[T.mode],_,T.count,T.size,T.source,S.exports[T.filter]),self.postMessage({id:T.id,count:T.count,action:"resolve",value:_},[_.buffer])}catch(R){self.postMessage({id:T.id,count:T.count,action:"reject",value:R})}})}return{ready:s,supported:!0,useWorkers:function(E){f(E)},decodeVertexBuffer:function(E,T,S,_,R){c(r,r.exports.meshopt_decodeVertexBuffer,E,T,S,_,r.exports[d[R]])},decodeIndexBuffer:function(E,T,S,_){c(r,r.exports.meshopt_decodeIndexBuffer,E,T,S,_)},decodeIndexSequence:function(E,T,S,_){c(r,r.exports.meshopt_decodeIndexSequence,E,T,S,_)},decodeGltfBuffer:function(E,T,S,_,R,L){c(r,r.exports[u[R]],E,T,S,_,r.exports[d[L]])},decodeGltfBufferAsync:function(E,T,S,_,R){return h.length>0?b(E,T,S,u[_],d[R]):s.then(function(){var L=new Uint8Array(E*T);return c(r,r.exports[u[_]],L,E,T,S,r.exports[d[R]]),L})}}})();var NAn=y(x(),1),wAn=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuec:G:Pdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXqM;YeQdbk;A1er3ue99euE99Que9:r998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:jjjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:jjjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:jjjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaXcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaKcdtfaABdbaCaKBdbaKhHaKcefhKkaYaHBdbaXcefgXad9hmbkkaQcbyd:m:jjjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:jjjbHjjjjbbhXasc:Cefasyd;8egecdtfaXBdbasaXBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:jjjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:jjjbHjjjjbbhAasc:Cefasyd;8egHcdtfaABdbasaHcefBd;8ea3cbyd1:jjjbHjjjjbbhKasc:Cefasyd;8egHcdtfaKBdbasaHcefBd;8eaAaKaialavazasc:Cefz:djjjbalcbyd1:jjjbHjjjjbbh5asc:Cefasyd;8egHcdtfa5BdbasaHcefBd;8ea3cbyd1:jjjbHjjjjbbhHasc:Cefasyd;8egOcdtfaHBdbasaOcefBd;8ea3cbyd1:jjjbHjjjjbbhOasc:Cefasyd;8egCcdtfaOBdbasaCcefBd;8eaHcFeaez:tjjjbh8EaOcFeaez:tjjjbh8FdnalTmbaEcwfhaindnaXa8AgOcefg8AcdtfydbgCaXaOcdtgefydbgHSmbaCaH9RhhaEaHcitfhga8Faefh8Ja8Eaefh8KcbhQindndnagaQcitfydbgLaO9hmba8KaOBdba8JaOBdbxekdnaXaLcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhYaaaCfhHcbheinaYaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6meka8Fa8LfgeaOaLaeydbcuSEBdba8KaLaOa8KydbcuSEBdbkaQcefgQah9hmbkka8Aal9hmbkaAhHaKhOa8FhCa8EhQcbheindndnaeaHydbgL9hmbdnaeaOydbgL9hmbaQydbhLdnaCydbgYcu9hmbaLcu9hmba5aefcb86bbxikdnaYcuSmbaLcuSmbaeaYSmbaAaYcdtfydbaAaLcdtfydb9hmba5aefcd86bbxika5aefh8KdnaeaYSmbaeaLSmba8Kce86bbxika8Kcl86bbxdkdnaeaKaLcdtgYfydb9hmbdnaCydbg8KcuSmbaea8KSmbaQydbghcuSmbaeahSmba8FaYfydbggcuSmbagaLSmba8EaYfydbgYcuSmbaYaLSmbdnaAa8KcdtfydbgLaAaYcdtfydb9hmbaLaAahcdtfydbgYSmbaYaAagcdtfydb9hmba5aefcd86bbxlka5aefcl86bbxika5aefcl86bbxdka5aefcl86bbxeka5aefa5aLfRbb86bbkaHclfhHaOclfhOaCclfhCaQclfhQalaecefge9hmbkdnamcaGTmbaEcwfh8Jcbh8Nindndna5a8NfgyRbbg8Pc9:fPibebekdndndnaAa8Ncdtfydbgea8N9hmbdnaqmbcbhgxdkdnazTmbcbhga8NheinagaqazaecdtgefydbfRbbcdGce4VhgaKaefydbgea8N9hmbxikkcbhga8NheinagaqaefRbbcdGce4VhgaKaecdtfydbgea8N9hmbxdkka5aefRbbhexeka8NheindnaXaecdtgafgeclfydbgHaeydbgeSmbaHae9Rh8AaEaecitfh8MaAaafh8Lcbh8Kina8Ma8KcitfydbgYhednindnaXaecdtgLfgeclfydbgHaeydbgeSmbdnaAaEaecitgOfydbcdtfydba8LydbgQ9hmbcehexikaHae9Rhhaecu7aHfhCa8JaOfhHcbheinaCaeSmeaecefheaHydbhOaHcwfhHaAaOcdtfydbaQ9hmbkaeah6hexdkaKaLfydbgeaY9hmbkcbhekagaece7Vhga8Kcefg8Ka8A9hmbkkaKaafydbgea8N9hmbka8PciagceGEhekayae86bbka8Ncefg8Nal9hmbkkdnaqTmbdndnazTmbazheaAhHalhOindnaqaeydbfRbbceGTmba5aHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaqheaAhHalhOindnaeRbbceGTmba5aHydbfcl86bbkaecefheaHclfhHaOcufgOmbkkaAhealhOa5hHindna5aeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmba5healhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbhIcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbhaasc:Cefasyd;8egecdtfaaBdbasaecefBd;8easc:qefcbBdbas9cb83i1eaaaialavazasc1efz:ejjjbh8RdndnaDmbcbhycbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:jjjbHjjjjbbhyasc:Cefasyd;8egecdtfayBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4h8KdnazTmbaCcdthhcbhXayhYinaoazaXcdtfydba8K2cdtfhLasheaYhHaChOinaHaLaeydbcdtgQfIdbawaQfIdbNUdbaeclfheaHclfhHaOcufgOmbkaYahfhYaXcefgXal9hmbxdkkaCcdthhcbhXayhYinaoaXa8K2cdtfhLasheaYhHaChOinaHaLaeydbcdtgQfIdbawaQfIdbNUdbaeclfheaHclfhHaOcufgOmbkaYahfhYaXcefgXal9hmbkkcualc8S2gHalc;D;O;f8U0EgQcbyd1:jjjbHjjjjbbheasc:Cefasyd;8egOcdtfaeBdbasaOcefBd;8eaecbaHz:tjjjbh8ScbhDcbh8KdnaCTmbcbhIaQcbyd1:jjjbHjjjjbbh8Kasc:Cefasyd;8egecdtfa8KBdbasaecefBd;8ea8KcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1:jjjbHjjjjbbhDasc:Cefasyd;8egecdtfaDBdbasaecefBd;8eaDcbaHz:tjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:jjjbHjjjjbbhIasc:Cefasyd;8egHcdtfaIBdbasaHcefBd;8eaIcbaez:tjjjb8AkdnadTmbcbhLabhHinaaaHclfydbgXcx2fgeIdbaaaHydbgYcx2fgOIdbgR:tg8UaaaHcwfydbghcx2fgQIdlaOIdlg8V:tg8WNaQIdbaR:tg8XaeIdla8V:tg8YN:tg8Zh80aeIdwaOIdwg81:tgBa8XNaQIdwa81:tg83a8UN:tgUh8Xa8Ya83Na8WaBN:tg8Yh8Udna8Za8ZNa8Ya8YNaUaUNMM:rgBJbbbb9EgOTmba8ZaB:vh80aUaB:vh8Xa8YaB:vh8Uka8SaAaYcdtfydbgQc8S2fgea8UaB:rg8Wa8UNNg85aeIdbMUdbaea8Xa8Wa8XNg86Ng87aeIdlMUdlaea80a8Wa80Ng83Ng88aeIdwMUdwaea86a8UNg86aeIdxMUdxaea83a8UNg89aeIdzMUdzaea83a8XNg8:aeIdCMUdCaea8Ua8Wa80a81Na8UaRNa8Va8XNMM:mgZNg83Ng8UaeIdKMUdKaea8Xa83Ng8XaeId3MUd3aea80a83Ng80aeIdaMUdaaea83aZNg83aeId8KMUd8Kaea8WaeIdyMUdya8SaAaXcdtfydbgXc8S2fgea85aeIdbMUdbaea87aeIdlMUdlaea88aeIdwMUdwaea86aeIdxMUdxaea89aeIdzMUdzaea8:aeIdCMUdCaea8UaeIdKMUdKaea8XaeId3MUd3aea80aeIdaMUdaaea83aeId8KMUd8Kaea8WaeIdyMUdya8SaAahcdtfydbgYc8S2fgea85aeIdbMUdbaea87aeIdlMUdlaea88aeIdwMUdwaea86aeIdxMUdxaea89aeIdzMUdzaea8:aeIdCMUdCaea8UaeIdKMUdKaea8XaeId3MUd3aea80aeIdaMUdaaea83aeId8KMUd8Kaea8WaeIdyMUdydnaITmbdnaOTmba8ZaB:vh8ZaUaB:vhUa8YaB:vh8YkaIaQcltfgeaBJbbbZNg8UaUNg8WaeIdlMUdlaea8Ua8ZNg8XaeIdwMUdwaea8Ua8YNg80aeIdbMUdbaea8UaR:ma8YNaUa8VN:ta81a8ZN:tNg8UaeIdxMUdxaIaXcltfgea8WaeIdlMUdlaea8XaeIdwMUdwaea80aeIdbMUdbaea8UaeIdxMUdxaIaYcltfgea8WaeIdlMUdlaea8XaeIdwMUdwaea80aeIdbMUdbaea8UaeIdxMUdxkaHcxfhHaLcifgLad6mbkkdnalTmbJ;n;m;m89J:v:;;w8ZamczGEh8YcbhOaAhQaahHa8SheindnaOaQydb9hmbaecxfgLaLIdbJbbbbMUdbaeczfgLaLIdbJbbbbMUdbaecCfgLaLIdbJbbbbMUdbaea8YaecyfgLIdbg8ZNg8UaeIdbMUdbaeclfgXa8UaXIdbMUdbaecwfgXa8UaXIdbMUdbaecKfgXaXIdbaHIdbg8Xa8UN:tUdbaHcwfIdbh8Waec3fgXaXIdba8UaHclfIdbg80N:tUdbaecafgXaXIdba8Ua8WN:tUdbaec8KfgXIdbhUaLa8Za8UMUdbaXaUa8Ua8Wa8WNa8Xa8XNa80a80NMMNMUdbkaQclfhQaHcxfhHaec8SfhealaOcefgO9hmbkkdnadTmbcbhhabhYinabahcdtfhXcbhHina5aXaHc:G1jjbfydbcdtfydbgOfRbbhedndna5aYaHfydbgQfRbbgLc99fcFeGcpe0mbaec99fcFeGc;:e6mekdnaLcufcFeGce0mba8EaQcdtfydbaO9hmekdnaecufcFeGce0mba8FaOcdtfydbaQ9hmekJbbacJbbacJbbbZaecFeGceSEaLcFeGceSEh88aaaOcx2fgeIdwaaaQcx2fgLIdwgB:tg80:mh86aeIdlaLIdlg83:tg8Z:mh89aeIdbaLIdbgR:tgU:mh8:dnaaaXaHc:K1jjbfydbcdtfydbcx2fgeIdwaB:tg8Va80a80NaUaUNa8Za8ZNMMg8YNa8Va80NaeIdbaR:tg81aUNa8ZaeIdla83:tg85NMMg8Wa80N:tg8Xa8XNa81a8YNa8WaUN:tg8Ua8UNa85a8YNa8Wa8ZN:tg8Wa8WNMM:rg87Jbbbb9ETmba8Xa87:vh8Xa8Wa87:vh8Wa8Ua87:vh8Uka88a8Y:rNg8Ya8XaBNa8UaRNa83a8WNMM:mgZNg87aZNhZa8Xa87Nhna8Wa87Nhca8Ua87Nh9ca8Ya8XNg87a8WNhJa87a8UNh9ea8Ya8WNgTa8UNhSa8Xa87Nh87a8WaTNhTa8Ua8Ya8UNNh9hdnaUa85Na81a89NMg8Xa8XNa8Za8VNa85a86NMg8Ua8UNa80a81Na8Va8:NMg8Wa8WNMM:rg80Jbbbb9ETmba8Xa80:vh8Xa8Wa80:vh8Wa8Ua80:vh8Uka8SaAaQcdtfydbc8S2fgeaeIdba9ha8Ua88a80:rNg80a8UNNMgUMUdbaeaTa8Wa80a8WNg8VNMg81aeIdlMUdlaea87a8Xa80a8XNg8ZNMg85aeIdwMUdwaeaSa8Va8UNMg8VaeIdxMUdxaea9ea8Za8UNMg87aeIdzMUdzaeaJa8Za8WNMg8ZaeIdCMUdCaea9ca8Ua80a8XaBNa8UaRNa83a8WNMMgB:mNg80NMg8UaeIdKMUdKaeaca8Wa80NMg8WaeId3MUd3aeana8Xa80NMg8XaeIdaMUdaaeaZaBa80N:tg80aeId8KMUd8Kaea8YJbbbbMg8YaeIdyMUdya8SaAaOcdtfydbc8S2fgeaUaeIdbMUdbaea81aeIdlMUdlaea85aeIdwMUdwaea8VaeIdxMUdxaea87aeIdzMUdzaea8ZaeIdCMUdCaea8UaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea80aeId8KMUd8Kaea8YaeIdyMUdykaHclfgHcx9hmbkaYcxfhYahcifghad6mbkaCTmbcbhYinJbbbbh8YaaabaYcdtfgeclfydbghcx2fgHIdwaaaeydbggcx2fgOIdwg81:tg8Wa8WNaHIdbaOIdbg85:tg8Xa8XNaHIdlaOIdlg87:tg80a80NMMgRaaaecwfydbgEcx2fgeIdwa81:tg8ZNa8Wa8Wa8ZNa8XaeIdba85:tgUNa80aeIdla87:tgBNMMg8UN:tJbbbbJbbjZaRa8Za8ZNaUaUNaBaBNMMg8VNa8Ua8UN:tg83:va83Jbbbb9BEg83Nh89a8Va8WNa8Za8UN:ta83Nh8:aRaBNa80a8UN:ta83NhZa8Va80NaBa8UN:ta83NhnaRaUNa8Xa8UN:ta83Nhca8Va8XNaUa8UN:ta83Nh9ca8XaBNaUa80N:tg8Ua8UNa80a8ZNaBa8WN:tg8Ua8UNa8WaUNa8Za8XN:tg8Ua8UNMM:rJbbbZNh8UayagaC2g8LcdtfhHayaEaC2g8JcdtfhOayahaC2g8AcdtfhQa81:mhJa87:mh9ea85:mhTcbhLaChXJbbbbhBJbbbbh83JbbbbhRJbbbbh8VJbbbbh81Jbbbbh85Jbbbbh87Jbbbbh88Jbbbbh86inascjdfaLfgecwfa8Ua8:aQIdbaHIdbg8Z:tg80Na89aOIdba8Z:tgUNMg8WNUdbaeclfa8Uana80NaZaUNMg8XNUdbaea8Ua9ca80NacaUNMg80NUdbaecxfa8UaJa8WNa9ea8XNa8ZaTa80NMMMg8ZNUdba8Ua8Wa8XNNa8VMh8Va8Ua8Wa80NNa81Mh81a8Ua8Xa80NNa85Mh85a8Ua8Za8ZNNa8YMh8Ya8Ua8Wa8ZNNaBMhBa8Ua8Xa8ZNNa83Mh83a8Ua80a8ZNNaRMhRa8Ua8Wa8WNNa87Mh87a8Ua8Xa8XNNa88Mh88a8Ua80a80NNa86Mh86aHclfhHaQclfhQaOclfhOaLczfhLaXcufgXmbka8Kagc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdya8Kahc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdya8KaEc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdyaDa8LcltfhXcbhHaChQinaXaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgLaOclfIdbaLIdbMUdbaecwfgLaOcwfIdbaLIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaQcufgQmbkaDa8AcltfhXcbhHaChQinaXaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgLaOclfIdbaLIdbMUdbaecwfgLaOcwfIdbaLIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaQcufgQmbkaDa8JcltfhXcbhHaChQinaXaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgLaOclfIdbaLIdbMUdbaecwfgLaOcwfIdbaLIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaQcufgQmbkaYcifgYad6mbkkcbhOdndnamcwGg9imbJbbbbhRcbh6cbh9kcbh0xekcbh6a3cbyd1:jjjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ecua0alabadaAz:fjjjbgQcltaQcjjjjiGEcbyd1:jjjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ea9kaQa0aaalz:gjjjbJFFuuhRaQTmba9kheaQhHinaeIdbg8UaRaRa8U9EEhRaeclfheaHcufgHmbkaQh6kasydNeh9mdnalTmba9mclfhea9mydbhQa5hHalhLcbhOincbaeydbgXaQ9RaHRbbcpeGEaOfhOaHcefhHaeclfheaXhQaLcufgLmbkaOce4hOkcuadaO9Rcifg9ncx2a9nc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh9oasc:Cefasyd;8egecdtfa9oBdbasaecefBd;8ecua9ncdta9ncFFFFi0Ecbyd1:jjjbHjjjjbbh9pasc:Cefasyd;8egecdtfa9pBdbasaecefBd;8ea3cbyd1:jjjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealcbyd1:jjjbHjjjjbbh9qasc:Cefasyd;8egecdtfa9qBdbasaecefBd;8eaxaxNa8RJbbjZamclGEgnanN:vh88Jbbbbh86dnadak9nmbdna9nci6mbasyd:yeh9raCclth9sa9ocwfh9tJbbbbh87Jbbbbh86inascNefabadalaAz:cjjjbabhgcbh8Ncbh3inaba3cdtfh8LcbheindnaAagaefydbgOcdtghfydbgQaAa8Laec:W1jjbfydbcdtfydbgHcdtgEfydbgLSmba5aHfRbbgYcv2a5aOfRbbgXfc;a1jjbfRbbg8AaXcv2aYfg8Jc;a1jjbfRbbg8MVcFeGTmbdnaLaQ9nmba8Jc;G1jjbfRbbcFeGmekdnaXcufcFeGce0mbaYTmba8EahfydbaH9hmekdnaXTmbaYcufcFeGce0mba8FaEfydbaO9hmeka9oa8Ncx2fgQaHaOa8McFeGgLEBdlaQaOaHaLEBdbaQaLa8AGcb9hBdwa8Ncefh8Nkaeclfgecx9hmbkdna3cifg3ad9pmbagcxfhga8Ncifa9n9nmekka8NTmdcbh8Jina8SaAa9oa8Jcx2fghydbgLcdtgQfydbggc8S2fgeIdwaaahydlgXcx2fgHIdwg8XNaeIdzaHIdbg80NaeIdaMg8Ua8UMMa8XNaeIdlaHIdlg8ZNaeIdCa8XNaeId3Mg8Ua8UMMa8ZNaeIdba80NaeIdxa8ZNaeIdKMg8Ua8UMMa80NaeId8KMMM:lh8UJbbbbJbbjZaeIdyg8W:va8WJbbbb9BEh8Wdndnahydwg8LmbJFFuuh83xekJbbbbJbbjZa8SaAaXcdtfydbc8S2fgeIdygU:vaUJbbbb9BEaeIdwaaaLcx2fgHIdwgUNaeIdzaHIdbg8YNaeIdaMgBaBMMaUNaeIdlaHIdlgBNaeIdCaUNaeId3MgUaUMMaBNaeIdba8YNaeIdxaBNaeIdKMgUaUMMa8YNaeId8KMMM:lNh83ka8Wa8UNhBdnaCTmba8KaLc8S2fgOIdwa8XNaOIdza80NaOIdaMg8Ua8UMMa8XNaOIdla8ZNaOIdCa8XNaOId3Mg8Ua8UMMa8ZNaOIdba80NaOIdxa8ZNaOIdKMg8Ua8UMMa80NaOId8KMMMh8UayaXaC2gYcdtfhHaDaLaC2gEcltfheaOIdyhUaChOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbkdndna8LmbJbbbbh8Wxeka8KaXc8S2fgOIdwaaaLcx2fgeIdwg80NaOIdzaeIdbg8ZNaOIdaMg8Wa8WMMa80NaOIdlaeIdlgUNaOIdCa80NaOId3Mg8Wa8WMMaUNaOIdba8ZNaOIdxaUNaOIdKMg8Wa8WMMa8ZNaOId8KMMMh8WayaEcdtfhHaDaYcltfheaOIdyh8YaChOinaHIdbg8Xa8Xa8YNaecxfIdba80aecwfIdbNa8ZaeIdbNaUaeclfIdbNMMMg8Xa8XM:tNa8WMh8WaHclfhHaeczfheaOcufgOmbka8W:lh8WkaBa8U:lMhBa83a8WMh83dndndna5aLfRbbc9:fPddbekaKaQfydbgQaLSmbaAaXcdtfydbhEindndna8EaQcdtgYfydbgecuSmbaAaecdtfydbaESmekdna8FaYfydbgecuSmbaAaecdtfydbaESmekaXheka8KaQc8S2fgOIdwaaaecx2fgHIdwg8XNaOIdzaHIdbg80NaOIdaMg8Ua8UMMa8XNaOIdlaHIdlg8ZNaOIdCa8XNaOId3Mg8Ua8UMMa8ZNaOIdba80NaOIdxa8ZNaOIdKMg8Ua8UMMa80NaOId8KMMMh8UayaeaC2cdtfhHaDaQaC2cltfheaOIdyhUaChOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbkaBa8U:lMhBaKaYfydbgQaL9hmbkka5aXfRbbci9hmea8LTmeaKaXcdtfydbgQaXSmeindndna8EaQcdtgYfydbgecuSmbaAaecdtfydbagSmekdna8FaYfydbgecuSmbaAaecdtfydbagSmekaLheka8KaQc8S2fgOIdwaaaecx2fgHIdwg8XNaOIdzaHIdbg80NaOIdaMg8Ua8UMMa8XNaOIdlaHIdlg8ZNaOIdCa8XNaOId3Mg8Ua8UMMa8ZNaOIdba80NaOIdxa8ZNaOIdKMg8Ua8UMMa80NaOId8KMMMh8UayaeaC2cdtfhHaDaQaC2cltfheaOIdyhUaChOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbka83a8U:lMh83aKaYfydbgQaX9hmbxdkkdna8Fa8Ea8EaQfydbaXSEaKaQfydbgYcdtfydbgQcu9hmbaKaXcdtfydbhQka8KaYc8S2fgOIdwaaaQcx2fgeIdwg8XNaOIdzaeIdbg80NaOIdaMg8Ua8UMMa8XNaOIdlaeIdlg8ZNaOIdCa8XNaOId3Mg8Ua8UMMa8ZNaOIdba80NaOIdxa8ZNaOIdKMg8Ua8UMMa80NaOId8KMMMh8UayaQaC2ggcdtfhHaDaYaC2gEcltfheaOIdyhUaChOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbkdndna8LmbJbbbbh8Wxeka8KaQc8S2fgOIdwaaaYcx2fgeIdwg80NaOIdzaeIdbg8ZNaOIdaMg8Wa8WMMa80NaOIdlaeIdlgUNaOIdCa80NaOId3Mg8Wa8WMMaUNaOIdba8ZNaOIdxaUNaOIdKMg8Wa8WMMa8ZNaOId8KMMMh8WayaEcdtfhHaDagcltfheaOIdyh8YaChOinaHIdbg8Xa8Xa8YNaecxfIdba80aecwfIdbNa8ZaeIdbNaUaeclfIdbNMMMg8Xa8XM:tNa8WMh8WaHclfhHaeczfheaOcufgOmbka8W:lh8WkaBa8U:lMhBa83a8WMh83kaha83aBa83aB9DgeEUdwahaLaXaea8Lcb9hGgeEBdlahaXaLaeEBdba8Jcefg8Ja8N9hmbkascjdfcbcj;qbz:tjjjb8Aa9thea8NhHinascjdfaeydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgOydbhQaOaHBdbaQaHfhHaeclfgecj;qb9hmbkcbhea9thHinascjdfaHydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbgOcefBdba9paOcdtfaeBdbaHcxfhHa8Naecefge9hmbkadak9RgOci9Uh9udnalTmbcbhea8PhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9va9qcbalz:tjjjbh9waOcO9Uh9xa9uce4h9ycbh3cbh8Adnina9oa9pa8Acdtfydbcx2fg8JIdwg8Ua889Emea3a9u9pmeJFFuuh8Wdna9ya8N9pmba9oa9pa9ycdtfydbcx2fIdwJbb;aZNh8Wkdna8Ua8W9ETmba8Ua869ETmba3a9x0mdkdna9waAa8Jydlg8Mcdtg9zfgEydbgQfg9ARbba9waAa8Jydbggcdtg9Bfydbgefg9CRbbVmba5agfRbbh9Ddna9maecdtfgHclfydbgOaHydbgHSmbaOaH9RhLaaaQcx2fhYaaaecx2fhha9raHcitfhecbhHceh8Ldnindna8PaeydbcdtfydbgOaQSmba8PaeclfydbcdtfydbgXaQSmbaOaXSmbaaaXcx2fgXIdbaaaOcx2fgOIdbg8X:tg8UahIdlaOIdlg80:tg8YNahIdba8X:tgBaXIdla80:tg8WN:tg8Za8UaYIdla80:tg83NaYIdba8X:tg8Va8WN:tg80Na8WahIdwaOIdwgU:tg81Na8YaXIdwaU:tg8XN:tg8Ya8WaYIdwaU:tg85Na83a8XN:tg8WNa8XaBNa81a8UN:tgUa8Xa8VNa85a8UN:tg8UNMMa8Za8ZNa8Ya8YNaUaUNMMa80a80Na8Wa8WNa8Ua8UNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaL6h8LaLaH9hmbkka8LceGTmba9ycefh9yxekdndndndna9Dc9:fPdebdkagheinaEydbhOdndna8EaecdtgHfydbgecuSmbaAaecdtfydbaOSmekdna8FaHfydbgecuSmbaAaecdtfydbaOSmeka8Mheka8PaHfaeBdbaKaHfydbgeag9hmbxikkdna8Fa8Ea8Ea9Bfydba8MSEaKa9Bfydbggcdtfydbgecu9hmbaKa9zfydbheka8Pa9Bfa8MBdbaeh8Mka8Pagcdtfa8MBdbka9Cce86bba9Ace86bba8JIdwg8Ua86a86a8U9DEh86a9vcefh9vcecda9DceSEa3fh3ka8Acefg8Aa8N9hmbkka9vTmddnalTmbcbhXcbhhindna8PahcdtgefydbgOahSmbaAaOcdtfydbhgdnahaAaefydb9hgEmba8Sagc8S2fgea8Sahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdyaITmbaIagcltfgeaIahcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxkaCTmba8KaOc8S2fgea8Kahc8S2g8LfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9saO2hYaDhHaChQinaHaYfgeaHaXfgOIdbaeIdbMUdbaeclfgLaOclfIdbaLIdbMUdbaecwfgLaOcwfIdbaLIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaQcufgQmbkaEmbJbbbbJbbjZa8Sa8LfgeIdyg8U:va8UJbbbb9BEaeIdwaaagcx2fgHIdwg8UNaeIdzaHIdbg8WNaeIdaMg8Xa8XMMa8UNaeIdlaHIdlg8XNaeIdCa8UNaeId3Mg8Ua8UMMa8XNaeIdba8WNaeIdxa8XNaeIdKMg8Ua8UMMa8WNaeId8KMMM:lNg8Ua87a87a8U9DEh87kaXa9sfhXahcefghal9hmbkcbhHa8EheindnaeydbgOcuSmbdnaHa8PaOcdtgQfydbgO9hmbcuhOa8EaQfydbgQcuSmba8PaQcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHa8FheindnaeydbgOcuSmbdnaHa8PaOcdtgQfydbgO9hmbcuhOa8FaQfydbgQcuSmba8PaQcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkka87a86aCEh87cbhHabhecbhOindnaAa8PaeydbcdtfydbgXcdtfydbgQaAa8PaeclfydbcdtfydbgYcdtfydbgLSmbaQaAa8PaecwfydbcdtfydbggcdtfydbghSmbaLahSmbabaHcdtfgQaXBdbaQcwfagBdbaQclfaYBdbaHcifhHkaecxfheaOcifgOad6mbkdndna9imbaHhdxekdnaHak0mbaHhdxekdnaRa879FmbaHhdxekJFFuuhRcbhdabhecbhOindna9ka0aeydbgQcdtfydbcdtfIdbg8Ua879ETmbaeclf8Pdbh9EabadcdtfgLaQBdbaLclfa9E83dba8UaRaRa8U9EEhRadcifhdkaecxfheaOcifgOaH6mbkkadak0mbxdkkascNefabadalaAz:cjjjbkdndnadak0mbadhhxekdna9imbadhhxekdnaRa889FmbadhhxekcehLinaRJbb;aZNg8Ua88a8Ua889DEh8XJbbbbh8Udna6Tmba9khea6hHinaeIdbg8Wa8Ua8Wa8X9FEa8Ua8Wa8U9EEh8UaeclfheaHcufgHmbkkJFFuuhRcbhhabhecbhHindna9ka0aeydbgOcdtfydbcdtfIdbg8Wa8X9ETmbaeclf8Pdbh9EabahcdtfgQaOBdbaQclfa9E83dba8WaRaRa8W9EEhRahcifhhkaecxfheaHcifgHad6mbkdnaLahad9hVceGmbadhhxdka8Ua86a86a8U9DEh86ahak9nmecbhLahhdaRa889FmbkkdnamcjjjjdGTmba9qcbalz:tjjjbh8LdnahTmbabheahhHina8LaeydbgOfce86bba8LaAaOcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabahalaAz:cjjjbdndndnalTmbcbhQasyd:yehEindna8LaQfRbbTmbdna5aQfRbbgecl0mbceaetcQGmekdnaAaQcdtgXfydbgeaQSmbaaaQcx2fgHaaaecx2fge8Pdb83dbaHcwfaecwfydbBdbxeka8SaQc8S2fgLIdyg9ca9cJL:3;rUNg8UMh88aLIdwg9ha8UMhRaLIdlgxa8UMh8VaLIdbg9Fa8UMhUaLIdag9Ga8UaaaQcx2fggIdwg89N:th81aLId3g9Ha8UagIdlg8:N:th85aLIdKg9IagIdbgZa8UN:th8YJbbbbhcaLIdCg9JJbbbbMh87aLIdzg9KJbbbbMhBaLIdxgWJbbbbMh83dndnaCTmbaQhOinJbbbba88a8KaOc8S2fgHIdyg8U:va8UJbbbb9BEh8UaDaOaC2cltfheaHIdaa88Na81Mh81aHId3a88Na85Mh85aHIdKa88Na8YMh8YaHIdCa88Na87Mh87aHIdza88NaBMhBaHIdxa88Na83Mh83aHIdwa88NaRMhRaHIdla88Na8VMh8VaHIdba88NaUMhUaChHina81aecxfIdbg8ZaecwfIdbg8WNa8UN:th81a85a8ZaeclfIdbg8XNa8UN:th85a87a8Wa8XNa8UN:th87aUaeIdbg80a80Na8UN:thUa8Ya8Za80Na8UN:th8YaBa8Wa80Na8UN:thBa83a8Xa80Na8UN:th83aRa8Wa8WNa8UN:thRa8Va8Xa8XNa8UN:th8VaeczfheaHcufgHmbkaKaOcdtfydbgOaQ9hmbkaITmbaIaQcltfgeIdxhSaeIdwhJaeIdlh9eaeIdbh8UxekJbbbbhSJbbbbhJJbbbbh9eJbbbbh8UkaBaU:vg8Xa8YNa81:ta87aBa83aU:vg8WN:tg81a8Va83a8WN:tg8Z:vg80a8Wa8YNa85:tg8VN:th85aJa8Ua8XN:ta9ea8Ua8WN:tg83a80N:tg87aRaBa8XN:ta81a80N:tgB:vgR:mh81a83a8Z:vgJ:mh9ednJbbbba8Ua8UaU:vgTN:ta83aJN:ta87aRN:tg83:la88J:983:g81Ng8U9ETmba81a85Na9ea8VNaTa8YNaS:tMMa83:vhckaU:la8U9ETmba8Z:la8U9ETmbaB:la8U9ETmbaT:macNa8X:ma81acNa85aB:vMgBNa8W:ma9eacNa80:maBNa8Va8Z:vMMg87Na8Y:maU:vMMMh88a9maXfgeclfydbgHaeydbge9RhYaEaecitfhXJbbbbh8UdnaHaeSg8JmbJbbbbh8UaXheaYhOinaaaeclfydbcx2fgHIdwa89:tg8Wa8WNaHIdbaZ:tg8Wa8WNaHIdla8::tg8Wa8WNMMg8Waaaeydbcx2fgHIdwa89:tg8Xa8XNaHIdbaZ:tg8Xa8XNaHIdla8::tg8Xa8XNMMg8Xa8Ua8Ua8X9DEg8Ua8Ua8W9DEh8UaecwfheaOcufgOmbkkaBa89:tg8Wa8WNa88aZ:tg8Wa8WNa87a8::tg8Wa8WNMMa8U:rg8Ua8UN9EmbaLId8Khcdna8JmbcbhOcehLdninaaaXclfydbcx2fgeIdbaaaXydbcx2fgHIdbg8X:tg8Ua8:aHIdlg80:tg8YNaZa8X:tg83aeIdla80:tg8WN:tg8Za8Ua87a80:tgRNa88a8X:tg8Va8WN:tg80Na8Wa89aHIdwgU:tg81Na8YaeIdwaU:tg8XN:tg8Ya8WaBaU:tg85NaRa8XN:tg8WNa8Xa83Na81a8UN:tgUa8Xa8VNa85a8UN:tg8UNMMa8Za8ZNa8Ya8YNaUaUNMMa80a80Na8Wa8WNa8Ua8UNMMN:rJbbj8:N9FmeaXcwfhXaOcefgOaY6hLaYaO9hmbkkaLceGmekJbbbbJbbjZa9c:va9cJbbbb9BEg8Ua9haBNa9Ka88Na9GMg8Wa8WMMaBNaxa87Na9JaBNa9HMg8Wa8WMMa87Na9Fa88NaWa87Na9IMg8Wa8WMMa88NacMMM:lNa8Ua9ha89Na9KaZNa9GMg8Wa8WMMa89Naxa8:Na9Ja89Na9HMg8Wa8WMMa8:Na9FaZNaWa8:Na9IMg8Wa8WMMaZNacMMM:lNJbb;aZNJ:983:g81M9EmbagaBUdwaga87Udlaga88UdbkaQcefgQal9hmbkaCTmecbhLindna8LaLfRbbTmbaAaLcdtgefydbaL9hmba5aLfhEaaaLcx2fhOaKaefh8JayaLaC2cdtfh8AcbhgincuhQdnaERbbci9hmbaLhQa8JydbgeaLSmbayagcdtgHfhXa8AaHfIdbh8UaLhQinaQhHcuhQdnaXaeaC2cdtfIdba8U9CmbaHcuSmbaHhQa8Kaec8S2fIdya8KaHc8S2fIdy9ETmbaehQkaKaecdtfydbgeaL9hmbkkayagcdtfhXaDagcltfhYaLheinaXaeaC2cdtfJbbbbJbbjZa8KaeaQaQcuSEgHc8S2fIdyg8U:va8UJbbbb9BEaYaHaC2cltfgHIdwaOIdwNaHIdbaOIdbNaHIdlaOIdlNMMaHIdxMNUdbaKaecdtfydbgeaL9hmbkagcefggaC9hmbkkaLcefgLalSmixbkkaCmekcbhCkaiavaoarawaCalaaayazasa8Rasc1efa5a8Laqz:hjjjbkdnamcjjjjlGTmbazmbahTmbcbhQabheina5aeydbgAfRbbc3thLaecwfgKydbhHdndna8EaAcdtgYfydbaeclfgXydbgOSmbcbhCa8FaOcdtfydbaA9hmekcjjjj94hCkaeaLaCVaAVBdba5aOfRbbc3thLdndna8EaOcdtfydbaHSmbcbhCa8FaHcdtfydbaO9hmekcjjjj94hCkaXaLaCVaOVBdba5aHfRbbc3thCdndna8EaHcdtfydbaASmbcbhOa8FaYfydbaH9hmekcjjjj94hOkaKaCaOVaHVBdbaecxfheaQcifgQah6mbkkdnazTmbahTmbahheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPana86:rNUdbkasyd;8egecdtasc:Ceffc98fhHdninaeTmeaHydbcbyd:m:jjjbH:bjjjbbaHc98fhHaecufhexbkkascj;sbf8Kjjjjbahk;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:jjjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:jjjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkawclfhwabclfhbaiaDcefgD9hmbkkk:hrdvuv998Jjjjjbca9Rgoczfcwfcbyd11jjbBdbaocb8Pdj1jjb83izaocwfcbydN1jjbBdbaocb8Pd:m1jjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:ZlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvc:G1jjbfydbcdtfydbcdtfydbhodnabalawavfydbcdtfydbgqcdtfgkydbgvaqSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnabaocdtfgkydbgvaoSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnabavfgDydbgvaxSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhvabhocbhkindndnavalydbgq9hmbdnavaoydbgq9hmbaoakBdbakcefhkxdkaoabaqcdtfydbBdbxekaoabaqcdtfydbBdbkaoclfhoalclfhlaeavcefgv9hmbkakk;Jiilud99duabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakclfgxaqaxIdbMUdbakcwfgxaDaxIdbMUdbakcxfgkakIdbJbbjZMUdbaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhraehkinarcxfgoIdbhDaocbBdbararIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbarclfgoaDaoIdbNUdbarcwfgoaDaoIdbNUdbarczfhrakcufgkmbkkdnalTmbinavadydbcltfgrcxfgkaicwfIdbarcwfIdb:tgDaDNaiIdbarIdb:tgDaDNaiclfIdbarclfIdb:tgDaDNMMgDakIdbgqaqaD9DEUdbadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhrinabarIdbUdbarczfhrabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:d8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:jjjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufavaz9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkJbbbbh8Adnas:ZgCaL:taY:Ygwaz:Y:tgENak:Zg3aO:Zg5:tNa3aL:tawaP:Y:tg8ENa5aC:tNMg8FJbbbb9BmbaCa3:ta8EaEa5aL:tNNNa8F:vh8AkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdna8AawMJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhicdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgYavcFFFFi0Ecbyd1:jjjbHjjjjbbgKBdCaqciBd2aqamcbyd1:jjjbHjjjjbbgzBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihAaxhHindndnaoaOfRbbceGTmbaOcjjjjlVhXxekdndnaHclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqthXdndnaHcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarVhXdndnaHIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarcCtVhXkaAaXBdbaAclfhAaHcxfhHalaOcefgO9hmbxikkaKcFeaYz:tjjjb8AcbhPcbhvxdkaxhOaihHalhAindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcCthXdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0Ehvkcbhraqavcbyd1:jjjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinJbbnnJbbjZazaiydbgAcdtfydbgvazaiclfydbgHcdtfydbgYSavazaicwfydbgXcdtfydbgKSGgoEh8EdnaxaHcx2fgHIdbaxaAcx2fgAIdbg5:tgCaxaXcx2fgXIdlaAIdlg8A:tgwNaXIdba5:tg3aHIdla8A:tg8FN:tgLaLNa8FaXIdwaAIdwgE:tgaNawaHIdwaE:tg8FN:tgwawNa8Fa3NaaaCN:tgCaCNMM:rg3Jbbbb9ETmbaLa3:vhLaCa3:vhCawa3:vhwkaOavc8S2fgvavIdbawa8Ea3:rNg3awNNg8FMUdbavaCa3aCNgaNghavIdlMUdlavaLa3aLNg8ENggavIdwMUdwavaaawNgaavIdxMUdxava8EawNg8JavIdzMUdzava8EaCNg8EavIdCMUdCavawa3aLaENawa5Na8AaCNMM:mg8ANg5NgwavIdKMUdKavaCa5NgCavId3MUd3avaLa5NgLavIdaMUdaava5a8ANg5avId8KMUd8Kava3avIdyMUdydnaombaOaYc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava5avId8KMUd8Kava3avIdyMUdyaOaKc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava5avId8KMUd8Kava3avIdyMUdykaicxfhiarcifgrad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:jjjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:jjjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkJbbbbhwdnaPTmbinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkkakcd4akfhOcehiinaigvcethiavaO6mbkcbhiaqcuavcdtgOavcFFFFi0Ecbyd1:jjjbHjjjjbbgHBdyaHcFeaOz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hikdnaDmbcwhvxdkaw:rhwcwhvkaDawUdbkavcdthvdninavTmeavc98fgvaqcxffydbcbyd:m:jjjbH:bjjjbbxbkkaqc;Wbf8Kjjjjbaik:2ldwue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:jjjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbhkarcxfaryd2gxcdtgmfakBdbaraxcefgPBd2akaialavcbcbz:ejjjb8AarcxfaPcdtfaDcbyd1:jjjbHjjjjbbgvBdbaraxcdfgiBd2arcxfaicdtfcuavalaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:jjjbHjjjjbbgiBdbaiaeavakalz:gjjjbdnadTmbaoaoNhocbhwabhlcbhkindnaiavalydbgecdtfydbcdtfIdbao9ETmbalclf8PdbhsabawcdtfgqaeBdbaqclfas83dbawcifhwkalcxfhlakcifgkad6mbkkaxcifhlamarcxffcwfhkdninalTmeakydbcbyd:m:jjjbH:bjjjbbakc98fhkalcufhlxbkkarc;Wbf8Kjjjjbawk:XCoDud99vue99vuo998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:jjjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:jjjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhDcbhCadhXcbhQinaeaDcufaeaD9iEaPcefaeaP9kEhLdndnadTmbaLcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kJbbbbh8EdnaX:ZgKaH:taL:YgOaD:Y:tg8FNaC:Zgaa3:Zgh:tNaaaH:taOaP:Y:tggNahaK:tNMg8JJbbbb9BmbaKaa:taga8FahaH:tNNNa8J:vh8EkaPaLa3ar0giEhPaCa3aiEhCdna3arSmbaLaDaiEgDaP9Rcd9imbdndnaQcl0mbdna8EaOMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaDfcd9Theka3aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd1:jjjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgLfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aLfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:jjjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgLaDcFFFFi0Egicbyd1:jjjbHjjjjbbgeBdaawcoBd2awaicbyd1:jjjbHjjjjbbgEBd8KaecFeaLz:tjjjbh3dnadTmbJbbjZJbbjZaK:vaPceSEaoNgOaONhKaxcdthxalheinaKaec;81jjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aLzMjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd:m:jjjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Ydidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;7idqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:jjjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkcbhrdninarc98Smealcxfarfydbcbyd:m:jjjbH:bjjjbbarc98fhrxbkkalc;Wbf8Kjjjjbk9teiucbcbyd:q:jjjbgeabcifc98GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcrfc94GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:jjjbge9Rcifc98GaefgbBd:q:jjjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Iedbcjwk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1Dkxebbbdbbb:GNbb",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(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(T){n=T.instance,n.exports.__wasm_call_ctors()});function o(T){for(var S=new Uint8Array(T.length),_=0;_<T.length;++_){var R=T.charCodeAt(_);S[_]=R>96?R-97:R>64?R-39:R+4}for(var L=0,_=0;_<T.length;++_)S[L++]=S[_]<60?t[S[_]]:(S[_]-60)*64+S[++_];return S.buffer.slice(0,L)}function r(T){if(!T)throw new Error("Assertion failed")}function s(T){return new Uint8Array(T.buffer,T.byteOffset,T.byteLength)}function a(T,S,_,R){var L=n.exports.sbrk,W=L(_*4),B=L(_*R*4),Y=new Uint8Array(n.exports.memory.buffer);Y.set(s(S),B),T(W,B,_,R*4),Y=new Uint8Array(n.exports.memory.buffer);var N=new Uint32Array(_);return new Uint8Array(N.buffer).set(Y.subarray(W,W+_*4)),L(W-L(0)),N}function c(T,S,_){var R=n.exports.sbrk,L=R(S.length*4),W=R(_*4),B=new Uint8Array(n.exports.memory.buffer),Y=s(S);B.set(Y,L);var N=T(W,L,S.length,_);B=new Uint8Array(n.exports.memory.buffer);var A=new Uint32Array(_);new Uint8Array(A.buffer).set(B.subarray(W,W+_*4)),Y.set(B.subarray(L,L+S.length*4)),R(L-R(0));for(var I=0;I<S.length;++I)S[I]=A[S[I]];return[A,N]}function d(T){for(var S=0,_=0;_<T.length;++_){var R=T[_];S=S<R?R:S}return S}function u(T,S,_,R,L,W,B,Y,N){var A=n.exports.sbrk,I=A(4),Z=A(_*4),G=A(L*W),w=A(_*4),X=new Uint8Array(n.exports.memory.buffer);X.set(s(R),G),X.set(s(S),w);var v=T(Z,w,_,G,L,W,B,Y,N,I);X=new Uint8Array(n.exports.memory.buffer);var U=new Uint32Array(v);s(U).set(X.subarray(Z,Z+v*4));var k=new Float32Array(1);return s(k).set(X.subarray(I,I+4)),A(I-A(0)),[U,k[0]]}function h(T,S,_,R,L,W,B,Y,N,A,I,Z,G){var w=n.exports.sbrk,X=w(4),v=w(_*4),U=w(L*W),k=w(L*Y),P=w(N.length*4),O=w(_*4),H=A?w(L):0,ee=new Uint8Array(n.exports.memory.buffer);ee.set(s(R),U),ee.set(s(B),k),ee.set(s(N),P),ee.set(s(S),O),A&&ee.set(s(A),H);var z=T(v,O,_,U,L,W,k,Y,P,N.length,H,I,Z,G,X);ee=new Uint8Array(n.exports.memory.buffer);var te=new Uint32Array(z);s(te).set(ee.subarray(v,v+z*4));var q=new Float32Array(1);return s(q).set(ee.subarray(X,X+4)),w(X-w(0)),[te,q[0]]}function p(T,S,_,R,L,W,B,Y,N,A,I,Z,G){var w=n.exports.sbrk,X=w(4),v=w(L*W),U=w(L*Y),k=w(N.length*4),P=w(_*4),O=A?w(L):0,H=new Uint8Array(n.exports.memory.buffer);H.set(s(R),v),H.set(s(B),U),H.set(s(N),k),H.set(s(S),P),A&&H.set(s(A),O);var ee=T(P,_,v,L,W,U,Y,k,N.length,O,I,Z,G,X);H=new Uint8Array(n.exports.memory.buffer),s(S).set(H.subarray(P,P+ee*4)),s(R).set(H.subarray(v,v+L*W)),s(B).set(H.subarray(U,U+L*Y));var z=new Float32Array(1);return s(z).set(H.subarray(X,X+4)),w(X-w(0)),[ee,z[0]]}function g(T,S,_,R){var L=n.exports.sbrk,W=L(_*R),B=new Uint8Array(n.exports.memory.buffer);B.set(s(S),W);var Y=T(W,_,R);return L(W-L(0)),Y}function f(T,S,_,R,L,W,B,Y){var N=n.exports.sbrk,A=N(Y*4),I=N(_*R),Z=N(_*W),G=new Uint8Array(n.exports.memory.buffer);G.set(s(S),I),L&&G.set(s(L),Z);var w=T(A,I,_,R,Z,W,B,Y);G=new Uint8Array(n.exports.memory.buffer);var X=new Uint32Array(w);return s(X).set(G.subarray(A,A+w*4)),N(A-N(0)),X}function b(T,S,_,R,L,W,B,Y,N){var A=n.exports.sbrk,I=A(4),Z=A(_*4),G=A(L*W),w=A(_*4),X=B?A(L):0,v=new Uint8Array(n.exports.memory.buffer);v.set(s(R),G),v.set(s(S),w),B&&v.set(s(B),X);var U=T(Z,w,_,G,L,W,X,Y,N,I);v=new Uint8Array(n.exports.memory.buffer);var k=new Uint32Array(U);s(k).set(v.subarray(Z,Z+U*4));var P=new Float32Array(1);return s(P).set(v.subarray(I,I+4)),A(I-A(0)),[k,P[0]]}function C(T,S,_,R,L,W,B){var Y=n.exports.sbrk,N=Y(_*4),A=Y(L*W),I=Y(_*4),Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(R),A),Z.set(s(S),I);var G=T(N,I,_,A,L,W,B);Z=new Uint8Array(n.exports.memory.buffer);var w=new Uint32Array(G);return s(w).set(Z.subarray(N,N+G*4)),Y(N-Y(0)),w}var E={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(T){r(T instanceof Uint32Array||T instanceof Int32Array||T instanceof Uint16Array||T instanceof Int16Array),r(T.length%3==0);var S=T.BYTES_PER_ELEMENT==4?T:new Uint32Array(T);return c(n.exports.meshopt_optimizeVertexFetchRemap,S,d(T)+1)},generatePositionRemap:function(T,S){return r(T instanceof Float32Array),r(T.length%S==0),r(S>=3),a(n.exports.meshopt_generatePositionRemap,T,T.length/S,S)},simplify:function(T,S,_,R,L,W){r(T instanceof Uint32Array||T instanceof Int32Array||T instanceof Uint16Array||T instanceof Int16Array),r(T.length%3==0),r(S instanceof Float32Array),r(S.length%_==0),r(_>=3),r(R>=0&&R<=T.length),r(R%3==0),r(L>=0);for(var B=0,Y=0;Y<(W?W.length:0);++Y)r(W[Y]in E),B|=E[W[Y]];var N=T.BYTES_PER_ELEMENT==4?T:new Uint32Array(T),A=u(n.exports.meshopt_simplify,N,T.length,S,S.length/_,_*4,R,L,B);return A[0]=T instanceof Uint32Array?A[0]:new T.constructor(A[0]),A},simplifyWithAttributes:function(T,S,_,R,L,W,B,Y,N,A){r(T instanceof Uint32Array||T instanceof Int32Array||T instanceof Uint16Array||T instanceof Int16Array),r(T.length%3==0),r(S instanceof Float32Array),r(S.length%_==0),r(_>=3),r(R instanceof Float32Array),r(R.length==L*(S.length/_)),r(L>=0),r(B==null||B instanceof Uint8Array),r(B==null||B.length==S.length/_),r(Y>=0&&Y<=T.length),r(Y%3==0),r(N>=0),r(Array.isArray(W)),r(L>=W.length),r(W.length<=32);for(var I=0;I<W.length;++I)r(W[I]>=0);for(var Z=0,I=0;I<(A?A.length:0);++I)r(A[I]in E),Z|=E[A[I]];var G=T.BYTES_PER_ELEMENT==4?T:new Uint32Array(T),w=h(n.exports.meshopt_simplifyWithAttributes,G,T.length,S,S.length/_,_*4,R,L*4,new Float32Array(W),B,Y,N,Z);return w[0]=T instanceof Uint32Array?w[0]:new T.constructor(w[0]),w},simplifyWithUpdate:function(T,S,_,R,L,W,B,Y,N,A){r(T instanceof Uint32Array||T instanceof Int32Array||T instanceof Uint16Array||T instanceof Int16Array),r(T.length%3==0),r(S instanceof Float32Array),r(S.length%_==0),r(_>=3),r(R instanceof Float32Array),r(R.length==L*(S.length/_)),r(L>=0),r(B==null||B instanceof Uint8Array),r(B==null||B.length==S.length/_),r(Y>=0&&Y<=T.length),r(Y%3==0),r(N>=0),r(Array.isArray(W)),r(L>=W.length),r(W.length<=32);for(var I=0;I<W.length;++I)r(W[I]>=0);for(var Z=0,I=0;I<(A?A.length:0);++I)r(A[I]in E),Z|=E[A[I]];var G=T.BYTES_PER_ELEMENT==4?T:new Uint32Array(T),w=p(n.exports.meshopt_simplifyWithUpdate,G,T.length,S,S.length/_,_*4,R,L*4,new Float32Array(W),B,Y,N,Z);if(T!==G)for(var I=0;I<w[0];++I)T[I]=G[I];return w},getScale:function(T,S){return r(T instanceof Float32Array),r(T.length%S==0),r(S>=3),g(n.exports.meshopt_simplifyScale,T,T.length/S,S*4)},simplifyPoints:function(T,S,_,R,L,W){return r(T instanceof Float32Array),r(T.length%S==0),r(S>=3),r(_>=0&&_<=T.length/S),R?(r(R instanceof Float32Array),r(R.length%L==0),r(L>=3),r(T.length/S==R.length/L),f(n.exports.meshopt_simplifyPoints,T,T.length/S,S*4,R,L*4,W,_)):f(n.exports.meshopt_simplifyPoints,T,T.length/S,S*4,void 0,0,0,_)},simplifySloppy:function(T,S,_,R,L,W){r(T instanceof Uint32Array||T instanceof Int32Array||T instanceof Uint16Array||T instanceof Int16Array),r(T.length%3==0),r(S instanceof Float32Array),r(S.length%_==0),r(_>=3),r(R==null||R instanceof Uint8Array),r(R==null||R.length==S.length/_),r(L>=0&&L<=T.length),r(L%3==0),r(W>=0);var B=T.BYTES_PER_ELEMENT==4?T:new Uint32Array(T),Y=b(n.exports.meshopt_simplifySloppy,B,T.length,S,S.length/_,_*4,R,L,W);return Y[0]=T instanceof Uint32Array?Y[0]:new T.constructor(Y[0]),Y},simplifyPrune:function(T,S,_,R){r(T instanceof Uint32Array||T instanceof Int32Array||T instanceof Uint16Array||T instanceof Int16Array),r(T.length%3==0),r(S instanceof Float32Array),r(S.length%_==0),r(_>=3),r(R>=0);var L=T.BYTES_PER_ELEMENT==4?T:new Uint32Array(T),W=C(n.exports.meshopt_simplifyPrune,L,T.length,S,S.length/_,_*4,R);return W=T instanceof Uint32Array?W:new T.constructor(W),W}}})();var MAn=y(x(),1),XAn=(function(){var e="b9H79Tebbbe96x9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9GluuuubiCAdilvorwDqooqkbiibeilve9Weiiviebeoweuecj:Pdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bqE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bkL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbxl79IV9RbmDwebcekdzHq:Y:beAdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek;z8JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:pjjjb8Adndnalcb9imbaoal9nmbamcuaocdtaocFFFFi0Egscbyd;01jjbHjjjjbbgzBd:CwamceBd;8wamascbyd;01jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;01jjbHjjjjbbgOBd:KwamciBd;8waihsalhAinazasydbcdtfcbBdbasclfhsaAcufgAmbkaihsalhAinazasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkaihsalhCcbhXindnazasydbcdtgQfgAydbcb9imbaHaQfaXBdbaAaAydbgQcjjjj94VBdbaQaXfhXkasclfhsaCcufgCmbkalci9UhLdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhXaHaAydbcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaXcdtfgXaXydbgXcefBdbaOaXcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaihsalhAindnazasydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaHaCfgCaCydbaQ9RBdbkasclfhsaAcufgAmbxdkkamcuaocdtgsaocFFFFi0EgAcbyd;01jjbHjjjjbbgzBd:CwamceBd;8wamaAcbyd;01jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;01jjbHjjjjbbgOBd:KwamciBd;8wazcbasz:pjjjbhXalci9UhLaihsalhAinaXasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkdnaoTmbcbhsaHhAaXhCaohQinaAasBdbaAclfhAaCydbasfhsaCclfhCaQcufgQmbkkdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhQaHaAydbcdtfgKaKydbgKcefBdbaOaKcdtfasBdbaHaQcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaoTmbcbhsaohAinaHasfgCaCydbaXasfydb9RBdbasclfhsaAcufgAmbkkamaLcbyd;01jjbHjjjjbbgsBd:OwamclBd;8wascbaLz:pjjjbhYamcuaLcK2alcjjjjd0Ecbyd;01jjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihAa8AhsaLhrJbbbbh5inavaAclfydbaK2cdtfgCIdlh8EavaAydbaK2cdtfgXIdlhEavaAcwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgasaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbasclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyascxfa8EaE:tg8Eagah:tggNa8FaE:tg8Faaah:tgaN:tgEJbbbbJbbjZa8Ja8K:tg8Ja8FNa8La8K:tg8Ka8EN:tghahNaEaENaaa8KNaga8JN:tgEaENMM:rg8K:va8KJbbbb9BEg8ENUdbasczfaEa8ENUdbascCfaha8ENUdbascwfa8Maya8NMMJbbnn:vUdba5a8KMh5aAcxfhAascKfhsarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;01jjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhsaChAinaAasBdbaAclfhAaLascefgs9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;01jjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhsaLhAJFFuuh8NJFFuuh8MinascwfIdbgEa8Ma8MaE9EEh8MasclfIdbgEa8Na8NaE9EEh8NasIdbgEayayaE9EEhyascKfhsaAcufgAmbkkah:rhEamaocetgscuaocu9kEcbyd;01jjbHjjjjbbgCBd:4wdndnaoal9nmbaihsalhAinaCasydbcetfcFFi87ebasclfhsaAcufgAmbxdkkaCcFeasz:pjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhAJFFuuhEa8AhscuhIinascwfIdba8M:tghahNasIdbay:tghahNasclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEaAaIaXEhIascKfhsaLaAcefgA9hmbkkamczfcbcjwz:pjjjb8Aamcwf9cb83ibam9cb83iba8JaxNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh8EaRaENh5aIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaza81a3cdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAindndnaCaiaAydbgKcx2fgsclfydbgrcetf8Vebcs4aCasydbgXcetf8Vebcs4faCascwfydbglcetf8Vebcs4fgombcbhsxekcehsazaXcdtfydbgXceSmbcehsazarcdtfydbgrceSmbcehsazalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhsxekaocdfhskdnasaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba5:tghahNaXIdla8E:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEasaQ6ahaE9DVgXEhEaKaLaXEhLasaQaXEhQkaAclfhAavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama8EUd:KDama5Ud:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgzam8Pib83dbazcwfamcwf8Pib83dbaPcefhPkc3hzinazc98Smvamc:Cwfazfydbcbyd;41jjbH:bjjjbbazc98fhzxbkkcbh3a8Saq9pmbamydwaCaiaLcx2fgsydbcetf8Vebcs4aCascwfydbcetf8Vebcs4faCasclfydbcetf8Vebcs4ffaw9nmekcbhscbhAdna8ZTmbcbhAamczfhXinamczfaAcdtfaXydbgQBdbaXclfhXaAaYaQfRbbTfhAa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDaAc;8eaAclfc:bd6Eh8ZinamcjDfasfcFFF;7rBdbasclfgscz9hmbka8Zcdth80dnalTmbaeaXcdtfhocbhrindnazaoarcdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAcuhQcuhsinazaiaAydbgKcx2fgXclfydbcdtfydbazaXydbcdtfydbfazaXcwfydbcdtfydbfgXasaXas6gXEhsaKaQaXEhQaAclfhAavcufgvmbkaQcuSmba8AaQcK2fgAIdwa8M:tgEaENaAIdbay:tgEaENaAIdla8N:tgEaENMM:rhEcbhAindndnasamc:qDfaAfgvydbgX6mbasaX9hmeaEamcjDfaAfIdb9FTmekavasBdbamc:GDfaAfaQBdbamcjDfaAfaEUdbxdkaAclfgAcz9hmbkkarcefgral9hmbkkamczfa80fhQcbhscbhAindnamc:GDfasfydbgXcuSmbaQaAcdtfaXBdbaAcefhAkasclfgscz9hmbkaAa8Zfg8ZTmbJFFuuhhcuhKamczfhsa8ZhvcuhQina8AasydbgXcK2fgAIdwa8M:tgEaENaAIdbay:tgEaENaAIdla8N:tgEaENMM:rhEdndnazaiaXcx2fgAclfydbcdtfydbazaAydbcdtfydbfazaAcwfydbcdtfydbfgAaQ6mbaAaQ9hmeaEah9DTmekaEhhaAhQaXhKkasclfhsavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaOaHaraXcdtfydbcdtgAfydbcdtfgKhsazaAfgvydbgQhAdnaQTmbdninasydbaLSmeasclfhsaAcufgATmdxbkkasaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgsIdbhEasIdlhhasIdwh8KasIdxh8EasIdzh5asIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa5Mh8Xa8Wa8EMh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPk:joivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaoczfcwfcbBdbao9cb83izaocwfcbBdbao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;yddvue99dninabaecitfgrydlgwcl6mednawciGgDci9hmbabaecitfhbcbhecehqindnaiabydbgDfRbbmbcbhqadaDcK2fgkIdwalIdw:tgxaxNakIdbalIdb:tgxaxNakIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhwkabcwfhbaecefgeawcd46mbkaqceGTmdarawciGBdlskdnabcbawcd4gwalaDcdtfIdbarIdb:tgxJbbbb9FEgkaw7aecefgwfgecitfydlabakawfgwcitfydlVci0mbaraDBdlkabawadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0abydxaq9pVakVgDce9hmbavawcltfgxab8Pdb83dbaxcwfabcwfgx8Pdb83dbabydbhqdnaxydbgkTmbaoaqcdtfhxakhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaqakfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8Vebhscbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:zPrHue99eue99eue99eu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:pjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;01jjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;01jjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydbaC2cdtfhKavarcwfydbaC2cdtfhYavarclfydbaC2cdtfh8AcbhraLhEinaQarfgmaKarfg3Idbg5a8Aarfg8EIdbg8Fa5a8F9DEg5UdbamaYarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbarczf9cb83dbarcwf9cb83dbaxcuascx2gralc:bjjjl0Ecbyd;01jjbHjjjjbbgCBdN9GaxciBd;S9GascdthgazarfhvaChHazhLcbhPinaxcbcj;Gbz:pjjjbhEaPas2cdthadnaAmbaLhrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaCaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkaAmbavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3BdbarclfhramcufgmmbkaHhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydlg8EcefBdlava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydwg8EcefBdwaXa8Ecdtfa3BdbarclfhramcufgmmbkkaHagfhHaLagfhLaPcefgPci9hmbkaEaocetgrcuaocu9kEcbyd;01jjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:pjjjb8AkcbhmaEascbyd;01jjbHjjjjbbg8ABd:C9GaOaCaCascdtfaCascitfa8AascbazaKaiawaDaqakz:hjjjbcbh8Ednalci6gambcbh8Ea8Ahrash3ina8EarRbbfh8Earcefhra3cufg3mbkkaEcwf9cb83ibaE9cb83ibalawc9:fgrfcufar9UhrasaDfcufaD9Uh3dnaambara3ara30EhYcbhra8Ehacbhmincbh3dnarTmba8AarfRbbceSh3kamaEaiaCydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaCclfhCaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmbabamcltfgraE8Pib83dbarcwfaEcwf8Pib83dbamcefhmkczhrinarc98SmeaEc:m;Gbfarfydbcbyd;41jjbH:bjjjbbarc98fhrxbkkaxc;W;Gbf8Kjjjjbamk:YKDQue99lue99iul9:eur99lu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:pjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KaravcdtgYfc94fh8LcbazceakaxSEg8Mcdtg8N9RhyJFFuuh8PcuhIcbh8Rcbh8SinaPclfa8ScdtfydbhQaPc8WfcKfcb8Pd:y1jjbgR83ibaPc8Wfczfcb8Pd:q1jjbg8U83ibaPc8Wfcwfcb8Pd11jjbg8V83ibaPcb8Pdj1jjbg8W83i8WaPczfcKfaR83ibaPczfczfa8U83ibaPczfcwfa8V83ibaPa8W83izaQaYfh8XcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8YaCIdbg8Za8Ya8Z9DEUdbaCczfgCaOcxfIdbg8YaCIdbg8Za8Ya8Z9EEUdbazclfgzcx9hmbkaPIdnaPId8W:tg80aPId9iaPIdU:tg81NhBaba8XaXcu7cdtfydbcK2fhAcbhzaPId80h83aPId9ehUinaPczfazfgCaAazfgOIdbg8YaCIdbg8Za8Ya8Z9DEUdbaCczfgCaOcxfIdbg8YaCIdbg8Za8Ya8Z9EEUdbazclfgzcx9hmbkaraLfgzaUa83:tg8Ya81Na80a8YNaBMMUdbazaYfaPId8KaPIdC:tg8YaPIdyaPIdK:tg8ZNaPIdaaPIdz:tg80a8YNa80a8ZNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8XawaOclfydbcetfg868Vebh85awaOydbcetfgO8Vebh87aLce87eba86ce87ebaOce87ebaCaAa85cs4a87cs4fa8Xcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndna8Eav0mba8Eax0meavaK6mda5aE9pmDcehLaEhXa85Tmlxrka5ag9pmwa8Eax9nmdxlkdnavavaK9UgzaK29Raza320mba5aE9pmwa85Th88ceh86aEhLxvka5ag6mixrka5ag9pmokcbhLaghXa85mikJFFuuh8YcbhQa5hzindnazcefgCaK6mbaLavaC9RgOaK6GmbarazcdtfIdbg8ZaC:YNa8Lavaz9RcdtfIdbg80aO:YNMg81a8Y9Embdndna8KaOahf:YNgB:lJbbb9p9DTmbaB:OhAxekcjjjj94hAka80asaA2aO9R:YNh80dndna8Kazasf:YNgB:lJbbb9p9DTmbaB:OhOxekcjjjj94hOkamasaO2aC9R:Ya8ZNa80MNa81Mg8Za8Ya8Za8Y9DgOEh8YaCaQaOEhQkaza8MfgzaX6mbxlkka85Th88cbh86aghLkJFFuuh8YcbhQaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna86TmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Zaz:YNaAIdbg80aC:YNMg81a8Y9EmbazhXaCh8Xdna88mba85aOfydbgXh8Xkdndna8Ka8Xahf:YNgB:lJbbb9p9DTmbaB:Oh87xekcjjjj94h87ka80asa872a8X9R:YNh80dndna8KaXahf:YNgB:lJbbb9p9DTmbaB:Oh8Xxekcjjjj94h8Xkamasa8X2aX9R:Ya8ZNa80MNa81Mg8Za8Ya8Za8Y9DgXEh8YazaQaXEhQkaCa8M9RhCaAayfhAaOa8NfhOaza8MfgzcufaL6mbxdkkJFFuuh8YcbhQaEhCaahAa8FhOaKhzindnazaK6mbaLaCaK6GmbaraOfIdbg8Zaz:YNaAIdbg80aC:YNMg81a8Y9Embdndna8Ka85aOfydbg8Xahf:YNgB:lJbbb9p9DTmbaB:Oh86xekcjjjj94h86kamasa862a8X9R:YgBa8ZNa80aBNMNa81Mg8Za8Ya8Za8Y9Dg8XEh8YazaQa8XEhQkaCa8M9RhCaAayfhAaOa8NfhOaza8MfgzcufaX6mbkkaQTmba8Ya8P9DTmba8Yh8PaQh8Ra8ShIka8Scefg8Sci9hmbkdndnaoc8X9kmbaIcb9omeka8Acufh86cbhYindndndnavaY9RaxaYaxfav0Eg8XTmbcbhAaeaYcdtfgzhCa8XhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8XhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Xcufz:pjjjb8AxekalaYfgzce86bbazcefcba86z:pjjjb8Aa8Ah8Xka8XaYfgYav9pmdxbkkaravcdtg8XfhLdna8RTmbaPclfaIcdtfydbhza8RhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnava8R9nmbaPclfaIcdtfydba8Rcdtfhzava8R9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYaISmbcbhzaraPclfaYcdtfydbgKa8Xz:ojjjbhCavhXa8RhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaiala8RaocefgCarawaDaqakaxamz:hjjjbabaea8Rcdtgzfadazfaiazfala8Rfava8R9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk;Nkovud99euv99eul998Jjjjjbc:W;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:W:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaoc8Wfawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeaocbBd8Sao9cb83iKao9cb83izaoczfaoc8Wfawci2cxaoc8Sfcbcrz:jjjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:W:qefawcxaoc8Sfcbciz:jjjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:W:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:W:qefheaoc8WfhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabaxUd8KabasUdaabazUd3abaCaxaPN:tUdKabaXasaPN:tUdCabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabae86b8UdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabav86bRdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:W;aef8Kjjjjbk;Iwwvul99iud99eue99eul998Jjjjjbcje9Rgr8Kjjjjbavcd4hwaicd4hDdndnaoTmbarc;abfcbaocdtgvz:pjjjb8Aarc;Gbfcbavz:pjjjb8AarhvarcafhiaohqinavcFFF97BdbaicFFF;7rBdbaiclfhiavclfhvaqcufgqmbkdnadTmbcbhkinaeakaD2cdtfgvIdwhxavIdlhmavIdbhPalakaw2cdtfIdbhsarc;abfhzarhiarc;GbfhHarcafhqc:G1jjbhvaohOinasavcwfIdbaxNavIdbaPNavclfIdbamNMMgAMhCakhXdnaAas:tgAaqIdbgQ9DgLmbaHydbhXkaHaXBdbakhXdnaCaiIdbgK9EmbazydbhXaKhCkazaXBdbaiaCUdbaqaAaQaLEUdbavcxfhvaqclfhqaHclfhHaiclfhiazclfhzaOcufgOmbkakcefgkad9hmbkkadThkJbbbbhCcbhXarc;abfhvarc;Gbfhicbhqinalavydbgzaw2cdtfIdbalaiydbgHaw2cdtfIdbaeazaD2cdtfgzIdwaeaHaD2cdtfgHIdw:tgsasNazIdbaHIdb:tgsasNazIdlaHIdl:tgsasNMM:rMMgsaCasaC9EgzEhCaqaXazEhXaiclfhiavclfhvaoaqcefgq9hmbkaCJbbbZNhKxekadThkcbhXJbbbbhKkJbbbbhCdnaearc;abfaXcdtgifydbgqaD2cdtfgvIdwaearc;GbfaifydbgzaD2cdtfgiIdwgm:tgsasNavIdbaiIdbgY:tgAaANavIdlaiIdlgP:tgQaQNMM:rgxJbbbb9ETmbaxalaqaw2cdtfIdbMalazaw2cdtfIdb:taxaxM:vhCkasaCNamMhmaQaCNaPMhPaAaCNaYMhYdnakmbaDcdthvawcdthiindnalIdbg8AaecwfIdbam:tgCaCNaeIdbaY:tgsasNaeclfIdbaP:tgAaANMM:rgQMgEaK9ETmbJbbbbhxdnaQJbbbb9ETmbaEaK:taQaQM:vhxkaxaCNamMhmaxaANaPMhPaxasNaYMhYa8AaKaQMMJbbbZNhKkaeavfhealaifhladcufgdmbkkabaKUdxabamUdwabaPUdlabaYUdbarcjef8Kjjjjbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz1jjjbarcj8Wf8Kjjjjbk:Reeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrz:jjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk:3lequ8JjjjjbcjP9Rgl8Kjjjjbcbhvalcjxfcbaiz:pjjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjxfaDcefRbbfRbb9RcFeGci6aoalcjxfaDRbbfRbb9RcFeGci6faoalcjxfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2zMjjjb8Aakalcjxffaocefgo86bbaxalcjxffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjxffao86bbarcifhravcefgvad9hmbkalcFeaicetz:pjjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkcetfgw8UebgDcu9kmbawax87ebaocjlfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjlfaDz:ojjjb8AalcjPf8Kjjjjbk9teiucbcbyd;81jjbgeabcifc98GfgbBd;81jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;81jjbgeabcrfc94GfgbBd;81jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;81jjbge9Rcifc98GaefgbBd;81jjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkk:nedbcjwktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0wkxebbbdbbbjNbb",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(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(b){n=b.instance,n.exports.__wasm_call_ctors()});function o(b){for(var C=new Uint8Array(b.length),E=0;E<b.length;++E){var T=b.charCodeAt(E);C[E]=T>96?T-97:T>64?T-39:T+4}for(var S=0,E=0;E<b.length;++E)C[S++]=C[E]<60?t[C[E]]:(C[E]-60)*64+C[++E];return C.buffer.slice(0,S)}function r(b){if(!b)throw new Error("Assertion failed")}function s(b){return new Uint8Array(b.buffer,b.byteOffset,b.byteLength)}var a=48,c=16;function d(b,C){var E=b.meshlets[C*4+0],T=b.meshlets[C*4+1],S=b.meshlets[C*4+2],_=b.meshlets[C*4+3];return{vertices:b.vertices.subarray(E,E+S),triangles:b.triangles.subarray(T,T+_*3)}}function u(b,C,E,T,S,_,R,L,W,B){var Y=n.exports.sbrk,N=n.exports.meshopt_buildMeshletsBound(C.length,_,R),A=Y(N*c),I=Y(C.length*4),Z=Y(C.length),G=Y(C.byteLength),w=Y(E.byteLength),X=new Uint8Array(n.exports.memory.buffer);X.set(s(C),G),X.set(s(E),w);var v=b(A,I,Z,G,C.length,w,T,S,_,R,L,W,B);X=new Uint8Array(n.exports.memory.buffer);for(var U=X.subarray(A,A+v*c),k=new Uint32Array(U.buffer,U.byteOffset,U.byteLength/4).slice(),P=0;P<v;++P){var O=k[P*4+0],H=k[P*4+1],T=k[P*4+2],ee=k[P*4+3];n.exports.meshopt_optimizeMeshlet(I+O*4,Z+H,ee,T)}var z=k[(v-1)*4+0],te=k[(v-1)*4+1],q=k[(v-1)*4+2],me=k[(v-1)*4+3],ye=z+q,oe=te+me*3,xe={meshlets:k,vertices:new Uint32Array(X.buffer,I,ye).slice(),triangles:new Uint8Array(X.buffer,Z,oe*3).slice(),meshletCount:v};return Y(A-Y(0)),xe}function h(b){var C=new Float32Array(n.exports.memory.buffer,b,a/4);return{centerX:C[0],centerY:C[1],centerZ:C[2],radius:C[3],coneApexX:C[4],coneApexY:C[5],coneApexZ:C[6],coneAxisX:C[7],coneAxisY:C[8],coneAxisZ:C[9],coneCutoff:C[10]}}function p(b,C,E,T){var S=n.exports.sbrk,_=[],R=S(C.byteLength),L=S(b.vertices.byteLength),W=S(b.triangles.byteLength),B=S(a),Y=new Uint8Array(n.exports.memory.buffer);Y.set(s(C),R),Y.set(s(b.vertices),L),Y.set(s(b.triangles),W);for(var N=0;N<b.meshletCount;++N){var A=b.meshlets[N*4+0],I=b.meshlets[N*4+0+1],Z=b.meshlets[N*4+0+3];n.exports.meshopt_computeMeshletBounds(B,L+A*4,W+I,Z,R,E,T),_.push(h(B))}return S(R-S(0)),_}function g(b,C,E,T){var S=n.exports.sbrk,_=S(a),R=S(b.byteLength),L=S(C.byteLength),W=new Uint8Array(n.exports.memory.buffer);W.set(s(b),R),W.set(s(C),L),n.exports.meshopt_computeClusterBounds(_,R,b.length,L,E,T);var B=h(_);return S(_-S(0)),B}function f(b,C,E,T,S){var _=n.exports.sbrk,R=_(a),L=_(b.byteLength),W=T?_(T.byteLength):0,B=new Uint8Array(n.exports.memory.buffer);B.set(s(b),L),T&&B.set(s(T),W),n.exports.meshopt_computeSphereBounds(R,L,C,E,W,T?S:0);var Y=h(R);return _(R-_(0)),Y}return{ready:i,supported:!0,buildMeshlets:function(b,C,E,T,S,_){r(b.length%3==0),r(C instanceof Float32Array),r(C.length%E==0),r(E>=3),r(T>0&&T<=256),r(S>=1&&S<=512),_=_||0;var R=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b);return u(n.exports.meshopt_buildMeshletsFlex,R,C,C.length/E,E*4,T,S,S,_,0)},buildMeshletsFlex:function(b,C,E,T,S,_,R,L){r(b.length%3==0),r(C instanceof Float32Array),r(C.length%E==0),r(E>=3),r(T>0&&T<=256),r(S>=1&&_<=512),r(S<=_),R=R||0,L=L||0;var W=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b);return u(n.exports.meshopt_buildMeshletsFlex,W,C,C.length/E,E*4,T,S,_,R,L)},buildMeshletsSpatial:function(b,C,E,T,S,_,R){r(b.length%3==0),r(C instanceof Float32Array),r(C.length%E==0),r(E>=3),r(T>0&&T<=256),r(S>=1&&_<=512),r(S<=_),R=R||0;var L=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b);return u(n.exports.meshopt_buildMeshletsSpatial,L,C,C.length/E,E*4,T,S,_,R)},extractMeshlet:function(b,C){return r(C>=0&&C<b.meshletCount),d(b,C)},computeClusterBounds:function(b,C,E){r(b.length%3==0),r(b.length/3<=512),r(C instanceof Float32Array),r(C.length%E==0),r(E>=3);var T=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b);return g(T,C,C.length/E,E*4)},computeMeshletBounds:function(b,C,E){return r(b.meshletCount!=0),r(C instanceof Float32Array),r(C.length%E==0),r(E>=3),p(b,C,C.length/E,E*4)},computeSphereBounds:function(b,C,E,T){return r(b instanceof Float32Array),r(b.length%C==0),r(C>=3),r(!E||E instanceof Float32Array),r(!E||E.length%T==0),r(!E||T>=1),r(!E||b.length/C==E.length/T),T=T||0,f(b,b.length/C,C*4,E,T*4)}}})();function oC(e){e=e??Q.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,d=a.byteOffset,u=a.byteLength,h=!1,p,g,f,b;if(Ti(a,"EXT_meshopt_compression")){let E=a.extensions.EXT_meshopt_compression;c=E.buffer,d=E.byteOffset??0,u=E.byteLength,h=!0,p=E.byteStride,g=E.count,f=E.mode,b=E.filter??"NONE"}let C=n.buffers[c];this._hasMeshopt=h,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=f,this._meshoptFilter=b,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=C,this._bufferId=c,this._byteOffset=d,this._byteLength=u,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(oC.prototype=Object.create(Oi.prototype),oC.prototype.constructor=oC);Object.defineProperties(oC.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function iDe(e){try{let t=oDe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);o0.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=ft.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=ft.FAILED,e.getError("Failed to load buffer view",t)}}oC.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=ft.LOADING,this._promise=iDe(this),this._promise)};function oDe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}oC.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var IS=oC;var bgn=y(x(),1);var sgn=y(x(),1);function rs(){}rs._maxDecodingConcurrency=Math.max(rn.hardwareConcurrency-1,1);rs._decoderTaskProcessor=void 0;rs._taskProcessorReady=!1;rs._error=void 0;rs._getDecoderTaskProcessor=function(){if(!l(rs._decoderTaskProcessor)){let e=new Jn("decodeDraco",rs._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?rs._taskProcessorReady=!0:rs._error=new he("Draco decoder could not be initialized.")}).catch(t=>{rs._error=t}),rs._decoderTaskProcessor=e}return rs._decoderTaskProcessor};rs.decodePointCloud=function(e){let t=rs._getDecoderTaskProcessor();if(l(rs._error))throw rs._error;if(rs._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};rs.decodeBufferView=function(e){let t=rs._getDecoderTaskProcessor();if(l(rs._error))throw rs._error;if(rs._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var QA=rs;var lgn=y(x(),1);var kn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION"};function rDe(e){switch(e){case kn.POSITION:return"positionMC";case kn.NORMAL:return"normalMC";case kn.TANGENT:return"tangentMC";case kn.TEXCOORD:return"texCoord";case kn.COLOR:return"color";case kn.JOINTS:return"joints";case kn.WEIGHTS:return"weights";case kn.FEATURE_ID:return"featureId";case kn.SCALE:return"scale";case kn.ROTATION:return"rotation"}}kn.hasSetIndex=function(e){switch(e){case kn.POSITION:case kn.NORMAL:case kn.TANGENT:return!1;case kn.TEXCOORD:case kn.COLOR:case kn.JOINTS:case kn.WEIGHTS:case kn.FEATURE_ID:case kn.SCALE:case kn.ROTATION:return!0}};kn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return kn.POSITION;case"NORMAL":return kn.NORMAL;case"TANGENT":return kn.TANGENT;case"TEXCOORD":return kn.TEXCOORD;case"COLOR":return kn.COLOR;case"JOINTS":return kn.JOINTS;case"WEIGHTS":return kn.WEIGHTS;case"_FEATURE_ID":return kn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return kn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return kn.ROTATION}};kn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return kn.POSITION;case"RGBA":case"RGB":case"RGB565":return kn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return kn.NORMAL;case"BATCH_ID":return kn.FEATURE_ID}};kn.getGlslType=function(e){switch(e){case kn.POSITION:case kn.NORMAL:case kn.TANGENT:return"vec3";case kn.TEXCOORD:return"vec2";case kn.COLOR:return"vec4";case kn.JOINTS:return"ivec4";case kn.WEIGHTS:return"vec4";case kn.FEATURE_ID:return"int";case kn.SCALE:return"vec3";case kn.ROTATION:return"vec4";case kn.OPACITY:return"float"}};kn.getVariableName=function(e,t){let n=rDe(e);return l(t)&&(n+=`_${t}`),n};var at=Object.freeze(kn);function r0(e){e=e??Q.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.draco,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;this._resourceCache=t,this._gltfResource=r,this._baseResource=s,this._gltf=n,this._primitive=i,this._draco=o,this._cacheKey=a,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=ft.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(r0.prototype=Object.create(Oi.prototype),r0.prototype.constructor=r0);Object.defineProperties(r0.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function sDe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=ft.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Kae(e,n)}}r0.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=ft.LOADING,this._promise=sDe(this),this._promise)};function Kae(e,t){throw e.unload(),e._state=ft.FAILED,e.getError("Failed to load Draco",t)}async function aDe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=ft.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var rC={};rC[at.POSITION]="POSITION";rC[at.NORMAL]="NORMAL";rC[at.COLOR]="COLOR";rC[at.TEXCOORD]="TEX_COORD";function cDe(e){for(let t in rC)if(rC.hasOwnProperty(t)&&e.startsWith(t))return rC[t]}r0.prototype.process=function(e){if(this._state===ft.READY)return!0;if(this._state!==ft.PROCESSING||(l(this._dracoError)&&Kae(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,n=this._primitive,i=this._gltf,o=i.bufferViews,r=t.bufferView,s=o[r],a=t.attributes,c=[];for(let h in n.attributes)if(n.attributes.hasOwnProperty(h)){let p=cDe(h);l(p)&&i.accessors[n.attributes[h]].componentType===J.FLOAT&&(c.includes(p)||c.push(p))}let d={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:c},u=QA.decodeBufferView(d);if(!l(u))return!1;this._decodePromise=aDe(this,u)};r0.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0};var _S=r0;var Lgn=y(x(),1);var Egn=y(x(),1);function lDe(e){let{uint8Array:t,format:n,request:i}=e,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return Ge.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ge.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ge({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var OA=lDe;function zA(e){e=e??Q.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,d=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=d,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(zA.prototype=Object.create(Oi.prototype),zA.prototype.constructor=zA);Object.defineProperties(zA.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});zA.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=dDe(this),this._promise):(this._promise=uDe(this),this._promise)};function Jae(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function dDe(e){e._state=ft.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await hDe(i);if(e.isDestroyed())return;let r=Jae(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=ft.READY,e}catch(n){return e.isDestroyed()?void 0:jae(e,n,"Failed to load embedded image")}}async function uDe(e){e._state=ft.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await pDe(i);if(e.isDestroyed())return;let r=Jae(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=ft.READY,e}catch(o){return e.isDestroyed()?void 0:jae(e,o,`Failed to load image: ${n}`)}}function jae(e,t,n){return e.unload(),e._state=ft.FAILED,Promise.reject(e.getError(n,t))}function mDe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new he("Image format is not recognized")}async function hDe(e){let t=mDe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return nd(n)}return zA._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var fDe=/(^data:image\/ktx2)|(\.ktx2$)/i;function pDe(e){let t=e.getUrlComponent(!1,!0);return fDe.test(t)?nd(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}zA.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};zA._loadImageFromTypedArray=OA;var ZS=zA;var Qgn=y(x(),1);var Fgn=y(x(),1),ADe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},yc=Object.freeze(ADe);function s0(e){e=e??Q.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,c=e.cacheKey,d=e.asynchronous??!0,u=e.loadBuffer??!1,h=e.loadTypedArray??!1,p=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=p,this._primitive=s,this._draco=a,this._cacheKey=c,this._asynchronous=d,this._loadBuffer=u,this._loadTypedArray=h,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(s0.prototype=Object.create(Oi.prototype),s0.prototype.constructor=s0);Object.defineProperties(s0.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var gDe=new jH;s0.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=bDe(this),this._promise):(this._promise=yDe(this),this._promise)};async function bDe(e){e._state=ft.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=ft.LOADED,e)}catch(n){if(e.isDestroyed())return;JH(e,n)}}async function yDe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=ft.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=xDe(e,a),e._state=ft.PROCESSING,e}catch(s){if(e.isDestroyed())return;JH(e,s)}}function xDe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Pe.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let h=r*a,p=new Uint8Array(c,d,h);c=new Uint8Array(p).buffer,d=0,Ms("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Pe.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Pe.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Pe.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function JH(e,t){throw e.unload(),e._state=ft.FAILED,e.getError("Failed to load index buffer",t)}function jH(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}jH.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};jH.prototype.execute=function(){this.buffer=qae(this.typedArray,this.indexDatatype,this.context)};function qae(e,t,n){let i=mt.createIndexBuffer({typedArray:e,context:n,usage:Xe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}s0.prototype.process=function(e){if(this._state===ft.READY)return!0;if(this._state!==ft.LOADED&&this._state!==ft.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=J.fromTypedArray(t),this._indexDatatype=n)}catch(o){JH(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=gDe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,yc.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=qae(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=ft.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};s0.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0};var RS=s0;var zyn=y(x(),1);var fbn=y(x(),1);var zgn=y(x(),1);function CDe(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var ia=CDe;var ebn=y(x(),1);var Jgn=y(x(),1);function EDe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var wr=EDe;function nn(){}nn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};nn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};nn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?nn.objectLegacy(i,n):nn.object(i,n)};nn.accessor=function(e,t){return nn.topLevel(e,"accessors",t)};nn.accessorWithSemantic=function(e,t,n){let i={};return nn.mesh(e,function(o){return nn.meshPrimitive(o,function(r){let s=nn.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let d=n(a);if(l(d))return d}});return l(s)?s:nn.meshPrimitiveTarget(r,function(a){return nn.meshPrimitiveTargetAttribute(a,function(c,d){if(d.indexOf(t)===0&&!l(i[c])){i[c]=!0;let u=n(c);if(l(u))return u}})})})})};nn.accessorContainingVertexAttributeData=function(e,t){let n={};return nn.mesh(e,function(i){return nn.meshPrimitive(i,function(o){let r=nn.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:nn.meshPrimitiveTarget(o,function(s){return nn.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};nn.accessorContainingIndexData=function(e,t){let n={};return nn.mesh(e,function(i){return nn.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};nn.animation=function(e,t){return nn.topLevel(e,"animations",t)};nn.animationChannel=function(e,t){let n=e.channels;return nn.object(n,t)};nn.animationSampler=function(e,t){let n=e.samplers;return nn.object(n,t)};nn.buffer=function(e,t){return nn.topLevel(e,"buffers",t)};nn.bufferView=function(e,t){return nn.topLevel(e,"bufferViews",t)};nn.camera=function(e,t){return nn.topLevel(e,"cameras",t)};nn.image=function(e,t){return nn.topLevel(e,"images",t)};nn.material=function(e,t){return nn.topLevel(e,"materials",t)};nn.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.mesh=function(e,t){return nn.topLevel(e,"meshes",t)};nn.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};nn.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};nn.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};nn.node=function(e,t){return nn.topLevel(e,"nodes",t)};nn.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let d=a.children;if(l(d)&&(c=nn.nodeInTree(e,d,n),l(c)))return c}}}};nn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return nn.nodeInTree(e,i,n)};nn.program=function(e,t){return wr(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.programs,t):nn.topLevel(e,"programs",t)};nn.sampler=function(e,t){return nn.topLevel(e,"samplers",t)};nn.scene=function(e,t){return nn.topLevel(e,"scenes",t)};nn.shader=function(e,t){return wr(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.shaders,t):nn.topLevel(e,"shaders",t)};nn.skin=function(e,t){return nn.topLevel(e,"skins",t)};nn.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};nn.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.technique=function(e,t){return wr(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.techniques,t):nn.topLevel(e,"techniques",t)};nn.texture=function(e,t){return nn.topLevel(e,"textures",t)};var Ye=nn;var abn=y(x(),1);var nbn=y(x(),1);function TDe(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}}var qd=TDe;function SDe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return J.getSizeInBytes(t.componentType)*qd(t.type)}var ud=SDe;function IDe(e){Ye.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Ye.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Ye.mesh(e,function(n){Ye.meshPrimitive(n,function(i){if(i.mode=i.mode??ne.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=ia(e.materials,o)}})}),Ye.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,l(o)){let r=e.bufferViews[o];r.byteStride=ud(e,i),r.target=ne.ARRAY_BUFFER}}),Ye.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ne.ELEMENT_ARRAY_BUFFER}}),Ye.material(e,function(n){let i=n.extensions??{},o=i.KHR_materials_common;if(l(o)){let c=o.technique,d=l(o.values)?o.values:{};o.values=d,d.ambient=l(d.ambient)?d.ambient:[0,0,0,1],d.emission=l(d.emission)?d.emission:[0,0,0,1],d.transparency=d.transparency??1,c!=="CONSTANT"&&(d.diffuse=l(d.diffuse)?d.diffuse:[0,0,0,1],c!=="LAMBERT"&&(d.specular=l(d.specular)?d.specular:[0,0,0,1],d.shininess=d.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;l(r)&&Ye.materialValue(n,function(c){l(c.index)&&sC(c)}),sC(n.emissiveTexture),sC(n.normalTexture),sC(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,sC(s.baseColorTexture),sC(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,sC(a.specularGlossinessTexture))}),Ye.animation(e,function(n){Ye.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=_De(e);return Ye.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),Ye.sampler(e,function(n){n.wrapS=n.wrapS??ne.REPEAT,n.wrapT=n.wrapT??ne.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function _De(e){let t={};return Ye.animation(e,function(n){Ye.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function sC(e){l(e)&&(e.texCoord=e.texCoord??0)}var rW=IDe;var bbn=y(x(),1);function ZDe(e){return Ye.shader(e,function(t){Xv(t)}),Ye.buffer(e,function(t){Xv(t)}),Ye.image(e,function(t){Xv(t)}),Xv(e),e}function Xv(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var a0=ZDe;var Fbn=y(x(),1);var Ibn=y(x(),1);var Cbn=y(x(),1);function RDe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var sW=RDe;function GDe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),sW(e,t),n.length===0&&delete e.extensionsUsed}}var aC=GDe;var VDe=4;function LDe(e){if(Zh(e)!=="glTF")throw new he("File is not valid binary glTF");let n=$ae(e,0,5),i=n[1];if(i!==1&&i!==2)throw new he("Binary glTF version is not 1 or 2");return i===1?WDe(e,n):FDe(e,n)}function $ae(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*VDe,!0);return o}function WDe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new he("Binary glTF scene format is not JSON");let r=20,s=r+i,a=cd(e,r,i),c=JSON.parse(a);a0(c);let d=e.subarray(s,n),u=c.buffers;if(l(u)&&Object.keys(u).length>0){let h=u.binary_glTF??u.KHR_binary_glTF;l(h)&&(h.extras._pipeline.source=d,delete h.uri)}return aC(c,"KHR_binary_glTF"),c}function FDe(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=$ae(e,i,2),a=s[0],c=s[1];i+=8;let d=e.subarray(i,i+a);if(i+=a,c===1313821514){let u=cd(d);o=JSON.parse(u),a0(o)}else c===5130562&&(r=d)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var cC=LDe;var Nbn=y(x(),1);function BDe(e){return Ye.shader(e,function(t){Pv(t)}),Ye.buffer(e,function(t){Pv(t)}),Ye.image(e,function(t){Pv(t)}),Pv(e),e}function Pv(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var aW=BDe;var pyn=y(x(),1);var Ubn=y(x(),1);function wDe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),ia(n,t,!0)}var lm=wDe;var jbn=y(x(),1);var kbn=y(x(),1);function YDe(e){switch(e){case J.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case J.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case J.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case J.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case J.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case J.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case J.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case J.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var HA=YDe;function NDe(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=qd(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],d=c.buffer,h=i[d].extras._pipeline.source,p=t.count,g=ud(e,t),f=t.byteOffset+c.byteOffset+h.byteOffset,b=t.componentType,C=J.getSizeInBytes(b),E=new DataView(h.buffer),T=new Array(r),S=HA(b);for(let _=0;_<p;_++){S(E,f,r,C,T);for(let R=0;R<r;R++){let L=T[R];s[R]=Math.min(s[R],L),a[R]=Math.max(a[R],L)}f+=g}return{min:s,max:a}}var lC=NDe;var i0n=y(x(),1);var XDe=[ne.FUNC_ADD,ne.FUNC_ADD],PDe=[ne.ONE,ne.ZERO,ne.ONE,ne.ZERO];function ece(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var MDe=[ne.ZERO,ne.ONE,ne.SRC_COLOR,ne.ONE_MINUS_SRC_COLOR,ne.SRC_ALPHA,ne.ONE_MINUS_SRC_ALPHA,ne.DST_ALPHA,ne.ONE_MINUS_DST_ALPHA,ne.DST_COLOR,ne.ONE_MINUS_DST_COLOR];function UDe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(MDe.indexOf(e[n])===-1)return t;return e}function DDe(e){let t={},n={},i=e.techniques;return l(i)&&(Ye.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(ece(s,ne.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??XDe,blendFactors:UDe(c.blendFuncSeparate,PDe)})}ece(s,ne.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),lm(e,"KHR_blend")),Ye.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Ye.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var cW=DDe;var p0n=y(x(),1);var c0n=y(x(),1);function vDe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),ia(n,t,!0),lm(e,t)}var lW=vDe;function kDe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Ye.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(Ye.techniqueAttribute(a,function(h,p){u=a.parameters[h],d.attributes[p]={semantic:u.semantic}}),Ye.techniqueUniform(a,function(h,p){u=a.parameters[h],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},l(n[c])||(n[c]={}),n[c][h]=p}),l(o[a.program]))d.program=o[a.program];else{let h=e.programs[a.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[h.fragmentShader];p.fragmentShader=ia(r.shaders,g,!0);let f=e.shaders[h.vertexShader];p.vertexShader=ia(r.shaders,f,!0),d.program=ia(r.programs,p),o[a.program]=d.program}i[c]=ia(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,lm(e,"KHR_techniques_webgl"),lW(e,"KHR_techniques_webgl"))}return Ye.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Ye.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var dW=kDe;var _0n=y(x(),1);var x0n=y(x(),1);function QDe(e,t){Xo.typeOf.object("material",e),Xo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,d=t(c.index,c);if(l(d))return d}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,d=t(c.index,c);if(l(d))return d}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:d}=s;if(l(c)){let u=t(c.index,c);if(l(u))return u}if(l(d)){let u=t(d.index,d);if(l(u))return u}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:d,emission:u,specular:h}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(h)&&l(h.index)){let p=t(h.index,h);if(l(p))return p}}}let o=Ye.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var GS=QDe;var tce=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function ODe(e,t){return t=t??tce,tce.forEach(function(n){t.indexOf(n)>-1&&HDe(e,n)}),e}var zDe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function HDe(e,t){let n=zDe[t],i=e[n];if(l(i)){let o=0,r=ip[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(np[t](e,a-o),o++)}}function np(){}np.accessor=function(e,t){e.accessors.splice(t,1),Ye.mesh(e,function(i){Ye.meshPrimitive(i,function(o){Ye.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Ye.meshPrimitiveTarget(o,function(a){Ye.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Ye.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Ye.animation(e,function(i){Ye.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};np.buffer=function(e,t){e.buffers.splice(t,1),Ye.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};np.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Ye.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ye.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ye.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),wr(e,"KHR_draco_mesh_compression")&&Ye.mesh(e,function(i){Ye.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),wr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.bufferView)&&d.bufferView>t&&d.bufferView--,l(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,l(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(wr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];l(u.values)&&u.values>t&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};np.image=function(e,t){e.images.splice(t,1),Ye.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};np.mesh=function(e,t){e.meshes.splice(t,1),Ye.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};np.node=function(e,t){e.nodes.splice(t,1),Ye.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Ye.animation(e,function(i){Ye.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Ye.technique(e,function(i){Ye.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Ye.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Ye.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};np.material=function(e,t){e.materials.splice(t,1),Ye.mesh(e,function(i){Ye.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};np.sampler=function(e,t){e.samplers.splice(t,1),Ye.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};np.texture=function(e,t){if(e.textures.splice(t,1),Ye.material(e,function(i){GS(i,function(o,r){r.index>t&&--r.index})}),wr(e,"EXT_feature_metadata")){Ye.mesh(e,function(r){Ye.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let h=0;h<u;++h){let g=d[h].featureIds.texture;g.index>t&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(wr(e,"EXT_mesh_features")&&Ye.mesh(e,function(i){Ye.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;d<c;++d){let u=a[d];l(u.texture)&&u.texture.index>t&&--u.texture.index}}}})}),wr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];u.index>t&&--u.index}}}}};function ip(){}ip.accessor=function(e){let t={};return Ye.mesh(e,function(n){Ye.meshPrimitive(n,function(i){Ye.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Ye.meshPrimitiveTarget(i,function(r){Ye.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Ye.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Ye.animation(e,function(n){Ye.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),wr(e,"EXT_mesh_gpu_instancing")&&Ye.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),wr(e,"CESIUM_primitive_outline")&&Ye.mesh(e,function(n){Ye.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};ip.buffer=function(e){let t={};return Ye.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};ip.bufferView=function(e){let t={};if(Ye.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ye.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ye.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),wr(e,"KHR_draco_mesh_compression")&&Ye.mesh(e,function(n){Ye.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),wr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(wr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.values)&&(t[d.values]=!0),l(d.arrayOffsets)&&(t[d.arrayOffsets]=!0),l(d.stringOffsets)&&(t[d.stringOffsets]=!0)}}}}return t};ip.image=function(e){let t={};return Ye.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};ip.mesh=function(e){let t={};return Ye.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function nce(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!nce(e,o,n)}).length===0}ip.node=function(e){let t={};return Ye.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Ye.skinJoint(n,function(i){t[i]=!0})}),Ye.animation(e,function(n){Ye.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Ye.technique(e,function(n){Ye.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Ye.node(e,function(n,i){nce(e,i,t)||(t[i]=!0)}),t};ip.material=function(e){let t={};return Ye.mesh(e,function(n){Ye.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};ip.texture=function(e){let t={};if(Ye.material(e,function(n){GS(n,function(i){t[i]=!0})}),wr(e,"EXT_feature_metadata")){Ye.mesh(e,function(o){Ye.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;u<d;++u){let p=c[u].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].texture;t[d.index]=!0}}}}if(wr(e,"EXT_mesh_features")&&Ye.mesh(e,function(n){Ye.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let d=s[c];l(d.texture)&&(t[d.texture.index]=!0)}}}})}),wr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];t[d.index]=!0}}}}return t};ip.sampler=function(e){let t={};return Ye.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var uW=ODe;var v0n=y(x(),1);var G0n=y(x(),1);function KDe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:ia(e.buffers,n),byteOffset:0,byteLength:t.length};return ia(e.bufferViews,o)}var mW=KDe;var Y0n=y(x(),1);function JDe(e,t){let n=ud(e,t),i=J.getSizeInBytes(t.componentType),o=qd(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,d=t.byteOffset+a.byteOffset+c.byteOffset,u=new DataView(c.buffer),h=new Array(o),p=HA(t.componentType);for(let g=0;g<r;++g){p(u,d,o,i,h);for(let f=0;f<o;++f)s[g*o+f]=h[f];d+=n}return s}var hW=JDe;function jDe(e){let t;return Ye.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?Mv(e,i,J.UNSIGNED_BYTE):t!==ne.UNSIGNED_BYTE&&t!==ne.UNSIGNED_SHORT&&Mv(e,i,J.UNSIGNED_SHORT)}),Ye.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?Mv(e,i,J.UNSIGNED_BYTE):t===ne.SHORT&&Mv(e,i,J.UNSIGNED_SHORT)}),e}function Mv(e,t,n){let i=J.createTypedArray(n,hW(e,t)),o=new Uint8Array(i.buffer);t.bufferView=mW(e,o),t.componentType=n,t.byteOffset=0}var fW=jDe;var H0n=y(x(),1);function qDe(e,t){return aC(e,t),t==="CESIUM_RTC"&&$De(e),qH(e,t)}function $De(e){Ye.technique(e,function(t){Ye.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function qH(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)qH(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&qH(e[o],t);return i}}var dC=qDe;var Uv={.8:rve,"1.0":_ve,"2.0":void 0};function eve(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(Uv,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(Uv,i)||(i="1.0"));let o=Uv[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=Uv[i];return t.keepLegacyExtensions||(Gve(e,t),Vve(e)),e}function rce(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function tve(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.primitive??ne.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function nve(e){let t=e.nodes,n=new m,i=new Me;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;m.fromArray(a,0,n),Me.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function ive(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new m,a=new Me;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let d=t[c],u=d.channels,h=d.parameters,p=d.samplers;if(l(u)){let g=u.length;for(let f=0;f<g;++f){let b=u[f];if(b.target.path==="rotation"){let C=h[p[b.sampler].output];if(l(r[C]))continue;r[C]=!0;let E=n[C],T=i[E.bufferView],_=o[T.buffer].extras._pipeline.source,R=_.byteOffset+T.byteOffset+E.byteOffset,L=E.componentType,W=E.count,B=qd(E.type),Y=E.count*B,N=J.createArrayBufferView(L,_.buffer,R,Y);for(let A=0;A<W;A++){let I=A*B;m.unpack(N,I,s);let Z=N[I+3];Me.fromAxisAngle(s,Z,a),Me.pack(a,N,I)}}}}}}function ove(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function rve(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,rce(e),tve(e),nve(e),ive(e),ove(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,lm(e,"KHR_materials_common")}}function sve(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function ice(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function ave(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=ice(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Ye.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Ye.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Ye.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Ye.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Ye.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Ye.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Ye.mesh(e,function(s){Ye.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Ye.meshPrimitiveAttribute(a,function(c,d){a.attributes[d]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Ye.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,d=c.length;if(d>0)for(s.mesh=n.meshes[c[0]],t=1;t<d;++t){let u={mesh:n.meshes[c[t]]},h=ia(e.nodes,u);l(a)||(a=[],s.children=a),a.push(h)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Ye.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t<d;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Ye.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Ye.animation(e,function(s){let a={};s.samplers=ice(s.samplers,a),Ye.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Ye.animationChannel(s,function(c){c.sampler=a[c.sampler];let d=c.target;l(d)&&(d.node=n.nodes[d.id],delete d.id)})}),Ye.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Ye.materialValue(s,function(c,d){typeof c=="string"&&(s.values[d]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Ye.materialValue(c,function(d,u){typeof d=="string"&&(c.values[u]={index:n.textures[d]})})}}),Ye.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Ye.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function cve(e){Ye.animation(e,function(t){Ye.animationSampler(t,function(n){delete n.name})})}function lve(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Ye.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function dve(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var uve={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function mve(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(uve[o])&&e.extensionsRequired.push(o)}}}function hve(e){Ye.buffer(e,function(t){delete t.type})}function fve(e){Ye.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function pve(e){Ye.mesh(e,function(t){Ye.meshPrimitive(t,function(n){Ye.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Ye.technique(e,function(t){Ye.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var Ave={POSITION:!0,NORMAL:!0,TANGENT:!0},gve={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function bve(e){let t={};Ye.mesh(e,function(n){Ye.meshPrimitive(n,function(i){Ye.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=gve[a];l(u)?(d=u+c,t[r]=d):l(Ave[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Ye.technique(e,function(n){Ye.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function yve(e){Ye.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function eK(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:ud(e,t)}function xve(e){Ye.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Ye.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=eK(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function Cve(e){let t,n,i,o=e.bufferViews,r={};Ye.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Ye.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let d=0,u=0,h=c.length;for(t=0;t<h;++t){let p=c[t],g=eK(e,p),f=p.byteOffset,b=p.count*g;delete p.byteStride;let C=t<h-1,E=C?eK(e,c[t+1]):void 0;if(g!==E){let T=Qe(i,!0);r[a]&&(T.byteStride=g),T.byteOffset+=d,T.byteLength=f+b-d;let S=ia(o,T);for(n=u;n<=t;++n)p=c[n],p.bufferView=S,p.byteOffset=p.byteOffset-d;d=C?c[t+1].byteOffset:void 0,u=t+1}}}uW(e,["accessor","bufferView","buffer"])}function Eve(e){Ye.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=lC(e,n);n.min=i.min,n.max=i.max}})}function sce(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||m.fromArray(e.translation).equals(m.ZERO))&&(!l(e.scale)||m.fromArray(e.scale).equals(new m(1,1,1)))&&(!l(e.rotation)||ce.fromArray(e.rotation).equals(new ce(0,0,0,1)))&&(!l(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function ace(e,t){Ye.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Ye.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),sce(n)&&ace(e,i))}}),delete e.nodes[t]}function Tve(e){return Ye.node(e,function(t,n){sce(t)&&ace(e,n)}),e}function Sve(e){Ye.animation(e,function(t){Ye.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=lC(e,i);i.min=o.min,i.max=o.max}})})}function Ive(e){Ye.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=lC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function _ve(e){e.asset=e.asset??{},e.asset.version="2.0",rce(e),sve(e),Tve(e),ave(e),cve(e),dve(e),mve(e),xve(e),Cve(e),Eve(e),Sve(e),Ive(e),hve(e),fve(e),pve(e),bve(e),fW(e),yve(e),cW(e),dW(e),lve(e)}var Zve=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],Rve=["u_diffuse","u_diffuse_mat"];function tK(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function nK(e){return l(e.index)}function iK(e){return Array.isArray(e)&&e.length===4}function cce(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function Gve(e,t){t=t??{};let n=t.baseColorTextureNames??Zve,i=t.baseColorFactorNames??Rve;Ye.material(e,function(o){Ye.materialValue(o,function(r,s){n.indexOf(s)!==-1&&nK(r)?(tK(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&iK(r)&&(tK(o),o.pbrMetallicRoughness.baseColorFactor=cce(r))})}),dC(e,"KHR_techniques_webgl"),dC(e,"KHR_blend")}function $H(e,t){l(t)&&(iK(t)?e.pbrMetallicRoughness.baseColorFactor=cce(t):nK(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function oce(e,t){l(t)&&(iK(t)?e.emissiveFactor=t.slice(0,3):nK(t)&&(e.emissiveTexture=t))}function Vve(e){Ye.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;tK(t),n.technique==="CONSTANT"?(lm(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},$H(t,s),$H(t,o)):($H(t,r),oce(t,o),oce(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),dC(e,"KHR_materials_common")}var pW=eve;var Ryn=y(x(),1);function Pc(){}Pc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
${n.message}`);let o=new he(i);return l(n)&&(o.stack=`Original stack:
${n.stack}
Handler stack:
${o.stack}`),o};Pc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:Me.IDENTITY,l(e.scale)?e.scale:m.ONE)};Pc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Pc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};Pc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Pc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};Pc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=at.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=Ut.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),d;return c&&(d=r?"vec4":Ut.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:d}};var Lve=new m,Wve=new m;Pc.getPositionMinMax=function(e,t,n){let i=Pc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=m.add(r,t,Wve),o=m.add(o,n,Lve)),{min:r,max:o}};Pc.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===to.Y?n=F.clone(to.Y_UP_TO_Z_UP,n):e===to.X&&(n=F.clone(to.X_UP_TO_Z_UP,n)),t===to.Z&&(n=F.multiplyTransformation(n,to.Z_UP_TO_X_UP,n)),n};var Fve=new $;Pc.getCullFace=function(e,t){if(!Be.isTriangles(t))return wi.BACK;let n=F.getMatrix3(e,Fve);return $.determinant(n)<0?wi.FRONT:wi.BACK};Pc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Pc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};Pc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Pc.supportedExtensions[i])throw new he(`Unsupported glTF Extension: ${i}`)}};var Xt=Pc;function c0(e){e=e??Q.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(c0.prototype=Object.create(Oi.prototype),c0.prototype.constructor=c0);Object.defineProperties(c0.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});c0.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=ft.LOADING,l(this._gltfJson)?(this._promise=lce(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=dce(this,this._typedArray),this._promise):(this._promise=Bve(this),this._promise))};async function Bve(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;oK(e,n)}return dce(e,t)}function oK(e,t){e.unload(),e._state=ft.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function wve(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!wr(t,"KHR_techniques_webgl")&&!wr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Ye.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),pW(t)}function Yve(e){let t=[];return Ye.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&ch(i)&&(delete n.uri,t.push(Ge.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function Nve(e,t){let n=[];return Ye.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function lce(e,t){try{a0(t),await Yve(t),await wve(e,t),rW(t),await Nve(e,t),aW(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new he(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Xt.checkSupportedExtensions(i),e._gltf=t,e._state=ft.READY,e}catch(n){if(e.isDestroyed())return;oK(e,n)}}async function dce(e,t){let n;try{Zh(t)==="glTF"?n=cC(t):n=Cr(t)}catch(i){if(e.isDestroyed())return;oK(e,i)}return lce(e,n)}c0.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};c0.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var VS=c0;var Vxn=y(x(),1);var hxn=y(x(),1);var nxn=y(x(),1);var Kyn=y(x(),1),Xve={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},op=Object.freeze(Xve);var Ho={};function Pve(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function Mve(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function Uve(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function Dve(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function vve(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function kve(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function Qve(){this.attributes=[]}function Ove(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0}function zve(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function Hve(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function Kve(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function Jve(){this.nodes=[]}var jve={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function qve(){this.input=[],this.interpolation=void 0,this.output=[]}function $ve(){this.node=void 0,this.path=void 0}function eke(){this.sampler=void 0,this.target=void 0}function tke(){this.name=void 0,this.samplers=[],this.channels=[]}function nke(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function ike(){this.name=void 0,this.stages=[]}function uce(){this.credits=[]}function oke(){this.asset=new uce,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=F.clone(F.IDENTITY),this.extensions={}}function rke(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0}function l0(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ce.clone(l0.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=l0.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=l0.DEFAULT_ROUGHNESS_FACTOR}l0.DEFAULT_BASE_COLOR_FACTOR=ce.ONE;l0.DEFAULT_METALLIC_FACTOR=1;l0.DEFAULT_ROUGHNESS_FACTOR=1;function uC(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ce.clone(uC.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=m.clone(uC.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=uC.DEFAULT_GLOSSINESS_FACTOR}uC.DEFAULT_DIFFUSE_FACTOR=ce.ONE;uC.DEFAULT_SPECULAR_FACTOR=m.ONE;uC.DEFAULT_GLOSSINESS_FACTOR=1;function AW(){this.specularFactor=AW.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=m.clone(AW.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}AW.DEFAULT_SPECULAR_FACTOR=1;AW.DEFAULT_SPECULAR_COLOR_FACTOR=m.ONE;function gW(){this.anisotropyStrength=gW.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=gW.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}gW.DEFAULT_ANISOTROPY_STRENGTH=0;gW.DEFAULT_ANISOTROPY_ROTATION=0;function bW(){this.clearcoatFactor=bW.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=bW.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}bW.DEFAULT_CLEARCOAT_FACTOR=0;bW.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function rK(){this.metallicRoughness=new l0,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=m.clone(rK.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=op.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0}rK.DEFAULT_EMISSIVE_FACTOR=m.ZERO;Ho.Quantization=Pve;Ho.Attribute=Mve;Ho.Indices=Uve;Ho.FeatureIdAttribute=Dve;Ho.FeatureIdTexture=kve;Ho.FeatureIdImplicitRange=vve;Ho.MorphTarget=Qve;Ho.Primitive=Ove;Ho.Instances=zve;Ho.Skin=Hve;Ho.Node=Kve;Ho.Scene=Jve;Ho.AnimatedPropertyType=Object.freeze(jve);Ho.AnimationSampler=qve;Ho.AnimationTarget=$ve;Ho.AnimationChannel=eke;Ho.Animation=tke;Ho.ArticulationStage=nke;Ho.Articulation=ike;Ho.Asset=uce;Ho.Components=oke;Ho.TextureReader=rke;Ho.MetallicRoughness=l0;Ho.SpecularGlossiness=uC;Ho.Specular=AW;Ho.Anisotropy=gW;Ho.Clearcoat=bW;Ho.Material=rK;var Tn=Ho;var Dv={};Dv.getImageIdFromTexture=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};Dv.createSampler=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=bn.REPEAT,r=bn.REPEAT,s=zt.LINEAR,a=ui.LINEAR,c=n.index,u=t.textures[c].sampler;if(l(u)){let h=t.samplers[u];o=h.wrapS??o,r=h.wrapT??r,s=h.minFilter??s,a=h.magFilter??a}return i&&s!==zt.LINEAR&&s!==zt.NEAREST&&(s===zt.NEAREST_MIPMAP_NEAREST||s===zt.NEAREST_MIPMAP_LINEAR?s=zt.NEAREST:s=zt.LINEAR),new Ht({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var ske=new M(1,1);Dv.createModelTextureReader=function(e){e=e??Q.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,o=t.texCoord??0,r,s=t.extensions?.KHR_texture_transform;if(l(s)){o=s.texCoord??o;let c=l(s.offset)?M.unpack(s.offset):M.ZERO,d=s.rotation??0,u=l(s.scale)?M.unpack(s.scale):ske;d=-d,r=new $(Math.cos(d)*u.x,-Math.sin(d)*u.y,c.x,Math.sin(d)*u.x,Math.cos(d)*u.y,c.y,0,0,1)}let a=new Tn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var md=Dv;var Axn=y(x(),1);function ake(e){let t=document.createElement("canvas");return t.width=V.nextPowerOfTwo(e.width),t.height=V.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var d0=ake;function u0(e){e=e??Q.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=e.asynchronous??!0,d=i.index,u=md.getImageIdFromTexture({gltf:n,textureId:d,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=u,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(u0.prototype=Object.create(Oi.prototype),u0.prototype.constructor=u0);Object.defineProperties(u0.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var cke=new sK;async function lke(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=ft.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=ft.FAILED,e.getError("Failed to load texture",n)}}u0.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=ft.LOADING,this._promise=lke(this),this._promise)};function sK(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}sK.prototype.set=function(e,t,n,i,o,r){this.gltf=e,this.textureInfo=t,this.textureId=n,this.image=i,this.mipLevels=o,this.context=r};sK.prototype.execute=function(){this.texture=mce(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function mce(e,t,n,i,o,r){let s=i.internalFormat,a=!1;je.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=md.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),d=c.minificationFilter,u=c.wrapS,h=c.wrapT,p=d===zt.NEAREST_MIPMAP_NEAREST||d===zt.NEAREST_MIPMAP_LINEAR||d===zt.LINEAR_MIPMAP_NEAREST||d===zt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,f=g||u===bn.REPEAT||u===bn.MIRRORED_REPEAT||h===bn.REPEAT||h===bn.MIRRORED_REPEAT,b=!V.isPowerOfTwo(i.width)||!V.isPowerOfTwo(i.height),C=f&&b,E;return l(s)?(!r.webgl2&&je.isCompressedFormat(s)&&b&&f&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),E=Wt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(C&&(i=d0(i)),E=Wt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&E.generateMipmap(),E}u0.prototype.process=function(e){if(this._state===ft.READY)return!0;if(this._state!==ft.LOADED&&this._state!==ft.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=ft.PROCESSING;let t;if(this._asynchronous){let n=cke;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,yc.TEXTURE))return;t=n.texture}else t=mce(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=ft.READY,this._resourceCache.statistics.addTextureLoader(this),!0};u0.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var LS=u0;var Dxn=y(x(),1);function m0(e){e=e??Q.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.primitive,a=e.draco,c=e.attributeSemantic,d=e.accessorId,u=e.cacheKey,h=e.spz,p=e.asynchronous??!0,g=e.loadBuffer??!1,f=e.loadTypedArray??!1;this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._primitive=s,this._draco=a,this._spz=h,this._attributeSemantic=c,this._accessorId=d,this._cacheKey=u,this._asynchronous=p,this._loadBuffer=g,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(m0.prototype=Object.create(Oi.prototype),m0.prototype.constructor=m0);Object.defineProperties(m0.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function dke(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}m0.prototype.load=async function(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=mke(this),this._promise):dke(this._draco,this._attributeSemantic)?(this._promise=Ake(this),this._promise):(this._promise=bke(this),this._promise)};function uke(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Tn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=Ut.VEC2,a.normalizationRange=r;else{let c=Ut.getMathType(i);if(c===Number){let d=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=d,a.normalizationRange=r,a.quantizedVolumeStepSize=d*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let d=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(d);let u=d.map(function(h){return h*s});a.quantizedVolumeStepSize=c.unpack(u)}}return a}async function mke(e){e._state=ft.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=ft.LOADED,e)}catch{if(e.isDestroyed())return}}function hke(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function fke(e){let t=hke(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),s=parseInt(e.slice(o+n.length),10);return{l:r,n:s}}function pke(e){e._state=ft.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,o=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let r=0;r<i.length/3;r++)e._typedArray[r*4]=V.clamp(i[r*3]*255,0,255),e._typedArray[r*4+1]=V.clamp(i[r*3+1]*255,0,255),e._typedArray[r*4+2]=V.clamp(i[r*3+2]*255,0,255),e._typedArray[r*4+3]=V.clamp(o[r]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:o}=fke(e._attributeSemantic),r=n.shDegree,s=0,a=[0,9,24];switch(r){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}let c=n.numPoints,d=n.sh;e._typedArray=new Float32Array(c*3);for(let u=0;u<c;u++){let h=u*s+a[i-1]+o*3;e._typedArray[u*3]=d[h],e._typedArray[u*3+1]=d[h+1],e._typedArray[u*3+2]=d[h+2]}}}async function Ake(e){e._state=ft.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=ft.LOADED,e)}catch{if(e.isDestroyed())return;vv(e)}}function gke(e){e._state=ft.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,d=o.data.quantization;l(d)&&(e._quantization=uke(d,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function bke(e){e._state=ft.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=ft.PROCESSING,e)}catch(n){if(e.isDestroyed())return;vv(e,n)}}function vv(e,t){throw e.unload(),e._state=ft.FAILED,e.getError("Failed to load vertex buffer",t)}function aK(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}aK.prototype.set=function(e,t){this.typedArray=e,this.context=t};aK.prototype.execute=function(){this.buffer=hce(this.typedArray,this.context)};function hce(e,t){let n=mt.createVertexBuffer({typedArray:e,context:t,usage:Xe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var yke=new aK;m0.prototype.process=function(e){if(this._state===ft.READY)return!0;if(this._state!==ft.LOADED&&this._state!==ft.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){vv(this,i)}gke(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(e))return!1}catch(i){vv(this,i)}pke(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=yke;if(i.set(n,e.context),!e.jobScheduler.execute(i,yc.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=hce(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=ft.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};m0.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),l(this._spzLoader)&&e.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0};var WS=m0;var $xn=y(x(),1);var kxn=y(x(),1),fce={};async function xke(e={}){var t,n,i=e,o=typeof window=="object",r=typeof WorkerGlobalScope<"u",s=typeof process=="object"&&((t=process.versions)==null?void 0:t.node)&&process.type!="renderer";if(s){let{createRequire:ae}=await Promise.resolve().then(()=>Ike);var a=ae(fce.url)}var c="./this.program",d=fce.url,u;if(s){var h=a("fs");d.startsWith("file:")&&a("path").dirname(a("url").fileURLToPath(d)),u=ae=>(ae=C(ae)?new URL(ae):ae,h.readFileSync(ae)),1<process.argv.length&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2)}else if(o||r){try{new URL(".",d)}catch{}r&&(u=ae=>{var re=new XMLHttpRequest;return re.open("GET",ae,!1),re.responseType="arraybuffer",re.send(null),new Uint8Array(re.response)})}var p=console.log.bind(console),g=console.error.bind(console),f,b=!1,C=ae=>ae.startsWith("file://"),E,T,S,_,R,L,W,B,Y,N,A,I,Z,G=!1;function w(){var ae=S.buffer;_=new Int8Array(ae),L=new Int16Array(ae),i.HEAPU8=R=new Uint8Array(ae),W=new Uint16Array(ae),B=new Int32Array(ae),Y=new Uint32Array(ae),i.HEAPF32=N=new Float32Array(ae),A=new Float64Array(ae),I=new BigInt64Array(ae),Z=new BigUint64Array(ae)}var X=0,v=null;function U(ae){var re;throw(re=i.onAbort)==null||re.call(i,ae),ae="Aborted("+ae+")",g(ae),b=!0,ae=new WebAssembly.RuntimeError(ae+". Build with -sASSERTIONS for more info."),T?.(ae),ae}var k;async function P(ae){if(!ArrayBuffer.isView(ae))if(ae==k&&f)ae=new Uint8Array(f);else if(u)ae=u(ae);else throw"both async and sync fetching of the wasm failed";return ae}async function O(ae){var re=k;try{var Ie=await P(re);return await WebAssembly.instantiate(Ie,ae)}catch(Ze){g(`failed to asynchronously prepare wasm: ${Ze}`),U(Ze)}}async function H(ae){return O(ae)}var ee=ae=>{for(;0<ae.length;)ae.shift()(i)},z=[],te=[],q=()=>{var ae=i.preRun.shift();te.push(ae)},me=ae=>{if(s)return ae=Buffer.from(ae,"base64"),new Uint8Array(ae.buffer,ae.byteOffset,ae.length);for(var re,Ie,Ze=0,He=0,xt=ae.length,dt=new Uint8Array((3*xt>>2)-(ae[xt-2]=="=")-(ae[xt-1]=="="));Ze<xt;Ze+=4,He+=3)re=aA[ae.charCodeAt(Ze+1)],Ie=aA[ae.charCodeAt(Ze+2)],dt[He]=aA[ae.charCodeAt(Ze)]<<2|re>>4,dt[He+1]=re<<4|Ie>>2,dt[He+2]=Ie<<6|aA[ae.charCodeAt(Ze+3)];return dt},ye={},oe=ae=>{for(;ae.length;){var re=ae.pop();ae.pop()(re)}};function xe(ae){return this.N(Y[ae>>2])}var Ee={},Le={},Se={},Fe=class extends Error{constructor(ae){super(ae),this.name="InternalError"}},Ue=(ae,re,Ie)=>{function Ze(_t){if(_t=Ie(_t),_t.length!==ae.length)throw new Fe("Mismatched type converter count");for(var Ln=0;Ln<ae.length;++Ln)it(ae[Ln],_t[Ln])}ae.forEach(_t=>Se[_t]=re);var He=Array(re.length),xt=[],dt=0;re.forEach((_t,Ln)=>{Le.hasOwnProperty(_t)?He[Ln]=Le[_t]:(xt.push(_t),Ee.hasOwnProperty(_t)||(Ee[_t]=[]),Ee[_t].push(()=>{He[Ln]=Le[_t],++dt,dt===xt.length&&Ze(He)}))}),xt.length===0&&Ze(He)},De=ae=>{for(var re="";;){var Ie=R[ae++];if(!Ie)return re;re+=String.fromCharCode(Ie)}},Je=class extends Error{constructor(ae){super(ae),this.name="BindingError"}},St=ae=>{throw new Je(ae)};function Oe(ae,re,Ie={}){var Ze=re.name;if(!ae)throw new Je(`type "${Ze}" must have a positive integer typeid pointer`);if(Le.hasOwnProperty(ae)){if(Ie.wa)return;throw new Je(`Cannot register type '${Ze}' twice`)}Le[ae]=re,delete Se[ae],Ee.hasOwnProperty(ae)&&(re=Ee[ae],delete Ee[ae],re.forEach(He=>He()))}function it(ae,re,Ie={}){return Oe(ae,re,Ie)}var yt=(ae,re,Ie)=>{switch(re){case 1:return Ie?Ze=>_[Ze]:Ze=>R[Ze];case 2:return Ie?Ze=>L[Ze>>1]:Ze=>W[Ze>>1];case 4:return Ie?Ze=>B[Ze>>2]:Ze=>Y[Ze>>2];case 8:return Ie?Ze=>I[Ze>>3]:Ze=>Z[Ze>>3];default:throw new TypeError(`invalid integer width (${re}): ${ae}`)}},Ot=ae=>{throw new Je(ae.L.P.M.name+" instance already deleted")},Mn=!1,sn=()=>{},ut=ae=>typeof FinalizationRegistry>"u"?(ut=re=>re,ae):(Mn=new FinalizationRegistry(re=>{re=re.L,--re.count.value,re.count.value===0&&(re.S?re.W.Y(re.S):re.P.M.Y(re.O))}),ut=re=>{var Ie=re.L;return Ie.S&&Mn.register(re,{L:Ie},re),re},sn=re=>{Mn.unregister(re)},ut(ae));function Nt(){}var In=(ae,re)=>Object.defineProperty(re,"name",{value:ae}),lt={},fi=(ae,re,Ie)=>{if(ae[re].R===void 0){var Ze=ae[re];ae[re]=function(...He){if(!ae[re].R.hasOwnProperty(He.length))throw new Je(`Function '${Ie}' called with an invalid number of arguments (${He.length}) - expects one of (${ae[re].R})!`);return ae[re].R[He.length].apply(this,He)},ae[re].R=[],ae[re].R[Ze.aa]=Ze}},ao=(ae,re,Ie)=>{if(i.hasOwnProperty(ae)){if(Ie===void 0||i[ae].R!==void 0&&i[ae].R[Ie]!==void 0)throw new Je(`Cannot register public name '${ae}' twice`);if(fi(i,ae,ae),i[ae].R.hasOwnProperty(Ie))throw new Je(`Cannot register multiple overloads of a function with the same number of arguments (${Ie})!`);i[ae].R[Ie]=re}else i[ae]=re,i[ae].aa=Ie},po=ae=>{ae=ae.replace(/[^a-zA-Z0-9_]/g,"$");var re=ae.charCodeAt(0);return 48<=re&&57>=re?`_${ae}`:ae};function ri(ae,re,Ie,Ze,He,xt,dt,_t){this.name=ae,this.constructor=re,this.$=Ie,this.Y=Ze,this.U=He,this.ra=xt,this.ea=dt,this.pa=_t,this.ya=[]}var co=(ae,re,Ie)=>{for(;re!==Ie;){if(!re.ea)throw new Je(`Expected null or instance of ${Ie.name}, got an instance of ${re.name}`);ae=re.ea(ae),re=re.U}return ae},lo=ae=>{if(ae===null)return"null";var re=typeof ae;return re==="object"||re==="array"||re==="function"?ae.toString():""+ae};function Di(ae,re){if(re===null){if(this.ha)throw new Je(`null is not a valid ${this.name}`);return 0}if(!re.L)throw new Je(`Cannot pass "${lo(re)}" as a ${this.name}`);if(!re.L.O)throw new Je(`Cannot pass deleted object as a pointer of type ${this.name}`);return co(re.L.O,re.L.P.M,this.M)}function Wi(ae,re){if(re===null){if(this.ha)throw new Je(`null is not a valid ${this.name}`);if(this.ga){var Ie=this.ia();return ae!==null&&ae.push(this.Y,Ie),Ie}return 0}if(!re||!re.L)throw new Je(`Cannot pass "${lo(re)}" as a ${this.name}`);if(!re.L.O)throw new Je(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.fa&&re.L.P.fa)throw new Je(`Cannot convert argument of type ${re.L.W?re.L.W.name:re.L.P.name} to parameter type ${this.name}`);if(Ie=co(re.L.O,re.L.P.M,this.M),this.ga){if(re.L.S===void 0)throw new Je("Passing raw pointer to smart pointer is illegal");switch(this.Da){case 0:if(re.L.W===this)Ie=re.L.S;else throw new Je(`Cannot convert argument of type ${re.L.W?re.L.W.name:re.L.P.name} to parameter type ${this.name}`);break;case 1:Ie=re.L.S;break;case 2:if(re.L.W===this)Ie=re.L.S;else{var Ze=re.clone();Ie=this.za(Ie,ws(()=>Ze.delete())),ae!==null&&ae.push(this.Y,Ie)}break;default:throw new Je("Unsupporting sharing policy")}}return Ie}function Qn(ae,re){if(re===null){if(this.ha)throw new Je(`null is not a valid ${this.name}`);return 0}if(!re.L)throw new Je(`Cannot pass "${lo(re)}" as a ${this.name}`);if(!re.L.O)throw new Je(`Cannot pass deleted object as a pointer of type ${this.name}`);if(re.L.P.fa)throw new Je(`Cannot convert argument of type ${re.L.P.name} to parameter type ${this.name}`);return co(re.L.O,re.L.P.M,this.M)}var uo=(ae,re,Ie)=>re===Ie?ae:Ie.U===void 0?null:(ae=uo(ae,re,Ie.U),ae===null?null:Ie.pa(ae)),vo={},hr=(ae,re)=>{if(re===void 0)throw new Je("ptr should not be undefined");for(;ae.U;)re=ae.ea(re),ae=ae.U;return vo[re]},Vr=(ae,re)=>{if(!re.P||!re.O)throw new Fe("makeClassHandle requires ptr and ptrType");if(!!re.W!=!!re.S)throw new Fe("Both smartPtrType and smartPtr must be specified");return re.count={value:1},ut(Object.create(ae,{L:{value:re,writable:!0}}))};function qs(ae,re,Ie,Ze,He,xt,dt,_t,Ln,On,un){this.name=ae,this.M=re,this.ha=Ie,this.fa=Ze,this.ga=He,this.xa=xt,this.Da=dt,this.na=_t,this.ia=Ln,this.za=On,this.Y=un,He||re.U!==void 0?this.T=Wi:(this.T=Ze?Di:Qn,this.V=null)}var xs=(ae,re,Ie)=>{if(!i.hasOwnProperty(ae))throw new Fe("Replacing nonexistent public symbol");i[ae].R!==void 0&&Ie!==void 0?i[ae].R[Ie]=re:(i[ae]=re,i[ae].aa=Ie)},Na,Ao=(ae,re)=>{ae=De(ae);var Ie=Na.get(re);if(typeof Ie!="function")throw new Je(`unknown function pointer with signature ${ae}: ${re}`);return Ie};class Vn extends Error{}var Qo=ae=>{ae=pte(ae);var re=De(ae);return Zb(ae),re},Oo=(ae,re)=>{function Ie(xt){He[xt]||Le[xt]||(Se[xt]?Se[xt].forEach(Ie):(Ze.push(xt),He[xt]=!0))}var Ze=[],He={};throw re.forEach(Ie),new Vn(`${ae}: `+Ze.map(Qo).join([", "]))},$s=(ae,re)=>{for(var Ie=[],Ze=0;Ze<ae;Ze++)Ie.push(Y[re+4*Ze>>2]);return Ie};function Fi(ae){for(var re=1;re<ae.length;++re)if(ae[re]!==null&&ae[re].V===void 0)return!0;return!1}function Wo(ae,re,Ie,Ze,He,xt){var dt=re.length;if(2>dt)throw new Je("argTypes array size mismatch! Must at least get return value and 'this' types!");var _t=re[1]!==null&&Ie!==null,Ln=Fi(re);Ie=!re[0].ma;var On=re[0],un=re[1];for(Ze=[ae,St,Ze,He,oe,On.N.bind(On),un?.T.bind(un)],He=2;He<dt;++He)On=re[He],Ze.push(On.T.bind(On));if(!Ln)for(He=_t?1:2;He<re.length;++He)re[He].V!==null&&Ze.push(re[He].V);for(Ln=Fi(re),He=re.length-2,un=[],On=["fn"],_t&&On.push("thisWired"),dt=0;dt<He;++dt)un.push(`arg${dt}`),On.push(`arg${dt}Wired`);un=un.join(","),On=On.join(","),un=`return function (${un}) {
`,Ln&&(un+=`var destructors = [];
`);var Es=Ln?"destructors":"null",Xd="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(_t&&(un+=`var thisWired = toClassParamWire(${Es}, this);
`),dt=0;dt<He;++dt){var sl=`toArg${dt}Wire`;un+=`var arg${dt}Wired = ${sl}(${Es}, arg${dt});
`,Xd.push(sl)}if(un+=(Ie||xt?"var rv = ":"")+`invoker(${On});
`,Ln)un+=`runDestructors(destructors);
`;else for(dt=_t?1:2;dt<re.length;++dt)xt=dt===1?"thisWired":"arg"+(dt-2)+"Wired",re[dt].V!==null&&(un+=`${xt}_dtor(${xt});
`,Xd.push(`${xt}_dtor`));return Ie&&(un+=`var ret = fromRetWire(rv);
return ret;
`),re=new Function(Xd,un+`}
`)(...Ze),In(ae,re)}for(var dc=ae=>{ae=ae.trim();let re=ae.indexOf("(");return re===-1?ae:ae.slice(0,re)},ea=[],Lr=[0,1,,1,null,1,!0,1,!1,1],Wr=ae=>{9<ae&&--Lr[ae+1]===0&&(Lr[ae]=void 0,ea.push(ae))},rh=ae=>{if(!ae)throw new Je(`Cannot use deleted val. handle = ${ae}`);return Lr[ae]},ws=ae=>{switch(ae){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let re=ea.pop()||Lr.length;return Lr[re]=ae,Lr[re+1]=1,re}},Xa={name:"emscripten::val",N:ae=>{var re=rh(ae);return Wr(ae),re},T:(ae,re)=>ws(re),X:xe,V:null},Yf=(ae,re,Ie)=>{switch(re){case 1:return Ie?function(Ze){return this.N(_[Ze])}:function(Ze){return this.N(R[Ze])};case 2:return Ie?function(Ze){return this.N(L[Ze>>1])}:function(Ze){return this.N(W[Ze>>1])};case 4:return Ie?function(Ze){return this.N(B[Ze>>2])}:function(Ze){return this.N(Y[Ze>>2])};default:throw new TypeError(`invalid integer width (${re}): ${ae}`)}},Fo=(ae,re)=>{var Ie=Le[ae];if(Ie===void 0)throw ae=`${re} has unknown type ${Qo(ae)}`,new Je(ae);return Ie},Jl=(ae,re)=>{switch(re){case 4:return function(Ie){return this.N(N[Ie>>2])};case 8:return function(Ie){return this.N(A[Ie>>3])};default:throw new TypeError(`invalid float width (${re}): ${ae}`)}},jl=Object.assign({optional:!0},Xa),pa=(ae,re,Ie)=>{var Ze=R;if(!(0<Ie))return 0;var He=re;Ie=re+Ie-1;for(var xt=0;xt<ae.length;++xt){var dt=ae.codePointAt(xt);if(127>=dt){if(re>=Ie)break;Ze[re++]=dt}else if(2047>=dt){if(re+1>=Ie)break;Ze[re++]=192|dt>>6,Ze[re++]=128|dt&63}else if(65535>=dt){if(re+2>=Ie)break;Ze[re++]=224|dt>>12,Ze[re++]=128|dt>>6&63,Ze[re++]=128|dt&63}else{if(re+3>=Ie)break;Ze[re++]=240|dt>>18,Ze[re++]=128|dt>>12&63,Ze[re++]=128|dt>>6&63,Ze[re++]=128|dt&63,xt++}}return Ze[re]=0,re-He},Bo=ae=>{for(var re=0,Ie=0;Ie<ae.length;++Ie){var Ze=ae.charCodeAt(Ie);127>=Ze?re++:2047>=Ze?re+=2:55296<=Ze&&57343>=Ze?(re+=4,++Ie):re+=3}return re},ql=new TextDecoder,An=(ae,re,Ie,Ze)=>{if(Ie=re+Ie,Ze)return Ie;for(;ae[re]&&!(re>=Ie);)++re;return re},Re=new TextDecoder("utf-16le"),Gt=(ae,re,Ie)=>(ae>>=1,Re.decode(W.subarray(ae,An(W,ae,re/2,Ie)))),gn=(ae,re,Ie)=>{if(Ie??(Ie=2147483647),2>Ie)return 0;Ie-=2;var Ze=re;Ie=Ie<2*ae.length?Ie/2:ae.length;for(var He=0;He<Ie;++He)L[re>>1]=ae.charCodeAt(He),re+=2;return L[re>>1]=0,re-Ze},fr=ae=>2*ae.length,Pa=(ae,re,Ie)=>{var Ze="";ae>>=2;for(var He=0;!(He>=re/4);He++){var xt=Y[ae+He];if(!xt&&!Ie)break;Ze+=String.fromCodePoint(xt)}return Ze},Cs=(ae,re,Ie)=>{if(Ie??(Ie=2147483647),4>Ie)return 0;var Ze=re;Ie=Ze+Ie-4;for(var He=0;He<ae.length;++He){var xt=ae.codePointAt(He);if(65535<xt&&He++,B[re>>2]=xt,re+=4,re+4>Ie)break}return B[re>>2]=0,re-Ze},Zc=ae=>{for(var re=0,Ie=0;Ie<ae.length;++Ie)65535<ae.codePointAt(Ie)&&Ie++,re+=4;return re},Nd=[],Ib=ae=>{var re=Nd.length;return Nd.push(ae),re},nR=(ae,re)=>{for(var Ie=Array(ae),Ze=0;Ze<ae;++Ze)Ie[Ze]=Fo(Y[re+4*Ze>>2],`parameter ${Ze}`);return Ie},Aa=(ae,re,Ie)=>{var Ze=[];return ae=ae(Ze,Ie),Ze.length&&(Y[re>>2]=ws(Ze)),ae},oD={},rD=ae=>{var re=oD[ae];return re===void 0?De(ae):re},n3={},fte=()=>{if(!i3){var ae={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",_:c||"./this.program"},re;for(re in n3)n3[re]===void 0?delete ae[re]:ae[re]=n3[re];var Ie=[];for(re in ae)Ie.push(`${re}=${ae[re]}`);i3=Ie}return i3},i3,sRe=[null,[],[]],aA=new Uint8Array(123),_b=25;0<=_b;--_b)aA[48+_b]=52+_b,aA[65+_b]=_b,aA[97+_b]=26+_b;aA[43]=62,aA[47]=63,(()=>{let ae=Nt.prototype;Object.assign(ae,{isAliasOf:function(Ie){if(!(this instanceof Nt&&Ie instanceof Nt))return!1;var Ze=this.L.P.M,He=this.L.O;Ie.L=Ie.L;var xt=Ie.L.P.M;for(Ie=Ie.L.O;Ze.U;)He=Ze.ea(He),Ze=Ze.U;for(;xt.U;)Ie=xt.ea(Ie),xt=xt.U;return Ze===xt&&He===Ie},clone:function(){if(this.L.O||Ot(this),this.L.da)return this.L.count.value+=1,this;var Ie=ut,Ze=Object,He=Ze.create,xt=Object.getPrototypeOf(this),dt=this.L;return Ie=Ie(He.call(Ze,xt,{L:{value:{count:dt.count,ba:dt.ba,da:dt.da,O:dt.O,P:dt.P,S:dt.S,W:dt.W}}})),Ie.L.count.value+=1,Ie.L.ba=!1,Ie},delete(){if(this.L.O||Ot(this),this.L.ba&&!this.L.da)throw new Je("Object already scheduled for deletion");sn(this);var Ie=this.L;--Ie.count.value,Ie.count.value===0&&(Ie.S?Ie.W.Y(Ie.S):Ie.P.M.Y(Ie.O)),this.L.da||(this.L.S=void 0,this.L.O=void 0)},isDeleted:function(){return!this.L.O},deleteLater:function(){if(this.L.O||Ot(this),this.L.ba&&!this.L.da)throw new Je("Object already scheduled for deletion");return this.L.ba=!0,this}});let re=Symbol.dispose;re&&(ae[re]=ae.delete)})(),Object.assign(qs.prototype,{sa(ae){return this.na&&(ae=this.na(ae)),ae},ka(ae){var re;(re=this.Y)==null||re.call(this,ae)},X:xe,N:function(ae){function re(){return this.ga?Vr(this.M.$,{P:this.xa,O:Ie,W:this,S:ae}):Vr(this.M.$,{P:this,O:ae})}var Ie=this.sa(ae);if(!Ie)return this.ka(ae),null;var Ze=hr(this.M,Ie);if(Ze!==void 0)return Ze.L.count.value===0?(Ze.L.O=Ie,Ze.L.S=ae,Ze.clone()):(Ze=Ze.clone(),this.ka(ae),Ze);if(Ze=this.M.ra(Ie),Ze=lt[Ze],!Ze)return re.call(this);Ze=this.fa?Ze.oa:Ze.pointerType;var He=uo(Ie,this.M,Ze.M);return He===null?re.call(this):this.ga?Vr(Ze.M.$,{P:Ze,O:He,W:this,S:ae}):Vr(Ze.M.$,{P:Ze,O:He})}}),i.print&&(p=i.print),i.printErr&&(g=i.printErr),i.wasmBinary&&(f=i.wasmBinary),i.thisProgram&&(c=i.thisProgram);var pte,o3,Zb,aRe={x:()=>U(""),q:ae=>{var re=ye[ae];delete ye[ae];var Ie=re.ia,Ze=re.Y,He=re.la,xt=He.map(dt=>dt.va).concat(He.map(dt=>dt.Ba));Ue([ae],xt,dt=>{var _t={};return He.forEach((Ln,On)=>{var un=dt[On],Es=Ln.ta,Xd=Ln.ua,sl=dt[On+He.length],al=Ln.Aa,Du=Ln.Ca;_t[Ln.qa]={read:cA=>un.N(Es(Xd,cA)),write:(cA,iR)=>{var Pd=[];al(Du,cA,sl.T(Pd,iR)),oe(Pd)},optional:dt[On].optional}}),[{name:re.name,N:Ln=>{var On={},un;for(un in _t)On[un]=_t[un].read(Ln);return Ze(Ln),On},T:(Ln,On)=>{for(var un in _t)if(!(un in On||_t[un].optional))throw new TypeError(`Missing field: "${un}"`);var Es=Ie();for(un in _t)_t[un].write(Es,On[un]);return Ln!==null&&Ln.push(Ze,Es),Es},X:xe,V:Ze}]})},n:(ae,re,Ie,Ze,He)=>{re=De(re),Ze=Ze===0n;let xt=dt=>dt;if(Ze){let dt=8*Ie;xt=_t=>BigInt.asUintN(dt,_t),He=xt(He)}it(ae,{name:re,N:xt,T:(dt,_t)=>(typeof _t=="number"&&(_t=BigInt(_t)),_t),X:yt(re,Ie,!Ze),V:null})},B:(ae,re,Ie,Ze)=>{re=De(re),it(ae,{name:re,N:function(He){return!!He},T:function(He,xt){return xt?Ie:Ze},X:function(He){return this.N(R[He])},V:null})},j:(ae,re,Ie,Ze,He,xt,dt,_t,Ln,On,un,Es,Xd)=>{un=De(un),xt=Ao(He,xt),_t&&(_t=Ao(dt,_t)),On&&(On=Ao(Ln,On)),Xd=Ao(Es,Xd);var sl=po(un);ao(sl,function(){Oo(`Cannot construct ${un} due to unbound types`,[Ze])}),Ue([ae,re,Ie],Ze?[Ze]:[],al=>{if(al=al[0],Ze)var Du=al.M,cA=Du.$;else cA=Nt.prototype;al=In(un,function(...s3){if(Object.getPrototypeOf(this)!==iR)throw new Je(`Use 'new' to construct ${un}`);if(Pd.Z===void 0)throw new Je(`${un} has no accessible constructor`);var Ate=Pd.Z[s3.length];if(Ate===void 0)throw new Je(`Tried to invoke ctor of ${un} with invalid number of parameters (${s3.length}) - expected (${Object.keys(Pd.Z).toString()}) parameters instead!`);return Ate.apply(this,s3)});var iR=Object.create(cA,{constructor:{value:al}});al.prototype=iR;var Pd=new ri(un,al,iR,Xd,Du,xt,_t,On);if(Pd.U){var oR;(oR=Pd.U).ja??(oR.ja=[]),Pd.U.ja.push(Pd)}return Du=new qs(un,Pd,!0,!1,!1),oR=new qs(un+"*",Pd,!1,!1,!1),cA=new qs(un+" const*",Pd,!1,!0,!1),lt[ae]={pointerType:oR,oa:cA},xs(sl,al),[Du,oR,cA]})},g:(ae,re,Ie,Ze,He,xt)=>{var dt=$s(re,Ie);He=Ao(Ze,He),Ue([],[ae],_t=>{_t=_t[0];var Ln=`constructor ${_t.name}`;if(_t.M.Z===void 0&&(_t.M.Z=[]),_t.M.Z[re-1]!==void 0)throw new Je(`Cannot register multiple constructors with identical number of parameters (${re-1}) for class '${_t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return _t.M.Z[re-1]=()=>{Oo(`Cannot construct ${_t.name} due to unbound types`,dt)},Ue([],dt,On=>(On.splice(1,0,null),_t.M.Z[re-1]=Wo(Ln,On,null,He,xt),[])),[]})},b:(ae,re,Ie,Ze,He,xt,dt,_t,Ln)=>{var On=$s(Ie,Ze);re=De(re),re=dc(re),xt=Ao(He,xt),Ue([],[ae],un=>{function Es(){Oo(`Cannot call ${Xd} due to unbound types`,On)}un=un[0];var Xd=`${un.name}.${re}`;re.startsWith("@@")&&(re=Symbol[re.substring(2)]),_t&&un.M.ya.push(re);var sl=un.M.$,al=sl[re];return al===void 0||al.R===void 0&&al.className!==un.name&&al.aa===Ie-2?(Es.aa=Ie-2,Es.className=un.name,sl[re]=Es):(fi(sl,re,Xd),sl[re].R[Ie-2]=Es),Ue([],On,Du=>(Du=Wo(Xd,Du,un,xt,dt,Ln),sl[re].R===void 0?(Du.aa=Ie-2,sl[re]=Du):sl[re].R[Ie-2]=Du,[])),[]})},z:ae=>it(ae,Xa),r:(ae,re,Ie,Ze)=>{function He(){}re=De(re),He.values={},it(ae,{name:re,constructor:He,N:function(xt){return this.constructor.values[xt]},T:(xt,dt)=>dt.value,X:Yf(re,Ie,Ze),V:null}),ao(re,He)},d:(ae,re,Ie)=>{var Ze=Fo(ae,"enum");re=De(re),ae=Ze.constructor,Ze=Object.create(Ze.constructor.prototype,{value:{value:Ie},constructor:{value:In(`${Ze.name}_${re}`,function(){})}}),ae.values[Ie]=Ze,ae[re]=Ze},m:(ae,re,Ie)=>{re=De(re),it(ae,{name:re,N:Ze=>Ze,T:(Ze,He)=>He,X:Jl(re,Ie),V:null})},l:(ae,re,Ie,Ze,He,xt,dt)=>{var _t=$s(re,Ie);ae=De(ae),ae=dc(ae),He=Ao(Ze,He),ao(ae,function(){Oo(`Cannot call ${ae} due to unbound types`,_t)},re-1),Ue([],_t,Ln=>(Ln=[Ln[0],null].concat(Ln.slice(1)),xs(ae,Wo(ae,Ln,null,He,xt,dt),re-1),[]))},c:(ae,re,Ie,Ze,He)=>{re=De(re);let xt=_t=>_t;if(Ze===0){var dt=32-8*Ie;xt=_t=>_t<<dt>>>dt,He=xt(He)}it(ae,{name:re,N:xt,T:(_t,Ln)=>Ln,X:yt(re,Ie,Ze!==0),V:null})},a:(ae,re,Ie)=>{function Ze(xt){return new He(_.buffer,Y[xt+4>>2],Y[xt>>2])}var He=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][re];Ie=De(Ie),it(ae,{name:Ie,N:Ze,X:Ze},{wa:!0})},h:ae=>{it(ae,jl)},A:(ae,re)=>{re=De(re),it(ae,{name:re,N(Ie){var Ze=(Ze=Ie+4)?ql.decode(R.subarray(Ze,An(R,Ze,Y[Ie>>2],!0))):"";return Zb(Ie),Ze},T(Ie,Ze){Ze instanceof ArrayBuffer&&(Ze=new Uint8Array(Ze));var He=typeof Ze=="string";if(!(He||ArrayBuffer.isView(Ze)&&Ze.BYTES_PER_ELEMENT==1))throw new Je("Cannot pass non-string to std::string");var xt=He?Bo(Ze):Ze.length,dt=o3(4+xt+1),_t=dt+4;return Y[dt>>2]=xt,He?pa(Ze,_t,xt+1):R.set(Ze,_t),Ie!==null&&Ie.push(Zb,dt),dt},X:xe,V(Ie){Zb(Ie)}})},f:(ae,re,Ie)=>{if(Ie=De(Ie),re===2)var Ze=Gt,He=gn,xt=fr;else Ze=Pa,He=Cs,xt=Zc;it(ae,{name:Ie,N:dt=>{var _t=Ze(dt+4,Y[dt>>2]*re,!0);return Zb(dt),_t},T:(dt,_t)=>{if(typeof _t!="string")throw new Je(`Cannot pass non-string to C++ string type ${Ie}`);var Ln=xt(_t),On=o3(4+Ln+re);return Y[On>>2]=Ln/re,He(_t,On+4,Ln+re),dt!==null&&dt.push(Zb,On),On},X:xe,V(dt){Zb(dt)}})},i:(ae,re,Ie,Ze,He,xt)=>{ye[ae]={name:De(re),ia:Ao(Ie,Ze),Y:Ao(He,xt),la:[]}},e:(ae,re,Ie,Ze,He,xt,dt,_t,Ln,On)=>{ye[ae].la.push({qa:De(re),va:Ie,ta:Ao(Ze,He),ua:xt,Ba:dt,Aa:Ao(_t,Ln),Ca:On})},C:(ae,re)=>{re=De(re),it(ae,{ma:!0,name:re,N:()=>{},T:()=>{}})},p:(ae,re,Ie)=>{var[Ze,...He]=nR(ae,re);re=Ze.T.bind(Ze);var xt=He.map(Ln=>Ln.X.bind(Ln));ae--;var dt={toValue:rh};switch(ae=xt.map((Ln,On)=>{var un=`argFromPtr${On}`;return dt[un]=Ln,`${un}(args${On?"+"+8*On:""})`}),Ie){case 0:var _t="toValue(handle)";break;case 2:_t="new (toValue(handle))";break;case 3:_t="";break;case 1:dt.getStringOrSymbol=rD,_t="toValue(handle)[getStringOrSymbol(methodName)]"}return _t+=`(${ae})`,Ze.ma||(dt.toReturnWire=re,dt.emval_returnValue=Aa,_t=`return emval_returnValue(toReturnWire, destructorsRef, ${_t})`),_t=`return function (handle, methodName, destructorsRef, args) {
  ${_t}
  }`,Ie=new Function(Object.keys(dt),_t)(...Object.values(dt)),_t=`methodCaller<(${He.map(Ln=>Ln.name)}) => ${Ze.name}>`,Ib(In(_t,Ie))},E:Wr,o:(ae,re,Ie,Ze,He)=>Nd[ae](re,Ie,Ze,He),D:ae=>{var re=rh(ae);oe(re),Wr(ae)},s:(ae,re,Ie,Ze)=>{var He=new Date().getFullYear(),xt=new Date(He,0,1).getTimezoneOffset();He=new Date(He,6,1).getTimezoneOffset(),Y[ae>>2]=60*Math.max(xt,He),B[re>>2]=+(xt!=He),re=dt=>{var _t=Math.abs(dt);return`UTC${0<=dt?"-":"+"}${String(Math.floor(_t/60)).padStart(2,"0")}${String(_t%60).padStart(2,"0")}`},ae=re(xt),re=re(He),He<xt?(pa(ae,Ie,17),pa(re,Ze,17)):(pa(ae,Ze,17),pa(re,Ie,17))},y:ae=>{var re=R.length;if(ae>>>=0,2147483648<ae)return!1;for(var Ie=1;4>=Ie;Ie*=2){var Ze=re*(1+.2/Ie);Ze=Math.min(Ze,ae+100663296);e:{Ze=(Math.min(2147483648,65536*Math.ceil(Math.max(ae,Ze)/65536))-S.buffer.byteLength+65535)/65536|0;try{S.grow(Ze),w();var He=1;break e}catch{}He=void 0}if(He)return!0}return!1},t:(ae,re)=>{var Ie=0,Ze=0,He;for(He of fte()){var xt=re+Ie;Y[ae+Ze>>2]=xt,Ie+=pa(He,xt,1/0)+1,Ze+=4}return 0},u:(ae,re)=>{var Ie=fte();Y[ae>>2]=Ie.length,ae=0;for(var Ze of Ie)ae+=Bo(Ze)+1;return Y[re>>2]=ae,0},v:()=>52,w:function(){return 70},k:(ae,re,Ie,Ze)=>{for(var He=0,xt=0;xt<Ie;xt++){var dt=Y[re>>2],_t=Y[re+4>>2];re+=8;for(var Ln=0;Ln<_t;Ln++){var On=ae,un=R[dt+Ln],Es=sRe[On];un===0||un===10?(On=On===1?p:g,un=An(Es,0),un=ql.decode(Es.buffer?Es.subarray(0,un):new Uint8Array(Es.slice(0,un))),On(un),Es.length=0):Es.push(un)}He+=_t}return Y[Ze>>2]=He,0}},wT=await(async function(){var ae;function re(Ze){var He;return wT=Ze.exports,S=wT.F,w(),Na=wT.H,Ze=wT,pte=Ze.I,i._malloc=o3=Ze.J,i._free=Zb=Ze.K,X--,(He=i.monitorRunDependencies)==null||He.call(i,X),X==0&&v&&(Ze=v,v=null,Ze()),wT}X++,(ae=i.monitorRunDependencies)==null||ae.call(i,X);var Ie={a:aRe};return i.instantiateWasm?new Promise(Ze=>{i.instantiateWasm(Ie,(He,xt)=>{Ze(re(He))})}):(k??(k=me("[encoded data, 218712 characters]")),re((await H(Ie)).instance))})();function r3(){function ae(){var re;if(i.calledRun=!0,!b){if(G=!0,wT.G(),E?.(i),(re=i.onRuntimeInitialized)==null||re.call(i),i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;){var Ie=i.postRun.shift();z.push(Ie)}ee(z)}}if(0<X)v=r3;else{if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)q();ee(te),0<X?v=r3:i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),ae()},1)):ae()}}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);0<i.preInit.length;)i.preInit.shift()();return r3(),G?n=i:n=new Promise((ae,re)=>{E=ae,T=re}),n}var FS=(e,t,n=i=>i)=>{let i=e.vf32_ptr(t),o=t.size();return new Float32Array(e.HEAPF32.buffer,i,o).map(n)},Cke=e=>1/(1+Math.exp(-e)),Eke=e=>t=>t*e+.5,Tke=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:FS(e,t.positions),scales:FS(e,t.scales,Math.exp),rotations:FS(e,t.rotations),alphas:FS(e,t.alphas,Cke),colors:FS(e,t.colors,Eke(i)),sh:FS(e,t.sh)}},Ske=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},pce=async(e,t)=>{var n;let i=await xke(),o=e instanceof Uint8Array?e:new Uint8Array(e),r=null;try{if(r=i._malloc(Uint8Array.BYTES_PER_ELEMENT*o.length),r===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(o,r/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(r,o.length,{coordinateSystem:s}),c=Tke(i,a,t);return Ske(i,a),c}catch(s){throw s}finally{r!==null&&i._free(r)}};var Ike=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function h0(e){e=e??Q.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.spz,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;this._resourceCache=t,this._gltfResource=r,this._baseResource=s,this._gltf=n,this._primitive=i,this._spz=o,this._cacheKey=a,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=ft.UNLOADED,this._promise=void 0,this._spzError=void 0}l(Object.create)&&(h0.prototype=Object.create(Oi.prototype),h0.prototype.constructor=h0);Object.defineProperties(h0.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function _ke(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:0,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=ft.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Ace(e,n)}}h0.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=ft.LOADING,this._promise=_ke(this),this._promise)};function Ace(e,t){throw e.unload(),e._state=ft.FAILED,e.getError("Failed to load SPZ",t)}async function Zke(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=ft.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}h0.prototype.process=function(e){if(this._state===ft.READY)return!0;if(this._state!==ft.PROCESSING||(l(this._spzError)&&Ace(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=pce(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(t))return!1;this._decodePromise=Zke(this,t)};h0.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0};var yW=h0;var GCn=y(x(),1);var ECn=y(x(),1);var rCn=y(x(),1);function xW(e){e=e??Q.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Qe(e.extras,!0),this._extensions=Qe(e.extensions,!0)}xW.fromJson=function(e){e=e??Q.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=tp.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new xW({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(xW.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});xW.BATCH_TABLE_CLASS_NAME="_batchTable";var Lh=xW;var pCn=y(x(),1);var lCn=y(x(),1);function kv(e){e=e??Q.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Qe(e.extras,!0),this._extensions=Qe(e.extensions,!0)}kv.fromJson=function(e){return new kv({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(kv.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var CW=kv;function Qv(e){e=e??Q.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=e.valueType??jt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Qe(e.extras,!0),this._extensions=Qe(e.extensions,!0)}Qv.fromJson=function(e){e=e??Q.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(o){return CW.fromJson(o)});return new Qv({id:t,values:i,valueType:jt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(Qv.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var EW=Qv;function Ov(e){e=e??Q.EMPTY_OBJECT;let t=e.classes??{},n=e.enums??{};this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Qe(e.extras,!0),this._extensions=Qe(e.extensions,!0)}Ov.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=EW.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Lh.fromJson({id:i,class:e.classes[i],enums:t}));return new Ov({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Ov.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Zl=Ov;function mC(e){e=e??Q.EMPTY_OBJECT;let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?Zl.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(mC.prototype=Object.create(Oi.prototype),mC.prototype.constructor=mC);Object.defineProperties(mC.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});mC.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=Rke(this),this._promise)};async function Rke(e){let t=e._resource;e._state=ft.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Zl.fromJson(n),e._state=ft.READY,e)}catch(n){if(e.isDestroyed())return;e._state=ft.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}mC.prototype.unload=function(){this._schema=void 0};var f0=mC;var YCn=y(x(),1);var dm={};function BS(e){return Nf(e.url)}function TW(e){let{byteOffset:t,byteLength:n}=e;if(Ti(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function Gke(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function gce(e,t){return`${BS(e)}-buffer-id-${t}`}function wS(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return BS(o)}return gce(n,t)}function cK(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=wS(a,s,n,i),d=TW(r);return`${c}-range-${d}`}function bce(e,t,n,i){let r=e.bufferViews[0],s=r.buffer,a=e.buffers[s],c=wS(a,s,n,i),d=TW(r);return`${c}-range-${d}`}function yce(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return BS(p)}let a=e.bufferViews[r],c=a.buffer,d=e.buffers[c],u=wS(d,c,n,i),h=TW(a);return`${u}-range-${h}`}function Vke(e,t){let n=md.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}dm.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${BS(n)}`};dm.getExternalBufferCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${BS(t)}`};dm.getEmbeddedBufferCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${gce(t,n)}`};dm.getGltfCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${BS(t)}`};dm.getBufferViewCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];Ti(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=wS(a,s,i,o),d=TW(r);return`buffer-view:${c}-range-${d}`};dm.getDracoCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${cK(t,n,i,o)}`};dm.getSpzCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,primitive:n,gltfResource:i,baseResource:o}=e;return`spz:${bce(t,n,i,o)}`};dm.getVertexBufferCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,spz:a,attributeSemantic:c,dequantize:d=!1,loadBuffer:u=!1,loadTypedArray:h=!1}=e,p="";if(d&&(p+="-dequantize"),u&&(p+="-buffer",p+=`-context-${o.context.id}`),h&&(p+="-typed-array"),l(s))return`vertex-buffer:${cK(t,s,n,i)}-draco-${c}${p}`;if(a)return`vertex-buffer:${bce(t,a,n,i)}-spz-${c}${p}`;let g=t.bufferViews[r],f=g.buffer,b=t.buffers[f],C=wS(b,f,n,i),E=TW(g);return`vertex-buffer:${C}-range-${E}${p}`};dm.getIndexBufferCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,d="";if(a&&(d+="-buffer",d+=`-context-${r.context.id}`),c&&(d+="-typed-array"),l(s))return`index-buffer:${cK(t,s,i,o)}-draco${d}`;let u=t.accessors[n],h=u.bufferView,p=t.bufferViews[h],g=p.buffer,f=t.buffers[g],b=wS(f,g,i,o),C=Gke(u,p);return`index-buffer:${b}-accessor-${C}${d}`};dm.getImageCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${yce(t,n,i,o)}`};dm.getTextureCacheKey=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=md.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),d=yce(t,c,i,o),u=Vke(t,n);return`texture:${d}-sampler-${u}-context-${s.context.id}`};var Rl=dm;var PCn=y(x(),1);function SW(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}SW.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};SW.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};SW.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};SW.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var IW=SW;function wn(){}wn.cacheEntries={};wn.statistics=new IW;function Lke(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}wn.get=function(e){let t=wn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};wn.add=function(e){let t=e.cacheKey;return wn.cacheEntries[t]=new Lke(e),e};wn.unload=function(e){let t=e.cacheKey,n=wn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(wn.statistics.removeLoader(e),e.destroy(),delete wn.cacheEntries[t])};wn.getSchemaLoader=function(e){e=e??Q.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=Rl.getSchemaCacheKey({schema:t,resource:n}),o=wn.get(i);return l(o)?o:(o=new f0({schema:t,resource:n,cacheKey:i}),wn.add(o))};wn.getEmbeddedBufferLoader=function(e){e=e??Q.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,o=Rl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=wn.get(o);return l(r)?r:(r=new iC({typedArray:i,cacheKey:o}),wn.add(r))};wn.getExternalBufferLoader=function(e){e=e??Q.EMPTY_OBJECT;let{resource:t}=e,n=Rl.getExternalBufferCacheKey({resource:t}),i=wn.get(n);return l(i)?i:(i=new iC({resource:t,cacheKey:n}),wn.add(i))};wn.getGltfJsonLoader=function(e){e=e??Q.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Rl.getGltfCacheKey({gltfResource:t}),s=wn.get(r);return l(s)?s:(s=new VS({resourceCache:wn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),wn.add(s))};wn.getBufferViewLoader=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Rl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=wn.get(r);return l(s)?s:(s=new IS({resourceCache:wn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),wn.add(s))};wn.getDracoLoader=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e,s=Rl.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),a=wn.get(s);return l(a)?a:(a=new _S({resourceCache:wn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),wn.add(a))};wn.getSpzLoader=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:o,baseResource:r}=e,s=Rl.getSpzCacheKey({gltf:t,primitive:n,gltfResource:o,baseResource:r}),a=wn.get(s);return l(a)?a:(a=new yW({resourceCache:wn,gltf:t,primitive:n,spz:i,gltfResource:o,baseResource:r,cacheKey:s}),wn.add(a))};wn.getVertexBufferLoader=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,spz:c,attributeSemantic:d,accessorId:u,asynchronous:h=!0,dequantize:p=!1,loadBuffer:g=!1,loadTypedArray:f=!1}=e,b=Rl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,spz:c,attributeSemantic:d,dequantize:p,loadBuffer:g,loadTypedArray:f}),C=wn.get(b);return l(C)?C:(C=new WS({resourceCache:wn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,spz:c,attributeSemantic:d,accessorId:u,cacheKey:b,asynchronous:h,dequantize:p,loadBuffer:g,loadTypedArray:f}),wn.add(C))};wn.getIndexBufferLoader=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:d=!1,loadTypedArray:u=!1}=e,h=Rl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:d,loadTypedArray:u}),p=wn.get(h);return l(p)?p:(p=new RS({resourceCache:wn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:h,asynchronous:c,loadBuffer:d,loadTypedArray:u}),wn.add(p))};wn.getImageLoader=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Rl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=wn.get(r);return l(s)?s:(s=new ZS({resourceCache:wn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),wn.add(s))};wn.getTextureLoader=function(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=Rl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),d=wn.get(c);return l(d)?d:(d=new LS({resourceCache:wn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),wn.add(d))};wn.clearForSpecs=function(){let e=[WS,RS,_S,LS,ZS,IS,iC,f0,VS],t,n=wn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}wn.statistics.clear()};var Li=wn;function za(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(za.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});za.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};za.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};za.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};za.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};za.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};za.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};za.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};za.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Zs.OCTREE&&(t=3),e>>t};za.fromSubtreeJson=async function(e,t,n,i,o){let r=new za(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=Wke(n);let a=s.json;r._subtreeJson=a;let c;if(Ti(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let T=a.tileMetadata;c=a.propertyTables[T]}let d=[];if(l(a.contentMetadata)){let T=a.contentMetadata.length;for(let S=0;S<T;S++){let _=a.contentMetadata[S];d.push(a.propertyTables[_])}}let u,h=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let T=p.class,S=h.classes[T];u=new nW({subtreeMetadata:p,class:S})}r._metadata=u,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=d;let g={constant:0};a.contentAvailabilityHeaders=[],Ti(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let f=Fke(a.buffers),b=Bke(a.bufferViews,f);wke(a,b),l(c)&&xce(c,b);for(let T=0;T<d.length;T++){let S=d[T];xce(S,b)}let C=await Yke(r,f,s.binary),E=Xke(b,C);return Pke(r,a,i,E),l(c)&&(Mke(r,i,E),Dke(r)),Uke(r,i,E),vke(r),r._ready=!0,r};function Wke(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Cr(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function Fke(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function Bke(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function wke(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function xce(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=r.values??r.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=r.stringOffsets??r.stringOffsetBufferView;l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=r.arrayOffsets??r.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function Yke(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=Nke(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function Nke(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Li.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function Xke(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function Pke(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=Ti(t,"3DTILES_metadata"),d=l(e._tilePropertyTableJson),u=c||d;e._tileAvailability=lK(t.tileAvailability,i,s,u);let h=e._contentPropertyTableJsons.length>0;u=u||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=lK(t.contentAvailabilityHeaders[p],i,s,u);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=lK(t.childSubtreeAvailability,i,a)}function lK(e,t,n,i){if(l(e.constant))return new TS({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new TS({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function Mke(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new cm({class:a,count:o,properties:i.properties,bufferViews:n})}function Uke(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],u=o[a].availableCount,h=c.class,p=r.classes[h],g=new cm({class:p,count:u,properties:c.properties,bufferViews:n});s.push(g)}}function Cce(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function Dke(e){let t=Cce(e._tileAvailability);e._tileJumpBuffer=t}function vke(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Cce(o);t.push(r)}}za.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new he("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};za.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new he("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function kke(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function Qke(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}za.prototype.getTileMetadataView=function(e){let t=kke(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new SS({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};za.prototype.getContentMetadataView=function(e,t){let n=Qke(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new SS({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};za.prototype.isDestroyed=function(){return!1};za.prototype.destroy=function(){return l(this._bufferLoader)&&Li.unload(this._bufferLoader),fe(this)};var KA=za;var AEn=y(x(),1),Oke={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},um=Object.freeze(Oke);var yEn=y(x(),1);var p0={};p0.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:p0.parseBoundingVolumeSemantic(e,t),minimumHeight:p0._parseMinimumHeight(e,t),maximumHeight:p0._parseMaximumHeight(e,t)}};p0.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};p0._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};p0._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var A0=p0;function Gl(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(Gl.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(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Gl.fromSubtreeJson=async function(e,t,n,i,o,r){r=r??0;let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,d=await KA.fromSubtreeJson(n,i,s,a,c),u=new Gl(e,t,n);return u._implicitSubtree=d,zke(u,d),u._ready=!0,u};function zke(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=Kke(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=Hke(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],d=c.tile,u=o9e(e,d,c.childIndex);d.children.push(u),r.numberOfTilesTotal++}}function Hke(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function Kke(e,t,n,i){let s=Ece(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],d=[],u=e._implicitTileset;for(let h=1;h<u.subtreeLevels;h++){let p=t.getLevelOffset(h),g=u.branchingFactor*c.length;for(let f=0;f<g;f++){let b=p+f;if(!t.tileIsAvailableAtIndex(b)){d.push(void 0);continue}let C=t.getParentMortonIndex(f),E=c[C],T=f%u.branchingFactor,S=Ece(e,t,E,T,b);E.children.push(S),a.numberOfTilesTotal++,d.push(S)}c=d,d=[]}return{rootTile:s,bottomRow:c}}function Tce(e,t,n){let i=um.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Ece(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,d;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(a),d=A0.parseAllBoundingVolumeSemantics("TILE",c));let h=t.contentPropertyTableJsons.length,p=!1;for(let R=0;R<h;R++)if(t.contentIsAvailableAtCoordinates(a,R)){p=!0;break}let g=qke(s,a,i,r,n,d),f=[];for(let R=0;R<s.contentCount;R++){if(!t.contentIsAvailableAtIndex(o,R))continue;let B={uri:s.contentUriTemplates[R].getDerivedResource({templateValues:a.getTemplateValues()}).url},Y;if(t.contentPropertyTableJsons.length>0){let A=t.getContentMetadataView(a,R);Y=A0.parseAllBoundingVolumeSemantics("CONTENT",A)}let N=$ke(g,Y);l(N)&&(B.boundingVolume=N),f.push(Rt(B,s.contentHeaders[R]))}let b=Tce(c,s,a),C={boundingVolume:g,geometricError:b,refine:s.refine,contents:f},E=!0,T=Qe(s.tileHeader,E);delete T.boundingVolume,delete T.transform,delete T.metadata;let S=Rt(C,T,E),_=Rce(e,s.baseResource,S,n);return _.implicitCoordinates=a,_.implicitSubtree=t,_.metadata=c,_.hasImplicitContentMetadata=p,_}function zv(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(Ti(e,"3DTILES_bounding_volume_S2")||l(e.region))}function uK(e,t){l(t)&&(Ti(e,"3DTILES_bounding_volume_S2")?jke(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&Jke(e.region,t.minimumHeight,t.maximumHeight))}function Jke(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function jke(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function qke(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!zv(r.boundingVolume,r)&&zv(e.boundingVolume,r)?s=Sce(e,t,n,i??!1,o):s=r.boundingVolume,uK(s,r),s}function $ke(e,t){let n;return l(t)&&(n=t.boundingVolume),zv(n,t)?uK(n,t):zv(e,t)&&(n=Qe(e,!0),uK(n,t)),n}function Sce(e,t,n,i,o){let r=e.boundingVolume;return Ti(r,"3DTILES_bounding_volume_S2")?Ice(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:Zce(r.region,t.level,t.x,t.y,t.z)}:{box:_ce(r.box,t.level,t.x,t.y,t.z)}}function Ice(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:UA.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?CS.encode2D(i,o,r):CS.encode2D(i,r,o),u=UA.fromFacePositionLevel(c,BigInt(d),i),h,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else h=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:UA.getTokenFromId(u._cellId),minimumHeight:h,maximumHeight:p}}}}var e9e=new m,t9e=new m,dK=new m,n9e=new $;function _ce(e,t,n,i,o){if(t===0)return e;let r=m.unpack(e,0,t9e),s=$.unpack(e,3,n9e),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,h=m.fromElements(a,a,1,e9e);l(o)&&(u=-1+(2*o+1)*a,h.z=a);let p=m.fromElements(c,d,u,dK);p=$.multiplyByVector(s,p,dK),p=m.add(p,r,dK);let g=$.clone(s);g=$.multiplyByScale(g,h,g);let f=new Array(12);return m.pack(p,f),$.pack(g,f,3),f}var i9e=new de;function Zce(e,t,n,i,o){if(t===0)return e.slice();let r=de.unpack(e,0,i9e),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=V.negativePiToPi(r.west+n*d),h=V.negativePiToPi(u+d),p=c*r.height,g=V.negativePiToPi(r.south+i*p),f=V.negativePiToPi(g+p),b=s,C=a;if(l(o)){let E=c*(a-s);b+=o*E,C=b+E}return[u,g,h,f,b,C]}function o9e(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Sce(i,o,n,!1,t),s=Tce(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=Rce(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function Rce(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Gl.prototype.hasProperty=function(e,t){return!1};Gl.prototype.getFeature=function(e){};Gl.prototype.applyDebugSettings=function(e,t){};Gl.prototype.applyStyle=function(e){};Gl.prototype.update=function(e,t){};Gl.prototype.pick=function(e,t,n){};Gl.prototype.isDestroyed=function(){return!1};Gl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),fe(this)};Gl._deriveBoundingBox=_ce;Gl._deriveBoundingRegion=Zce;Gl._deriveBoundingVolumeS2=Ice;var YS=Gl;var $zn=y(x(),1);var NEn=y(x(),1),r9e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},hd=Object.freeze(r9e);var vzn=y(x(),1);var aTn=y(x(),1);var UEn=y(x(),1);function NS(e,t){this._distance=t,this._normal=new Gce(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(NS.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});NS.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new NS(e.normal,e.distance),t};NS.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new NS(e.normal,e.distance)};function Gce(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(Gce.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(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){l(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){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var Us=NS;function Mc(e){e=e??Q.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.edgeColor=D.clone(e.edgeColor??D.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new Ce,this.planeRemoved=new Ce,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Bce:wce,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function Bce(e){return e===Jt.OUTSIDE}function wce(e){return e===Jt.INSIDE}Object.defineProperties(Mc.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?Bce:wce)}},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}}});function Vce(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Mc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Vce(n,i)},e.index=t,Vce(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Mc.prototype.get=function(e){return this._planes[e]};function Yce(e,t){let n=e.length;for(let i=0;i<n;++i)if(an.equals(e[i],t))return i;return-1}Mc.prototype.contains=function(e){return Yce(this._planes,e)!==-1};Mc.prototype.remove=function(e){let t=this._planes,n=Yce(t,e);if(n===-1)return!1;e instanceof Us&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof Us&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Mc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof Us&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var s9e=new ce,a9e=new ce;function Lce(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=_n.octEncodeToCartesian4(a.normal,a9e);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let d=ce.packFloat(a.distance,s9e);i[r+4]=d.x,i[r+5]=d.y,i[r+6]=d.z,i[r+7]=d.w,r+=8}}function Wce(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function Nce(e,t){let n=Yt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var c9e=new M;Mc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Mc.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=Nce(o,c9e);s.y*=2,i?(t=new Wt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:ve.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Wt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,sampler:Ht.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(Wce(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Lce(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),Wce(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),Lce(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var l9e=new F,Fce=new an(m.UNIT_X,0);Mc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=F.multiply(t,o,l9e));let r=Jt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Jt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];an.transform(a,o,Fce);let c=e.intersectPlane(Fce);if(c===Jt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Mc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Mc.useFloatTexture=function(e){return e.floatingPointTexture};Mc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Mc.useFloatTexture(t)?e.length:e.length*2,r=Nce(o,n);return r.y*=2,r};Mc.prototype.isDestroyed=function(){return!1};Mc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),fe(this)};var ss=Mc;var AIn=y(x(),1);var OSn=y(x(),1);var NSn=y(x(),1);var qTn=y(x(),1);var STn=y(x(),1);var lTn=y(x(),1);function fK(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Pce(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,d;if(i&&(r=f9e(e,t,r,n)),e.length>80*n){a=e[0],c=e[1];let u=a,h=c;for(let p=n;p<o;p+=n){let g=e[p],f=e[p+1];g<a&&(a=g),f<c&&(c=f),g>u&&(u=g),f>h&&(h=f)}d=Math.max(u-a,h-c),d=d!==0?32767/d:0}return ZW(r,s,n,a,c,d,0),s}function Pce(e,t,n,i,o){let r;if(o===I9e(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=Xce(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=Xce(s/i|0,e[s],e[s+1],r);return r&&XS(r,r.next)&&(GW(r),r=r.next),r}function hC(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(XS(n,n.next)||as(n.prev,n,n.next)===0)){if(GW(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function ZW(e,t,n,i,o,r,s){if(!e)return;!s&&r&&y9e(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?u9e(e,i,o,r):d9e(e)){t.push(c.i,e.i,d.i),GW(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=m9e(hC(e),t),ZW(e,t,n,i,o,r,2)):s===2&&h9e(e,t,n,i,o,r):ZW(hC(e),t,n,i,o,r,1);break}}}function d9e(e){let t=e.prev,n=e,i=e.next;if(as(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,d=i.y,u=Math.min(o,r,s),h=Math.min(a,c,d),p=Math.max(o,r,s),g=Math.max(a,c,d),f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=g&&_W(o,a,r,c,s,d,f.x,f.y)&&as(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function u9e(e,t,n,i){let o=e.prev,r=e,s=e.next;if(as(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,h=r.y,p=s.y,g=Math.min(a,c,d),f=Math.min(u,h,p),b=Math.max(a,c,d),C=Math.max(u,h,p),E=mK(g,f,t,n,i),T=mK(b,C,t,n,i),S=e.prevZ,_=e.nextZ;for(;S&&S.z>=E&&_&&_.z<=T;){if(S.x>=g&&S.x<=b&&S.y>=f&&S.y<=C&&S!==o&&S!==s&&_W(a,u,c,h,d,p,S.x,S.y)&&as(S.prev,S,S.next)>=0||(S=S.prevZ,_.x>=g&&_.x<=b&&_.y>=f&&_.y<=C&&_!==o&&_!==s&&_W(a,u,c,h,d,p,_.x,_.y)&&as(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;S&&S.z>=E;){if(S.x>=g&&S.x<=b&&S.y>=f&&S.y<=C&&S!==o&&S!==s&&_W(a,u,c,h,d,p,S.x,S.y)&&as(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;_&&_.z<=T;){if(_.x>=g&&_.x<=b&&_.y>=f&&_.y<=C&&_!==o&&_!==s&&_W(a,u,c,h,d,p,_.x,_.y)&&as(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function m9e(e,t){let n=e;do{let i=n.prev,o=n.next.next;!XS(i,o)&&Uce(i,n,n.next,o)&&RW(i,o)&&RW(o,i)&&(t.push(i.i,n.i,o.i),GW(n),GW(n.next),n=e=o),n=n.next}while(n!==e);return hC(n)}function h9e(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&E9e(s,a)){let c=Dce(s,a);s=hC(s,s.next),c=hC(c,c.next),ZW(s,t,n,i,o,r,0),ZW(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function f9e(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,d=Pce(e,a,c,i,!1);d===d.next&&(d.steiner=!0),o.push(C9e(d))}o.sort(p9e);for(let r=0;r<o.length;r++)n=A9e(o[r],n);return n}function p9e(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),o=(t.next.y-t.y)/(t.next.x-t.x);n=i-o}return n}function A9e(e,t){let n=g9e(e,t);if(!n)return t;let i=Dce(n,e);return hC(i,i.next),hC(n,n.next)}function g9e(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(XS(e,n))return n;do{if(XS(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,s=n.x<n.next.x?n:n.next,h===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,d=s.y,u=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&Mce(o<d?i:r,o,c,d,o<d?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);RW(n,e)&&(h<u||h===u&&(n.x>s.x||n.x===s.x&&b9e(s,n)))&&(s=n,u=h)}n=n.next}while(n!==a);return s}function b9e(e,t){return as(e.prev,e,t.prev)<0&&as(t.next,e,e.next)<0}function y9e(e,t,n,i){let o=e;do o.z===0&&(o.z=mK(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,x9e(o)}function x9e(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d<n&&(a++,s=s.nextZ,!!s);d++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function mK(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function C9e(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function Mce(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function _W(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Mce(e,t,n,i,o,r,s,a)}function E9e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!T9e(e,t)&&(RW(e,t)&&RW(t,e)&&S9e(e,t)&&(as(e.prev,e,t.prev)||as(e,t.prev,t))||XS(e,t)&&as(e.prev,e,e.next)>0&&as(t.prev,t,t.next)>0)}function as(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function XS(e,t){return e.x===t.x&&e.y===t.y}function Uce(e,t,n,i){let o=Kv(as(e,t,n)),r=Kv(as(e,t,i)),s=Kv(as(n,i,e)),a=Kv(as(n,i,t));return!!(o!==r&&s!==a||o===0&&Hv(e,n,t)||r===0&&Hv(e,i,t)||s===0&&Hv(n,e,i)||a===0&&Hv(n,t,i))}function Hv(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Kv(e){return e>0?1:e<0?-1:0}function T9e(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Uce(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function RW(e,t){return as(e.prev,e,e.next)<0?as(e,t,e.next)>=0&&as(e,e.prev,t)>=0:as(e,t,e.prev)<0||as(e,e.next,t)<0}function S9e(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Dce(e,t){let n=hK(e.i,e.x,e.y),i=hK(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function Xce(e,t,n,i){let o=hK(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function GW(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 hK(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function I9e(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var _9e=new m,Z9e=new m,g0={};g0.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};g0.computeWindingOrder2D=function(e){return g0.computeArea2D(e)>0?Ns.COUNTER_CLOCKWISE:Ns.CLOCKWISE};g0.triangulate=function(e,t){let n=M.packArray(e);return fK(n,t,2)};var Oce=new m,zce=new m,Hce=new m,vce=new m,kce=new m,Qce=new m,JA=new m,Kce=new M,Jce=new M,jce=new M,PS=new M;g0.computeSubdivision=function(e,t,n,i,o){o=o??V.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let S=t[a];if(d[h++]=S.x,d[h++]=S.y,d[h++]=S.z,r){let _=i[a];u[p++]=_.x,u[p++]=_.y}}let g=[],f={},b=e.maximumRadius,C=V.chordLength(o,b),E=C*C;for(;s.length>0;){let S=s.pop(),_=s.pop(),R=s.pop(),L=m.fromArray(d,R*3,Oce),W=m.fromArray(d,_*3,zce),B=m.fromArray(d,S*3,Hce),Y,N,A;r&&(Y=M.fromArray(u,R*2,Kce),N=M.fromArray(u,_*2,Jce),A=M.fromArray(u,S*2,jce));let I=m.multiplyByScalar(m.normalize(L,vce),b,vce),Z=m.multiplyByScalar(m.normalize(W,kce),b,kce),G=m.multiplyByScalar(m.normalize(B,Qce),b,Qce),w=m.magnitudeSquared(m.subtract(I,Z,JA)),X=m.magnitudeSquared(m.subtract(Z,G,JA)),v=m.magnitudeSquared(m.subtract(G,I,JA)),U=Math.max(w,X,v),k,P,O;U>E?w===U?(k=`${Math.min(R,_)} ${Math.max(R,_)}`,a=f[k],l(a)||(P=m.add(L,W,JA),m.multiplyByScalar(P,.5,P),d.push(P.x,P.y,P.z),a=d.length/3-1,f[k]=a,r&&(O=M.add(Y,N,PS),M.multiplyByScalar(O,.5,O),u.push(O.x,O.y))),s.push(R,a,S),s.push(a,_,S)):X===U?(k=`${Math.min(_,S)} ${Math.max(_,S)}`,a=f[k],l(a)||(P=m.add(W,B,JA),m.multiplyByScalar(P,.5,P),d.push(P.x,P.y,P.z),a=d.length/3-1,f[k]=a,r&&(O=M.add(N,A,PS),M.multiplyByScalar(O,.5,O),u.push(O.x,O.y))),s.push(_,a,R),s.push(a,S,R)):v===U&&(k=`${Math.min(S,R)} ${Math.max(S,R)}`,a=f[k],l(a)||(P=m.add(B,L,JA),m.multiplyByScalar(P,.5,P),d.push(P.x,P.y,P.z),a=d.length/3-1,f[k]=a,r&&(O=M.add(A,Y,PS),M.multiplyByScalar(O,.5,O),u.push(O.x,O.y))),s.push(S,a,_),s.push(a,R,_)):(g.push(R),g.push(_),g.push(S))}let T={attributes:{position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:Be.TRIANGLES};return r&&(T.attributes.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),new pt(T)};var R9e=new pe,G9e=new pe,V9e=new pe,pK=new pe;g0.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??V.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let R=t[a];if(d[h++]=R.x,d[h++]=R.y,d[h++]=R.z,r){let L=i[a];u[p++]=L.x,u[p++]=L.y}}let g=[],f={},b=e.maximumRadius,C=V.chordLength(o,b),E=new Ac(void 0,void 0,e),T=new Ac(void 0,void 0,e),S=new Ac(void 0,void 0,e);for(;s.length>0;){let R=s.pop(),L=s.pop(),W=s.pop(),B=m.fromArray(d,W*3,Oce),Y=m.fromArray(d,L*3,zce),N=m.fromArray(d,R*3,Hce),A,I,Z;r&&(A=M.fromArray(u,W*2,Kce),I=M.fromArray(u,L*2,Jce),Z=M.fromArray(u,R*2,jce));let G=e.cartesianToCartographic(B,R9e),w=e.cartesianToCartographic(Y,G9e),X=e.cartesianToCartographic(N,V9e);E.setEndPoints(G,w);let v=E.surfaceDistance;T.setEndPoints(w,X);let U=T.surfaceDistance;S.setEndPoints(X,G);let k=S.surfaceDistance,P=Math.max(v,U,k),O,H,ee,z,te;P>C?v===P?(O=`${Math.min(W,L)} ${Math.max(W,L)}`,a=f[O],l(a)||(H=E.interpolateUsingFraction(.5,pK),ee=(G.height+w.height)*.5,z=m.fromRadians(H.longitude,H.latitude,ee,e,JA),d.push(z.x,z.y,z.z),a=d.length/3-1,f[O]=a,r&&(te=M.add(A,I,PS),M.multiplyByScalar(te,.5,te),u.push(te.x,te.y))),s.push(W,a,R),s.push(a,L,R)):U===P?(O=`${Math.min(L,R)} ${Math.max(L,R)}`,a=f[O],l(a)||(H=T.interpolateUsingFraction(.5,pK),ee=(w.height+X.height)*.5,z=m.fromRadians(H.longitude,H.latitude,ee,e,JA),d.push(z.x,z.y,z.z),a=d.length/3-1,f[O]=a,r&&(te=M.add(I,Z,PS),M.multiplyByScalar(te,.5,te),u.push(te.x,te.y))),s.push(L,a,W),s.push(a,R,W)):k===P&&(O=`${Math.min(R,W)} ${Math.max(R,W)}`,a=f[O],l(a)||(H=S.interpolateUsingFraction(.5,pK),ee=(X.height+G.height)*.5,z=m.fromRadians(H.longitude,H.latitude,ee,e,JA),d.push(z.x,z.y,z.z),a=d.length/3-1,f[O]=a,r&&(te=M.add(Z,A,PS),M.multiplyByScalar(te,.5,te),u.push(te.x,te.y))),s.push(R,a,L),s.push(a,W,L)):(g.push(W),g.push(L),g.push(R))}let _={attributes:{position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:Be.TRIANGLES};return r&&(_.attributes.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),new pt(_)};g0.scaleToGeodeticHeight=function(e,t,n,i){n=n??ie.default;let o=_9e,r=Z9e;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)m.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),m.multiplyByScalar(o,t,o),m.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var Si=g0;var _Tn=y(x(),1);function b0(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(b0.prototype,{length:{get:function(){return this._length}}});b0.prototype.enqueue=function(e){this._array.push(e),this._length++};b0.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};b0.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};b0.prototype.contains=function(e){return this._array.indexOf(e)!==-1};b0.prototype.clear=function(){this._array.length=this._offset=this._length=0};b0.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var y0=b0;var Er={};Er.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};Er.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let d=0;d<c;++d,n+=i.packedLength)i.pack(s[d],t,n)}if(l(a)){let c=a.length;for(let d=0;d<c;++d)o.push(a[d])}}return n};Er.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=Er.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var fC=new M;function ele(e,t,n,i){return M.subtract(t,e,fC),M.multiplyByScalar(fC,n/i,fC),M.add(e,fC,fC),[fC.x,fC.y]}var x0=new m;function L9e(e,t,n,i){return m.subtract(t,e,x0),m.multiplyByScalar(x0,n/i,x0),m.add(e,x0,x0),[x0.x,x0.y,x0.z]}Er.subdivideLineCount=function(e,t,n){let o=m.distance(e,t)/n,r=Math.max(0,Math.ceil(V.log2(o)));return Math.pow(2,r)};var jv=new pe,qv=new pe,W9e=new pe,F9e=new m,Jv=new Ac;Er.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,jv),r=e.cartesianToCartographic(n,qv),a=new Ac(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(V.log2(a)));return Math.pow(2,c)};Er.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=Er.subdivideLineCount(n,i,o),a=M.distance(e,t),c=a/s,d=r;d.length=s*2;let u=0;for(let h=0;h<s;h++){let p=ele(e,t,h*c,a);d[u++]=p[0],d[u++]=p[1]}return d};Er.subdivideLine=function(e,t,n,i){let o=Er.subdivideLineCount(e,t,n),r=m.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let d=0;d<o;d++){let u=L9e(e,t,d*s,r);a[c++]=u[0],a[c++]=u[1],a[c++]=u[2]}return a};Er.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,jv),c=n.cartesianToCartographic(o,qv);Jv.setEndPoints(a,c);let d=Jv.surfaceDistance/r,u=Math.max(0,Math.ceil(V.log2(d))),h=Math.pow(2,u),p=M.distance(e,t),g=p/h,f=s;f.length=h*2;let b=0;for(let C=0;C<h;C++){let E=ele(e,t,C*g,p);f[b++]=E[0],f[b++]=E[1]}return f};Er.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,jv),s=e.cartesianToCartographic(n,qv),a=new Ac(r,s,e);if(l(o)||(o=[]),a.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let c=a.surfaceDistance/i,d=Math.max(0,Math.ceil(V.log2(c))),u=Math.pow(2,d),h=a.surfaceDistance/u,p=o;p.length=u*3;let g=0;for(let f=0;f<u;f++){let b=a.interpolateUsingSurfaceDistance(f*h,W9e),C=e.cartographicToCartesian(b,F9e);p[g++]=C.x,p[g++]=C.y,p[g++]=C.z}return p};var B9e=new m,w9e=new m,Y9e=new m,N9e=new m;Er.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??ie.default;let r=B9e,s=w9e,a=Y9e,c=N9e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let d=e.attributes.position.values,u=d.length/2;for(let h=0;h<u;h+=3)m.fromArray(d,h,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=m.multiplyByScalar(r,n,s),s=m.add(c,s,s),d[h+u]=s.x,d[h+1+u]=s.y,d[h+2+u]=s.z,o&&(c=m.clone(a,c)),s=m.multiplyByScalar(r,t,s),s=m.add(c,s,s),d[h]=s.x,d[h+1]=s.y,d[h+2]=s.z}return e};Er.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new y0;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),d=c.positions;if(t)for(a=d.length,r=0;r<a;r++)n.scaleToGeodeticSurface(d[r],d[r]);if(d=Mo(d,m.equalsEpsilon,!0),d.length<3)continue;let u=c.holes?c.holes.length:0;for(r=0;r<u;r++){let h=c.holes[r],p=h.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Mo(p,m.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(h.holes)&&(g=h.holes.length),s=0;s<g;s++)o.enqueue(h.holes[s])}i.push(d)}return i};var X9e=new pe;function P9e(e,t,n){let i=n.cartesianToCartographic(e,jv),o=n.cartesianToCartographic(t,qv);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;Jv.setEndPoints(i,o);let r=Jv.findIntersectionWithLatitude(0,X9e);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>V.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function M9e(e,t,n,i){if(i===ln.RHUMB)return P9e(e,t,n);let o=di.lineSegmentPlane(e,t,an.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var U9e=new pe;function D9e(e,t,n){let i=[],o,r,s,a,c,d=0;for(;d<e.length;){o=e[d],r=e[(d+1)%e.length],s=V.sign(o.z),a=V.sign(r.z);let u=h=>t.cartesianToCartographic(h,U9e).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=M9e(o,r,t,n),++d,!l(c))continue;e.splice(d,0,c),i.push({position:d,type:s,visited:!1,next:a,theta:u(c)})}++d}return i}function tle(e,t,n,i,o,r,s){let a=[],c=r,d=h=>p=>p.position===h,u=[];do{let h=n[c];a.push(h);let p=i.findIndex(d(c)),g=i[p];if(!l(g)){++c;continue}let{visited:f,type:b,next:C}=g;if(g.visited=!0,b===0){if(C===0){let _=i[p-(s?1:-1)];if(_?.position===c+1)_.visited=!0;else{++c;continue}}if(!f&&s&&C>0||r===c&&!s&&C<0){++c;continue}}if(!(s?b>=0:b<=0)){++c;continue}f||u.push(c);let T=p+(s?1:-1),S=i[T];if(!l(S)){++c;continue}c=S.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let h of u)t=tle(e,++t,n,i,0,h,!s);return t}Er.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=D9e(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((d,u)=>d.theta-u.theta);let c=s[0].z>=0;o=tle(i,o,s,a,1,0,c)}return i};Er.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new y0;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),h=u.positions,p=u.holes,g,f;if(i)for(f=h.length,g=0;g<f;g++)o.scaleToGeodeticSurface(h[g],h[g]);if(t||(h=Mo(h,m.equalsEpsilon,!0)),h.length<3)continue;let b=n(h);if(!l(b))continue;let C=[],E=Si.computeWindingOrder2D(b);if(E===Ns.CLOCKWISE&&(b.reverse(),h=h.slice().reverse()),d){d=!1;let L=[h];if(L=r(L,L),L.length>1){for(let W of L)c.enqueue(new gc(W,p));continue}}let T=h.slice(),S=l(p)?p.length:0,_=[],R;for(g=0;g<S;g++){let L=p[g],W=L.positions;if(i)for(f=W.length,R=0;R<f;++R)o.scaleToGeodeticSurface(W[R],W[R]);if(t||(W=Mo(W,m.equalsEpsilon,!0)),W.length<3)continue;let B=n(W);if(!l(B))continue;E=Si.computeWindingOrder2D(B),E===Ns.CLOCKWISE&&(B.reverse(),W=W.slice().reverse()),_.push(W),C.push(T.length),T=T.concat(W),b=b.concat(B);let Y=0;for(l(L.holes)&&(Y=L.holes.length),R=0;R<Y;R++)c.enqueue(L.holes[R])}s.push({outerRing:h,holes:_}),a.push({positions:T,positions2D:b,holes:C})}return{hierarchy:s,polygons:a}};var v9e=new M,k9e=new m,Q9e=new Me,O9e=new $;Er.computeBoundingRectangle=function(e,t,n,i,o){let r=Me.fromAxisAngle(e,i,Q9e),s=$.fromQuaternion(r,O9e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let g=m.clone(n[p],k9e);$.multiplyByVector(s,g,g);let f=t(g,v9e);l(f)&&(a=Math.min(a,f.x),c=Math.max(c,f.x),d=Math.min(d,f.y),u=Math.max(u,f.y))}return o.x=a,o.y=d,o.width=c-a,o.height=u-d,o};Er.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=Si.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,d=l(n),u=d?n.positions:void 0;if(o){let h=c.length,p=new Array(h*3),g=0;for(let C=0;C<h;C++){let E=c[C];p[g++]=E.x,p[g++]=E.y,p[g++]=E.z}let f={attributes:{position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Be.TRIANGLES};d&&(f.attributes.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:M.packArray(u)}));let b=new pt(f);return r.normal?Dn.computeNormal(b):b}if(s===ln.GEODESIC)return Si.computeSubdivision(e,c,a,u,i);if(s===ln.RHUMB)return Si.computeRhumbLineSubdivision(e,c,a,u,i)};var qce=[],$ce=[],z9e=new m,H9e=new m;Er.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,d,u,h,p,g,f,b=e.length,C=0,E=0,T=l(t),S=T?t.positions:void 0;if(o)for(a=b*3*2,s=new Array(a*2),T&&(f=b*2*2,g=new Array(f*2)),c=0;c<b;c++)d=e[c],u=e[(c+1)%b],s[C]=s[C+a]=d.x,++C,s[C]=s[C+a]=d.y,++C,s[C]=s[C+a]=d.z,++C,s[C]=s[C+a]=u.x,++C,s[C]=s[C+a]=u.y,++C,s[C]=s[C+a]=u.z,++C,T&&(h=S[c],p=S[(c+1)%b],g[E]=g[E+f]=h.x,++E,g[E]=g[E+f]=h.y,++E,g[E]=g[E+f]=p.x,++E,g[E]=g[E+f]=p.y,++E);else{let B=V.chordLength(i,n.maximumRadius),Y=0;if(r===ln.GEODESIC)for(c=0;c<b;c++)Y+=Er.subdivideLineCount(e[c],e[(c+1)%b],B);else if(r===ln.RHUMB)for(c=0;c<b;c++)Y+=Er.subdivideRhumbLineCount(n,e[c],e[(c+1)%b],B);for(a=(Y+b)*3,s=new Array(a*2),T&&(f=(Y+b)*2,g=new Array(f*2)),c=0;c<b;c++){d=e[c],u=e[(c+1)%b];let N,A;T&&(h=S[c],p=S[(c+1)%b]),r===ln.GEODESIC?(N=Er.subdivideLine(d,u,B,$ce),T&&(A=Er.subdivideTexcoordLine(h,p,d,u,B,qce))):r===ln.RHUMB&&(N=Er.subdivideRhumbLine(n,d,u,B,$ce),T&&(A=Er.subdivideTexcoordRhumbLine(h,p,n,d,u,B,qce)));let I=N.length;for(let Z=0;Z<I;++Z,++C)s[C]=N[Z],s[C+a]=N[Z];if(s[C]=u.x,s[C+a]=u.x,++C,s[C]=u.y,s[C+a]=u.y,++C,s[C]=u.z,s[C+a]=u.z,++C,T){let Z=A.length;for(let G=0;G<Z;++G,++E)g[E]=A[G],g[E+f]=A[G];g[E]=p.x,g[E+f]=p.x,++E,g[E]=p.y,g[E+f]=p.y,++E}}}b=s.length;let _=Pe.createTypedArray(b/3,b-e.length*6),R=0;for(b/=6,c=0;c<b;c++){let B=c,Y=B+1,N=B+b,A=N+1;d=m.fromArray(s,B*3,z9e),u=m.fromArray(s,Y*3,H9e),!m.equalsEpsilon(d,u,V.EPSILON10,V.EPSILON10)&&(_[R++]=B,_[R++]=N,_[R++]=Y,_[R++]=Y,_[R++]=N,_[R++]=A)}let L={attributes:new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:s})}),indices:_,primitiveType:Be.TRIANGLES};return T&&(L.attributes.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:g})),new pt(L)};var ei=Er;var lSn=y(x(),1);function cs(e,t){this.position=e,l(this.position)||(this.position=new M),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=cs.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(cs.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=M.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(V.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=V.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=V.TWO_PI),e}}});var MS=new pe,K9e=new m;cs.prototype.getLatitude=function(e){l(e)||(e=ie.default),MS.latitude=this.conformalLatitude,MS.longitude=this.longitude,MS.height=0;let t=this.ellipsoid.cartographicToCartesian(MS,K9e);return e.cartesianToCartographic(t,MS),MS.latitude};var J9e=new xn,j9e=new m,q9e=new m;cs.fromCartesian=function(e,t){let n=V.signNotZero(e.z),i=cs.NORTH_POLE_TANGENT_PLANE,o=cs.SOUTH_POLE;n<0&&(i=cs.SOUTH_POLE_TANGENT_PLANE,o=cs.NORTH_POLE);let r=J9e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=m.subtract(r.origin,o,j9e),m.normalize(r.direction,r.direction);let s=di.rayPlane(r,i.plane,q9e),a=m.subtract(s,o,s),c=m.dot(i.xAxis,a),d=n*m.dot(i.yAxis,a);return l(t)?(t.position=new M(c,d),t.tangentPlane=i,t):new cs(new M(c,d),i)};cs.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=cs.fromCartesian(e[i],t[i]);return t};cs.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new cs(e.position,e.tangentPlane)};cs.HALF_UNIT_SPHERE=Object.freeze(new ie(.5,.5,.5));cs.NORTH_POLE=Object.freeze(new m(0,0,.5));cs.SOUTH_POLE=Object.freeze(new m(0,0,-.5));cs.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Ss(cs.NORTH_POLE,cs.HALF_UNIT_SPHERE));cs.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Ss(cs.SOUTH_POLE,cs.HALF_UNIT_SPHERE));var Uc=cs;var $9e=new pe,nle=new pe;function eQe(e,t,n,i){let r=i.cartesianToCartographic(e,$9e).height,s=i.cartesianToCartographic(t,nle);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,nle);a.height=r-100,i.cartographicToCartesian(a,n)}var ile=new $e,tQe=new m,nQe=new m,iQe=new m,oQe=new m,rQe=new m,sQe=new m,$v=new m,rp=new m,US=new m,aQe=new M,cQe=new M,lQe=new m,ole=new Me,dQe=new $,uQe=new $;function AK(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,d=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let u=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,f=e.stRotation,b=e.perPositionHeight,C=aQe;C.x=u.x,C.y=u.y;let E=t.st?new Float32Array(2*(s/3)):void 0,T;t.normal&&(b&&c&&!a?T=n.attributes.normal.values:T=new Float32Array(s));let S=t.tangent?new Float32Array(s):void 0,_=t.bitangent?new Float32Array(s):void 0,R=i?new Float32Array(s):void 0,L=0,W=0,B=nQe,Y=iQe,N=oQe,A=!0,I=dQe,Z=uQe;if(f!==0){let X=Me.fromAxisAngle(h,f,ole);I=$.fromQuaternion(X,I),X=Me.fromAxisAngle(h,-f,ole),Z=$.fromQuaternion(X,Z)}else I=$.clone($.IDENTITY,I),Z=$.clone($.IDENTITY,Z);let G=0,w=0;c&&d&&(G=s/2,w=s/3,s/=2);for(let X=0;X<s;X+=3){let v=m.fromArray(o,X,lQe);if(t.st&&!l(r)){let U=$.multiplyByVector(I,v,tQe);U=g.scaleToGeodeticSurface(U,U);let k=p([U],cQe)[0];M.subtract(k,C,k);let P=V.clamp(k.x/u.width,0,1),O=V.clamp(k.y/u.height,0,1);d&&(E[L+w]=P,E[L+1+w]=O),c&&(E[L]=P,E[L+1]=O),L+=2}if(t.normal||t.tangent||t.bitangent||i){let U=W+1,k=W+2;if(a){if(X+3<s){let P=m.fromArray(o,X+3,rQe);if(A){let O=m.fromArray(o,X+s,sQe);b&&eQe(v,P,O,g),m.subtract(P,v,P),m.subtract(O,v,O),B=m.normalize(m.cross(O,P,B),B),A=!1}m.equalsEpsilon(P,v,V.EPSILON10)&&(A=!0)}(t.tangent||t.bitangent)&&(N=g.geodeticSurfaceNormal(v,N),t.tangent&&(Y=m.normalize(m.cross(N,B,Y),Y)))}else B=g.geodeticSurfaceNormal(v,B),(t.tangent||t.bitangent)&&(b&&($v=m.fromArray(T,W,$v),rp=m.cross(m.UNIT_Z,$v,rp),rp=m.normalize($.multiplyByVector(Z,rp,rp),rp),t.bitangent&&(US=m.normalize(m.cross($v,rp,US),US))),Y=m.cross(m.UNIT_Z,B,Y),Y=m.normalize($.multiplyByVector(Z,Y,Y),Y),t.bitangent&&(N=m.normalize(m.cross(B,Y,N),N)));t.normal&&(e.wall?(T[W+G]=B.x,T[U+G]=B.y,T[k+G]=B.z):d&&(T[W+G]=-B.x,T[U+G]=-B.y,T[k+G]=-B.z),(c&&!b||a)&&(T[W]=B.x,T[U]=B.y,T[k]=B.z)),i&&(a&&(B=g.geodeticSurfaceNormal(v,B)),R[W+G]=-B.x,R[U+G]=-B.y,R[k+G]=-B.z),t.tangent&&(e.wall?(S[W+G]=Y.x,S[U+G]=Y.y,S[k+G]=Y.z):d&&(S[W+G]=-Y.x,S[U+G]=-Y.y,S[k+G]=-Y.z),c&&(b?(S[W]=rp.x,S[U]=rp.y,S[k]=rp.z):(S[W]=Y.x,S[U]=Y.y,S[k]=Y.z))),t.bitangent&&(d&&(_[W+G]=N.x,_[U+G]=N.y,_[k+G]=N.z),c&&(b?(_[W]=US.x,_[U]=US.y,_[k]=US.z):(_[W]=N.x,_[U]=N.y,_[k]=N.z))),W+=3}}t.st&&!l(r)&&(n.attributes.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:E})),t.normal&&(n.attributes.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:T})),t.tangent&&(n.attributes.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:S})),t.bitangent&&(n.attributes.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:_})),i&&(n.attributes.extrudeDirection=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:R}))}if(e.extrude&&l(e.offsetAttribute)){let u=o.length/3,h=new Uint8Array(u);if(e.offsetAttribute===mn.TOP)c&&d||a?h=h.fill(1,0,u/2):c&&(h=h.fill(1));else{let p=e.offsetAttribute===mn.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var rle=[];function mQe(e,t,n,i,o,r,s,a,c,d){let u={walls:[]},h;if(s||a){let T=ei.createGeometryFromPositions(e,t,n,i,r,c,d),S=T.attributes.position.values,_=T.indices,R,L;if(s&&a){let W=S.concat(S);R=W.length/3,L=Pe.createTypedArray(R,_.length*2),L.set(_);let B=_.length,Y=R/2;for(h=0;h<B;h+=3){let N=L[h]+Y,A=L[h+1]+Y,I=L[h+2]+Y;L[h+B]=I,L[h+1+B]=A,L[h+2+B]=N}if(T.attributes.position.values=W,r&&c.normal){let N=T.attributes.normal.values;T.attributes.normal.values=new Float32Array(W.length),T.attributes.normal.values.set(N)}if(c.st&&l(n)){let N=T.attributes.st.values;T.attributes.st.values=new Float32Array(R*2),T.attributes.st.values=N.concat(N)}T.indices=L}else if(a){for(R=S.length/3,L=Pe.createTypedArray(R,_.length),h=0;h<_.length;h+=3)L[h]=_[h+2],L[h+1]=_[h+1],L[h+2]=_[h];T.indices=L}u.topAndBottom=new Bt({geometry:T})}let p=o.outerRing,g=Ss.fromPoints(p,e),f=g.projectPointsOntoPlane(p,rle),b=Si.computeWindingOrder2D(f);b===Ns.CLOCKWISE&&(p=p.slice().reverse());let C=ei.computeWallGeometry(p,n,e,i,r,d);u.walls.push(new Bt({geometry:C}));let E=o.holes;for(h=0;h<E.length;h++){let T=E[h];f=g.projectPointsOntoPlane(T,rle),b=Si.computeWindingOrder2D(f),b===Ns.COUNTER_CLOCKWISE&&(T=T.slice().reverse()),C=ei.computeWallGeometry(T,n,e,i,r,d),u.walls.push(new Bt({geometry:C}))}return u}function hm(e){let t=e.polygonHierarchy,n=e.vertexFormat??we.DEFAULT,i=e.ellipsoid??ie.default,o=e.granularity??V.RADIANS_PER_DEGREE,r=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),d=e.height??0,u=e.extrudedHeight??d;if(!c){let h=Math.max(d,u);u=Math.min(d,u),d=h}this._vertexFormat=we.clone(n),this._ellipsoid=ie.clone(i),this._granularity=o,this._stRotation=r,this._height=d,this._extrudedHeight=u,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??ln.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=ei.computeHierarchyPackedLength(t,m)+ie.packedLength+we.packedLength+(s?ei.computeHierarchyPackedLength(s,M):1)+12}hm.fromPositions=function(e){e=e??Q.EMPTY_OBJECT;let t={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,textureCoordinates:e.textureCoordinates};return new hm(t)};hm.pack=function(e,t,n){return n=n??0,n=ei.packPolygonHierarchy(e._polygonHierarchy,t,n,m),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=ei.packPolygonHierarchy(e._textureCoordinates,t,n,M):t[n++]=-1,t[n++]=e.packedLength,t};var hQe=ie.clone(ie.UNIT_SPHERE),fQe=new we,pQe={polygonHierarchy:{}};hm.unpack=function(e,t,n){t=t??0;let i=ei.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,hQe);t+=ie.packedLength;let r=we.unpack(e,t,fQe);t+=we.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++]===1,h=e[t++]===1,p=e[t++]===1,g=e[t++]===1,f=e[t++]===1,b=e[t++],C=e[t++],E=e[t]===-1?void 0:ei.unpackPolygonHierarchy(e,t,M);l(E)?(t=E.startingIndex,delete E.startingIndex):t++;let T=e[t++];return l(n)||(n=new hm(pQe)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=we.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=d,n._perPositionHeightExtrude=u,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=g,n._shadowVolume=f,n._offsetAttribute=b===-1?void 0:b,n._arcType=C,n._textureCoordinates=E,n.packedLength=T,n};var AQe=new M,gQe=new M,bQe=new Uc;function sle(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+V.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),d=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==ln.RHUMB){let p=M.subtract(t.position,e.position,AQe),g=M.dot(t.position,p)/M.dot(p,p);if(g>0&&g<1){let f=M.add(t.position,M.multiplyByScalar(p,-g,p),gQe),b=Uc.clone(t,bQe);b.position=f;let C=b.getLatitude(n);r.south=Math.min(r.south,C),r.north=Math.max(r.north,C),Math.abs(c)>Math.abs(C)&&(d=C)}}let u=t.x*e.y-e.x*t.y,h=Math.sign(u);h!==0&&(h*=M.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=h),d<=0&&(o.southAngle+=h)}var ale=new Uc,yQe=new Uc,mm={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};hm.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new de),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,mm.northAngle=0,mm.southAngle=0,mm.westOverIdl=Number.POSITIVE_INFINITY,mm.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Uc.fromCartesian(e[0],yQe);for(let s=1;s<o;s++){let a=Uc.fromCartesian(e[s],ale);sle(a,r,t,n,mm,i),r=Uc.clone(a,r)}return sle(Uc.fromCartesian(e[0],ale),r,t,n,mm,i),i.east-i.west>mm.eastOverIdl-mm.westOverIdl&&(i.west=mm.westOverIdl,i.east=mm.eastOverIdl,i.east>V.PI&&(i.east=i.east-V.TWO_PI),i.west>V.PI&&(i.west=i.west-V.TWO_PI)),V.equalsEpsilon(Math.abs(mm.northAngle),V.TWO_PI,V.EPSILON10)&&(i.north=V.PI_OVER_TWO,i.east=V.PI,i.west=-V.PI),V.equalsEpsilon(Math.abs(mm.southAngle),V.TWO_PI,V.EPSILON10)&&(i.south=-V.PI_OVER_TWO,i.east=V.PI,i.west=-V.PI),i};var xQe=new Uc;function CQe(e,t,n){return e.height>=V.PI||e.width>=V.PI?Uc.fromCartesian(t[0],xQe).tangentPlane:Ss.fromPoints(t,n)}var cle=new pe;function EQe(e,t,n){return(i,o)=>{if(e.height>=V.PI||e.width>=V.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],cle);o[s]=new M(a.longitude/V.PI,a.latitude/V.PI_OVER_TWO)}return o.length=i.length,o}return Uc.fromCartesianArray(i,o)}return Ss.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function TQe(e,t,n){if(e.height>=V.PI||e.width>=V.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,cle);return l(r)||(r=new M),r.x=s.longitude/V.PI,r.y=s.latitude/V.PI_OVER_TWO,r}return Uc.fromCartesian(o,r)};let i=Ss.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function SQe(e,t,n,i){return(o,r)=>!i&&(e.height>=V.PI_OVER_TWO||e.width>=2*V.PI_OVER_THREE)?ei.splitPolygonsOnEquator(o,t,n,r):o}function IQe(e,t,n,i){if(t.height>=V.PI||t.width>=V.PI)return $e.fromRectangle(t,void 0,ile);let o=e,r=Ss.fromPoints(o,n);return ei.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,ile)}hm.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,d=e._arcType,u=e._textureCoordinates,h=l(u),p=r.positions;if(p.length<3)return;let g=e.rectangle,f=ei.polygonsFromHierarchy(r,h,EQe(g,p,n),!s,n,SQe(g,n,d,s)),b=f.hierarchy,C=f.polygons,E=function(G){return G},T=h?ei.polygonsFromHierarchy(u,!0,E,!1,n).polygons:void 0;if(b.length===0)return;let S=b[0].outerRing,_=IQe(S,g,n,o),R=[],L=e._height,W=e._extrudedHeight,B=e._perPositionHeightExtrude||!V.equalsEpsilon(L,W,0,V.EPSILON2),Y={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:CQe(g,S,n).plane.normal,projectTo2d:TQe(g,S,n),boundingRectangle:_,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},N;if(B)for(Y.extrude=!0,Y.top=a,Y.bottom=c,Y.shadowVolume=e._shadowVolume,Y.offsetAttribute=e._offsetAttribute,N=0;N<C.length;N++){let G=mQe(n,C[N],h?T[N]:void 0,i,b[N],s,a,c,t,d),w;a&&c?(w=G.topAndBottom,Y.geometry=ei.scaleToGeodeticHeightExtruded(w.geometry,L,W,n,s)):a?(w=G.topAndBottom,w.geometry.attributes.position.values=Si.scaleToGeodeticHeight(w.geometry.attributes.position.values,L,n,!s),Y.geometry=w.geometry):c&&(w=G.topAndBottom,w.geometry.attributes.position.values=Si.scaleToGeodeticHeight(w.geometry.attributes.position.values,W,n,!0),Y.geometry=w.geometry),(a||c)&&(Y.wall=!1,w.geometry=AK(Y),R.push(w));let X=G.walls;Y.wall=!0;for(let v=0;v<X.length;v++){let U=X[v];Y.geometry=ei.scaleToGeodeticHeightExtruded(U.geometry,L,W,n,s),U.geometry=AK(Y),R.push(U)}}else for(N=0;N<C.length;N++){let G=new Bt({geometry:ei.createGeometryFromPositions(n,C[N],h?T[N]:void 0,i,s,t,d)});if(G.geometry.attributes.position.values=Si.scaleToGeodeticHeight(G.geometry.attributes.position.values,L,n,!s),Y.geometry=G.geometry,G.geometry=AK(Y),l(e._offsetAttribute)){let w=G.geometry.attributes.position.values.length,X=e._offsetAttribute===mn.NONE?0:1,v=new Uint8Array(w/3).fill(X);G.geometry.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})}R.push(G)}let A=Dn.combineInstances(R)[0];A.attributes.position.values=new Float64Array(A.attributes.position.values),A.indices=Pe.createTypedArray(A.attributes.position.values.length/3,A.indices);let I=A.attributes,Z=ue.fromVertices(I.position.values);return t.position||delete I.position,new pt({attributes:I,indices:A.indices,primitiveType:A.primitiveType,boundingSphere:Z,offsetAttribute:e._offsetAttribute})};hm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new hm({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:we.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function _Qe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return pt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(hm.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=hm.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=_Qe(this)),this._textureCoordinateRotationPoints}}});var jA=hm;function pC(e){this._ellipsoid=e.ellipsoid??ie.default,this._positions=dle(e.positions),this._cachedPositions=void 0,this._cachedRectangle=void 0}function dle(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=m.clone(e[i]);return n}function ZQe(e,t){if(!l(e)&&!l(t))return!0;if(l(e)!==l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t[i];if(!m.equals(o,r))return!1}return!0}Object.defineProperties(pC.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});pC.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new pC({positions:e.positions,ellipsoid:e.ellipsoid})};pC.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};pC.prototype.computeRectangle=function(e){if(ZQe(this._positions,this._cachedPositions))return de.clone(this._cachedRectangle,e);let t=jA.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e);return this._cachedPositions=dle(this._positions),this._cachedRectangle=de.clone(t),t};var RQe=new de,lle=new m;pC.prototype.computeSphericalExtents=function(e){l(e)||(e=new de);let t=this.computeRectangle(RQe),n=pe.toCartesian(de.southwest(t),this.ellipsoid,lle),i=Math.sqrt(n.x*n.x+n.y*n.y),o=V.fastApproximateAtan2(i,n.z),r=V.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=pe.toCartesian(de.northeast(t),this.ellipsoid,lle),i=Math.sqrt(n.x*n.x+n.y*n.y),o=V.fastApproximateAtan2(i,n.z),r=V.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var DS=pC;var HSn=y(x(),1),VW=`in vec2 v_textureCoordinates;

uniform int u_polygonsLength;
uniform int u_extentsLength;
uniform highp sampler2D u_polygonTexture;
uniform highp sampler2D u_extentsTexture;

int getPolygonIndex(float dimension, vec2 coord) {
   vec2 uv = coord.xy * dimension;
   return int(floor(uv.y) * dimension + floor(uv.x));
}

vec2 getLookupUv(ivec2 dimensions, int i) {
    int pixY = i / dimensions.x;
    int pixX = i - (pixY * dimensions.x);
    float pixelWidth = 1.0 / float(dimensions.x);
    float pixelHeight = 1.0 / float(dimensions.y);
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    return vec2(u, v);
}

vec4 getExtents(int i) {
    return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));
}

ivec2 getPositionsLengthAndExtentsIndex(int i) {
    vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
    vec4 value = texture(u_polygonTexture, uv);
    return ivec2(int(value.x), int(value.y));
}

vec2 getPolygonPosition(int i) {
    vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
    return texture(u_polygonTexture, uv).xy;
}

vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {
    float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);
    float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);
    return vec2(latitude, longitude);
}

void main() {
    int lastPolygonIndex = 0;
    out_FragColor = vec4(1.0);

    // Get the relevant region of the texture
    float dimension = float(u_extentsLength);
    if (u_extentsLength > 2) {
        dimension = ceil(log2(float(u_extentsLength)));
    }
    int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);

    for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
        ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
        int positionsLength = positionsLengthAndExtents.x;
        int polygonExtentsIndex = positionsLengthAndExtents.y;
        lastPolygonIndex += 1;

         // Only compute signed distance for the relevant part of the atlas
         if (polygonExtentsIndex == regionIndex) {
            float clipAmount = czm_infinity;
            vec4 extents = getExtents(polygonExtentsIndex);
            vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension;
            vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents);
            float s = 1.0;

            // Check each edge for absolute distance
            for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) {
                vec2 a = getPolygonPosition(lastPolygonIndex + i);
                vec2 b = getPolygonPosition(lastPolygonIndex + j);
 
                vec2 ab = b - a;
                vec2 pa = p - a;
                float t = dot(pa, ab) / dot(ab, ab);
                t = clamp(t, 0.0, 1.0);

                vec2 pq = pa - t * ab;
                float d = length(pq);

                // Inside / outside computation to determine sign
                bvec3 cond = bvec3(p.y >= a.y, 
                            p.y < b.y, 
                            ab.x * pa.y > ab.y * pa.x);
                if (all(cond) || all(not(cond))) s = -s;
                if (abs(d) < abs(clipAmount)) {
                    clipAmount = d;
                }
            }

            // Normalize the range to [0,1]
            vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
            // In the case where we've iterated through multiple polygons, take the minimum
            out_FragColor = min(out_FragColor, result);
         }

        lastPolygonIndex += positionsLength;
    }
}`;function Rs(e){e=e??Q.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new Ce,this.polygonRemoved=new Ce,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(Rs.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});Rs.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};Rs.prototype.get=function(e){return this._polygons[e]};Rs.prototype.contains=function(e){return this._polygons.some(t=>DS.equals(t,e))};Rs.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>DS.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var GQe=new de;function VQe(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=de.clone(a);u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI);let h=[r];for(let p=0;p<t.length;++p){let g=t[p];if(l(g)&&l(de.simpleIntersection(g,u))&&!de.equals(g,u)){let f=n[p];h.push(...f),f.reduce((b,C)=>de.union(e[C].computeSphericalExtents(GQe),b,b),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=de.clone(a,u),u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI),p=-1}}t.push(u),n.push(h)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}Rs.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function LQe(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=VQe(i),s=0;for(let[c,d]of i.entries()){let u=d.length;t[s++]=u,t[s++]=r.get(c);for(let h=0;h<u;++h){let p=d.positions[h],g=Math.hypot(p.x,p.y),f=V.fastApproximateAtan2(g,p.z),b=V.fastApproximateAtan2(p.x,p.y);t[s++]=f,t[s++]=b}}let a=0;for(let c of o){let d=1/(c.east-c.west),u=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=u,n[a++]=d}e._extentsCount=o.length}var gK=new M;Rs.prototype.update=function(e){let t=e.context;if(!Rs.isSupported(e))throw new he("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let s=Rs.getTextureResolution(i,this.pixelsNeededForPolygonPositions,gK);i=new Wt({context:t,width:s.x,height:s.y,pixelFormat:je.RG,pixelDatatype:ve.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(l(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let s=Rs.getTextureResolution(o,this.pixelsNeededForExtents,gK);o=new Wt({context:t,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:ve.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(LQe(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let s=Rs.getClippingDistanceTextureResolution(this,gK);r=new Wt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?je.RED:je.LUMINANCE,pixelDatatype:ve.FLOAT,sampler:new Ht({wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:zt.LINEAR,magnificationFilter:ui.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=WQe(this)};Rs.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function WQe(e){let t=e._polygonsTexture,n=e._extentsTexture;return new ll({fragmentShaderSource:VW,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var ule=new de,FQe=new de;Rs.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Jt.OUTSIDE;this.inverse&&(o=Jt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let u=e.boundingVolume.computeCorners();c=de.fromCartesianArray(u,t,ule)}l(c)||(c=de.fromBoundingSphere(e.boundingSphere,t,ule));let d=de.simpleIntersection(c,a,FQe);l(d)&&(o=Jt.INTERSECTING)}return o};Rs.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Rs.isSupported=function(e){return e?.context.webgl2};Rs.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Yt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};Rs.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Yt.maximumTextureSize,4096),t.y=Math.min(Yt.maximumTextureSize,4096),t)};Rs.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):Rs.getTextureResolution(n,e.pixelsNeededForExtents,t)};Rs.prototype.isDestroyed=function(){return!1};Rs.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),fe(this)};var Wh=Rs;var d_n=y(x(),1);var TIn=y(x(),1);var bIn=y(x(),1),LW={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};LW.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?LW.SUNLIGHT:LW.SCENE_LIGHT:LW.NONE};var qA=Object.freeze(LW);function mle(){this.lightIntensity=10,this.rayleighCoefficient=new m(55e-7,13e-6,284e-7),this.mieCoefficient=new m(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=qA.NONE}mle.requiresColorCorrect=function(e){return!(V.equalsEpsilon(e.hueShift,0,V.EPSILON7)&&V.equalsEpsilon(e.saturationShift,0,V.EPSILON7)&&V.equalsEpsilon(e.brightnessShift,0,V.EPSILON7))};var AC=mle;var IIn=y(x(),1),Fh=`uniform vec3 u_radiiAndDynamicAtmosphereColor;

uniform float u_atmosphereLightIntensity;
uniform float u_atmosphereRayleighScaleHeight;
uniform float u_atmosphereMieScaleHeight;
uniform float u_atmosphereMieAnisotropy;
uniform vec3 u_atmosphereRayleighCoefficient;
uniform vec3 u_atmosphereMieCoefficient;

const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

/**
 * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
 * the transmittance value for the ray.
 *
 * @param {czm_ray} primaryRay The ray from the camera to the position.
 * @param {float} primaryRayLength The length of the primary ray.
 * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
 * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
 * @param {vec3} mieColor The variable the Mie scattering will be written to.
 * @param {float} opacity The variable the transmittance will be written to.
 * @glslFunction
 */
void computeScattering(
    czm_ray primaryRay,
    float primaryRayLength,
    vec3 lightDirection,
    float atmosphereInnerRadius,
    out vec3 rayleighColor,
    out vec3 mieColor,
    out float opacity
) {

    // Initialize the default scattering amounts to 0.
    rayleighColor = vec3(0.0);
    mieColor = vec3(0.0);
    opacity = 0.0;

    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;

    vec3 origin = vec3(0.0);

    // Calculate intersection from the camera to the outer ring of the atmosphere.
    czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);

    // Return empty colors if no intersection with the atmosphere geometry.
    if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
        return;
    }

    // To deal with smaller values of PRIMARY_STEPS (e.g. 4)
    // we implement a split strategy: sky or horizon.
    // For performance reasons, instead of a if/else branch
    // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
    float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
    // Value close to 0.0: close to the horizon
    // Value close to 1.0: above in the sky
    float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));

    // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
    float start_0 = primaryRayAtmosphereIntersect.start;
    primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
    // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
    primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));

    // For the number of ray steps, distinguish inside or outside atmosphere (outer space)
    // (1) from outer space we have to use more ray steps to get a realistic rendering
    // (2) within atmosphere we need fewer steps for faster rendering
    float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
    float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
    int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
    int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

    // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
    float rayPositionLength = primaryRayAtmosphereIntersect.start;
    // (1) Outside the atmosphere: constant rayStepLength
    // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
    float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
    float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
    float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));

    vec3 rayleighAccumulation = vec3(0.0);
    vec3 mieAccumulation = vec3(0.0);
    vec2 opticalDepth = vec2(0.0);
    vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);

    // Sample positions on the primary ray.
    for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {

        // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
        // loop with non-constant condition, so it has to break early instead
        if (i >= PRIMARY_STEPS) {
            break;
        }

        // Calculate sample position along viewpoint ray.
        vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);

        // Calculate height of sample position above ellipsoid.
        float sampleHeight = length(samplePosition) - atmosphereInnerRadius;

        // Calculate and accumulate density of particles at the sample position.
        vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
        opticalDepth += sampleDensity;

        // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
        czm_ray lightRay = czm_ray(samplePosition, lightDirection);
        czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);

        float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
        float lightPositionLength = 0.0;

        vec2 lightOpticalDepth = vec2(0.0);

        // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
        for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {

            // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
            // loop with non-constant condition, so it has to break early instead
            if (j >= LIGHT_STEPS) {
                break;
            }

            // Calculate sample position along light ray.
            vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);

            // Calculate height of the light sample position above ellipsoid.
            float lightHeight = length(lightPosition) - atmosphereInnerRadius;

            // Calculate density of photons at the light sample position.
            lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;

            // Increment distance on light ray.
            lightPositionLength += lightStepLength;
        }

        // Compute attenuation via the primary ray and the light ray.
        vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));

        // Accumulate the scattering.
        rayleighAccumulation += sampleDensity.x * attenuation;
        mieAccumulation += sampleDensity.y * attenuation;

        // Increment distance on primary ray.
        rayPositionLength += (rayStepLength += rayStepLengthIncrease);
    }

    // Compute the scattering amount.
    rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
    mieColor = u_atmosphereMieCoefficient * mieAccumulation;

    // Compute the transmittance i.e. how much light is passing through the atmosphere.
    opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
}

vec4 computeAtmosphereColor(
    vec3 positionWC,
    vec3 lightDirection,
    vec3 rayleighColor,
    vec3 mieColor,
    float opacity
) {
    // Setup the primary ray: from the camera position to the vertex position.
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);

    float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
    float cosAngleSq = cosAngle * cosAngle;

    float G = u_atmosphereMieAnisotropy;
    float GSq = G * G;

    // The Rayleigh phase function.
    float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
    // The Mie phase function.
    float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));

    // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
    vec3 rayleigh = rayleighPhase * rayleighColor;
    vec3 mie = miePhase * mieColor;

    vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;

    return vec4(color, opacity);
}
`;var ZIn=y(x(),1),WW=`uniform samplerCube u_radianceMap;

in vec2 v_textureCoordinates;


const float twoSqrtPi = 2.0 * sqrt(czm_pi);

// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf
float computeShBasis(int index, vec3 s) {
    if (index == 0) { // l = 0, m = 0
        return 1.0 / twoSqrtPi;
    }
    
    if (index == 1) { // l = 1, m = -1
        return -sqrt(3.0) * s.y / twoSqrtPi;
    }

    if (index == 2) { // l = 1, m = 0
        return sqrt(3.0) * s.z / twoSqrtPi;
    }

    if (index == 3) { // l = 1, m = 1
        return -sqrt(3.0) * s.x / twoSqrtPi;
    }

    if (index == 4) { // l = 2, m = -2
        return sqrt(15.0) * s.y * s.x / twoSqrtPi;
    }

    if (index == 5) { // l = 2, m = -1
        return -sqrt(15.0) * s.y * s.z / twoSqrtPi;
    }

    if (index == 6) { // l = 2, m = 0
        return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi;
    }

    if (index == 7) { // l = 2, m = 1
        return -sqrt(15.0) * s.x * s.z / twoSqrtPi;
    }

    if (index == 8) { // l = 2, m = 2
        return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi;
    }

    return 0.0;
}

float vdcRadicalInverse(int i)
{
    float r;
    float base = 2.0;
    float value = 0.0;
    float invBase = 1.0 / base;
    float invBi = invBase;
    for (int x = 0; x < 100; x++)
    {
        if (i <= 0)
        {
            break;
        }
        r = mod(float(i), base);
        value += r * invBi;
        invBi *= invBase;
        i = int(float(i) * invBase);
    }
    return value;
}

vec2 hammersley2D(int i, int N)
{
    return vec2(float(i) / float(N), vdcRadicalInverse(i));
}

// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics
const int samples = 256; 
const float solidAngle = 1.0 / float(samples);

void main() {
    // Get the current coefficient based on the uv
   vec2 uv = v_textureCoordinates.xy * 3.0;
   int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x));

    for (int i = 0; i < samples; ++i) {
        vec2 xi = hammersley2D(i, samples);
        float phi = czm_twoPi * xi.x;
        float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y);
        float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
        vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi)));

        // Generate the spherical harmonics basis from the direction
        float Ylm = computeShBasis(coefficientIndex, direction);

        vec3 lookupDirection = -direction.xyz;
        lookupDirection.z = -lookupDirection.z;

        vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0);

        // Use the relevant function for this coefficient
        out_FragColor += Ylm * color * solidAngle * sinTheta;
    }
    
}
`;var GIn=y(x(),1),FW=`precision highp float;

in vec2 v_textureCoordinates;

uniform vec3 u_faceDirection; // Current cubemap face
uniform vec3 u_positionWC;
uniform mat4 u_enuToFixedFrame;
uniform vec4 u_brightnessSaturationGammaIntensity;
uniform vec4 u_groundColor; // alpha component represent albedo

vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) {
    vec2 scaledUV = uv * 2.0 - 1.0;

    if (faceDir.x != 0.0) {
        return vec4(faceDir.x,  scaledUV.x * faceDir.x, -scaledUV.y, 0.0);
    } else if (faceDir.y != 0.0) {
        return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0);
    } else {
        return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); 
    }
}

void main() {    
    float height = length(u_positionWC);
    float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y;
    float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0);

    // Scale the position to ensure the sky color is present, even when underground.
    vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius);

    float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x;
    float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius;

    vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz;
    vec3 normalizedDirection = normalize(direction);

    czm_ray ray = czm_ray(positionWC, normalizedDirection);
    czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius);
    if (!czm_isEmpty(intersection)) {
        intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii);
    }

    bool onEllipsoid = intersection.start >= 0.0;
    float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius);

    // Compute sky color for each position on a sphere at radius centered around the provided position's origin
    vec3 skyPositionWC = positionWC + normalizedDirection * rayLength;

    float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
    vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum));
    vec3 mieColor;
    vec3 rayleighColor;
    float opacity;
    czm_computeScattering(
        ray,
        rayLength,
        lightDirectionWC,
        atmosphereInnerRadius, 
        rayleighColor,
        mieColor,
        opacity
    );

    vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity);

#ifdef ATMOSPHERE_COLOR_CORRECT
    const bool ignoreBlackPixels = true;
    atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels);
#endif

    vec3 lookupDirection = -normalizedDirection;
     // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
    lookupDirection.x = -lookupDirection.x;
    lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection);
    lookupDirection.x = -lookupDirection.x;

    // Values outside the atmopshere are rendered as black, when they should be treated as transparent
    float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0);
    skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent

    // Blend starmap with atmopshere scattering
    float intensity = u_brightnessSaturationGammaIntensity.w;
    vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection);
    vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a);
    vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0);

    // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height
    vec3 up = normalize(positionWC);
    float occlusion = max(dot(lightDirectionWC, up), 0.05);
    vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0);
    vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0));

    vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor);

    float brightness = u_brightnessSaturationGammaIntensity.x;
    float saturation = u_brightnessSaturationGammaIntensity.y;
    float gamma = u_brightnessSaturationGammaIntensity.z;

#ifdef ENVIRONMENT_COLOR_CORRECT
    color.rgb = mix(vec3(0.0), color.rgb, brightness);
    color.rgb = czm_saturation(color.rgb, saturation);
#endif
    color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0.
    color.rgb = czm_gammaCorrect(color.rgb);

    out_FragColor = color;
}
`;var LIn=y(x(),1),BW=`precision highp float;

in vec3 v_textureCoordinates;

uniform float u_roughness;
uniform samplerCube u_radianceTexture;
uniform vec3 u_faceDirection;

float vdcRadicalInverse(int i)
{
    float r;
    float base = 2.0;
    float value = 0.0;
    float invBase = 1.0 / base;
    float invBi = invBase;
    for (int x = 0; x < 100; x++)
    {
        if (i <= 0)
        {
            break;
        }
        r = mod(float(i), base);
        value += r * invBi;
        invBi *= invBase;
        i = int(float(i) * invBase);
    }
    return value;
}

vec2 hammersley2D(int i, int N)
{
    return vec2(float(i) / float(N), vdcRadicalInverse(i));
}

vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
{
    float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
    float phi = czm_twoPi * xi.x;
    float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
    float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
    vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
    vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
    vec3 tangentX = normalize(cross(upVector, N));
    vec3 tangentY = cross(N, tangentX);
    return tangentX * H.x + tangentY * H.y + N * H.z;
}

// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses
const int samples = 128;

void main() {
    vec3 normal = u_faceDirection;
    vec3 V = normalize(v_textureCoordinates);
    float roughness = u_roughness;

    vec4 color = vec4(0.0);
    float weight = 0.0;
    for (int i = 0; i < samples; ++i) {
            vec2 xi = hammersley2D(i, samples);
            vec3 H = importanceSampleGGX(xi, roughness, V);
            vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector

            float NdotL = max(dot(V, L), 0.0);
            if (NdotL > 0.0) {
                color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL;
                weight += NdotL;
            }
        }
    out_FragColor = color / weight;
}
`;var FIn=y(x(),1),wW=`in vec3 position;
out vec3 v_textureCoordinates;

uniform vec3 u_faceDirection;

vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) {
    vec2 scaledUV = uv;

    if (faceDir.x != 0.0) {
        return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x);
    } else if (faceDir.y != 0.0) {
        return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y);
    } else {
        return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); 
    }
}

void main() 
{
    v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection);
    v_textureCoordinates.y = -v_textureCoordinates.y;
    v_textureCoordinates.z = -v_textureCoordinates.z;
    gl_Position = vec4(position, 1.0);
}
`;function gi(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=e??Q.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(Yt.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=gi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new j;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new M(i,i),this._radiiAndDynamicAtmosphereColor=new m,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??gi.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(gi.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){m.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=m.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});gi._maximumComputeCommandCount=8;gi._activeComputeCommandCount=0;gi._nextFrameCommandQueue=[];gi._queueCommand=(e,t)=>{if(gi._activeComputeCommandCount>=gi._maximumComputeCommandCount){gi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),gi._activeComputeCommandCount++};gi._updateCommandQueue=e=>{if(gi._maximumComputeCommandCount=Math.log2(Yt.maximumCubeMapSize),gi._nextFrameCommandQueue.length>0&&gi._activeComputeCommandCount<gi._maximumComputeCommandCount){let t=gi._nextFrameCommandQueue.shift();for(;l(t)&&gi._activeComputeCommandCount<gi._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=gi._nextFrameCommandQueue.shift();continue}e.commandList.push(t),gi._activeComputeCommandCount++,t=gi._nextFrameCommandQueue.shift()}l(t)&&gi._nextFrameCommandQueue.push(t)}};gi.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};gi.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var BQe=new m,wQe=new m;function YQe(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,wQe),s=1.025,a=BQe,c=l(r)?m.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!m.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(m.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var hle=new m,NQe=new F,XQe=new ce,PQe=new D;function MQe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new zr({context:n,width:i.x,height:i.y,pixelDatatype:ve.UNSIGNED_BYTE,pixelFormat:je.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new ze({sources:[Fh,FW]}),e._radianceMapFS=o),AC.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=Tt.eastNorthUpToFixedFrame(r,a,NQe),d=XQe;d.x=e.brightness,d.y=e.saturation,d.z=e.gamma,d.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let u=0;for(let h of zr.faceNames()){let p=e._radianceMapTextures[u];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Wt({context:n,width:i.x,height:i.y,pixelDatatype:ve.UNSIGNED_BYTE,pixelFormat:je.RGBA}),e._radianceMapTextures[u]=p;let g=u,f=new ll({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>zr.getDirection(h,hle),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,PQe)},owner:e});f.postExecute=()=>{if(e.isDestroyed()||f.canceled){gi._activeComputeCommandCount--;return}let b=e._radianceMapComputeCommands;b[g]=void 0;let C=new ns({context:n,colorTextures:[e._radianceMapTextures[g]]});C._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),C._unBind(),C.destroy(),gi._activeComputeCommandCount--,b.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[u]=f,gi._queueCommand(f,t),u++}e._radianceCommandsDirty=!1}}function UQe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,d=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new Ht({minificationFilter:zt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},u=(p,g,f,b,C)=>()=>{if(e.isDestroyed()||p.canceled){gi._activeComputeCommandCount--;return}let E=e._convolutionComputeCommands;E[g]=void 0,n.copyFace(t,f,b,C),c++,gi._activeComputeCommandCount--,f.destroy(),e._specularMapTextures[g]=void 0,d()},h=0;for(let p=1;p<i;++p){for(let g of zr.faceNames()){l(e._specularMapTextures[h])&&e._specularMapTextures[h].destroy();let f=e._specularMapTextures[h]=new Wt({context:a,width:r,height:s,pixelDatatype:ve.UNSIGNED_BYTE,pixelFormat:je.RGBA}),b=e._va;l(b)||(b=zr.createVertexArray(a,g),e._va=b);let C=e._convolveSP;l(C)||(C=cn.fromCache({context:a,vertexShaderSource:wW,fragmentShaderSource:BW,attributeLocations:{positions:0}}),e._convolveSP=C);let E=new ll({shaderProgram:C,vertexArray:b,outputTexture:f,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>zr.getDirection(g,hle)}});E.postExecute=u(E,h,f,g,p),e._convolutionComputeCommands[h]=E,gi._queueCommand(E,t),++h}r/=2,s/=2}d()}var fle=new M(3,3);function DQe(e,t){let n=t.context,i=fle,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new Wt({context:n,width:i.x,height:i.y,pixelDatatype:ve.FLOAT,pixelFormat:je.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new ze({sources:[WW]}),e._irradianceMapFS=r);let s=new ll({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){gi._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,gi._activeComputeCommandCount--},e._irradianceComputeCommand=s,gi._queueCommand(s,t),e._irradianceTextureDirty=!0}function vQe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new ns({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=fle,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=m.unpack(r,s*4),m.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}gi.prototype.update=function(e){let t=e.mode;if(!(gi.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===se.MORPHING){this._shouldRegenerateShaders=!1;return}gi._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=YQe(this,e)||i===qA.SUNLIGHT&&!j.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=j.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(MQe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(UQe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(DQe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){vQe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};gi.prototype.isDestroyed=function(){return!1};gi.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),fe(this)};gi.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};gi.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(D.fromCssColorString("#717145"));gi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new m(.35449,.35449,.35449)),m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO]);var $A=gi;var h_n=y(x(),1);var YW={HIGHLIGHT:0,REPLACE:1,MIX:2};YW.getColorBlend=function(e,t){if(e===YW.HIGHLIGHT)return 0;if(e===YW.REPLACE)return 1;if(e===YW.MIX)return V.clamp(t,V.EPSILON4,1)};var Dc=Object.freeze(YW);var VGn=y(x(),1);var p_n=y(x(),1),kQe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},vc=Object.freeze(kQe);var g_n=y(x(),1),QQe={STEP:0,LINEAR:1,CUBICSPLINE:2},Bh=Object.freeze(QQe);var ZZn=y(x(),1);var lZn=y(x(),1);var R_n=y(x(),1);var E_n=y(x(),1);var ple={};function NW(e){this._count=e.count,this._properties=Qe(e.properties,!0)}NW.prototype.hasProperty=function(e){return zn.hasProperty(e,this._properties,ple)};NW.prototype.getPropertyIds=function(e){return zn.getPropertyIds(this._properties,ple,e)};NW.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Qe(n[e],!0)};NW.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Qe(n,!0)};var eg=NW;function kc(e){e=e??Q.EMPTY_OBJECT,this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(kc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});kc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};kc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};kc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};kc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var bK=[];kc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(bK);ni(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,bK);ni(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(bK);ni(t,n)}return t};kc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};kc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new eg({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};kc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};kc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};kc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};kc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};kc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};kc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};kc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var Vl=kc;var U_n=y(x(),1);var Y_n=y(x(),1);function XW(e){e=e??Q.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=md.createModelTextureReader({textureInfo:r,channels:HQe(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,d=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=d,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(XW.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});XW.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(At(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(At(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==Et.SCALAR?(At(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==jt.UINT8?(At(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:Et.isVectorType(t)||t===Et.SCALAR?n!==jt.UINT8?(At(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(At(`Property texture property ${e.id} has an unsupported type`),!1)};var OQe=[void 0,"float","vec2","vec3","vec4"],zQe=[void 0,"int","ivec2","ivec3","ivec4"];XW.prototype.getGlslType=function(){let e=this._classProperty,t=Et.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?OQe[t]:zQe[t]};XW.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function HQe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var PW=XW;function yK(e){e=e??Q.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new PW({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(yK.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});yK.prototype.getProperty=function(e){return this._properties[e]};var tg=yK;var J_n=y(x(),1);var Q_n=y(x(),1);function Ale(e){e=e??Q.EMPTY_OBJECT;let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=i??n.offset,o=o??n.scale,i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Ale.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var MW=Ale;function xK(e){e=e??Q.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new MW({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(xK.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});xK.prototype.getProperty=function(e){return this._properties[e]};var gC=xK;var eZn=y(x(),1);function UW(e){e=e??Q.EMPTY_OBJECT,this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(UW.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});UW.prototype.getPropertyTable=function(e){return this._propertyTables[e]};UW.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};UW.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var Sa=UW;function KQe(e){e=e??Q.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],d=new cm({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Vl({id:s,name:a.name,count:a.count,metadataTable:d,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new tg({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new gC({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Sa({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var DW=KQe;var bZn=y(x(),1);function JQe(e){e=e??Q.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],d=n.classes[c.class],u=new cm({count:c.count,properties:c.properties,class:d,bufferViews:e.bufferViews});o.push(new Vl({id:a,count:c.count,metadataTable:u,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new tg({id:a,propertyTexture:jQe(c),class:n.classes[c.class],textures:e.textures}))}return new Sa({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function jQe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:qQe(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=Rt(o.texture,r,!0)}return t}function qQe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var vW=JQe;function C0(e){e=e??Q.EMPTY_OBJECT;let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:d=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=d,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(C0.prototype=Object.create(Oi.prototype),C0.prototype.constructor=C0);Object.defineProperties(C0.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function $Qe(e){try{let t=o5e(e),n=l5e(e),i=d5e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=ft.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=ft.FAILED,e.getError("Failed to load structural metadata",t)}}C0.prototype.load=function(){return l(this._promise)?this._promise:(this._state=ft.LOADING,this._promise=$Qe(this),this._promise)};function e5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function t5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function n5e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];e5e(o.properties,n)}return n}function i5e(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&t5e(r,n)}}return n}async function o5e(e){let t;l(e._extension)?t=n5e(e._extension):t=i5e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Li.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function r5e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&s5e(r,t)}return t}function s5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function a5e(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&c5e(r,t)}}return t}function c5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function l5e(e){let t;l(e._extension)?t=r5e(e._extension):t=a5e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let d in t)if(t.hasOwnProperty(d)){let u=Li.getTextureLoader({gltf:n,textureInfo:t[d],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(u),e._textureIds.push(d),c.push(u.load())}return Promise.all(c)}async function d5e(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Li.getSchemaLoader({resource:i})}else n=Li.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}C0.prototype.process=function(e){if(this._state===ft.READY)return!0;if(this._state!==ft.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let d=t[a].process(e);i=i&&d}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],d=this._bufferViewLoaders[a];if(!d.isDestroyed()){let u=new Uint8Array(d.typedArray);r[c]=u}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],d=t[a];d.isDestroyed()||(s[c]=d.texture)}return l(this._extension)?this._structuralMetadata=DW({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=vW({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),gle(this),this._state=ft.READY,!0};function gle(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Li.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function u5e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Li.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}C0.prototype.unload=function(){gle(this),u5e(this),l(this._schemaLoader)&&Li.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var kW=C0;var GZn=y(x(),1);var vS={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};vS.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return vS.TRANSLATION;case"ROTATION":return vS.ROTATION;case"SCALE":return vS.SCALE;case"_FEATURE_ID":return vS.FEATURE_ID}};var Gs=Object.freeze(vS);var JZn=y(x(),1);var MZn=y(x(),1);var m5e=65534,h5e=255;function ek(e){e=e??Q.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new xle(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],f5e(this)}Object.defineProperties(ek.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function f5e(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],d=t[a+1],u=t[a+2],h=!1,p=h||n.hasEdge(c,d),g=h||n.hasEdge(d,u),f=h||n.hasEdge(u,c),b=ble(i,c,d,u,p,g,f);for(;l(b);){let C=s[b];if(!l(C)){C=r+o.length;let E=b;for(;E>=r;)E=o[E-r];o.push(E),s[b]=C}C>m5e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):C>h5e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),b===c?(c=C,t[a]=C):b===d?(d=C,t[a+1]=C):(u=C,t[a+2]=C),b=ble(i,c,d,u,p,g,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function ble(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=CK(e,t,a,c,d);if(u===0)return t;let h=0,p=o?1:0,g=r?1:0,f=CK(e,n,h,p,g);if(f===0)return n;let b=s?1:0,C=0,E=r?1:0,T=CK(e,i,b,C,E);if(T===0)return i;let S=u&f&T,_,R,L;if(S&1)_=0,R=1,L=2;else if(S&2)_=0,L=1,R=2;else if(S&4)R=0,_=1,L=2;else if(S&8)R=0,L=1,_=2;else if(S&16)L=0,_=1,R=2;else if(S&32)L=0,R=1,_=2;else{let N=EK(u),A=EK(f),I=EK(T);return N<A&&N<I?t:A<I?n:i}let W=t*3;e[W+_]=a,e[W+R]=c,e[W+L]=d;let B=n*3;e[B+_]=h,e[B+R]=p,e[B+L]=g;let Y=i*3;e[Y+_]=b,e[Y+R]=C,e[Y+L]=E}function CK(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function EK(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}ek.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,d=n+a*i;for(let u=0;u<i;u++)s[d+u]=s[c+u]}return s};ek.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Yt.maximumTextureSize),i=n,o=yle(i),r=[];for(;i>1;)i>>=1,r.push(yle(i));let s=new Wt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:je.LUMINANCE,sampler:new Ht({wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:zt.LINEAR_MIPMAP_LINEAR,magnificationFilter:ui.LINEAR})});return t.outlineTexture=s,s};function yle(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function xle(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}xle.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var bC=ek;function Cle(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function p5e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function tk(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}tk.prototype.postProcess=function(e){this.needsOutlines&&(A5e(this),y5e(this,e)),this.needsGaussianSplats&&b5e(this,e)};function A5e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new bC({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Pe.fromTypedArray(n.typedArray);let r=g5e(o.outlineCoordinates),s=new Cle(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let d=0;d<c;d++){let u=a[d].attribute;u.typedArray=o.updateAttribute(u.typedArray)}}function g5e(e){let t=new Tn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=J.FLOAT,t.type=Ut.VEC3,t.normalized=!1,t.count=e.length/3,t}function b5e(e,t){let n=e.attributePlans,i=n.length;for(let o=0;o<i;o++){let r=n[o];r.loadBuffer=!1,r.loadTypedArray=!0}}function y5e(e,t){x5e(e.attributePlans,t),l(e.indicesPlan)&&C5e(e.indicesPlan,t)}function x5e(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=mt.createVertexBuffer({typedArray:s,context:t,usage:Xe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function C5e(e,t){let n=e.indices;if(e.loadBuffer){let i=mt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Xe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}tk.AttributeLoadPlan=Cle;tk.IndicesLoadPlan=p5e;var yC=tk;var $Zn=y(x(),1);function E5e(e){e=e??Q.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var QW=E5e;var ERn=y(x(),1);var tRn=y(x(),1);function Ele(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Ele.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var OW=Ele;var iRn=y(x(),1);function Tle(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Tle.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var zW=Tle;var rRn=y(x(),1);function Sle(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Sle.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var HW=Sle;var lRn=y(x(),1);var aRn=y(x(),1),T5e={Direct:"Direct",Indirect:"Indirect"},E0=Object.freeze(T5e);function Ile(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(Ile.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var kS=Ile;var uRn=y(x(),1);function _le(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(_le.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var KW=_le;function QS(){}function Zle(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function S5e(e){let t=m.fromArray(e.position,0,new m),n=m.fromArray(e.adjustmentParams,0,new m);return new OW({position:t,adjustmentParams:n})}function I5e(e){let t=m.fromArray(e.position,0,new m),n=m.fromArray(e.adjustmentParams,0,new m),i=Zle(e.covarianceMatrix);return new zW({position:t,adjustmentParams:n,covarianceMatrix:i})}function _5e(e){let t=e.groupFlags,n=m.fromArray(e.rotationThetas,0,new m),i=[];for(let r of e.params){let s=new KW({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new HW({groupFlags:t,rotationThetas:n,params:i})}QS.load=function(e){let t=e.storageType;if(t===E0.Direct)return QS.loadDirect(e);if(t===E0.Indirect)return QS.loadIndirect(e);throw new he(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};QS.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=S5e(r);t.push(s)}let i=Zle(e.covarianceDirectUpperTriangle);return new kS({storageType:E0.Direct,anchorPointsDirect:t,covarianceDirect:i})};QS.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=I5e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=_5e(s);o.push(a)}return new kS({storageType:E0.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var JW=QS;var URn=y(x(),1);var SRn=y(x(),1);function Rle(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(Rle.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var jW=Rle;var _Rn=y(x(),1);function Gle(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(Gle.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var qW=Gle;var RRn=y(x(),1);function Vle(e){this._ppeTextures=e}Object.defineProperties(Vle.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var $W=Vle;function jr(e){e=e??Q.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=ft.UNLOADED,this._promise=void 0}l(Object.create)&&(jr.prototype=Object.create(Oi.prototype),jr.prototype.constructor=jr);Object.defineProperties(jr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});jr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=ft.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=ft.FAILED,this.getError("Failed to load GPM data",e)}};jr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=ft.LOADING,this._promise=this._loadResources(this),this._promise)};function Z5e(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}jr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=Z5e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let d=Li.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(d),this._textureIds.push(c),a.push(d.load())}return Promise.all(a)};jr.ppeTexturesMetadataSchemaCache=new Map;jr._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,o=e.offset??0,r=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:o,scale:r,min:n.min,max:n.max}}}};jr._obtainPpeTexturesMetadataSchema=function(e){let n=jr._collectPpeTexturePropertyIdentifiers(e).toString(),i=jr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${jr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],d=`ppeTexture_${a}`,u=jr._createPpeTextureClassJson(c,a);r.classes[d]=u}return i=Zl.fromJson(r),jr.ppeTexturesMetadataSchemaCache.set(n,i),i};jr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=jr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};jr._convertToStructuralMetadata=function(e,t){let n=[],i=jr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,u=a.traits.source,h=i.classes[c],p={class:c,properties:{[u]:{index:a.index,texCoord:a.texCoord}}};n.push(new tg({id:s,name:a.name,propertyTexture:p,class:h,textures:t}))}return new Sa({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};jr.prototype.process=function(e){if(this._state===ft.READY)return!0;if(this._state!==ft.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let d=0;d<n;++d){let h=t[d].process(e);i=i&&h}if(!i)return!1;let o={};for(let d=0;d<this._textureIds.length;++d){let u=this._textureIds[d],h=t[d];h.isDestroyed()||(o[u]=h.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let d=s.ppeTextures;for(let u of d){let h=u.traits,p=new qW({min:h.min,max:h.max,source:h.source}),g=new jW({traits:p,noData:u.noData,offset:u.offset,scale:u.scale,index:u.index,texCoord:u.texCoord});r.push(g)}}let a=new $W(r);this._meshPrimitiveGpmLocal=a;let c=jr._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=ft.READY,!0};jr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Li.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};jr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var eF=jr;var zRn=y(x(),1);function R5e(e){let n=(e.extensions??Q.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let o=[];ni(o,i);for(let r of n.primitiveGroups){let s=r.primitives[0];if(!l(s)||!i[s])return i;let a={...i[s],indices:r.indices};switch(a.mode){case ne.TRIANGLE_FAN:case ne.TRIANGLE_STRIP:case ne.LINE_STRIP:case ne.LINE_LOOP:break;default:return i}for(let c of r.primitives){let d=o[c];if(!l(d?.indices)||d.mode!==a.mode)return i;o[c]=void 0}o[s]=a}return o.filter(l)}var tF=R5e;var{Attribute:G5e,Indices:V5e,FeatureIdAttribute:Lle,FeatureIdTexture:Wle,FeatureIdImplicitRange:Fle,MorphTarget:L5e,Primitive:W5e,Instances:F5e,Skin:B5e,Node:w5e,AnimatedPropertyType:Y5e,AnimationSampler:N5e,AnimationTarget:X5e,AnimationChannel:P5e,Animation:M5e,ArticulationStage:U5e,Articulation:D5e,Asset:v5e,Scene:k5e,Components:Q5e,MetallicRoughness:O5e,SpecularGlossiness:z5e,Specular:H5e,Anisotropy:TK,Clearcoat:SK,Material:K5e}=Tn,tr={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function wh(e){e=e??Q.EMPTY_OBJECT;let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=to.Y,forwardAxis:a=to.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:d=!1,enablePick:u=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:f=!1}=e,{baseResource:b=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=b,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=d,this._enablePick=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=f,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=tr.NOT_LOADED,this._textureState=tr.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(wh.prototype=Object.create(Oi.prototype),wh.prototype.constructor=wh);Object.defineProperties(wh.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function J5e(e){e._state=tr.LOADING,e._textureState=tr.LOADING;try{let t=Li.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=tr.LOADED,e._textureState=tr.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=tr.FAILED,e._textureState=tr.FAILED,nk(e,t)}}async function j5e(e,t){rn.supportsWebP.initialized||await rn.supportsWebP.initialize(),e._supportedImageFormats=new QW({webp:rn.supportsWebP(),basis:t.context.supportsBasis});let n=n3e(e,t);return e._state=tr.PROCESSING,e._textureState=tr.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Li.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}wh.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=J5e(this),this._promise)};function nk(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function q5e(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(l(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(l(r)){let s=r.process(t);s&&(l(e._components.structuralMetadata)&&At("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=tr.POST_PROCESSING)}function $5e(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),(o.needsOutlines||o.needsGaussianSplats)&&eOe(e,o)}}function eOe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}wh.prototype._process=function(e){return this._state===tr.READY?!0:(this._state===tr.PROCESSING&&q5e(this,e),this._resourcesLoaded&&this._state===tr.POST_PROCESSING&&($5e(this,e.context),this._state=tr.PROCESSED),this._resourcesLoaded&&this._state===tr.PROCESSED?(Dle(this),this._typedArray=void 0,this._state=tr.READY,!0):!1)};wh.prototype._processTextures=function(e){if(this._textureState===tr.READY)return!0;if(this._textureState!==tr.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&l(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=tr.READY,this._texturesLoaded=!0,!0):!1};wh.prototype.process=function(e){if(this._state===tr.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=j5e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=tr.FAILED;let o=this._processError;this._processError=void 0,nk(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===tr.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=tr.FAILED,nk(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=tr.FAILED,nk(this,o)}return this._incrementallyLoadTextures?n:n&&i};function tOe(e,t,n,i,o,r,s,a,c){let d=e.gltfJson,h=d.accessors[t].bufferView;return Li.getVertexBufferLoader({gltf:d,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:h,primitive:i,draco:o,spz:r,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:s,loadTypedArray:a})}function nOe(e,t,n,i,o,r,s){return Li.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function iOe(e,t){let n=Li.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Ble(e,t,n){let i=t.byteOffset,o=ud(e,t),r=t.count,s=qd(t.type),a=t.componentType,c=J.getSizeInBytes(a),d=c*s,u=r*s;if(o===d)return n=new Uint8Array(n),J.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let h=J.createTypedArray(a,u),p=new DataView(n.buffer),g=new Array(s),f=HA(t.componentType);i=n.byteOffset+i;for(let b=0;b<r;++b){f(p,i,s,c,g);for(let C=0;C<s;++C)h[b*s+C]=g[C];i+=o}return h}function oOe(e,t){let n=e.type;if(n===Ut.SCALAR)return t.fill(0);let i=Ut.getMathType(n);return t.fill(i.clone(i.ZERO))}function rOe(e,t,n,i){let o=e.type,r=e.count;if(o===Ut.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===Ut.VEC4&&i)for(let s=0;s<r;s++)n[s]=Me.unpack(t,s*4);else{let s=Ut.getMathType(o),a=Ut.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function sOe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=Ble(r,n,t.typedArray);i=i??!1,rOe(n,s,o,i)}function OS(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=iOe(e,o),s=sOe(e,r,t,n,i);return e._loaderPromises.push(s),i}return oOe(t,i)}function $d(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function aOe(e){return e===Number?0:new e}function cOe(e){switch(e){case J.BYTE:return 127;case J.UNSIGNED_BYTE:return 255;case J.SHORT:return 32767;case J.UNSIGNED_SHORT:return 65535;default:return 1}}var lOe={VEC2:new M(-1,-1),VEC3:new m(-1,-1,-1),VEC4:new ce(-1,-1,-1,-1)};function dOe(e,t){let n=cOe(e.componentDatatype),i=lOe[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function uOe(e,t,n){let i=e.decodeMatrix,o=$d(n,e.decodedMin),r=$d(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Tn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new M(i[6],i[7]),s.quantizedVolumeStepSize=new M(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new m(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new m(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new ce(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new ce(i[0],i[6],i[12],i[18])),t.quantization=s}function mOe(e,t,n,i,o){let r=e.accessors[t],s=Ut.getMathType(r.type),a=r.normalized??!1,c=new G5e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=aOe(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=$d(s,r.min),c.max=$d(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=ud(e,r),Ti(r,"WEB3D_quantized_attributes")&&uOe(r.extensions.WEB3D_quantized_attributes,c,s);let d=c.semantic===at.POSITION||c.semantic===at.NORMAL||c.semantic===at.TANGENT||c.semantic===at.TEXCOORD||c.semantic===at.FEATURE_ID||c.semantic===at.SCALE||c.semantic===at.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&dOe(c,s),c}function wle(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var hOe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function IK(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=hOe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function fOe(e){let t=e===at.POSITION,n=e===at.FEATURE_ID,i=e===at.TEXCOORD;return t||n||i}function pOe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=J.createArrayBufferView(o,t.typedArray.buffer)}}function AOe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=J.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===at.POSITION){let o=s=>{let a=1/0,c=-1/0,d=1/0,u=-1/0,h=1/0,p=-1/0;for(let g=0;g<s.length;g+=3){let f=s[g],b=s[g+1],C=s[g+2];a=Math.min(a,f),c=Math.max(c,f),d=Math.min(d,b),u=Math.max(u,b),h=Math.min(h,C),p=Math.max(p,C)}return[new m(a,d,h),new m(c,u,p)]},r=e.typedArray;[e.min,e.max]=o(r)}}function gOe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Ble(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Yle(e,t,n,i,o,r,s,a,c){let d=e.gltfJson,u=d.accessors[t],h=u.bufferView,p=n.gltfSemantic,g=n.renamedSemantic,f=n.modelSemantic,b=l(f)?wle(g):void 0,E=mOe(d,t,p,f,b);if(!l(o)&&!l(h)&&!l(r))return E;let T=tOe(e,t,p,i,o,r,s,a,c),S=e._geometryLoaders.length;e._geometryLoaders.push(T);let _=T.load();return e._loaderPromises.push(_),e._geometryCallbacks[S]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[p])?pOe(E,T,s,a):l(r)?AOe(E,T,s,a):gOe(d,u,E,T,s,a)},E}function Nle(e,t,n,i,o,r,s,a,c){let d=n.modelSemantic,u=d===at.POSITION,h=d===at.FEATURE_ID,p=u&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,g=u&&e._enablePick&&!c.context.webgl2,f=e._loadForClassification&&h,b=e._loadAttributesAsTypedArray,C=!b,E=b||p||g||f,_=Yle(e,t,n,i,o,r,a?!1:C,a?!0:E,c),R=new yC.AttributeLoadPlan(_);return R.loadBuffer=C,R.loadTypedArray=E,R}function bOe(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=IK(e,Gs,i),d=c.modelSemantic,u=d===Gs.TRANSLATION||d===Gs.ROTATION||d===Gs.SCALE,h=d===Gs.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,f=!p,b=e._loadAttributesFor2D&&!o.scene3DOnly;return Yle(e,t,c,void 0,void 0,void 0,f,p||h&&(!a||b||g),o)}function yOe(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??Q.EMPTY_OBJECT,d=c.KHR_draco_mesh_compression,u=l(c.EXT_mesh_primitive_edge_visibility);if(!l(d)&&!l(a))return;let h=new V5e;h.count=s.count;let p=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,f=e._loadForClassification&&i,C=!p,E=p||g||f||u,_=nOe(e,t,n,d,o?!1:C,o?!0:E,r),R=e._geometryLoaders.length;e._geometryLoaders.push(_);let L=_.load();e._loaderPromises.push(L),e._geometryCallbacks[R]=()=>{h.indexDatatype=_.indexDatatype,h.buffer=_.buffer,h.typedArray=_.typedArray};let W=new yC.IndicesLoadPlan(h);return W.loadBuffer=C,W.loadTypedArray=E,W}function Ll(e,t,n,i){let o=e.gltfJson,r=md.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Li.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=md.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let d=s.load().catch(u=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw u;e._textureState=tr.FAILED,e._textureErrors.push(u)}});return e._texturesPromises.push(d),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function xOe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new z5e;return l(i)&&(c.diffuseTexture=Ll(e,i,n)),l(o)&&(c.specularGlossinessTexture=Ll(e,o,n)),c.diffuseFactor=$d(ce,r),c.specularFactor=$d(m,s),c.glossinessFactor=a,c}function COe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new O5e;return l(i)&&(c.baseColorTexture=Ll(e,i,n)),l(o)&&(c.metallicRoughnessTexture=Ll(e,o,n)),c.baseColorFactor=$d(ce,r),c.metallicFactor=s,c.roughnessFactor=a,c}function EOe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new H5e;return l(o)&&(a.specularTexture=Ll(e,o,n)),l(s)&&(a.specularColorTexture=Ll(e,s,n)),a.specularFactor=i,a.specularColorFactor=$d(m,r),a}function TOe(e,t,n){let{anisotropyStrength:i=TK.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=TK.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new TK;return l(r)&&(s.anisotropyTexture=Ll(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function SOe(e,t,n){let{clearcoatFactor:i=SK.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=SK.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new SK;return l(o)&&(c.clearcoatTexture=Ll(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=Ll(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Ll(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function IOe(e,t,n){let i=new K5e,o=t.extensions??Q.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness;i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=xOe(e,r,n):(l(d)&&(i.metallicRoughness=COe(e,d,n)),l(s)&&!i.unlit&&(i.specular=EOe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=TOe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=SOe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Ll(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Ll(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Ll(e,t.occlusionTexture,n)),i.emissiveFactor=$d(m,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided;let u=o.BENTLEY_materials_point_style;if(l(u)&&l(u.diameter)){let h=u.diameter;h>=1&&(i.pointDiameter=Math.floor(h))}return i}function Xle(e,t){let n=new Lle;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function Ple(e,t,n,i){let o=new Lle,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=wle(r.attribute),o.positionalLabel=i,o}function Mle(e,t){let n=new Fle;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Ule(e,t,n,i){let o=new Fle,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function _Oe(e,t,n,i){let o=new Wle;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=Ll(e,r,n,Ht.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function ZOe(e,t,n,i,o,r){let s=new Wle,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=Ll(e,c,i,Ht.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function ROe(e,t,n,i,o){let r=new L5e,s=void 0,a=void 0,c=void 0,d=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let h=t[u],p=IK(e,at,u),g=Nle(e,h,p,s,a,c,d,n,o);r.attributes.push(g.attribute),i.attributePlans.push(g)}return r}function GOe(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function VOe(e,t,n,i){let o=new W5e,r=new yC(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=IOe(e,e.gltfJson.materials[s],i));let a=t.extensions??Q.EMPTY_OBJECT,c=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=LOe(e,d,r));let u=a.EXT_mesh_primitive_edge_visibility;if(l(u)){let B=e.gltfJson.accessors[u.visibility];if(!l(B))throw new he("Edge visibility accessor not found!");let Y=OS(e,B);if(o.edgeVisibility={visibility:Y,material:u.material},l(u.silhouetteNormals)){let N=e.gltfJson.accessors[u.silhouetteNormals];if(l(N)){let A=OS(e,N);o.edgeVisibility.silhouetteNormals=A}}l(u.lineStrings)&&(r.edgeVisibility.lineStrings=u.lineStrings)}let p=GOe(a);l(p)&&(c=!0,r.needsGaussianSplats=!0);let g=e._loadForClassification,f=a.KHR_draco_mesh_compression,b=!1,C=t.attributes;if(l(C))for(let B in C){if(!C.hasOwnProperty(B))continue;let Y=C[B],N=IK(e,at,B),A=N.modelSemantic;if(g&&!fOe(A))continue;A===at.FEATURE_ID&&(b=!0);let I=Nle(e,Y,N,t,f,p,n,c,i);r.attributePlans.push(I),o.attributes.push(I.attribute)}let E=t.targets;if(l(E)&&!g)for(let B=0;B<E.length;++B)o.morphTargets.push(ROe(e,E[B],c,r,i));let T=t.indices;if(l(T)){let B=yOe(e,T,t,b,c,i);l(B)&&(r.indicesPlan=B,o.indices=B.indices)}let S=a.EXT_structural_metadata,_=a.EXT_mesh_features,R=a.EXT_feature_metadata,L=l(R);l(_)?WOe(e,o,_,i):L&&FOe(e,o,R,i),l(S)?BOe(o,S):L&&wOe(e,o,R);let W=t.mode;if(g&&W!==Be.TRIANGLES)throw new he("Only triangle meshes can be used for classification.");return o.primitiveType=W,o}function LOe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return OS(e,i,!1)}function WOe(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=_Oe(e,s,i,a):l(s.attribute)?c=Xle(s,a):c=Mle(s,a),t.featureIds.push(c)}}function FOe(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let d=s[c],u=d.featureTable,h=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f;l(d.featureIds.attribute)?f=Ple(d,h,p,g):f=Ule(d,h,p,g),t.featureIds.push(f)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let d=a[c],u=d.featureTable,h=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f=ZOe(e,d,h,i,p,g);t.featureIds.push(f)}}function BOe(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function wOe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function YOe(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new F5e,r=i.attributes;if(l(r))for(let d in r){if(!r.hasOwnProperty(d))continue;let u=r[d];o.attributes.push(bOe(e,u,r,d,n))}let s=i.extensions??Q.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?NOe(o,a):l(c)&&XOe(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function NOe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=Xle(o,r):s=Mle(o,r),e.featureIds.push(s)}}function XOe(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,d=i.indexOf(c),u=o[c].count,h=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=Ple(a,d,u,h):p=Ule(a,d,u,h),t.featureIds.push(p)}}function POe(e,t,n){let i=new w5e;i.name=t.name,i.matrix=$d(F,t.matrix),i.translation=$d(m,t.translation),i.rotation=$d(Me,t.rotation),i.scale=$d(m,t.scale);let o=t.extensions??Q.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new he("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=YOe(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],d=tF(c);for(let p=0;p<d.length;++p)i.primitives.push(VOe(e,d[p],l(i.instances),n));let u=t.weights??c.weights,h=i.primitives[0].morphTargets;i.morphWeights=l(u)?u.slice():new Array(h.length).fill(0)}return i}function MOe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=POe(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function UOe(e,t,n){let i=new B5e,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=OS(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(F.IDENTITY);return i}function DOe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=UOe(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function vOe(e,t,n,i){let o=new kW({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=o,o.load()}async function kOe(e,t,n,i){let o=new eF({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=o,o.load()}function QOe(e,t){let n=new N5e,i=e.gltfJson.accessors,o=i[t.input];n.input=OS(e,o);let r=t.interpolation;n.interpolation=Bh[r]??Bh.LINEAR;let s=i[t.output];return n.output=OS(e,s,!0),n}function OOe(e,t){let n=new X5e,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=Y5e[o],n}function zOe(e,t,n){let i=new P5e,o=e.sampler;return i.sampler=t[o],i.target=OOe(e.target,n),i}function HOe(e,t,n){let i=new M5e;i.name=t.name;let o=t.samplers.map(function(s,a){let c=QOe(e,s);return c.index=a,c}),r=t.channels.map(function(s){return zOe(s,o,n)});return i.samplers=o,i.channels=r,i}function KOe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=HOe(e,o,t);return s.index=r,s})}function JOe(e){let t=new U5e;t.name=e.name;let n=e.type.toUpperCase();return t.type=vc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function jOe(e){let t=new D5e;return t.name=e.name,t.stages=e.stages.map(JOe),t}function qOe(e){let n=(e.extensions??Q.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(jOe):[]}function $Oe(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function e3e(e,t){let n=new k5e,i=$Oe(e);return n.nodes=i.map(function(o){return t[o]}),n}var t3e=new m;function n3e(e,t){let n=e.gltfJson,i=n.extensions??Q.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let T=r.featureTables,S=r.featureTextures,_=l(T)?T:[],R=l(S)?S:[];e._sortedPropertyTableIds=Object.keys(_).sort(),e._sortedFeatureTextureIds=Object.keys(R).sort()}let a=MOe(e,t),c=DOe(e,a),d=KOe(e,a),u=qOe(n),h=e3e(n,a),p=new Q5e,g=new v5e,f=n.asset.copyright;if(l(f)){let T=f.split(";").map(function(S){return new bt(S.trim())});g.credits=T}if(p.asset=g,p.scene=h,p.nodes=a,p.skins=c,p.animations=d,p.articulations=u,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let T=m.fromArray(s.center,0,t3e);p.transform=F.fromTranslation(T,p.transform)}if(e._components=p,l(o)||l(r)){let T=vOe(e,o,r,t);e._loaderPromises.push(T)}let b=i.NGA_gpm_local;if(l(b)){let T=JW.load(b);e._components.extensions.NGA_gpm_local=T}let C=n.meshes;if(l(C))for(let T of C){let S=T.primitives;if(l(S))for(let _ of S){let R=_.extensions;if(l(R)){let L=R.NGA_gpm_local;if(l(L)){let W=kOe(e,n,L,t);e._loaderPromises.push(W)}}}}let E=[];return ni(E,e._loaderPromises),e._incrementallyLoadTextures||ni(E,e._texturesPromises),Promise.all(E)}function i3e(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._textureLoaders.length=0}function Dle(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._bufferViewLoaders.length=0}function o3e(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._geometryLoaders.length=0}function r3e(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function s3e(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function a3e(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}wh.prototype.isUnloaded=function(){return this._state===tr.UNLOADED};wh.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Li.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,i3e(this),Dle(this),o3e(this),r3e(this),s3e(this),a3e(this),this._components=void 0,this._typedArray=void 0,this._state=tr.UNLOADED};var eu=wh;var jGn=y(x(),1);var HGn=y(x(),1);var WGn=y(x(),1),nF=`uniform sampler2D u_pointCloud_colorGBuffer;
uniform sampler2D u_pointCloud_depthGBuffer;
uniform vec2 u_distanceAndEdlStrength;
in vec2 v_textureCoordinates;

vec2 neighborContribution(float log2Depth, vec2 offset)
{
    float dist = u_distanceAndEdlStrength.x;
    vec2 texCoordOrig = v_textureCoordinates + offset * dist;
    vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
    vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);

    float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));
    float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));

    // ignore depth values that are the clear depth
    if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
        return vec2(0.0);
    }

    // interpolate the two adjacent depth values
    float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
    vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
    return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
}

void main()
{
    float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
    eyeCoordinate /= eyeCoordinate.w;

    float log2Depth = log2(-eyeCoordinate.z);

    if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer
    {
        discard;
    }

    vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);

    // sample from neighbors left, right, down, up
    vec2 texelSize = 1.0 / czm_viewport.zw;

    vec2 responseAndCount = vec2(0.0);

    responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
    responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
    responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
    responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));

    float response = responseAndCount.x / responseAndCount.y;
    float strength = u_distanceAndEdlStrength.y;
    float shade = exp(-response * 300.0 * strength);
    color.rgb *= shade;
    out_FragColor = vec4(color);

    // Input and output depth are the same.
    gl_FragDepth = depthOrLogDepth;
}
`;function zS(){this._framebuffer=new xi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(zS.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function c3e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var _K=new M;function l3e(e,t){let n=new ze({defines:["LOG_DEPTH_WRITE"],sources:[nF]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return _K.x=e._radius,_K.y=e._strength,_K}},o=ke.fromCache({blending:fn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Qt.setCesium3DTileBit(),stencilMask:Qt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Ve.CESIUM_3D_TILE,owner:e}),e._clearCommand=new li({framebuffer:e.framebuffer,color:new D(0,0,0,0),depth:1,renderState:ke.fromCache(),pass:Ve.CESIUM_3D_TILE,owner:e})}function d3e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),l3e(e,t)}function vle(e){return e.drawBuffers&&e.fragmentDepth}zS.isSupported=vle;function u3e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=ze.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() 
{ 
    czm_point_cloud_post_process_main(); 
#ifdef LOG_DEPTH
    czm_writeLogDepth();
    out_FragData_1 = czm_packDepth(gl_FragDepth); 
#else
    out_FragData_1 = czm_packDepth(gl_FragCoord.z);
#endif
}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}zS.prototype.update=function(e,t,n,i){if(!vle(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,d3e(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let d=r[o];if(d.primitiveType!==Be.POINTS||d.pass===Ve.TRANSLUCENT)continue;let u,h,p=d.derivedCommands.pointCloudProcessor;l(p)&&(u=p.command,h=p.originalShaderProgram),(!l(u)||d.dirty||h!==d.shaderProgram||u.framebuffer!==this.framebuffer)&&(u=nt.shallowClone(d,u),u.framebuffer=this.framebuffer,u.shaderProgram=u3e(e.context,d.shaderProgram),u.castShadows=!1,u.receiveShadows=!1,l(p)||(p={command:u,originalShaderProgram:d.shaderProgram},d.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=d.shaderProgram),r[o]=u}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};zS.prototype.isDestroyed=function(){return!1};zS.prototype.destroy=function(){return c3e(this),fe(this)};var ng=zS;function kle(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}kle.isSupported=function(e){return ng.isSupported(e.context)};var sp=kle;var uVn=y(x(),1);var xc={},m3e=new ce(0,0,0,1),Qc=new ce,h3e=new $e,ZK=new M,RK=new M;xc.worldToWindowCoordinates=function(e,t,n){return xc.worldWithEyeOffsetToWindowCoordinates(e,t,m.ZERO,n)};var Qle=new ce,Ole=new m;function iF(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,ce.fromElements(e.x,e.y,e.z,1,Qle),Qle),s=m.multiplyComponents(t,m.normalize(r,Ole),Ole);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var f3e=new pe(Math.PI,V.PI_OVER_TWO),p3e=new m,A3e=new m;xc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=xc.computeActualEllipsoidPosition(o,t,m3e);if(!l(r))return;let s=e.canvas,a=h3e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,d=!1;if(o.mode===se.SCENE2D){let u=e.mapProjection,h=f3e,p=u.project(h,p3e),g=m.clone(c.position,A3e),f=c.frustum.clone(),b=F.computeViewportTransformation(a,0,1,new F),C=c.frustum.projectionMatrix,E=c.positionWC.y,T=m.fromElements(V.sign(E)*p.x-E,0,-c.positionWC.x),S=Tt.pointToGLWindowCoordinates(C,b,T);if(E===0||S.x<=0||S.x>=s.clientWidth)d=!0;else{if(S.x>s.clientWidth*.5){a.width=S.x,c.frustum.right=p.x-E,Qc=iF(r,n,c,Qc),xc.clipToGLWindowCoordinates(a,Qc,ZK),a.x+=S.x,c.position.x=-c.position.x;let _=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-_,Qc=iF(r,n,c,Qc),xc.clipToGLWindowCoordinates(a,Qc,RK)}else{a.x+=S.x,a.width-=S.x,c.frustum.left=-p.x-E,Qc=iF(r,n,c,Qc),xc.clipToGLWindowCoordinates(a,Qc,ZK),a.x=a.x-a.width,c.position.x=-c.position.x;let _=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-_,Qc=iF(r,n,c,Qc),xc.clipToGLWindowCoordinates(a,Qc,RK)}m.clone(g,c.position),c.frustum=f.clone(),i=M.clone(ZK,i),(i.x<0||i.x>s.clientWidth)&&(i.x=RK.x)}}if(o.mode!==se.SCENE2D||d){if(Qc=iF(r,n,c,Qc),Qc.z<0&&!(c.frustum instanceof hn)&&!(c.frustum instanceof is))return;i=xc.clipToGLWindowCoordinates(a,Qc,i)}return i.y=s.clientHeight-i.y,i};xc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=xc.worldToWindowCoordinates(e,t,n),!!l(n))return xc.transformWindowToDrawingBuffer(e,n,n)};var ig=new m,g3e=new pe;xc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===se.SCENE3D)return m.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,g3e);if(!l(r))return;if(o.project(r,ig),i===se.COLUMBUS_VIEW)return m.fromElements(ig.z,ig.x,ig.y,n);if(i===se.SCENE2D)return m.fromElements(0,ig.x,ig.y,n);let s=e.morphTime;return m.fromElements(V.lerp(ig.z,t.x,s),V.lerp(ig.x,t.y,s),V.lerp(ig.y,t.z,s),n)};var zle=new m,Hle=new m,Kle=new F;xc.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,zle),F.computeViewportTransformation(e,0,1,Kle),F.multiplyByPoint(Kle,zle,Hle),M.fromCartesian3(Hle,n)};xc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return M.fromElements(t.x*o,t.y*r,n)};var b3e=new ce,Jle=new ce;xc.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,g)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=ce.clone(ce.UNIT_W,b3e);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let h,p=e.camera.frustum;if(l(p.fovy)){h=F.multiplyByVector(r.inverseViewProjection,u,Jle);let g=1/h.w;m.multiplyByScalar(h,g,h)}else{let g=p.offCenterFrustum;l(g)&&(p=g),h=Jle,h.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(u.z*(a-c)-a-c)*.5,h.w=1,h=F.multiplyByVector(r.inverseView,h,h)}return m.fromCartesian4(h,i)};var no=xc;var i1n=y(x(),1);var AVn=y(x(),1);var HS={};HS._deprecationWarning=Ms;var og=Uint32Array.BYTES_PER_ELEMENT;HS.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=og;let r=o.getUint32(t,!0);if(r!==1)throw new he(`Only Batched 3D Model version 1 is supported.  Version ${r} is not.`);t+=og;let s=o.getUint32(t,!0);t+=og;let a=o.getUint32(t,!0);t+=og;let c=o.getUint32(t,!0);t+=og;let d=o.getUint32(t,!0);t+=og;let u=o.getUint32(t,!0);t+=og;let h;d>=570425344?(t-=og*2,h=a,d=c,u=0,a=0,c=0,HS._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=og,h=d,d=a,u=c,a=0,c=0,HS._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:h??0}:(p=Cr(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let f,b;d>0&&(f=Cr(i,t,d),t+=d,u>0&&(b=new Uint8Array(e,t,u),b=new Uint8Array(b),t+=u));let C=n+s-t;if(C===0)throw new he("glTF byte length must be greater than 0.");let E;return t%4===0?E=new Uint8Array(e,t,C):(HS._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),E=new Uint8Array(i.subarray(t,t+C))),{batchLength:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:b,gltf:E}};var oF=HS;var xVn=y(x(),1);function rF(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function jle(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=J.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function y3e(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=J.createTypedArray(n,i),o[t]=r),r}rF.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??J.UNSIGNED_INT,n=n??1,jle(this,e,t,n,1,i.byteOffset)):i};rF.prototype.hasProperty=function(e){return l(this.json[e])};rF.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=J.fromName(i.componentType)),jle(this,e,t,n,this.featuresLength,i.byteOffset)):y3e(this,e,t,i)};rF.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var Yh=rF;var XVn=y(x(),1);function sF(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput,s=x3e(n),a;l(s.jsonProperties)&&(a=new eg({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new jx({extension:s.hierarchy,binaryBody:i}));let d=Lh.BATCH_TABLE_CLASS_NAME,u=s.binaryProperties,h,p,g;if(o){let C=E3e(t,d,u,i,r);g=C.transcodedSchema,p=[new gC({propertyAttribute:C.propertyAttributeJson,class:C.transcodedClass})]}else{let C=C3e(t,d,u,i);g=C.transcodedSchema;let E=C.featureTableJson;h=new cm({count:E.count,properties:E.properties,class:C.transcodedClass,bufferViews:C.bufferViewsTypedArrays}),p=[]}let f=[];if(l(h)||l(a)||l(c)){let C=new Vl({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:a,batchTableHierarchy:c});f.push(C)}let b={schema:g,propertyTables:f,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Sa(b)}function x3e(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(sF._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function C3e(e,t,n,i){let o={},r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!l(i))throw new he(`Property ${h} requires a batch table binary.`);let p=n[h],g=rm(p);r[h]={bufferView:a},o[h]=qle(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let d=Zl.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:d,transcodedClass:d.classes[t]}}function E3e(e,t,n,i,o){let r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;let p=n[h];if(!l(i)&&!l(p.typedArray))throw new he(`Property ${h} requires a batch table binary.`);let g=Xt.sanitizeGlslIdentifier(h);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let f=qle(p);f.name=h,r[g]=f;let b=g.toUpperCase();b.startsWith("_")||(b=`_${b}`);let C=p.typedArray;l(C)||(C=rm(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let E=new Tn.Attribute;E.name=b,E.count=e,E.type=p.type;let T=J.fromTypedArray(C);(T===J.INT||T===J.UNSIGNED_INT||T===J.DOUBLE)&&(sF._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${b}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),C=new Float32Array(C)),E.componentDatatype=J.fromTypedArray(C),E.typedArray=C,o.push(E),s[g]={attribute:b}}let c={classes:{}};c.classes[t]={properties:r};let d=Zl.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:d,transcodedClass:d.classes[t]}}function qle(e){let t=T3e(e.componentType);return{type:e.type,componentType:t}}function T3e(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}sF._deprecationWarning=Ms;sF._oneTimeWarning=At;var rg=sF;var xC={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},S3e=Tn.FeatureIdAttribute;function T0(e){e=e??Q.EMPTY_OBJECT;let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,c=e.upAxis??to.Y,d=e.forwardAxis??to.X,u=e.loadAttributesAsTypedArray??!1,h=e.loadAttributesFor2D??!1,p=e.enablePick??!1,g=e.loadIndicesForWireframe??!1,f=e.loadPrimitiveOutline??!0,b=e.loadForClassification??!1;n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=h,this._enablePick=p,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=f,this._loadForClassification=b,this._state=xC.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(T0.prototype=Object.create(Oi.prototype),T0.prototype.constructor=T0);Object.defineProperties(T0.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});T0.prototype.load=function(){if(l(this._promise))return this._promise;let e=oF.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new Yh(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(a)&&(this._transform=F.fromTranslation(m.fromArray(a))),this._batchTable={json:o,binary:r};let c=new eu({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=xC.LOADING;let d=this;return this._promise=c.load().then(function(){if(!d.isDestroyed())return d._state=xC.PROCESSING,d}).catch(function(u){if(!d.isDestroyed())return I3e(d,u)}),this._promise};function I3e(e,t){return e.unload(),e._state=xC.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}T0.prototype.process=function(e){if(this._state===xC.READY)return!0;if(this._state!==xC.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),_3e(this,n),this._components=n,this._arrayBuffer=void 0,this._state=xC.READY,!0};function _3e(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=rg({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Vl({name:Lh.BATCH_TABLE_CLASS_NAME,count:i});o=new Sa({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)$le(r[a]);t.structuralMetadata=o}function $le(e){let t=e.children.length;for(let i=0;i<t;i++)$le(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Xt.getAttributeBySemantic(o,at.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new S3e;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}T0.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var aF=T0;var _1n=y(x(),1);function S0(e){e=e??Q.EMPTY_OBJECT,this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(S0.prototype=Object.create(Oi.prototype),S0.prototype.constructor=S0);Object.defineProperties(S0.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});S0.prototype.load=function(){return Promise.resolve(this)};S0.prototype.process=function(e){return l(this._components)||(this._components=P3e(this._geoJson,e),this._geoJson=void 0),!0};function Z3e(){this.lines=void 0,this.points=void 0,this.properties=void 0}function R3e(){this.features=[]}function GK(e){let t=e[0],n=e[1],i=e[2]??0;return new m(t,n,i)}function VK(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=GK(e[o]);return[n]}function G3e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=VK(e[i])[0];return n}function ede(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=VK(e[i])[0];return n}function V3e(e){let t=e.length,n=[];for(let i=0;i<t;i++){let o=ede(e[i]);ni(n,o)}return n}function L3e(e){return[GK(e)]}function W3e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=GK(e[i]);return n}var F3e={LineString:VK,MultiLineString:G3e,MultiPolygon:V3e,Polygon:ede,MultiPoint:W3e,Point:L3e},B3e={LineString:Be.LINES,MultiLineString:Be.LINES,MultiPolygon:Be.LINES,Polygon:Be.LINES,MultiPoint:Be.POINTS,Point:Be.POINTS};function tde(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=F3e[n],o=B3e[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new Z3e;o===Be.LINES?s.lines=i(r):o===Be.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function w3e(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)tde(n[o],t)}var Y3e={FeatureCollection:w3e,Feature:tde},ik=new m;function N3e(e,t,n){let i=0,o=0,r=e.length;for(let Y=0;Y<r;Y++){let N=e[Y];if(l(N.lines)){let A=N.lines.length;for(let I=0;I<A;I++){let Z=N.lines[I];i+=Z.length,o+=(Z.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Pe.createTypedArray(i,o),d=Pe.fromTypedArray(c),u=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let Y=0;Y<r;Y++){let N=e[Y];if(!l(N.lines))continue;let A=N.lines.length;for(let I=0;I<A;I++){let Z=N.lines[I],G=Z.length;for(let w=0;w<G;w++){let X=Z[w],v=m.fromDegrees(X.x,X.y,X.z,ie.WGS84,ik),U=F.multiplyByPoint(t,v,ik);m.minimumByComponent(u,U,u),m.maximumByComponent(h,U,h),m.pack(U,s,p*3),a[p]=Y,w<G-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let f=mt.createVertexBuffer({typedArray:s,context:n.context,usage:Xe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let b=mt.createVertexBuffer({typedArray:a,context:n.context,usage:Xe.STATIC_DRAW});b.vertexArrayDestroyable=!1;let C=mt.createIndexBuffer({typedArray:c,context:n.context,usage:Xe.STATIC_DRAW,indexDatatype:d});C.vertexArrayDestroyable=!1;let E=new Tn.Attribute;E.semantic=at.POSITION,E.componentDatatype=J.FLOAT,E.type=Ut.VEC3,E.count=i,E.min=u,E.max=h,E.buffer=f;let T=new Tn.Attribute;T.semantic=at.FEATURE_ID,T.setIndex=0,T.componentDatatype=J.FLOAT,T.type=Ut.SCALAR,T.count=i,T.buffer=b;let S=[E,T],_=new Tn.Material;_.unlit=!0;let R=new Tn.Indices;R.indexDatatype=d,R.count=c.length,R.buffer=C;let L=new Tn.FeatureIdAttribute;L.featureCount=r,L.propertyTableId=0,L.setIndex=0,L.positionalLabel="featureId_0";let W=[L],B=new Tn.Primitive;return B.attributes=S,B.indices=R,B.featureIds=W,B.primitiveType=Be.LINES,B.material=_,B}function X3e(e,t,n){let i=0,o=e.length;for(let S=0;S<o;S++){let _=e[S];l(_.points)&&(i+=_.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),d=0;for(let S=0;S<o;S++){let _=e[S];if(!l(_.points))continue;let R=_.points.length;for(let L=0;L<R;L++){let W=_.points[L],B=m.fromDegrees(W.x,W.y,W.z,ie.WGS84,ik),Y=F.multiplyByPoint(t,B,ik);m.minimumByComponent(a,Y,a),m.maximumByComponent(c,Y,c),m.pack(Y,r,d*3),s[d]=S,d++}}let u=mt.createVertexBuffer({typedArray:r,context:n.context,usage:Xe.STATIC_DRAW});u.vertexArrayDestroyable=!1;let h=mt.createVertexBuffer({typedArray:s,context:n.context,usage:Xe.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new Tn.Attribute;p.semantic=at.POSITION,p.componentDatatype=J.FLOAT,p.type=Ut.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=u;let g=new Tn.Attribute;g.semantic=at.FEATURE_ID,g.setIndex=0,g.componentDatatype=J.FLOAT,g.type=Ut.SCALAR,g.count=i,g.buffer=h;let f=[p,g],b=new Tn.Material;b.unlit=!0;let C=new Tn.FeatureIdAttribute;C.featureCount=o,C.propertyTableId=0,C.setIndex=0,C.positionalLabel="featureId_0";let E=[C],T=new Tn.Primitive;return T.attributes=f,T.featureIds=E,T.primitiveType=Be.POINTS,T.material=b,T}function P3e(e,t){let n=new R3e,i=Y3e[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new he("GeoJSON must have at least one feature");let s={};for(let Y=0;Y<r;Y++){let A=o[Y].properties??Q.EMPTY_OBJECT;for(let I in A)A.hasOwnProperty(I)&&(l(s[I])||(s[I]=new Array(r)))}for(let Y=0;Y<r;Y++){let N=o[Y];for(let A in s)if(s.hasOwnProperty(A)){let I=N.properties[A]??"";s[A][Y]=I}}let a=new eg({count:r,properties:s}),d=[new Vl({id:0,count:r,jsonMetadataTable:a})],u=Zl.fromJson({}),h=new Sa({schema:u,propertyTables:d}),p=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),f=!1,b=!1;for(let Y=0;Y<r;Y++){let N=o[Y];if(l(N.lines)){f=!0;let A=N.lines.length;for(let I=0;I<A;I++){let Z=N.lines[I],G=Z.length;for(let w=0;w<G;w++)m.minimumByComponent(p,Z[w],p),m.maximumByComponent(g,Z[w],g)}}if(l(N.points)){b=!0;let A=N.points.length;for(let I=0;I<A;I++){let Z=N.points[I];m.minimumByComponent(p,Z,p),m.maximumByComponent(g,Z,g)}}}let C=m.midpoint(p,g,new m),E=m.fromDegrees(C.x,C.y,C.z,ie.WGS84,new m),T=Tt.eastNorthUpToFixedFrame(E,ie.WGS84,new F),S=F.inverseTransformation(T,new F),_=[];f&&_.push(N3e(o,S,t)),b&&_.push(X3e(o,S,t));let R=new Tn.Node;R.index=0,R.primitives=_;let L=[R],W=new Tn.Scene;W.nodes=L;let B=new Tn.Components;return B.scene=W,B.nodes=L,B.transform=T,B.structuralMetadata=h,B}S0.prototype.unload=function(){this._components=void 0};var cF=S0;var aLn=y(x(),1);var L1n=y(x(),1);var ok={};ok._deprecationWarning=Ms;var I0=Uint32Array.BYTES_PER_ELEMENT;ok.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=I0;let r=o.getUint32(t,!0);if(r!==1)throw new he(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=I0;let s=o.getUint32(t,!0);t+=I0;let a=o.getUint32(t,!0);if(a===0)throw new he("featureTableJsonByteLength is zero, the feature table must be defined.");t+=I0;let c=o.getUint32(t,!0);t+=I0;let d=o.getUint32(t,!0);t+=I0;let u=o.getUint32(t,!0);t+=I0;let h=o.getUint32(t,!0);if(h!==1&&h!==0)throw new he(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${h} is not.`);t+=I0;let p=Cr(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let f,b;d>0&&(f=Cr(i,t,d),t+=d,u>0&&(b=new Uint8Array(e,t,u),b=new Uint8Array(b),t+=u));let C=n+s-t;if(C===0)throw new he("glTF byte length must be greater than 0.");let E;return t%4===0?E=new Uint8Array(e,t,C):(ok._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),E=new Uint8Array(i.subarray(t,t+C))),{gltfFormat:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:b,gltf:E}};var lF=ok;var sg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},rk=Tn.Attribute,M3e=Tn.FeatureIdAttribute,ide=Tn.Instances;function ag(e){e=e??Q.EMPTY_OBJECT;let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,c=e.upAxis??to.Y,d=e.forwardAxis??to.X,u=e.loadAttributesAsTypedArray??!1,h=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,g=e.enablePick??!1;i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=sg.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(ag.prototype=Object.create(Oi.prototype),ag.prototype.constructor=ag);Object.defineProperties(ag.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});ag.prototype.load=function(){if(l(this._promise))return this._promise;let e=lF.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new Yh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new he("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(c)&&(this._transform=F.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:o};let d={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let h=cd(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});d.gltfResource=p,d.baseResource=p}else d.gltfResource=this._i3dmResource,d.typedArray=e.gltf;let u=new eu(d);return this._gltfLoader=u,this._state=sg.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=sg.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw U3e(this,h)}),this._promise};function U3e(e,t){return e.unload(),e._state=sg.FAILED,e.getError("Failed to load i3dm",t)}ag.prototype.process=function(e){if(this._state===sg.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===sg.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),k3e(this,i,e),D3e(this,i),this._components=i,this._arrayBuffer=void 0,this._state=sg.READY,!0};function D3e(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=rg({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Vl({name:Lh.BATCH_TABLE_CLASS_NAME,count:i});o=new Sa({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var sk=new m,LK=new Array(4),v3e=new F;function k3e(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",J.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=O3e(o,r),h;c&&(h=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let g=new Float32Array(r),f=m.unpackArray(u),b=new m,C=new m,E=new m,T=new m,S=new $,_=new Me,R=new Array(4),L=new m,W=new Array(3),B=new F;if(!l(s)||m.equals(m.unpack(s),m.ZERO)){let U=ue.fromPoints(f);for(i=0;i<f.length;i++)m.subtract(f[i],U.center,sk),u[3*i+0]=sk.x,u[3*i+1]=sk.y,u[3*i+2]=sk.z;let k=F.fromTranslation(U.center,v3e);t.transform=F.multiplyTransformation(k,t.transform,t.transform)}for(i=0;i<r;i++){b=m.clone(f[i]),l(s)&&m.add(b,m.unpack(s),b),c&&(z3e(o,a,i,_,b,E,C,T,S,B),Me.pack(_,R,0),h[4*i+0]=R[0],h[4*i+1]=R[1],h[4*i+2]=R[2],h[4*i+3]=R[3]),d&&(H3e(o,i,L),m.pack(L,W,0),p[3*i+0]=W[0],p[3*i+1]=W[1],p[3*i+2]=W[2]);let U=o.getProperty("BATCH_ID",J.UNSIGNED_SHORT,1,i);l(U)||(U=i),g[i]=U}let Y=new ide;Y.transformInWorldSpace=!0;let N=e._buffers,A=new rk;if(A.name="Instance Translation",A.semantic=Gs.TRANSLATION,A.componentDatatype=J.FLOAT,A.type=Ut.VEC3,A.count=r,A.typedArray=u,!c){let U=mt.createVertexBuffer({context:n.context,typedArray:u,usage:Xe.STATIC_DRAW});U.vertexArrayDestroyable=!1,N.push(U),A.buffer=U}if(Y.attributes.push(A),c){let U=new rk;U.name="Instance Rotation",U.semantic=Gs.ROTATION,U.componentDatatype=J.FLOAT,U.type=Ut.VEC4,U.count=r,U.typedArray=h,Y.attributes.push(U)}if(d){let U=new rk;if(U.name="Instance Scale",U.semantic=Gs.SCALE,U.componentDatatype=J.FLOAT,U.type=Ut.VEC3,U.count=r,c)U.typedArray=p;else{let k=mt.createVertexBuffer({context:n.context,typedArray:p,usage:Xe.STATIC_DRAW});k.vertexArrayDestroyable=!1,N.push(k),U.buffer=k}Y.attributes.push(U)}let I=new rk;I.name="Instance Feature ID",I.setIndex=0,I.semantic=Gs.FEATURE_ID,I.componentDatatype=J.FLOAT,I.type=Ut.SCALAR,I.count=r;let Z=mt.createVertexBuffer({context:n.context,typedArray:g,usage:Xe.STATIC_DRAW});Z.vertexArrayDestroyable=!1,N.push(Z),I.buffer=Z,Y.attributes.push(I);let G=new M3e;G.propertyTableId=0,G.setIndex=0,G.positionalLabel="instanceFeatureId_0",Y.featureIds.push(G);let w=t.nodes,X=w.length,v=!1;for(i=0;i<X;i++){let U=w[i];U.primitives.length>0&&(U.instances=v?Q3e(Y):Y,v=!0)}}function Q3e(e){let t=new ide;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Qe(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function O3e(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",J.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",J.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",J.FLOAT,3);if(!l(i))throw new he("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",J.FLOAT,3);if(!l(o))throw new he("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new he("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var nde=new Array(4);function z3e(e,t,n,i,o,r,s,a,c,d){let u=e.getProperty("NORMAL_UP",J.FLOAT,3,n,LK),h=e.getProperty("NORMAL_RIGHT",J.FLOAT,3,n,nde),p=!1;if(l(u)){if(!l(h))throw new he("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");m.unpack(u,0,r),m.unpack(h,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",J.UNSIGNED_SHORT,2,n,LK),f=e.getProperty("NORMAL_RIGHT_OCT32P",J.UNSIGNED_SHORT,2,n,nde);if(l(g)){if(!l(f))throw new he("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");_n.octDecodeInRange(g[0],g[1],65535,r),_n.octDecodeInRange(f[0],f[1],65535,s),p=!0}else t?(Tt.eastNorthUpToFixedFrame(o,ie.WGS84,d),F.getMatrix3(d,c)):$.clone($.IDENTITY,c)}p&&(m.cross(s,r,a),m.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),Me.fromRotationMatrix(c,i)}function H3e(e,t,n){n=m.fromElements(1,1,1,n);let i=e.getProperty("SCALE",J.FLOAT,1,t);l(i)&&m.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",J.FLOAT,3,t,LK);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function K3e(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}ag.prototype.isUnloaded=function(){return this._state===sg.UNLOADED};ag.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),K3e(this),this._components=void 0,this._arrayBuffer=void 0,this._state=sg.UNLOADED};var dF=ag;var IWn=y(x(),1);var pWn=y(x(),1);var lLn=y(x(),1),J3e={STOPPED:0,ANIMATING:1},Nh=Object.freeze(J3e);var aWn=y(x(),1);var bLn=y(x(),1);var pLn=y(x(),1);function KS(){this.times=void 0,this.points=void 0,Ae.throwInstantiationError()}KS.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof m)return m;if(e instanceof Me)return Me};KS.prototype.evaluate=Ae.throwInstantiationError;KS.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=t??0,e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};KS.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};KS.prototype.clampTime=function(e){let t=this.times;return V.clamp(e,t[0],t[t.length-1])};var To=KS;function JS(e){this._value=e,this._valueType=To.getPointType(e)}Object.defineProperties(JS.prototype,{value:{get:function(){return this._value}}});JS.prototype.findTimeInterval=function(e){};JS.prototype.wrapTime=function(e){return 0};JS.prototype.clampTime=function(e){return 0};JS.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var uF=JS;var NLn=y(x(),1);var SLn=y(x(),1);function jS(e){e=e??Q.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=To.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(jS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});jS.prototype.findTimeInterval=To.prototype.findTimeInterval;jS.prototype.wrapTime=To.prototype.wrapTime;jS.prototype.clampTime=To.prototype.clampTime;jS.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new m),m.lerp(n[o],n[o+1],r,t))};var _0=jS;var ZLn=y(x(),1);var ode={};ode.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new m,s[a]=new m;o[0]=n[0]/t[0],r[0]=m.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=m.subtract(r[a],m.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var qS=ode;var rde=[],sde=[],ade=[],cde=[];function j3e(e,t,n){let i=rde,o=ade,r=sde,s=cde;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new m),m.clone(n,c),qS.solve(i,r,o,s)}function q3e(e){let t=rde,n=ade,i=sde,o=cde;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new m),m.subtract(e[1],e[0],s),m.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new m),m.subtract(e[r+1],e[r-1],s),m.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new m),m.subtract(e[r],e[r-1],s),m.multiplyByScalar(s,3,s),qS.solve(t,i,n,o)}function fd(e){e=e??Q.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=To.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(fd.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}}});fd.createC1=function(e){e=e??Q.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new fd({times:t,points:n,inTangents:r,outTangents:o})};fd.createNaturalCubic=function(e){e=e??Q.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new _0({points:n,times:t});let i=q3e(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new fd({times:t,points:n,inTangents:r,outTangents:o})};fd.createClampedCubic=function(e){e=e??Q.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=To.getPointType(n[0]);if(n.length<3)return new _0({points:n,times:t});let s=j3e(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new fd({times:t,points:n,inTangents:c,outTangents:a})};fd.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);fd.prototype.findTimeInterval=To.prototype.findTimeInterval;var $3e=new ce,$S=new m;fd.prototype.wrapTime=To.prototype.wrapTime;fd.prototype.clampTime=To.prototype.clampTime;fd.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,d=$3e;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;let u=F.multiplyByVector(fd.hermiteCoefficientMatrix,d,d);u.z*=a,u.w*=a;let h=this._pointType;return h===Number?n[s]*u.x+n[s+1]*u.y+r[s]*u.z+o[s]*u.w:(l(t)||(t=new h),t=h.multiplyByScalar(n[s],u.x,t),h.multiplyByScalar(n[s+1],u.y,$S),h.add(t,$S,t),h.multiplyByScalar(r[s],u.z,$S),h.add(t,$S,t),h.multiplyByScalar(o[s],u.w,$S),h.add(t,$S,t))};var Z0=fd;var DLn=y(x(),1);function eI(e){e=e??Q.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=To.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(eI.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});eI.prototype.findTimeInterval=To.prototype.findTimeInterval;eI.prototype.wrapTime=To.prototype.wrapTime;eI.prototype.clampTime=To.prototype.clampTime;eI.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var mF=eI;var HLn=y(x(),1);function eze(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Me);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return Me.fastSlerp(a,c,s,o)}}function tI(e){e=e??Q.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=eze(this),this._lastTimeIndex=0}Object.defineProperties(tI.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});tI.prototype.findTimeInterval=To.prototype.findTimeInterval;tI.prototype.wrapTime=To.prototype.wrapTime;tI.prototype.clampTime=To.prototype.clampTime;tI.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var hF=tI;var nI=Tn.AnimatedPropertyType;function WK(e){e=e??Q.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,rze(this)}Object.defineProperties(WK.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function tze(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new Z0({times:e,points:n,inTangents:i,outTangents:o})}function lde(e,t,n,i){if(e.length===1&&t.length===1)return new uF(t[0]);switch(n){case Bh.STEP:return new mF({times:e,points:t});case Bh.CUBICSPLINE:return tze(e,t);case Bh.LINEAR:return i===nI.ROTATION?new hF({times:e,points:t}):new _0({times:e,points:t})}}function nze(e,t,n,i,o){let r=[];if(i===nI.WEIGHTS){let a=t.length/o,c,d;for(c=0;c<o;c++){let u=new Array(a),h=c;if(n===Bh.CUBICSPLINE)for(d=0;d<a;d+=3)u[d]=t[h],u[d+1]=t[h+o],u[d+2]=t[h+2*o],h+=o*3;else for(d=0;d<a;d++)u[d]=t[h],h+=o;r.push(lde(e,u,n,i))}}else r.push(lde(e,t,n,i));return r}var ize=new m,oze=new Me;function rze(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,d=l(c.morphWeights)?c.morphWeights.length:1,u=nze(i,o,r,a,d);e._splines=u,e._path=a}WK.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===nI.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],d=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(d)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===nI.TRANSLATION||n===nI.SCALE?o[n]=r.evaluate(s,ize):n===nI.ROTATION&&(o[n]=r.evaluate(s,oze))}}};var fF=WK;function FK(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=j.clone(n.startTime),this._delay=n.delay??0,this._stopTime=j.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??hd.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new Ce,this.update=new Ce,this.stop=new Ce,this._state=Nh.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,sze(this)}Object.defineProperties(FK.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},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}},animationTime:{get:function(){return this._animationTime}}});function sze(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let d=r[c],u=d.target;if(!l(u))continue;let h=u.node.index,p=i._runtimeNodes[h],g=new fF({channel:d,runtimeAnimation:e,runtimeNode:p}),f=d.sampler.input;t=Math.min(t,f[0]),n=Math.max(n,f[f.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}FK.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var pF=FK;function cg(e){this.animationAdded=new Ce,this.animationRemoved=new Ce,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(cg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function BK(e,t,n){let i=e._model,o=new pF(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}cg.prototype.add=function(e){e=e??Q.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return BK(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return BK(this,n[i],e)};cg.prototype.addAll=function(e){e=e??Q.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=BK(this,n[r],e);i.push(s)}return i};cg.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};cg.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};cg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};cg.prototype.get=function(e){return this._runtimeAnimations[e]};var ak=[];function aze(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}cg.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&j.equals(e.time,this._previousTime))return!1;this._previousTime=j.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=j.addSeconds(a.startTime??o,a.delay,new j)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,d=a._duration,u=a.stopTime,h=j.lessThanOrEquals(c,o),p=l(u)&&j.greaterThan(o,u),g=0;if(d!==0){let C=j.secondsDifference(p?u:o,c);g=l(a._animationTime)?a._animationTime(d,C):C/d}let f=a.loop===hd.REPEAT||a.loop===hd.MIRRORED_REPEAT,b=(h||f&&!l(a.startTime))&&(g<=1||f)&&!p;if(g===a._prevAnimationDelta){let C=a._state===Nh.STOPPED;if(b!==C)continue}if(a._prevAnimationDelta=g,b||a._state===Nh.ANIMATING){if(b&&a._state===Nh.STOPPED&&(a._state=Nh.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===hd.REPEAT)g=g-Math.floor(g);else if(a.loop===hd.MIRRORED_REPEAT){let E=Math.floor(g),T=g-E;g=E%2===1?1-T:T}a.reverse&&(g=1-g);let C=g*d*a.multiplier;C=V.clamp(C,a.localStartTime,a.localStopTime),a.animate(C),a.update.numberOfListeners>0&&(a._updateEventTime=C,e.afterRender.push(a._raiseUpdateEvent)),i=!0,b||(a._state=Nh.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&ak.push(a))}}n=ak.length;for(let s=0;s<n;++s){let a=ak[s];t.splice(t.indexOf(a),1),e.afterRender.push(aze(this,r,a))}return ak.length=0,i};var AF=cg;var vWn=y(x(),1);var GWn=y(x(),1);function CC(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(CC.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new D),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});CC.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};CC.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};CC.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};CC.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};CC.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var gF=CC;var LWn=y(x(),1),bF={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};bF.getStyleCommandsNeeded=function(e,t){return t===0?bF.ALL_OPAQUE:t===e?bF.ALL_TRANSLUCENT:bF.OPAQUE_AND_TRANSLUCENT};var Xh=Object.freeze(bF);var FWn=y(x(),1);var R0={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};R0.is3DTiles=function(e){switch(e){case R0.TILE_GLTF:case R0.TILE_B3DM:case R0.TILE_I3DM:case R0.TILE_PNTS:case R0.TILE_GEOJSON:return!0;case R0.GLTF:return!1}};var Yr=Object.freeze(R0);function ls(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=Xh.ALL_OPAQUE,cze(this)}Object.defineProperties(ls.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function cze(e){let t=e._model,n=Yr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new Ea(s,o)}else for(o=0;o<i;o++)r[o]=new gF({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new _l({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}ls.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Xh.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};ls.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ls.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ls.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ls.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ls.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ls.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ls.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};ls.prototype.getFeature=function(e){return this._features[e]};ls.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};ls.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};ls.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};ls.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};ls.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};ls.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};ls.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};ls.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};ls.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var lze=new D;ls.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(_l.DEFAULT_COLOR_VALUE),this.setAllShow(_l.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,lze)??_l.DEFAULT_COLOR_VALUE:_l.DEFAULT_COLOR_VALUE,o=l(e.show)?e.show.evaluate(n)??_l.DEFAULT_SHOW_VALUE:_l.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};ls.prototype.isDestroyed=function(){return!1};ls.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),fe(this)};var yF=ls;var POn=y(x(),1);var KWn=y(x(),1);var dde={name:"TilesetPipelineStage"};dde.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,be.FRAGMENT);let r={u_polygonOffset:function(){return M.ZERO}};e.uniformMap=Rt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Qt.setCesium3DTileBit(),i.stencilMask=Qt.CESIUM_3D_TILE_MASK};var xF=dde;var sFn=y(x(),1);var jWn=y(x(),1),CF=`// robust iterative solution without trig functions
// https://github.com/0xfaded/ellipse_demo/issues/1
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
//
// This version uses only a single iteration for best performance. For fog
// rendering, the difference is negligible.
vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) {
    vec2 p = abs(pos);
    vec2 inverseRadii = 1.0 / radii;
    vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii;

    // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
    // but store the cos and sin of t in a vec2 for efficiency.
    // Initial guess: t = cos(pi/4)
    vec2 tTrigs = vec2(0.70710678118);
    vec2 v = radii * tTrigs;

    // Find the evolute of the ellipse (center of curvature) at v.
    vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;
    // Find the (approximate) intersection of p - evolute with the ellipsoid.
    vec2 q = normalize(p - evolute) * length(v - evolute);
    // Update the estimate of t.
    tTrigs = (q + evolute) * inverseRadii;
    tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
    v = radii * tTrigs;

    return v * sign(pos);
}

vec3 computeEllipsoidPositionWC(vec3 positionMC) {
    // Get the world-space position and project onto a meridian plane of
    // the ellipsoid
    vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;

    vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);
    vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);

    // Reconstruct a 3D point in world space
    return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);
}

void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {

    vec3 fogColor = groundAtmosphereColor.rgb;

    // If there is dynamic lighting, apply that to the fog.
    const float NONE = 0.0;
    if (czm_atmosphereDynamicLighting != NONE) {
        float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);
        fogColor *= darken;
    }

    // Tonemap if HDR rendering is disabled
    #ifndef HDR
        fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
        fogColor.rgb = czm_inverseGamma(fogColor.rgb);
    #endif

    vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar);
    color = vec4(withFog, color.a);
}

void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) {
    vec3 rayleighColor;
    vec3 mieColor;
    float opacity;

    vec3 positionWC;
    vec3 lightDirection;

    // When the camera is in space, compute the position per-fragment for
    // more accurate ground atmosphere. All other cases will use
    //
    // The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717
    if (false) {
        positionWC = computeEllipsoidPositionWC(attributes.positionMC);
        lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);

        // The fog color is derived from the ground atmosphere color
        czm_computeGroundAtmosphereScattering(
            positionWC,
            lightDirection,
            rayleighColor,
            mieColor,
            opacity
        );
    } else {
        positionWC = attributes.positionWC;
        lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
        rayleighColor = v_atmosphereRayleighColor;
        mieColor = v_atmosphereMieColor;
        opacity = v_atmosphereOpacity;
    }

    //color correct rayleigh and mie colors
    const bool ignoreBlackPixels = true;
    rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels);
    mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels);

    vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);

    if (u_isInFog) {
        float distanceToCamera = length(attributes.positionEC);
        applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera);
    } else {
        // Ground atmosphere
    }
}
`;var $Wn=y(x(),1),EF=`void atmosphereStage(ProcessedAttributes attributes) {
    vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);

    czm_computeGroundAtmosphereScattering(
        // This assumes the geometry stage came before this.
        v_positionWC,
        lightDirection,
        v_atmosphereRayleighColor,
        v_atmosphereMieColor,
        v_atmosphereOpacity
    );
}
`;var ude={name:"AtmospherePipelineStage"};ude.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,be.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,be.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([EF]),i.addFragmentLines([CF]),i.addUniform("bool","u_isInFog",be.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=m.distance(n.camera.positionWC,t.boundingSphere.center);return V.fog(o,n.fog.density)>V.EPSILON3}};var TF=ude;var AFn=y(x(),1);var cFn=y(x(),1),SF=`#ifdef DIFFUSE_IBL
vec3 sampleDiffuseEnvironment(vec3 cubeDir)
{
    #ifdef CUSTOM_SPHERICAL_HARMONICS
        return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); 
    #else
        return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); 
    #endif
}
#endif

#ifdef SPECULAR_IBL
vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness)
{
    #ifdef CUSTOM_SPECULAR_IBL
        float lod = roughness * model_specularEnvironmentMapsMaximumLOD;
        return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb;
    #else
        float lod = roughness * czm_specularEnvironmentMapsMaximumLOD;
        return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb;
    #endif
}
vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness)
{
    // see https://bruop.github.io/ibl/ at Single Scattering Results
    // Roughness dependent fresnel, from Fdez-Aguera
    vec3 f90 = max(vec3(1.0 - roughness), f0);
    vec3 F = fresnelSchlick2(f0, f90, NdotV);

    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
    vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness);

    return specularSample * (F * brdfLut.x + brdfLut.y);
}
#endif

#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
/**
 * Compute the light contributions from environment maps and spherical harmonic coefficients.
 * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation
 * of the single- and multi-scattering terms.
 *
 * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 * @param {czm_modelMaterial} The material properties.
 * @return {vec3} The computed HDR color.
 */
vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) {
    vec3 f0 = material.specular;
    float roughness = material.roughness;
    float specularWeight = 1.0;
    #ifdef USE_SPECULAR
        specularWeight = material.specularWeight;
    #endif
    float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0);

    // see https://bruop.github.io/ibl/ at Single Scattering Results
    // Roughness dependent fresnel, from Fdez-Aguera
    vec3 f90 = max(vec3(1.0 - roughness), f0);
    vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV);

    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
    vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y);

    #ifdef DIFFUSE_IBL
        vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC);
        vec3 irradiance = sampleDiffuseEnvironment(normalMC);

        vec3 averageFresnel = f0 + (1.0 - f0) / 21.0;
        float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y);
        vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems);
        vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse;
        vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x;
    #else
        vec3 diffuseContribution = vec3(0.0);
    #endif

    #ifdef USE_ANISOTROPY
        // Bend normal to account for anisotropic distortion of specular reflection
        vec3 anisotropyDirection = material.anisotropicB;
        vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC);
        vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);
        float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness);
        float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;
        vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4));
        vec3 reflectEC = reflect(-viewDirectionEC, bentNormal);
    #else
        vec3 reflectEC = reflect(-viewDirectionEC, normalEC);
    #endif

    #ifdef SPECULAR_IBL
        vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC);
        vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness);
        vec3 specularContribution = radiance * FssEss * model_iblFactor.y;
    #else
        vec3 specularContribution = vec3(0.0);
    #endif

    return diffuseContribution + specularContribution;
}
#endif
`;var mde={name:"ImageBasedLightingPipelineStage"},dze=new M;mde.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,be.FRAGMENT),r.addUniform("vec2","model_iblFactor",be.FRAGMENT),Ih.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",be.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,be.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,be.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,be.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",be.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,be.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,be.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,be.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",be.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",be.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,be.FRAGMENT)),r.addFragmentLines(SF);let c={model_iblFactor:function(){return M.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,dze)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=Rt(c,e.uniformMap)};var IF=mde;var VFn=y(x(),1);var SFn=y(x(),1);var uze=V.EPSILON16;function YK(e){e=e??Q.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(YK.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=V.clamp(e,this.minimumValue,this.maximumValue),V.equalsEpsilon(this._currentValue,e,uze)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var mze=new m,wK=new $;YK.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=mze,o;switch(t){case vc.XROTATE:o=$.fromRotationX(V.toRadians(n),wK),e=F.multiplyByMatrix3(e,o,e);break;case vc.YROTATE:o=$.fromRotationY(V.toRadians(n),wK),e=F.multiplyByMatrix3(e,o,e);break;case vc.ZROTATE:o=$.fromRotationZ(V.toRadians(n),wK),e=F.multiplyByMatrix3(e,o,e);break;case vc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case vc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case vc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case vc.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case vc.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case vc.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case vc.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var _F=YK;function ck(e){e=e??Q.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,hze(this)}Object.defineProperties(ck.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function hze(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new _F({stage:a,runtimeArticulation:e});o.push(c);let d=a.name;r[d]=c}}ck.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var fze=new F,pze=new F;ck.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,fze),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=F.multiplyTransformation(s.originalTransform,e,pze);s.transform=a}};var ZF=ck;var PFn=y(x(),1);var WFn=y(x(),1),RF=`void modelColorStage(inout czm_modelMaterial material)
{
    material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);
    float highlight = ceil(model_colorBlend);
    material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);
    material.alpha *= model_color.a;
}
`;var iI={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};iI.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,be.FRAGMENT),i.addFragmentLines(RF);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=Ve.TRANSLUCENT),i.addUniform("vec4",iI.COLOR_UNIFORM_NAME,be.FRAGMENT),o[iI.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",iI.COLOR_BLEND_UNIFORM_NAME,be.FRAGMENT),o[iI.COLOR_BLEND_UNIFORM_NAME]=function(){return Dc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Rt(o,e.uniformMap)};var G0=iI;var KFn=y(x(),1);var UFn=y(x(),1),GF=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
vec4 getClippingPlane(
    highp sampler2D packedClippingPlanes,
    int clippingPlaneNumber,
    mat4 transform
) {
    int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
    int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    vec4 plane = texture(packedClippingPlanes, vec2(u, v));
    return czm_transformPlane(plane, transform);
}
#else
// Handle uint8 clipping texture instead
vec4 getClippingPlane(
    highp sampler2D packedClippingPlanes,
    int clippingPlaneNumber,
    mat4 transform
) {
    int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each
    int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
    int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
    vec4 plane;
    plane.xyz = czm_octDecode(oct, 65535.0);
    plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
    return czm_transformPlane(plane, transform);
}
#endif

float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
    vec4 position = czm_windowToEyeCoordinates(fragCoord);
    vec3 clipNormal = vec3(0.0);
    vec3 clipPosition = vec3(0.0);
    float pixelWidth = czm_metersPerPixel(position);
    
    #ifdef UNION_CLIPPING_REGIONS
    float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.
    #else
    float clipAmount = 0.0;
    bool clipped = true;
    #endif

    for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
        clipNormal = clippingPlane.xyz;
        clipPosition = -clippingPlane.w * clipNormal;
        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
        
        #ifdef UNION_CLIPPING_REGIONS
        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
        if (amount <= 0.0) {
            discard;
        }
        #else
        clipAmount = max(amount, clipAmount);
        clipped = clipped && (amount <= 0.0);
        #endif
    }

    #ifndef UNION_CLIPPING_REGIONS
    if (clipped) {
        discard;
    }
    #endif
    
    return clipAmount;
}

void modelClippingPlanesStage(inout vec4 color)
{
    float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
    vec4 clippingPlanesEdgeColor = vec4(1.0);
    clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
    float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
    
    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
        color = clippingPlanesEdgeColor;
    }
}
`;var hde={name:"ModelClippingPlanesPipelineStage"},Aze=new M;hde.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,be.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,be.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,be.FRAGMENT),ss.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,be.FRAGMENT);let s=ss.getTextureResolution(i,o,Aze);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,be.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,be.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",be.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",be.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",be.FRAGMENT),r.addFragmentLines(GF);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=D.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=Rt(a,e.uniformMap)};var VF=hde;var rBn=y(x(),1);var jFn=y(x(),1),LF=`void modelClippingPolygonsStage(ProcessedAttributes attributes)
{
    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC);
    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);

    vec2 minDistance = vec2(czm_infinity);
    v_regionIndex = -1;
    v_clippingPosition = vec2(czm_infinity);

    for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
        vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex);
        vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;

        vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
        vec2 distance = abs(rectUv - clamped) * extents.wz;
        
        if (minDistance.x > distance.x || minDistance.y > distance.y) {
            minDistance = distance;
            v_clippingPosition = rectUv;
        }

        float threshold = 0.01;
        if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
            v_regionIndex = regionIndex;
        }
    }
}
`;var $Fn=y(x(),1),WF=`void modelClippingPolygonsStage()
{
    vec2 clippingPosition = v_clippingPosition;
    int regionIndex = v_regionIndex;
    czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
}
`;var fde={name:"ModelClippingPolygonsPipelineStage"};fde.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,be.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,be.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,be.BOTH),o.addUniform("sampler2D","model_clippingDistance",be.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",be.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(LF),o.addFragmentLines(WF);let r={model_clippingDistance:function(){return i.clippingTexture??n.context.defaultTexture},model_clippingExtents:function(){return i.extentsTexture??n.context.defaultTexture}};e.uniformMap=Rt(r,e.uniformMap)};var FF=fde;var cBn=y(x(),1);function pde(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(pde.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var BF=pde;var n2n=y(x(),1);var NBn=y(x(),1);var dBn=y(x(),1),wF=`mat4 getInstancingTransform()
{
    mat4 instancingTransform;

    #ifdef HAS_INSTANCE_MATRICES
    instancingTransform = mat4(
        a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1
        a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2
        a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3
        a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0  // Column 4
    );
    #else
    vec3 translation = vec3(0.0, 0.0, 0.0);
    vec3 scale = vec3(1.0, 1.0, 1.0);
    
        #ifdef HAS_INSTANCE_TRANSLATION
        translation = a_instanceTranslation;
        #endif
        #ifdef HAS_INSTANCE_SCALE
        scale = a_instanceScale;
        #endif

    instancingTransform = mat4(
        scale.x, 0.0, 0.0, 0.0,
        0.0, scale.y, 0.0, 0.0,
        0.0, 0.0, scale.z, 0.0,
        translation.x, translation.y, translation.z, 1.0
    ); 
    #endif

    return instancingTransform;
}

#ifdef USE_2D_INSTANCING
mat4 getInstancingTransform2D()
{
    mat4 instancingTransform2D;

    #ifdef HAS_INSTANCE_MATRICES
    instancingTransform2D = mat4(
        a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1
        a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2
        a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3
        a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0  // Column 4
    );
    #else
    vec3 translation2D = vec3(0.0, 0.0, 0.0);
    vec3 scale = vec3(1.0, 1.0, 1.0);
    
        #ifdef HAS_INSTANCE_TRANSLATION
        translation2D = a_instanceTranslation2D;
        #endif
        #ifdef HAS_INSTANCE_SCALE
        scale = a_instanceScale;
        #endif

    instancingTransform2D = mat4(
        scale.x, 0.0, 0.0, 0.0,
        0.0, scale.y, 0.0, 0.0,
        0.0, 0.0, scale.z, 0.0,
        translation2D.x, translation2D.y, translation2D.z, 1.0
    ); 
    #endif

    return instancingTransform2D;
}
#endif
`;var mBn=y(x(),1),YF=`void instancingStage(inout ProcessedAttributes attributes) 
{
    vec3 positionMC = attributes.positionMC;
    
    mat4 instancingTransform = getInstancingTransform();
    
    attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;

    #ifdef HAS_NORMALS
    vec3 normalMC = attributes.normalMC;
    attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;
    #endif

    #ifdef USE_2D_INSTANCING
    mat4 instancingTransform2D = getInstancingTransform2D();
    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
    #endif
}
`;var fBn=y(x(),1),NF=`void legacyInstancingStage(
    inout ProcessedAttributes attributes,
    out mat4 instanceModelView,
    out mat3 instanceModelViewInverseTranspose)
{
    vec3 positionMC = attributes.positionMC;

    mat4 instancingTransform = getInstancingTransform();
 
    mat4 instanceModel = instancingTransform * u_instance_nodeTransform;
    instanceModelView = u_instance_modifiedModelView;
    instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);

    attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;
    
    #ifdef USE_2D_INSTANCING
    mat4 instancingTransform2D = getInstancingTransform2D();
    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
    #endif
}
`;var lk=new F,gze=new F,bze=new F,gde={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Ede,_transformsToTypedArray:XK};gde.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(wF);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==se.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,h=[];Fze(e,n,i,h,d,u),Yze(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,be.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",be.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",be.VERTEX),p.u_instance_modifiedModelView=function(){let g=F.multiplyTransformation(s.modelMatrix,a.components.transform,lk);return d?F.multiplyTransformation(n.context.uniformState.view3D,g,lk):(n.mode!==se.SCENE3D&&(g=Tt.basisTo2D(n.mapProjection,g,lk)),F.multiplyTransformation(n.context.uniformState.view,g,lk))},p.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,gze)},r.addVertexLines(NF)):r.addVertexLines(YF),d){r.addDefine("USE_2D_INSTANCING",void 0,be.VERTEX),r.addUniform("mat4","u_modelView2D",be.VERTEX);let g=n.context,f=F.fromTranslation(c.instancingReferencePoint2D,new F);p.u_modelView2D=function(){return F.multiplyTransformation(g.uniformState.view,f,bze)}}e.uniformMap=Rt(p,e.uniformMap),e.instanceCount=o,ni(e.attributes,h)};var XF=new F,yze=new m;function xze(e,t,n,i,o){let r=F.multiplyTransformation(t,e,XF);return r=F.multiplyTransformation(r,n,XF),o=Tt.basisTo2D(i.mapProjection,r,o),o}function Cze(e,t,n,i,o){let r=F.fromTranslation(e,XF),s=F.multiplyTransformation(t,r,XF);s=F.multiplyTransformation(s,n,XF);let a=F.getTranslation(s,yze);return o=no.computeActualEllipsoidPosition(i,a,o),o}function bde(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var yde=new F,xde=new F,Eze=new F,Tze=new m;function Sze(e,t,n,i){let o=yde,r=xde;bde(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],h=xze(u,o,r,n,Eze),p=F.getTranslation(h,Tze),g=m.subtract(p,a,p);i[d]=F.setTranslation(h,g,i[d])}return i}function Ize(e,t,n,i){let o=yde,r=xde;bde(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],h=Cze(u,o,r,n,u);i[d]=m.subtract(h,a,i[d])}return i}var _ze=new m,Zze=new m;function Cde(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,_ze),r=no.computeActualEllipsoidPosition(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,Zze),a=no.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=m.lerp(r,a,.5,new m)}function XK(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function Rze(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var Gze=new m,Vze=new Me,Lze=new m;function Ede(e,t,n){let i=new Array(t),o=Xt.getAttributeBySemantic(e,Gs.TRANSLATION),r=Xt.getAttributeBySemantic(e,Gs.ROTATION),s=Xt.getAttributeBySemantic(e,Gs.SCALE),a=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=l(o),u=l(r),h=l(s),p=d?o.typedArray:new Float32Array(t*3),g=u?r.typedArray:new Float32Array(t*4);u&&r.normalized&&(g=_n.dequantize(g,r.componentDatatype,r.type,t));let f;h?f=s.typedArray:(f=new Float32Array(t*3),f.fill(1));for(let C=0;C<t;C++){let E=new m(p[C*3],p[C*3+1],p[C*3+2],Gze);m.maximumByComponent(a,E,a),m.minimumByComponent(c,E,c);let T=new Me(g[C*4],g[C*4+1],g[C*4+2],u?g[C*4+3]:1,Vze),S=new m(f[C*3],f[C*3+1],f[C*3+2],Lze),_=F.fromTranslationQuaternionRotationScale(E,T,S,new F);i[C]=_}let b=n.runtimeNode;return b.instancingTranslationMin=c,b.instancingTranslationMax=a,d&&(o.typedArray=void 0),u&&(r.typedArray=void 0),h&&(s.typedArray=void 0),i}function Wze(e,t,n){let i=new Array(t),o=e.typedArray,r=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let d=new m(o[c*3],o[c*3+1],o[c*3+2]);i[c]=d,m.minimumByComponent(r,d,r),m.maximumByComponent(s,d,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function PK(e,t){let n=mt.createVertexBuffer({context:t.context,typedArray:e,usage:Xe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function Fze(e,t,n,i,o,r){let s=Xt.getAttributeBySemantic(n,Gs.ROTATION);l(s)?Bze(e,n,i,t,o,r):wze(e,n,i,t,o)}function Bze(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,d=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",h,p=d.instancingTransformsBuffer;if(!l(p)){h=Ede(t,a,e);let C=XK(h);p=PK(C,i),c._modelResources.push(p),r&&(d.transformsTypedArray=C),d.instancingTransformsBuffer=p}if(Ade(e,p,n,u),!o)return;let g=Qe(i);g.mode=se.COLUMBUS_VIEW,Cde(e,g);let f=d.instancingTransformsBuffer2D;if(!l(f)){let C=Sze(h,e,g,h),E=XK(C);f=PK(E,i),c._modelResources.push(f),d.instancingTransformsBuffer2D=f}Ade(e,f,n,"Transform2D")}function wze(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Xt.getAttributeBySemantic(t,Gs.TRANSLATION),d=Xt.getAttributeBySemantic(t,Gs.SCALE);if(l(d)&&(s.addDefine("HAS_INSTANCE_SCALE"),NK(e,d.buffer,d.byteOffset,d.byteStride,n,"Scale")),!l(c))return;let u,h=c.typedArray;if(l(h)?u=Wze(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),NK(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let g=Qe(i);g.mode=se.COLUMBUS_VIEW,Cde(e,g);let f=a.instancingTranslationBuffer2D;if(!l(f)){let T=Ize(u,e,g,u),S=Rze(T);r&&(a.transformsTypedArray=S),f=PK(S,i),e.model._modelResources.push(f),a.instancingTranslationBuffer2D=f}if(!o)return;NK(e,f,0,void 0,n,"Translation2D")}function Ade(e,t,n,i){let r=J.getSizeInBytes(J.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:J.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:J.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:J.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),ni(n,a)}function NK(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function Yze(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===Gs.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Ut.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var PF=gde;var DBn=y(x(),1);var MK={};MK.name="ModelMatrixUpdateStage";MK.update=function(e,t,n){let i=n.mode!==se.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Tde(e,t,o,e.transformToRoot),e._transformDirty=!1}};function Nze(e,t,n){e.modelMatrix=F.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Xt.getCullFace(e.modelMatrix,e.primitiveType)}function Tde(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];Nze(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=F.clone(i,a._transformToRoot),Tde(a,t,n,i),a._transformDirty=!1}}var MF=MK;var QBn=y(x(),1);var Sde={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Ide,_countGeneratedBuffers:_de};Sde.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Ide(i,o),_de(i,r)};function Ide(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function _de(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var UF=Sde;function oI(e){e=e??Q.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,Xze(this)}Object.defineProperties(oI.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=F.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;m.equals(n,e)||(t.translation=m.clone(e,t.translation),UK(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Me.equals(n,e)||(t.rotation=Me.clone(e,t.rotation),UK(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;m.equals(n,e)||(t.scale=m.clone(e,t.scale),UK(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function Xze(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new Kb(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function UK(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}oI.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};oI.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(PF),t.push(UF),n.push(MF)};oI.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};oI.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var DF=oI;var AQn=y(x(),1);var c2n=y(x(),1);var Zde={name:"AlphaPipelineStage"};Zde.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===Ve.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=fn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,be.FRAGMENT),s.addUniform("float","u_alphaCutoff",be.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var vF=Zde;var u2n=y(x(),1);var Rde={name:"BatchTexturePipelineStage"};Rde.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Rt(o,e.uniformMap)};var kF=Rde;var b2n=y(x(),1);var Gde={name:"ClassificationPipelineStage"};Gde.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,be.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||Pze(t,o)};function Pze(e,t){let n=Xt.getAttributeBySemantic(e,at.POSITION);if(!l(n))throw new he("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Xt.getAttributeBySemantic(e,at.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let d=[],u=[0],h=r?i[0]:0,p=c[h],g=0;for(let b=1;b<s;b++){let C=r?i[b]:b,E=c[C];if(E!==p){let T=b-g,S=b;d.push(T),u.push(S),g=S,p=E}}let f=s-g;d.push(f),t.batchLengths=d,t.batchOffsets=u}var QF=Gde;var L2n=y(x(),1);var x2n=y(x(),1),OF=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
{
    bool styleTranslucent = (featureColor.a != 1.0);
    // Only render translucent features in the translucent pass (if the style or the original command has translucency).
    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
    {
        // If the model has a translucent silhouette, it needs to render during the silhouette color command,
        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
        #ifdef HAS_SILHOUETTE
        positionMC *= float(model_silhouettePass);
        #else
        positionMC *= 0.0;
        #endif
    }
    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
    else if (czm_pass != czm_passTranslucent && styleTranslucent)
    {
        positionMC *= 0.0;
    }
}

void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
{
    float show = ceil(feature.color.a);
    positionMC *= show;

    #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)
    filterByPassType(positionMC, feature.color);
    #endif
}
`;var E2n=y(x(),1),zF=`void filterByPassType(vec4 featureColor)
{
    bool styleTranslucent = (featureColor.a != 1.0);
    // Only render translucent features in the translucent pass (if the style or the original command has translucency).
    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
    {   
        // If the model has a translucent silhouette, it needs to render during the silhouette color command,
        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
        #ifdef HAS_SILHOUETTE
        if(!model_silhouettePass) {
            discard;
        }
        #else
        discard;
        #endif
    }
    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
    else if (czm_pass != czm_passTranslucent && styleTranslucent)
    {
        discard;
    }
}

void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
{
    vec4 featureColor = feature.color;
    if (featureColor.a == 0.0)
    {
        discard;
    }

    // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.
    // So, we only apply in in the fragment shader if the feature ID texture is used.
    #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
    filterByPassType(featureColor);
    #endif

    featureColor = czm_gammaCorrect(featureColor);

    // Classification models compute the diffuse differently.
    #ifdef HAS_CLASSIFICATION
    material.diffuse = featureColor.rgb * featureColor.a;
    #else
    float highlight = ceil(model_colorBlend);
    material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
    #endif
    
    material.alpha *= featureColor.a;
}
`;var Vde={name:"CPUStylingPipelineStage"};Vde.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(OF),o.addFragmentLines(zF),o.addDefine("USE_CPU_STYLING",void 0,be.BOTH),l(i.color)||(o.addUniform("float",G0.COLOR_BLEND_UNIFORM_NAME,be.FRAGMENT),e.uniformMap[G0.COLOR_BLEND_UNIFORM_NAME]=function(){return Dc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",be.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ve.TRANSLUCENT}};var HF=Vde;var F2n=y(x(),1),Lde={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Lde.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var lg=Object.freeze(Lde);var Gwn=y(x(),1);var w2n=y(x(),1),KF=`void customShaderStage(
    inout czm_modelVertexOutput vsOutput, 
    inout ProcessedAttributes attributes, 
    FeatureIds featureIds,
    Metadata metadata,
    MetadataClass metadataClass,
    MetadataStatistics metadataStatistics
) {
    // VertexInput and initializeInputStruct() are dynamically generated in JS, 
    // see CustomShaderPipelineStage.js
    VertexInput vsInput;
    initializeInputStruct(vsInput, attributes);
    vsInput.featureIds = featureIds;
    vsInput.metadata = metadata;
    vsInput.metadataClass = metadataClass;
    vsInput.metadataStatistics = metadataStatistics;
    vertexMain(vsInput, vsOutput);
    attributes.positionMC = vsOutput.positionMC;
}
`;var N2n=y(x(),1),JF=`void customShaderStage(
    inout czm_modelMaterial material,
    ProcessedAttributes attributes,
    FeatureIds featureIds,
    Metadata metadata,
    MetadataClass metadataClass,
    MetadataStatistics metadataStatistics
) {
    // FragmentInput and initializeInputStruct() are dynamically generated in JS, 
    // see CustomShaderPipelineStage.js
    FragmentInput fsInput;
    initializeInputStruct(fsInput, attributes);
    fsInput.featureIds = featureIds;
    fsInput.metadata = metadata;
    fsInput.metadataClass = metadataClass;
    fsInput.metadataStatistics = metadataStatistics;
    fragmentMain(fsInput, material);
}
`;var ewn=y(x(),1);var P2n=y(x(),1),jF=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
  initializeFeatureIds(featureIds, attributes);
  initializeFeatureIdAliases(featureIds);
}
`;var U2n=y(x(),1),qF=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) 
{
  initializeFeatureIds(featureIds, attributes);
  initializeFeatureIdAliases(featureIds);
  setFeatureIdVaryings();
}
`;var io={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};io.process=function(e,t,n){let i=e.shaderBuilder;Mze(i);let o=e.runtimeNode.node.instances;l(o)&&Uze(e,o,n),Dze(e,t,n),i.addVertexLines(qF),i.addFragmentLines(jF)};function Mze(e){e.addStruct(io.STRUCT_ID_FEATURE_IDS_VS,io.STRUCT_NAME_FEATURE_IDS,be.VERTEX),e.addStruct(io.STRUCT_ID_FEATURE_IDS_FS,io.STRUCT_NAME_FEATURE_IDS,be.FRAGMENT),e.addFunction(io.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,io.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,be.VERTEX),e.addFunction(io.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,io.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,be.FRAGMENT),e.addFunction(io.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,io.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,be.VERTEX),e.addFunction(io.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,io.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,be.FRAGMENT),e.addFunction(io.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,io.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,be.VERTEX)}function Uze(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof Tn.FeatureIdAttribute?vze(e,s,a):Wde(e,s,a,o,1,n);let c=s.label;l(c)&&Fde(e,a,c,be.BOTH)}}function Dze(e,t,n){let i=t.featureIds,r=Xt.getAttributeBySemantic(t,at.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,d=be.BOTH;a instanceof Tn.FeatureIdAttribute?kze(e,a,c):a instanceof Tn.FeatureIdImplicitRange?Wde(e,a,c,r,void 0,n):(Qze(e,a,c,s,n),d=be.FRAGMENT);let u=a.label;l(u)&&Fde(e,c,u,d)}}function vze(e,t,n){let i=e.shaderBuilder;i.addStructField(io.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(io.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,d=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(io.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(io.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[d]),i.addVarying("float",a),i.addFunctionLines(io.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function kze(e,t,n){let i=e.shaderBuilder;i.addStructField(io.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(io.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(io.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(io.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Wde(e,t,n,i,o,r){Oze(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(io.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(io.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(io.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(io.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(io.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Qze(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return a.texture??o.context.defaultTexture};let c=a.channels,d=e.shaderBuilder;d.addStructField(io.STRUCT_ID_FEATURE_IDS_FS,"int",n),d.addUniform("sampler2D",r,be.FRAGMENT);let h=`v_texCoord_${a.texCoord}`,p=h,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let C=`${r}Transform`;d.addUniform("mat3",C,be.FRAGMENT),s[C]=function(){return g},p=`vec2(${C} * vec3(${h}, 1.0))`}let f=`texture(${r}, ${p}).${c}`,b=`featureIds.${n} = czm_unpackUint(${f});`;d.addFunctionLines(io.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[b])}function Fde(e,t,n,i){let o=e.shaderBuilder,r=be.includesVertexShader(i);r&&o.addStructField(io.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(io.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(io.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(io.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function Oze(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let d=zze(t,n);s=mt.createVertexBuffer({context:o.context,typedArray:d,usage:Xe.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:J.FLOAT,strideInBytes:J.getSizeInBytes(J.FLOAT),offsetInBytes:0};e.attributes.push(c)}function zze(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var V0=io;var hwn=y(x(),1);var nwn=y(x(),1),$F=`void metadataStage(
  out Metadata metadata,
  out MetadataClass metadataClass,
  out MetadataStatistics metadataStatistics,
  ProcessedAttributes attributes
  )
{
  initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
}
`;var own=y(x(),1),eB=`void metadataStage(
  out Metadata metadata,
  out MetadataClass metadataClass,
  out MetadataStatistics metadataStatistics,
  ProcessedAttributes attributes
  )
{
  initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
  setMetadataVaryings();
}
`;var Mi={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Mi.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=Hze(r.propertyAttributes,t,a),d=Jze(r.propertyTextures,a),u=c.concat(d);qze(i,u),tHe(i),i.addVertexLines(eB),i.addFragmentLines($F);for(let h=0;h<c.length;h++){let p=c[h];nHe(e,p)}for(let h=0;h<d.length;h++){let p=d[h];oHe(e,p)}};function Hze(e,t,n){return l(e)?e.flatMap(i=>Kze(i,t,n)):[]}function Kze(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Xt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;u<c.length;u++){let[h,p]=c[u],g=i(t,p.attribute),{glslType:f,variableName:b}=o(g);d[u]={metadataVariable:r(h),property:p,type:p.classProperty.type,glslType:f,variableName:b,propertyStatistics:a?.properties[h],shaderDestination:be.BOTH}}return d}function Jze(e,t){return l(e)?e.flatMap(n=>jze(n,t)):[]}function jze(e,t){let{sanitizeGlslIdentifier:n}=Xt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,d]=r[a];s[a]={metadataVariable:n(c),property:d,type:d.classProperty.type,glslType:d.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:be.FRAGMENT}}return s}function qze(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:d,propertyStatistics:u}=t[a];n.add(d),l(u)&&c!==Et.ENUM&&i.add(d)}let o=Mi.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Mi.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,d){e.addStruct(a,a,be.BOTH);for(let u=0;u<d.length;u++){let{shaderName:h}=d[u],p=d[u].type==="float"?eHe(c):c;e.addStructField(a,p,h)}}}var $ze={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function eHe(e){let t=$ze[e];return l(t)?t:e}function tHe(e){e.addStruct(Mi.STRUCT_ID_METADATA_VS,Mi.STRUCT_NAME_METADATA,be.VERTEX),e.addStruct(Mi.STRUCT_ID_METADATA_FS,Mi.STRUCT_NAME_METADATA,be.FRAGMENT),e.addStruct(Mi.STRUCT_ID_METADATA_CLASS_VS,Mi.STRUCT_NAME_METADATA_CLASS,be.VERTEX),e.addStruct(Mi.STRUCT_ID_METADATA_CLASS_FS,Mi.STRUCT_NAME_METADATA_CLASS,be.FRAGMENT),e.addStruct(Mi.STRUCT_ID_METADATA_STATISTICS_VS,Mi.STRUCT_NAME_METADATA_STATISTICS,be.VERTEX),e.addStruct(Mi.STRUCT_ID_METADATA_STATISTICS_FS,Mi.STRUCT_NAME_METADATA_STATISTICS,be.FRAGMENT),e.addFunction(Mi.FUNCTION_ID_INITIALIZE_METADATA_VS,Mi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,be.VERTEX),e.addFunction(Mi.FUNCTION_ID_INITIALIZE_METADATA_FS,Mi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,be.FRAGMENT),e.addFunction(Mi.FUNCTION_ID_SET_METADATA_VARYINGS,Mi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,be.VERTEX)}function nHe(e,t){iHe(e,t),Bde(e.shaderBuilder,t),wde(e.shaderBuilder,t)}function iHe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=Nde({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:be.BOTH,property:o});n.addStructField(Mi.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Mi.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function oHe(e,t){rHe(e,t),Bde(e.shaderBuilder,t),wde(e.shaderBuilder,t)}function rHe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:d,texture:u,transform:h}=s.textureReader,p=`u_propertyTexture_${d}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,be.FRAGMENT),i[p]=()=>u),n.addStructField(Mi.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,f=g;if(l(h)&&!$.equals(h,$.IDENTITY)){let S=`${p}Transform`;n.addUniform("mat3",S,be.FRAGMENT),i[S]=function(){return h},f=`vec2(${S} * vec3(${g}, 1.0))`}let b=`texture(${p}, ${f}).${c}`,C=s.unpackInShader(b),E=Nde({valueExpression:C,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:be.FRAGMENT,property:s}),T=`metadata.${o} = ${E};`;n.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_METADATA_FS,[T])}function Bde(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Yde(Mi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Mi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),be.includesVertexShader(r)&&(e.addStructField(Mi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function wde(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===Et.ENUM)return;let s=Mi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Yde(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Mi.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),be.includesVertexShader(t.shaderDestination)&&(e.addStructField(Mi.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Yde(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function Nde(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:d}=e;s.addUniform(c,o,d),s.addUniform(c,r,d);let{offset:u,scale:h}=n;return a[o]=()=>u,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var fm=Mi;var pwn=y(x(),1),sHe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},L0=Object.freeze(sHe);var Ha={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:At};Ha.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===L0.TRANSLUCENT?r.pass=Ve.TRANSLUCENT:c===L0.OPAQUE&&(r.pass=void 0);let d=fHe(s,t);if(!d.customShaderEnabled)return;if(bHe(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,be.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,be.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,be.FRAGMENT);let p=lg.getDefineName(s.mode);i.addDefine(p,void 0,be.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];i.addUniform(g.type,p)}let h=s.varyings;for(let p in h)if(h.hasOwnProperty(p)){let g=h[p];i.addVarying(g,p)}e.uniformMap=Rt(e.uniformMap,s.uniformMap)};function aHe(e){let t={};for(let n=0;n<e.length;n++){let i=Xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var cHe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},lHe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Xde(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=cHe[t],i=lHe[t];if(l(n))return{attributeField:[n,e],value:i}}function dHe(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=Pde(t,n,!1),o=Mde(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let u=[i[c].glslType,c];s.push(u),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let d=o[c],u=Xde(d);if(!l(u))return Ha._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};s.push(u.attributeField),r=`vsInput.attributes.${d} = ${u.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function uHe(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function mHe(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=Pde(t,n,!0),o=Mde(t,n,!0),r,s=[],a=[];for(let d in i){if(!i.hasOwnProperty(d))continue;let h=[i[d].glslType,d];s.push(h),r=`fsInput.attributes.${d} = attributes.${d};`,a.push(r)}for(let d=0;d<o.length;d++){let u=o[d],h=Xde(u);if(!l(h))return Ha._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${u}, disabling custom fragment shader.`),{enabled:!1};s.push(h.attributeField),r=`fsInput.attributes.${u} = ${h.value};`,a.push(r)}let c=uHe(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var hHe={positionWC:!0,positionEC:!0};function Pde(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function Mde(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||hHe.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function fHe(e,t){let n=aHe(t.attributes),i=dHe(e,n),o=mHe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function pHe(e,t){let n=Ha.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Ha.STRUCT_NAME_ATTRIBUTES,be.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ha.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Ha.STRUCT_NAME_VERTEX_INPUT,be.VERTEX),e.addStructField(n,Ha.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,V0.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,fm.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,fm.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,fm.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Ha.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,Ha.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,be.VERTEX),e.addFunctionLines(r,o)}function AHe(e,t){let n=Ha.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Ha.STRUCT_NAME_ATTRIBUTES,be.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ha.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Ha.STRUCT_NAME_FRAGMENT_INPUT,be.FRAGMENT),e.addStructField(n,Ha.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,V0.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,fm.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,fm.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,fm.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Ha.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,Ha.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,be.FRAGMENT),e.addFunctionLines(r,o)}var gHe=[];function bHe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=gHe;i.enabled&&(pHe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,KF),e.addVertexLines(r)),o.enabled&&(AHe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,JF),e.addFragmentLines(r))}var tB=Ha;var Ywn=y(x(),1);var nB={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};nB.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,be.VERTEX),i.addFunction(nB.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,nB.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,be.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],d=c.quantization;if(!l(d))continue;let u=c.semantic===at.POSITION,h=c.semantic===at.TEXCOORD;if(r&&!u&&!h)continue;let p=Xt.getAttributeInfo(c);xHe(i,p),yHe(e,p)}};function yHe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,be.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,be.VERTEX),n.addUniform(c,a,be.VERTEX);let d=r.quantizedVolumeOffset,u=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(d=Ude(d,0),u=Ude(u,1)),i[s]=function(){return d},i[a]=function(){return u}}}function Ude(e,t){return e instanceof ce?e:new ce(e.x,e.y,e.z,t)}function xHe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=CHe(n,i):o=EHe(n),e.addFunctionLines(nB.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function CHe(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function EHe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var iB=nB;var Uwn=y(x(),1);var Xwn=y(x(),1),oB=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) {
    if (u_isEdgePass) {
        return;
    }

    vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;

    vec4 edgeColor = texture(czm_edgeColorTexture, screenCoord);
    vec4 edgeId = texture(czm_edgeIdTexture, screenCoord);

    // Packed window-space depth from edge pass (0..1)
    float edgeDepthWin = czm_unpackDepth(texture(czm_edgeDepthTexture, screenCoord));

    // Near / far for current frustum
    float n = czm_currentFrustum.x;
    float f = czm_currentFrustum.y;

    // geometry depth in eye coordinate
    vec4 geomEC = czm_windowToEyeCoordinates(gl_FragCoord);
    float geomDepthLinear = -geomEC.z;

    // Convert edge depth to linear depth
    float z_ndc_edge = edgeDepthWin * 2.0 - 1.0;
    float edgeDepthLinear = (2.0 * n * f) / (f + n - z_ndc_edge * (f - n));

    float d = abs(edgeDepthLinear - geomDepthLinear);

    // Adaptive epsilon using linear depth fwidth for robustness
    float pixelStepLinear = fwidth(geomDepthLinear);
    float rel = geomDepthLinear * 0.0005;
    float eps = max(n * 1e-4, max(pixelStepLinear * 1.5, rel));

    // If Edge isn't behind any geometry and the pixel has edge data
    if (d < eps && edgeId.r > 0.0) {
#ifdef HAS_EDGE_FEATURE_ID
        float edgeFeatureId    = edgeId.g;
        float currentFeatureId = float(featureIds.featureId_0);
#endif
        float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
        // Background / sky / globe: always show edge
        bool isBackground = geomDepthLinear > globeDepth;
        bool drawEdge = isBackground;

#ifdef HAS_EDGE_FEATURE_ID
        bool hasEdgeFeature = edgeFeatureId > 0.0;
        bool hasCurrentFeature = currentFeatureId > 0.0;
        bool featuresMatch = edgeFeatureId == currentFeatureId;

        drawEdge = drawEdge || !hasEdgeFeature || !hasCurrentFeature || featuresMatch;
#else
        drawEdge = true;
#endif

        if (drawEdge) {
            color = edgeColor;
        }
    }
}
`;var Dde={name:"EdgeDetectionPipelineStage"};Dde.process=function(e){e.shaderBuilder.addFragmentLines([oB])};var rB=Dde;var bYn=y(x(),1);var vwn=y(x(),1),sB=`// CESIUM_REDIRECTED_COLOR_OUTPUT flag is used to avoid color attachment conflicts
// when shaders are processed by different rendering pipelines (e.g., OIT).
// Only declare MRT outputs when not in a derived shader context.
#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
layout(location = 1) out vec4 out_id;        // edge id / metadata
layout(location = 2) out vec4 out_edgeDepth; // packed depth
#endif

void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds)
{
#ifdef HAS_EDGE_VISIBILITY

    if (!u_isEdgePass) {
        return;
    }
    
    float edgeTypeInt = v_edgeType * 255.0;
    
    // Color code different edge types
    vec4 edgeColor = vec4(0.0);
    
    if (edgeTypeInt < 0.5) { // HIDDEN (0)
        edgeColor = vec4(0.0, 0.0, 0.0, 0.0); // Transparent for hidden edges
    }
    else if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { // SILHOUETTE (1) - Conditional visibility
        // Proper silhouette detection using face normals
        vec3 normalA = normalize(v_faceNormalAView);
        vec3 normalB = normalize(v_faceNormalBView);
        
        // Calculate view direction using existing eye-space position varying (v_positionEC)
        vec3 viewDir = -normalize(v_positionEC);
        
        // Calculate dot products to determine triangle facing
        float dotA = dot(normalA, viewDir);
        float dotB = dot(normalB, viewDir);
        
        const float eps = 1e-3;
        bool frontA = dotA > eps;
        bool backA  = dotA < -eps;
        bool frontB = dotB > eps;
        bool backB  = dotB < -eps;
        
        // True silhouette: one triangle front-facing, other back-facing
        bool oppositeFacing = (frontA && backB) || (backA && frontB);
        
        // Exclude edges where both triangles are nearly grazing (perpendicular to view)
        // This handles the top-view cylinder case where both normals are ~horizontal
        bool bothNearGrazing = (abs(dotA) <= eps && abs(dotB) <= eps);
        
        if (!(oppositeFacing && !bothNearGrazing)) {
            discard; // Not a true silhouette edge
        } else {
            // True silhouette
            edgeColor = vec4(1.0, 0.0, 0.0, 1.0);
        }
    }
    else if (edgeTypeInt > 1.5 && edgeTypeInt < 2.5) { // HARD (2) - BRIGHT GREEN
        edgeColor = vec4(0.0, 1.0, 0.0, 1.0); // Extra bright green
    }
    else if (edgeTypeInt > 2.5 && edgeTypeInt < 3.5) { // REPEATED (3)
        edgeColor = vec4(0.0, 0.0, 1.0, 1.0);
    } else {
        edgeColor = vec4(0.0, 0.0, 0.0, 0.0);
    }

    // Temporary color: white
    edgeColor = vec4(1.0, 1.0, 1.0, 1.0);
    color = edgeColor;
    
    #if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
        // Write edge metadata
        out_id = vec4(0.0);
        out_id.r = edgeTypeInt;                    // Edge type (0-3)
#ifdef HAS_EDGE_FEATURE_ID
        out_id.g = float(featureIds.featureId_0); // Feature ID if available
#else
        out_id.g = 0.0;
#endif
        // Pack depth into separate MRT attachment
        out_edgeDepth = czm_packDepth(gl_FragCoord.z);
    #endif
#endif
}
`;var nYn=y(x(),1);var DK=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,o=t.quantization;if(!l(o)&&!i)return n;let r=t.type,s=t.count,a=n;return i&&(a=_n.dequantize(n,t.componentDatatype,r,s)),l(o)?e.dequantize(a,s,r,o):a}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,o=Ut.getNumberOfComponents(n),r=i*o,s=t.componentDatatype,a=t.quantization;l(a)&&(s=a.componentDatatype);let c=t.buffer,d=t.byteOffset,u=t.byteStride,h=J.getSizeInBytes(s),p=o*h;if(!l(u)||u===p){let S=J.createTypedArray(s,r);return c.getBufferData(S,d),S}let g=new Uint8Array(c.sizeInBytes);c.getBufferData(g);let f=J.createTypedArray(s,r),b=u??p,C=new DataView(g.buffer,g.byteOffset,g.byteLength),E=new Array(o),T=e.createComponentsReader(s);for(let S=0;S<i;++S){let _=d+S*b;T(C,_,o,E);for(let R=0;R<o;++R)f[S*o+R]=E[R]}return f}static dequantize(t,n,i,o){if(o.octEncoded){let a=e.octDecode(t,n,o.normalizationRange,void 0);return o.octEncodedZXY&&e.convertZxyToXyz(a,a),a}let r=o.quantizedVolumeStepSize,s=o.quantizedVolumeOffset;if(i===Ut.SCALAR)return e.dequantize1D(t,n,r,s,void 0);if(i===Ut.VEC2)return e.dequantize2D(t,n,r,s,void 0);if(i===Ut.VEC3)return e.dequantize3D(t,n,r,s,void 0);if(i===Ut.VEC4)return e.dequantize4D(t,n,r,s,void 0);throw new Ae(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,o){l(o)||(o=new Float32Array(t.length));let r=new m;for(let s=0;s<n;s++)m.unpack(t,s*3,r),_n.octDecodeInRange(r,i,r),m.pack(o,r,s*3);return o}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let o=0;for(let r=0;r<n;r++,o+=3){let s=t[o+0],a=t[o+1],c=t[o+2];i[o+0]=a,i[o+1]=c,i[o+2]=s}return i}static dequantize1D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));for(let s=0;s<n;s++){let c=t[s]*i+o;r[s]=c}return r}static dequantize2D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let s=new M;for(let a=0;a<n;a++)M.unpack(t,a*2,s),M.multiplyComponents(s,i,s),M.add(s,o,s),M.pack(s,r,a*2);return r}static dequantize3D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let s=new m;for(let a=0;a<n;a++)m.unpack(t,a*3,s),m.multiplyComponents(s,i,s),m.add(s,o,s),m.pack(s,r,a*3);return r}static dequantize4D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let s=new ce;for(let a=0;a<n;a++)ce.unpack(t,a*4,s),ce.multiplyComponents(s,i,s),ce.add(s,o,s),ce.pack(s,r,a*4);return r}static createComponentsReader(t){let n=e.createComponentReader(t),i=J.getSizeInBytes(t);return function(o,r,s,a){let c=r;for(let d=0;d<s;++d)a[d]=n(o,c),c+=i}}static createComponentReader(t){switch(t){case J.BYTE:return function(n,i){return n.getInt8(i)};case J.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case J.SHORT:return function(n,i){return n.getInt16(i,!0)};case J.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case J.INT:return function(n,i){return n.getInt32(i,!0)};case J.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case J.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case J.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new Ae(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let o=new m,r=t.length/3;for(let s=0;s<r;s++)m.unpack(t,s*3,o),F.multiplyByPoint(n,o,o),m.pack(o,i,s*3);return i}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,o=t.count,r=t.indexDatatype,s=e.createIndexTypedArray(r,o);return i.getBufferData(s),s}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Be.TRIANGLES)return i;if(n===Be.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Be.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new Ae(`The primitiveType must be TRIANGLES (${Be.TRIANGLES}, TRIANGLE_STRIP (${Be.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Be.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case Pe.UNSIGNED_BYTE:return new Uint8Array(n);case Pe.UNSIGNED_SHORT:return new Uint16Array(n);case Pe.UNSIGNED_INT:return new Uint32Array(n)}throw new Ae(`The indexDatatype must be UNSIGNED_BYTE (${Pe.UNSIGNED_BYTE}, UNSIGNED_SHORT (${Pe.UNSIGNED_SHORT}, or UNSIGNED_INT (${Pe.UNSIGNED_INT}, but is ${t}`)}},dg=DK;var vde={name:"EdgeVisibilityPipelineStage"};vde.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,be.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,be.FRAGMENT),i.addFragmentLines(sB),i.addUniform("bool","u_isEdgePass",be.BOTH);let o=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let r=i.addAttribute("float","a_edgeFeatureId"),s=i.addAttribute("vec3","a_silhouetteNormal");i.addVarying("vec3","v_silhouetteNormalView","flat");let a=i.addAttribute("vec3","a_faceNormalA"),c=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addFunctionLines("setDynamicVaryingsVS",["#ifdef HAS_EDGE_VISIBILITY","  if (u_isEdgePass) {","    v_edgeType = a_edgeType;","#ifdef HAS_EDGE_FEATURE_ID","    v_featureId_0 = a_edgeFeatureId;","#endif","    // Transform normals from model space to view space","    v_silhouetteNormalView = czm_normal * a_silhouetteNormal;","    v_faceNormalAView = czm_normal * a_faceNormalA;","    v_faceNormalBView = czm_normal * a_faceNormalB;","  }","#endif"]);let d=THe(t),u=IHe(t);if(!l(u)||!l(u.edgeIndices)||u.edgeIndices.length===0)return;let h=SHe(d,u.edgeIndices),p=_He(u.edgeIndices,u.edgeData,e,n.context,o,s,a,c,r,t.edgeVisibility,h);l(p)&&(p.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,be.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},e.edgeGeometry={vertexArray:p.vertexArray,indexCount:p.indexCount,primitiveType:Be.LINES,pass:Ve.CESIUM_3D_TILE_EDGES})};function THe(e){let t=e.indices;if(!l(t))return{edgeMap:new Map,faceNormals:new Float32Array(0),triangleCount:0};let n=t.typedArray,i=Math.floor(n.length/3),o=Xt.getAttributeBySemantic(e,at.POSITION),r=l(o.typedArray)?o.typedArray:dg.readAttributeAsTypedArray(o),s=o.quantization;if(l(s)&&!s.octEncoded){let C=r.length,E=new Float32Array(C),T=s.quantizedVolumeOffset,S=s.quantizedVolumeStepSize;for(let _=0;_<C;_+=3)E[_]=T.x+r[_]*S.x,E[_+1]=T.y+r[_+1]*S.y,E[_+2]=T.z+r[_+2]*S.z;r=E}let a=new Map,c=new Float32Array(i*3),d=new m,u=new m,h=new m,p=new m,g=new m,f=new m;function b(C,E,T){let S=`${C<E?C:E},${C<E?E:C}`,_=a.get(S);l(_)||(_=[],a.set(S,_)),_.length<2&&_.push(T)}for(let C=0;C<i;C++){let E=C*3,T=n[E],S=n[E+1],_=n[E+2],R=T*3,L=S*3,W=_*3;d.x=r[R],d.y=r[R+1],d.z=r[R+2],u.x=r[L],u.y=r[L+1],u.z=r[L+2],h.x=r[W],h.y=r[W+1],h.z=r[W+2],m.subtract(u,d,p),m.subtract(h,d,g),m.cross(p,g,f),m.normalize(f,f),c[E]=f.x,c[E+1]=f.y,c[E+2]=f.z,b(T,S,C),b(S,_,C),b(_,T,C)}return{edgeMap:a,faceNormals:c,triangleCount:i}}function SHe(e,t){let{edgeMap:n,faceNormals:i}=e,o=t.length/2,r=new Float32Array(o*6);for(let s=0;s<o;s++){let a=t[s*2],c=t[s*2+1],d=`${a<c?a:c},${a<c?c:a}`,u=n.get(d);if(!l(u)||u.length===0)continue;let p=u[0]*3,g=i[p],f=i[p+1],b=i[p+2],C,E,T;if(u.length>1){let R=u[1]*3;C=i[R],E=i[R+1],T=i[R+2]}else C=-g,E=-f,T=-b;let S=s*6;r[S]=g,r[S+1]=f,r[S+2]=b,r[S+3]=C,r[S+4]=E,r[S+5]=T}return r}function IHe(e){let n=e.edgeVisibility.visibility,i=e.indices;if(!l(n)||!l(i))return[];let o=i.typedArray,r=e.attributes[0].count,s=[],a=[],c=new Set,d=0,u=0,h=o.length;for(let p=0;p+2<h;p+=3){let g=o[p],f=o[p+1],b=o[p+2];for(let C=0;C<3;C++){let E,T;C===0?(E=g,T=f):C===1?(E=f,T=b):C===2&&(E=b,T=g);let S=Math.floor(u/4),_=u%4*2;if(u++,S>=n.length)break;let L=n[S]>>_&3,W=!1;switch(L){case 0:W=!1;break;case 1:W=!0;break;case 2:W=!0;break;case 3:W=!0;break}if(W){let B=Math.min(E,T),Y=Math.max(E,T),N=B*r+Y;if(!c.has(N)){c.add(N),s.push(E,T);let A=-1;L===1&&(A=d,d++),a.push({edgeType:L,triangleIndex:Math.floor(p/3),edgeIndex:C,mateVertexIndex:A,currentTriangleVertices:[g,f,b]})}}}}return{edgeIndices:s,edgeData:a,silhouetteEdgeCount:d}}function _He(e,t,n,i,o,r,s,a,c,d,u){if(!l(e)||e.length===0)return;let h=t.length,g=h*2,f=0,b=Xt.getAttributeBySemantic(n.runtimePrimitive.primitive,at.POSITION),C=l(b.typedArray)?b.typedArray:dg.readAttributeAsTypedArray(b),E=new Float32Array(g*3),T=new Float32Array(g),S=new Float32Array(g*3),_=new Float32Array(g*3),R=new Float32Array(g*3),L=0,W=C.length/3-1;for(let H=0;H<h;H++){let ee=e[H*2],z=e[H*2+1];if(ee<0||z<0||ee>W||z>W){E[L++]=0,E[L++]=0,E[L++]=0,E[L++]=0,E[L++]=0,E[L++]=0,T[H*2]=0,T[H*2+1]=0;let sn=H*2;S[sn*3]=0,S[sn*3+1]=0,S[sn*3+2]=1,S[(sn+1)*3]=0,S[(sn+1)*3+1]=0,S[(sn+1)*3+2]=1,_[sn*3]=0,_[sn*3+1]=0,_[sn*3+2]=1,_[(sn+1)*3]=0,_[(sn+1)*3+1]=0,_[(sn+1)*3+2]=1,R[sn*3]=0,R[sn*3+1]=0,R[sn*3+2]=1,R[(sn+1)*3]=0,R[(sn+1)*3+1]=0,R[(sn+1)*3+2]=1;continue}let te=C[ee*3],q=C[ee*3+1],me=C[ee*3+2],ye=C[z*3],oe=C[z*3+1],xe=C[z*3+2];E[L++]=te,E[L++]=q,E[L++]=me,E[L++]=ye,E[L++]=oe,E[L++]=xe;let Ee=t[H].edgeType,Le=Ee/255;T[H*2]=Le,T[H*2+1]=Le;let Se=0,Fe=0,Ue=1;if(Ee===1&&l(d.silhouetteNormals)){let sn=t[H].mateVertexIndex;if(sn>=0&&sn<d.silhouetteNormals.length){let Nt=d.silhouetteNormals[sn];l(Nt)&&(Se=Nt.x,Fe=Nt.y,Ue=Nt.z)}}let De=H*2;S[De*3]=Se,S[De*3+1]=Fe,S[De*3+2]=Ue,S[(De+1)*3]=Se,S[(De+1)*3+1]=Fe,S[(De+1)*3+2]=Ue;let Je=H*6,St=u[Je],Oe=u[Je+1],it=u[Je+2],yt=u[Je+3],Ot=u[Je+4],Mn=u[Je+5];_[De*3]=St,_[De*3+1]=Oe,_[De*3+2]=it,_[(De+1)*3]=St,_[(De+1)*3+1]=Oe,_[(De+1)*3+2]=it,R[De*3]=yt,R[De*3+1]=Ot,R[De*3+2]=Mn,R[(De+1)*3]=yt,R[(De+1)*3+1]=Ot,R[(De+1)*3+2]=Mn}let B=mt.createVertexBuffer({context:i,typedArray:E,usage:Xe.STATIC_DRAW}),Y=mt.createVertexBuffer({context:i,typedArray:T,usage:Xe.STATIC_DRAW}),N=mt.createVertexBuffer({context:i,typedArray:S,usage:Xe.STATIC_DRAW}),A=mt.createVertexBuffer({context:i,typedArray:_,usage:Xe.STATIC_DRAW}),I=mt.createVertexBuffer({context:i,typedArray:R,usage:Xe.STATIC_DRAW}),Z=g>65534,G=new Array(g);for(let H=0;H<g;H++)G[H]=H;let w=mt.createIndexBuffer({context:i,typedArray:Z?new Uint32Array(G):new Uint16Array(G),usage:Xe.STATIC_DRAW,indexDatatype:Z?Pe.UNSIGNED_INT:Pe.UNSIGNED_SHORT}),X=[{index:f,vertexBuffer:B,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:o,vertexBuffer:Y,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1},{index:r,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:s,vertexBuffer:A,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:a,vertexBuffer:I,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1}],v=n.runtimePrimitive.primitive,k=function(){if(l(v.featureIds)&&v.featureIds.length>0){let H=v.featureIds[0];if(l(H.setIndex)){let ee=v.attributes.find(z=>z.semantic===at.FEATURE_ID&&z.setIndex===H.setIndex);if(l(ee)){let z=l(ee.typedArray)?ee.typedArray:dg.readAttributeAsTypedArray(ee),te=new Float32Array(g);for(let q=0;q<h;q++){let me=e[q*2],ye=me<z.length?z[me]:0;te[q*2]=ye,te[q*2+1]=ye}return te}}}}(),P=l(k);if(P){let H=mt.createVertexBuffer({context:i,typedArray:k,usage:Xe.STATIC_DRAW});X.push({index:c,vertexBuffer:H,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1})}let O=new si({context:i,indexBuffer:w,attributes:X});if(!(!O||g===0||g%2!==0))return{vertexArray:O,indexBuffer:w,indexCount:g,hasEdgeFeatureIds:P}}var aB=vde;var QYn=y(x(),1);var xYn=y(x(),1),cB=`void geometryStage(out ProcessedAttributes attributes)
{
  attributes.positionMC = v_positionMC;
  attributes.positionEC = v_positionEC;

  #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)
  attributes.positionWC = v_positionWC;
  #endif

  #ifdef HAS_NORMALS
  // renormalize after interpolation
  attributes.normalEC = normalize(v_normalEC);
  #endif

  #ifdef HAS_TANGENTS
  attributes.tangentEC = normalize(v_tangentEC);
  #endif

  #ifdef HAS_BITANGENTS
  attributes.bitangentEC = normalize(v_bitangentEC);
  #endif

  // Everything else is dynamically generated in GeometryPipelineStage
  setDynamicVaryings(attributes);
}
`;var EYn=y(x(),1),lB=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
{
    vec4 computedPosition;

    // Compute positions in different coordinate systems
    vec3 positionMC = attributes.positionMC;
    v_positionMC = positionMC;
    v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;

    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
    vec3 position2D = attributes.position2D;
    vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
    computedPosition = czm_projection * vec4(positionEC, 1.0);
    #else
    computedPosition = czm_projection * vec4(v_positionEC, 1.0);
    #endif

    // Sometimes the custom shader and/or style needs this
    #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS)
    // Note that this is a 32-bit position which may result in jitter on small
    // scales.
    v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
    #endif

    #ifdef HAS_NORMALS
    v_normalEC = normalize(normal * attributes.normalMC);
    #endif

    #ifdef HAS_TANGENTS
    v_tangentEC = normalize(normal * attributes.tangentMC);
    #endif

    #ifdef HAS_BITANGENTS
    v_bitangentEC = normalize(normal * attributes.bitangentMC);
    #endif

    // All other varyings need to be dynamically generated in
    // GeometryPipelineStage
    setDynamicVaryings(attributes);

    return computedPosition;
}
`;var LYn=y(x(),1);var SYn=y(x(),1),rI=`vec2 computeSt(float featureId)
{
    float stepX = model_textureStep.x;
    float centerX = model_textureStep.y;

    #ifdef MULTILINE_BATCH_TEXTURE
    float stepY = model_textureStep.z;
    float centerY = model_textureStep.w;

    float xId = mod(featureId, model_textureDimensions.x); 
    float yId = floor(featureId / model_textureDimensions.x);
    
    return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
    #else
    return vec2(centerX + (featureId * stepX), 0.5);
    #endif
}

void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
{   
    int featureId = featureIds.SELECTED_FEATURE_ID;


    if (featureId < model_featuresLength)
    {
        vec2 featureSt = computeSt(float(featureId));

        feature.id = featureId;
        feature.st = featureSt;
        feature.color = texture(model_batchTexture, featureSt);
    }
    // Floating point comparisons can be unreliable in GLSL, so we
    // increment the feature ID to make sure it's always greater
    // then the model_featuresLength - a condition we check for in the
    // pick ID, to avoid sampling the pick texture if the feature ID is
    // greater than the number of features.
    else
    {
        feature.id = model_featuresLength + 1;
        feature.st = vec2(0.0);
        feature.color = vec4(1.0);
    }

    #ifdef HAS_NULL_FEATURE_ID
    if (featureId == model_nullFeatureId) {
        feature.id = featureId;
        feature.st = vec2(0.0);
        feature.color = vec4(1.0);
    }
    #endif
}
`;var dB={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};dB.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=ZHe(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),RHe(i);let c=s.featureIds.nullFeatureId,d=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return c}),s.shaderDestination===be.BOTH&&i.addVertexLines(rI),i.addFragmentLines(rI)};function kde(e){return e instanceof Tn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Qde(e){return e instanceof Tn.FeatureIdTexture?be.FRAGMENT:be.BOTH}function ZHe(e,t,n){let i,o;return l(t.instances)&&(o=Xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Qde(o),featureIdDefine:kde(o)}):(o=Xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Qde(o),featureIdDefine:kde(o)})}function RHe(e){e.addStructField(dB.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(dB.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(dB.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var W0=dB;var Ia={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Ia.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Ia.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",be.VERTEX),i.addStruct(Ia.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",be.FRAGMENT),i.addStruct(W0.STRUCT_ID_SELECTED_FEATURE,W0.STRUCT_NAME_SELECTED_FEATURE,be.BOTH),i.addFunction(Ia.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ia.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,be.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ia.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ia.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ia.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ia.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,be.VERTEX),i.addFunction(Ia.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ia.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,be.FRAGMENT),o.type===Yr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,be.FRAGMENT);let r=n.mode!==se.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let d=0;d<c;d++){let u=t.attributes[d],h=Ut.getAttributeLocationCount(u.type),p=u.semantic===at.POSITION,g;h>1?(g=e.attributeIndex,e.attributeIndex+=h):p&&!a?g=0:g=e.attributeIndex++,GHe(e,u,g,h,r,s)}XHe(i,t.attributes),t.primitiveType===Be.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(lB),i.addFragmentLines(cB)};function GHe(e,t,n,i,o,r){let s=e.shaderBuilder,a=Xt.getAttributeInfo(t),c=o&&!r;i>1?WHe(e,t,n,i):LHe(e,t,n,c),BHe(s,a,c),FHe(s,a),l(t.semantic)&&VHe(s,t),wHe(s,a,o),YHe(s,a,c),NHe(s,a)}function VHe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case at.NORMAL:e.addDefine("HAS_NORMALS");break;case at.TANGENT:e.addDefine("HAS_TANGENTS");break;case at.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case at.TEXCOORD:case at.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function LHe(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===at.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===at.POSITION,u=d?0:n,h=Ut.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let g=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:J.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function WHe(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=Ut.getNumberOfComponents(s)/i,u=J.getSizeInBytes(a),h=d*u,p=t.byteStride;for(let g=0;g<i;g++){let f=t.byteOffset+g*h,b={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:d,componentDatatype:a,offsetInBytes:f,strideInBytes:p,normalize:r};e.attributes.push(b)}}function FHe(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function BHe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===at.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function wHe(e,t,n){let i=Ia.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Ia.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function YHe(e,t,n){let i=Ia.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function NHe(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Ia.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Ia.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function XHe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===at.NORMAL?n=!0:r.semantic===at.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ia.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ia.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var uB=Ia;var dvn=y(x(),1);var mDn=y(x(),1);var rUn=y(x(),1);var qMn=y(x(),1);var vMn=y(x(),1);var vNn=y(x(),1);var $Yn=y(x(),1);function F0(e){if(e=e??Q.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new hi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new M(-i,-i),this._rectangleNortheastInMeters=new M(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new de(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(F0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});F0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};F0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};F0.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(de.southwest(e)),o=n.project(de.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new de(i.x,i.y,o.x,o.y)};F0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,u=this._rectangleNortheastInMeters.y-t*d,h=this._rectangleNortheastInMeters.y-(t+1)*d;return l(i)?(i.west=a,i.south=h,i.east=c,i.north=u,i):new de(a,h,c,u)};F0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new M(o.west,o.south)),a=r.unproject(new M(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};F0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!de.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-h.y,f=p/a|0;f>=o&&(f=o-1);let b=g/d|0;return b>=r&&(b=r-1),l(n)?(n.x=f,n.y=b,n):new M(f,b)};var Vs=F0;var oNn=y(x(),1);var vK,Ode="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmQBN5OwMQnvqcM3GTdzwDusCXj4eE5jKKONHLoPEAvNXnML4d2_ObFMHiYtbS6gOWoNlH6cNDium9FLGy4eRBK7mcDQKdokYzlY27y-WPo25dgjAfx6C0rbvGsk0yn7FHPv8yDcsW5frQhhXIJ48lW5UcbIlpxY_j-Im5MJfxgIQuUA_m0tvy4rxbkTMNS26yA.AT1_DJvNEaWq",sI={};sI.defaultAccessToken=Ode;sI.defaultWorldImageryServer=new Ge({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});sI.defaultWorldHillshadeServer=new Ge({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});sI.defaultWorldOceanServer=new Ge({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});sI.getDefaultTokenCredit=function(e){if(e===Ode){if(!l(vK)){let t='<b>             This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i>             with an API key from your ArcGIS Developer account before using the ArcGIS tile services.             You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';vK=new bt(t,!0)}return vK}};var tu=sI;var dNn=y(x(),1);function kK(e){e=e??Q.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ge.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=ah(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,h=d.length;a&&u<h;++u){let p=d[u],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}kK.prototype.isReady=function(){return this._isReady};kK.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=ah(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let d=0;d<4;++d){let u=c+d;if(i[u]!==n[u])return!1}}return!0};var mB=kK;var hNn=y(x(),1);function QK(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}QK.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};QK.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Ph=QK;var yNn=y(x(),1);function aI(){Ae.throwInstantiationError()}Object.defineProperties(aI.prototype,{rectangle:{get:Ae.throwInstantiationError},tileWidth:{get:Ae.throwInstantiationError},tileHeight:{get:Ae.throwInstantiationError},maximumLevel:{get:Ae.throwInstantiationError},minimumLevel:{get:Ae.throwInstantiationError},tilingScheme:{get:Ae.throwInstantiationError},tileDiscardPolicy:{get:Ae.throwInstantiationError},errorEvent:{get:Ae.throwInstantiationError},credit:{get:Ae.throwInstantiationError},proxy:{get:Ae.throwInstantiationError},hasAlphaChannel:{get:Ae.throwInstantiationError}});aI.prototype.getTileCredits=function(e,t,n){Ae.throwInstantiationError()};aI.prototype.requestImage=function(e,t,n,i){Ae.throwInstantiationError()};aI.prototype.pickFeatures=function(e,t,n,i,o){Ae.throwInstantiationError()};var PHe=/\.ktx2$/i;aI.loadImage=function(e,t){let n=Ge.createIfNeeded(t);return PHe.test(n.url)?nd(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Wl=aI;var CNn=y(x(),1),MHe={SATELLITE:1,OCEANS:2,HILLSHADE:3},Mh=Object.freeze(MHe);function zde(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Qi({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new bt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}zde.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new mB({missingImageUrl:Hde(e,0,0,this.maximumLevel).url,pixelsToCheck:[new M(0,0),new M(200,20),new M(20,200),new M(80,110),new M(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function UHe(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Vs({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Qi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new he(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new hi,o=e.fullExtent,r=i.unproject(new m(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new de(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=de.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new he(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new bt(e.copyrightText)]:t.credit=new bt(e.copyrightText))}function DHe(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new he(n)}async function vHe(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();UHe(i,t)}catch(i){DHe(e,i)}}function ap(e){e=e??Q.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Qi({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new bt(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new Ce}ap.fromBasemapType=async function(e,t){t=t??Q.EMPTY_OBJECT;let n,i,o;switch(e){case Mh.SATELLITE:{n=t.token??tu.defaultAccessToken,i=Ge.createIfNeeded(tu.defaultWorldImageryServer),i.appendForwardSlash();let r=tu.getDefaultTokenCredit(n);l(r)&&(o=bt.clone(r))}break;case Mh.OCEANS:{n=t.token??tu.defaultAccessToken,i=Ge.createIfNeeded(tu.defaultWorldOceanServer),i.appendForwardSlash();let r=tu.getDefaultTokenCredit(n);l(r)&&(o=bt.clone(r))}break;case Mh.HILLSHADE:{n=t.token??tu.defaultAccessToken,i=Ge.createIfNeeded(tu.defaultWorldHillshadeServer),i.appendForwardSlash();let r=tu.getDefaultTokenCredit(n);l(r)&&(o=bt.clone(r))}break;default:}return ap.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Hde(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof vi?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(ap.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});ap.fromUrl=async function(e,t){t=t??Q.EMPTY_OBJECT;let n=Ge.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new ap(t);i._resource=n;let o=new zde(t);return(t.usePreCachedTilesIfAvailable??!0)&&await vHe(n,o),o.build(i),i};ap.prototype.getTileCredits=function(e,t,n){return this._tileCredits};ap.prototype.requestImage=function(e,t,n,i){return Wl.loadImage(this,Hde(this,e,t,n,i))};ap.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof vi)s=V.toDegrees(i),a=V.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new pe(i,o,0));s=p.x,a=p.y,c="3857"}let d="visible";l(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let g=[],f=p.results;if(!l(f))return g;for(let b=0;b<f.length;++b){let C=f[b],E=new Ph;if(E.data=C,E.name=C.value,E.properties=C.attributes,E.configureDescriptionFromProperties(C.attributes),C.geometryType==="esriGeometryPoint"&&C.geometry){let T=C.geometry.spatialReference&&C.geometry.spatialReference.wkid?C.geometry.spatialReference.wkid:4326;if(T===4326||T===4283)E.position=pe.fromDegrees(C.geometry.x,C.geometry.y,C.geometry.z);else if(T===102100||T===900913||T===3857){let S=new hi;E.position=S.unproject(new m(C.geometry.x,C.geometry.y,C.geometry.z))}}g.push(E)}return g})};ap._metadataCache={};var ug=ap;var gXn=y(x(),1);var JNn=y(x(),1);var ONn=y(x(),1);function kHe(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=`
${o}`),t}var cp=kHe;function dk(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=s}dk.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new dk(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${cp(i)}`),c};dk.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Ko=dk;var qNn=y(x(),1),QHe={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"},cI=Object.freeze(QHe);var tXn=y(x(),1);function hB(e){}hB.prototype.isReady=function(){return!0};hB.prototype.shouldDiscardImage=function(e){return hB.EMPTY_IMAGE===e};var uk;Object.defineProperties(hB,{EMPTY_IMAGE:{get:function(){return l(uk)||(uk=new Image,uk.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),uk}}});var lI=hB;function Kde(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}Kde.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof bt)break;o.credit=new bt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],d=c.bbox;c.bbox=new de(V.toRadians(d[1]),V.toRadians(d[0]),V.toRadians(d[3]),V.toRadians(d[2]))}}};function OHe(e,t){if(e.resourceSets.length!==1)throw new he("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function zHe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Ko.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new he(i)}async function HHe(e,t,n){let i=e.url,o=oa._metadataCache[i];l(o)||(o=e.fetchJson(),oa._metadataCache[i]=o);try{let r=await o;return OHe(r,t)}catch(r){zHe(e,r,n)}}function oa(e){e=e??Q.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=e.mapStyle??cI.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new lI),this._proxy=e.proxy,this._credit=new bt(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${oa.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Vs({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new Ce}Object.defineProperties(oa.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}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});oa.fromUrl=async function(e,t){t=t??Q.EMPTY_OBJECT;let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??cI.AERIAL,o=Ge.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new oa(t);a._resource=o;let c=new Kde(t);return await HHe(s,c),c.build(a),a};var KHe=new de;oa.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,KHe);return qHe(this._attributionList,n,i)};oa.prototype.requestImage=function(e,t,n,i){let o=Wl.loadImage(this,JHe(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?lI.EMPTY_IMAGE:Promise.reject(r)})};oa.prototype.pickFeatures=function(e,t,n,i,o){};oa.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;(e&r)!==0&&(s|=1),(t&r)!==0&&(s|=2),i+=s}return i};oa.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];(s&1)!==0&&(t|=r),(s&2)!==0&&(n|=r)}return{x:t,y:n,level:i}};oa._logoUrl=void 0;Object.defineProperties(oa,{logoUrl:{get:function(){return l(oa._logoUrl)||(oa._logoUrl=en("Assets/Images/bing_maps_credit.png")),oa._logoUrl},set:function(e){oa._logoUrl=e}}});function JHe(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:oa.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var jHe=new de;function qHe(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let d=0,u=s.coverageAreas.length;!c&&d<u;++d){let h=a[d];if(t>=h.zoomMin&&t<=h.zoomMax){let p=de.intersection(n,h.bbox,jHe);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}oa._metadataCache={};var fB=oa;var HXn=y(x(),1);var FXn=y(x(),1);var Jde=/{[^}]+}/g,jde={x:nKe,y:oKe,z:aKe,s:cKe,reverseX:iKe,reverseY:rKe,reverseZ:sKe,westDegrees:lKe,southDegrees:dKe,eastDegrees:uKe,northDegrees:mKe,westProjected:hKe,southProjected:fKe,eastProjected:pKe,northProjected:AKe,width:gKe,height:bKe},$He=Rt(jde,{i:yKe,j:xKe,reverseI:CKe,reverseJ:EKe,longitudeDegrees:SKe,latitudeDegrees:IKe,longitudeProjected:_Ke,latitudeProjected:ZKe,format:GKe});function pB(e){e=e??Q.EMPTY_OBJECT,this._errorEvent=new Ce;let t=Ge.createIfNeeded(e.url),n=Ge.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Vs({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=de.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new bt(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=Rt(jde,r),a=Rt($He,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(pB.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});pB.prototype.getTileCredits=function(e,t,n){};pB.prototype.requestImage=function(e,t,n,i){return Wl.loadImage(this,eKe(this,e,t,n,i))};pB.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=tKe(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(c):d.type==="xml"?u.fetchXML().then(d.callback).catch(c):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(c):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(c)}return c()};var mk=!1,nu=new de,hk=!1,AB=new de;function eKe(e,t,n,i,o){mk=!1,hk=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(Jde);return l(d)&&d.forEach(function(u){let h=u.substring(1,u.length-1);l(a[h])&&(c[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var OK=!1,uI=new M,zK=!1;function tKe(e,t,n,i,o,r,s){mk=!1,hk=!1,OK=!1,zK=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},h=c.match(Jde);return l(h)&&h.forEach(function(p){let g=p.substring(1,p.length-1);l(d[g])&&(u[g]=d[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function mI(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function nKe(e,t,n,i){return mI(e,"{x}",t)}function iKe(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return mI(e,"{reverseX}",o)}function oKe(e,t,n,i){return mI(e,"{y}",n)}function rKe(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return mI(e,"{reverseY}",o)}function sKe(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return mI(e,"{reverseZ}",r)}function aKe(e,t,n,i){return mI(e,"{z}",i)}function cKe(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function fk(e,t,n,i){mk||(e.tilingScheme.tileXYToRectangle(t,n,i,nu),nu.west=V.toDegrees(nu.west),nu.south=V.toDegrees(nu.south),nu.east=V.toDegrees(nu.east),nu.north=V.toDegrees(nu.north),mk=!0)}function lKe(e,t,n,i){return fk(e,t,n,i),nu.west}function dKe(e,t,n,i){return fk(e,t,n,i),nu.south}function uKe(e,t,n,i){return fk(e,t,n,i),nu.east}function mKe(e,t,n,i){return fk(e,t,n,i),nu.north}function pk(e,t,n,i){hk||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,AB),hk=!0)}function hKe(e,t,n,i){return pk(e,t,n,i),AB.west}function fKe(e,t,n,i){return pk(e,t,n,i),AB.south}function pKe(e,t,n,i){return pk(e,t,n,i),AB.east}function AKe(e,t,n,i){return pk(e,t,n,i),AB.north}function gKe(e,t,n,i){return e.tileWidth}function bKe(e,t,n,i){return e.tileHeight}function yKe(e,t,n,i,o,r,s){return Ak(e,t,n,i,o,r),uI.x}function xKe(e,t,n,i,o,r,s){return Ak(e,t,n,i,o,r),uI.y}function CKe(e,t,n,i,o,r,s){return Ak(e,t,n,i,o,r),e.tileWidth-uI.x-1}function EKe(e,t,n,i,o,r,s){return Ak(e,t,n,i,o,r),e.tileHeight-uI.y-1}var TKe=new de,dI=new m;function Ak(e,t,n,i,o,r,s){if(OK)return;HK(e,t,n,i,o,r);let a=dI,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,TKe);uI.x=e.tileWidth*(a.x-c.west)/c.width|0,uI.y=e.tileHeight*(c.north-a.y)/c.height|0,OK=!0}function SKe(e,t,n,i,o,r,s){return V.toDegrees(o)}function IKe(e,t,n,i,o,r,s){return V.toDegrees(r)}function _Ke(e,t,n,i,o,r,s){return HK(e,t,n,i,o,r),dI.x}function ZKe(e,t,n,i,o,r,s){return HK(e,t,n,i,o,r),dI.y}var RKe=new pe;function HK(e,t,n,i,o,r,s){if(!zK){if(e.tilingScheme.projection instanceof vi)dI.x=V.toDegrees(o),dI.y=V.toDegrees(r);else{let a=RKe;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,dI)}zK=!0}}function GKe(e,t,n,i,o,r,s){return s}var Ds=pB;function pm(e){Ds.call(this,e)}pm._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return pm._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Pf)return pm._metadataFailure(e,t);throw o}};pm.fromUrl=async function(e,t){let n=Ge.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??Q.EMPTY_OBJECT;let r=await pm._requestMetadata(t,i,o);return new pm(r)};l(Object.create)&&(pm.prototype=Object.create(Ds.prototype),pm.prototype.constructor=pm);function qde(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function $de(e,t,n){let i=e.positionToTileXY(de.southwest(t),n),o=e.positionToTileXY(de.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}pm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,h,p=[],g=e.childNodes[0].childNodes;for(let B=0;B<g.length;B++)if(r.test(g.item(B).nodeName))d=g.item(B);else if(a.test(g.item(B).nodeName)){h=g.item(B);let Y=g.item(B).childNodes;for(let N=0;N<Y.length;N++)s.test(Y.item(N).nodeName)&&p.push(Y.item(N))}else c.test(g.item(B).nodeName)&&(u=g.item(B));let f;if(!l(h)||!l(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Ko.reportError(void 0,o,o.errorEvent,f),new he(f);let b=t.fileExtension??d.getAttribute("extension"),C=t.tileWidth??parseInt(d.getAttribute("width"),10),E=t.tileHeight??parseInt(d.getAttribute("height"),10),T=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),S=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),_=h.getAttribute("profile"),R=t.tilingScheme;if(!l(R))if(_==="geodetic"||_==="global-geodetic")R=new Qi({ellipsoid:t.ellipsoid});else if(_==="mercator"||_==="global-mercator")R=new Vs({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${_}.`,l(o)&&Ko.reportError(void 0,o,o.errorEvent,f),new he(f);let L=de.clone(t.rectangle);if(!l(L)){let B,Y,N,A;t.flipXY??!1?(N=new M(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),A=new M(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(N=new M(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),A=new M(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let Z=_==="geodetic"||_==="mercator";if(R.projection instanceof vi||Z)B=pe.fromDegrees(N.x,N.y),Y=pe.fromDegrees(A.x,A.y);else{let G=R.projection;B=G.unproject(N),Y=G.unproject(A)}L=new de(B.longitude,B.latitude,Y.longitude,Y.latitude)}return L=qde(L,R),T=$de(R,L,T),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${b}`}),tilingScheme:R,rectangle:L,tileWidth:C,tileHeight:E,minimumLevel:T,maximumLevel:S,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};pm._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Vs({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=qde(a,s);let c=$de(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var B0=pm;var aPn=y(x(),1);function eue(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}eue.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function VKe(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new he(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new he(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Vs({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new he(o)}return!0}function LKe(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Ko.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new he(i)}async function WKe(e,t,n){try{let i=await e.fetchText();VKe(i,t)}catch(i){LKe(i,e,n)}}function pd(e){e=e??{},this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new bt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${pd.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new Ce}Object.defineProperties(pd.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});pd.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=Ge.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new eue(n);s.channel=t,await WKe(r,s);let a=new pd(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};pd.prototype.getTileCredits=function(e,t,n){};pd.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Wl.loadImage(this,o)};pd.prototype.pickFeatures=function(e,t,n,i,o){};pd._logoUrl=void 0;Object.defineProperties(pd,{logoUrl:{get:function(){return l(pd._logoUrl)||(pd._logoUrl=en("Assets/Images/google_earth_credit.png")),pd._logoUrl},set:function(e){pd._logoUrl=e}}});var gB=pd;var fPn=y(x(),1);var FKe=/\/$/,tue=new bt('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function hI(e){e=e??Q.EMPTY_OBJECT;let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ge.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();FKe.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new bt(s))):s=tue,this._resource=i,this._imageryProvider=new Ds({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(hI.prototype,{url:{get:function(){return this._imageryProvider.url}},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}}});hI.prototype.getTileCredits=function(e,t,n){};hI.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};hI.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};hI._defaultCredit=tue;var bB=hI;var _Pn=y(x(),1);function EC(e){e=e??Q.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??de.MAX_VALUE,n=new Qi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new Ce;let i=e.credit;typeof i=="string"&&(i=new bt(i)),this._credit=i;let o=Ge.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(EC.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function BKe(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Ko.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return KK(e,n,r);throw l(n)&&(n._hasError=!0),new he(o)}async function KK(e,t,n){try{return await Wl.loadImage(null,e)}catch(i){return BKe(e,i,t,n)}}EC.fromUrl=async function(e,t){let n=Ge.createIfNeeded(e),i=await KK(n);t=t??Q.EMPTY_OBJECT;let o=new EC({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};EC.prototype.getTileCredits=function(e,t,n){};EC.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await KK(this._resource,this);return this._image=o,Ko.reportSuccess(this._errorEvent),o}return this._image};EC.prototype.pickFeatures=function(e,t,n,i,o){};var yB=EC;var JPn=y(x(),1);var WPn=y(x(),1);function wKe(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=YKe:e==="xml"?n=MKe:(e==="html"||e==="text")&&(n=nue)),this.callback=n}function YKe(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Ph;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=pe.fromDegrees(s,a)}t.push(r)}return t}var JK="http://www.mapinfo.com/mxp",NKe="http://www.esri.com/wms",XKe="http://www.opengis.net/wfs",PKe="http://www.opengis.net/gml";function MKe(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===JK)return UKe(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===NKe)return DKe(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===XKe)return vKe(e);if(t.localName==="ServiceExceptionReport")throw new he(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?kKe(e):QKe(e)}function UKe(e){let t=[],i=e.documentElement.getElementsByTagNameNS(JK,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(JK,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let h=u.getAttribute("ref"),p=u.textContent.trim();s[h]=p}}let c=new Ph;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function DKe(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let d=a[c];i[d.name]=d.value}n.push(gk(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let d=0;d<c.length;++d){let u=c[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(gk(a,i))}}return n}function vKe(e){let t=[],i=e.documentElement.getElementsByTagNameNS(PKe,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};jK(r,s),t.push(gk(r,s))}return t}function kKe(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new he("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};jK(s,a),t.push(gk(s,a))}}return t}function jK(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&jK(o,t)&&(t[o.localName]=o.textContent)}return n}function gk(e,t){let n=new Ph;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function QKe(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Ph;return o.data=e,o.description=n.innerHTML,[o]}var OKe=/<body>\s*<\/body>/im,zKe=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,HKe=/<title>([\s\S]*)<\/title>/im;function nue(e){if(OKe.test(e)||zKe.test(e))return;let t,n=HKe.exec(e);n&&n.length>1&&(t=n[1]);let i=new Ph;return i.name=t,i.description=e,i.data=e,[i]}var TC=wKe;var PPn=y(x(),1);function xB(e){e=e??Q.EMPTY_OBJECT,this._tileCache={},this._tilesRequestedForInterval=[];let 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)}Object.defineProperties(xB.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});xB.prototype.getFromCache=function(e,t,n,i){let o=iue(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};xB.prototype.checkApproachingInterval=function(e,t,n,i){let o=iue(e,t,n),r=this._tilesRequestedForInterval,s=oue(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!rue(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};xB.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=oue(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=rue(this,c,r),a||s.push(c)}}};function iue(e,t,n){return`${e}-${t}-${n}`}function KKe(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function oue(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=j.secondsDifference(c.stop,i),++a):(s=j.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function rue(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=KKe(s),c=new pr({throttle:!1,throttleByServer:!0,type:Ys.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(d)?(r[s]={promise:d,request:c},!0):!1}var SC=xB;var JKe=[3034,3035,3042,3043,3044],jKe=[4471,4559];function Uh(e){if(e=e??Q.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new Ae("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=Ge.createIfNeeded(e.url),n=Ge.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Uh.DefaultParameters,!0),n.setQueryParameters(Uh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(sue(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(sue(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new SC({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return aue(i,s,a,c,d,u)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof hi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!jKe.includes(a)||JKe.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof hi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Ds({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Qi({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:e.getFeatureInfoFormats??Uh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function aue(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function qKe(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(Uh.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}},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}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Uh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Uh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=aue(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Uh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return qKe(this,e,t,n,i,o,s)};Uh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Uh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Uh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new TC("json","application/json")),Object.freeze(new TC("xml","text/xml")),Object.freeze(new TC("text","text/html"))]);function sue(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var CB=Uh;var aMn=y(x(),1);var $Ke=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function EB(e){e=e??Q.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Ge.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters($Ke),this._useKvp=!0;else{let c={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(c),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=e.format??"image/jpeg",this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Vs({ellipsoid:e.ellipsoid}),this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new SC({clock:e.clock,times:e.times,requestImageFunction:function(c,d,u,h,p){return cue(s,c,d,u,h,p)},reloadFunction:function(){l(s._reload)&&s._reload()}})),this._errorEvent=new Ce;let a=e.credit;this._credit=typeof a=="string"?new bt(a):a,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function cue(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,d=e._dimensions,u=l(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),l(d)&&h.setTemplateValues(d),l(u)&&h.setTemplateValues(u);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(d)&&(g=Rt(g,d)),l(u)&&(g=Rt(g,u)),p={s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(p)}return Wl.loadImage(e,h)}Object.defineProperties(EB.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}},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,l(this._reload)&&this._reload())}}});EB.prototype.getTileCredits=function(e,t,n){};EB.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=cue(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};EB.prototype.pickFeatures=function(e,t,n,i,o){};var TB=EB;var CMn=y(x(),1);var uMn=y(x(),1);var bk={};bk.defaultApiKey=void 0;bk.mapTilesApiEndpoint=new Ge({url:"https://tile.googleapis.com/"});bk.getDefaultCredit=function(){return new bt('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var Am=bk;var lue=/\/$/;function mg(e){e=e??Q.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof os?e.url:Ge.createIfNeeded(e.url??Am.mapTilesApiEndpoint),n=t.getUrlComponent();lue.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new bt(o)));let r=new Ds({url:t,credit:o,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});r._resource=t,this._imageryProvider=r,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(mg.prototype,{url:{get:function(){return this._imageryProvider.url}},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}}});mg.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=due(e),i=os._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),o={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},r=await i.fetchJson(),s=r.options.url;return delete r.options.url,r.options={...r.options,...o},qK(s,r,i)};mg.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??Am.mapTilesApiEndpoint,e.key=e.key??Am.defaultApiKey;let t=e.overlayLayerType,n=await tJe(e);return new mg({...n,...e,credit:e.credit??Am.getDefaultCredit()})};mg.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};mg.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};mg.prototype.pickFeatures=function(e,t,n,i,o){};mg.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(eJe(this._resource,this._viewportUrl,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],s=n[o];if(s){let a=new bt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function eJe(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(Q.EMPTY_OBJECT)}).fetchJson()).copyright}function due(e){let{mapType:t,overlayLayerType:n,styles:i}=e,o={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(o.layerTypes=["layerRoadmap"]),l(n)&&(o.mapType="satellite",o.overlay=!0,o.layerTypes=[n]),l(i)&&(o.styles=i),o}async function tJe(e){let{language:t,region:n,key:i,url:o}=e,r=due(e),s=o.url??o;lue.test(s)||(s+="/");let a=await Ge.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...r,language:t,region:n})});return JSON.parse(a)}var SB=mg;var GMn=y(x(),1);var nJe=/\/$/;function fI(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof os?e.url:Ge.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();nJe.test(i)||(i+="/");let o=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=o,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new bt(r)));let s=new Ds({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:r});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(fI.prototype,{url:{get:function(){return this._imageryProvider.url}},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}}});fI.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};fI.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};fI.prototype.pickFeatures=function(e,t,n,i,o){};fI.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(iJe(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],s=n[o].join(",");if(s){let a=new bt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function iJe(e,t,n,i,o){return(await e.getDerivedResource({url:t,queryParameters:{zoom:o,bounds:"-180,-90,180,90"},data:JSON.stringify(Q.EMPTY_OBJECT)}).fetchJson()).copyrights}var IB=fI;var oJe=async(e,t,n)=>B0.fromUrl(new os(t,n)),rJe=async(e,{options:t})=>ug.fromUrl(e,t),sJe=async(e,{options:t})=>fB.fromUrl(e,t),aJe=async(e,{options:t})=>{let n=t.channel;return delete t.channel,gB.fromUrl(e,n,t)},cJe=async(e,{options:t})=>new bB({url:e,...t}),lJe=async(e,{options:t})=>yB.fromUrl(e,t),dJe=async(e,{options:t})=>B0.fromUrl(e,t),uJe=async(e,{options:t})=>new Ds({url:e,...t}),mJe=async(e,{options:t})=>new CB({url:e,...t}),hJe=async(e,{options:t})=>new TB({url:e,...t}),qK=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new os(t,n),o=(r,s)=>{delete s.externalType,s.url=e;let{options:a}=s;r.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=o,new SB({...t.options,url:i})},fJe=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new os(t,n),o=(r,s)=>{delete s.externalType,s.url=e;let{options:a}=s;r.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=o,new IB({...t.options,url:i})},pJe={ARCGIS_MAPSERVER:rJe,BING:sJe,GOOGLE_EARTH:aJe,MAPBOX:cJe,SINGLE_TILE:lJe,TMS:dJe,URL_TEMPLATE:uJe,WMS:mJe,WMTS:hJe,GOOGLE_2D_MAPS:qK,AZURE_MAPS:fJe,defaultFactoryCallback:oJe},pI=Object.freeze(pJe);function lp(e){e=e??Q.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new Ce}Object.defineProperties(lp.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});lp.fromAssetId=async function(e,t){t=t??Q.EMPTY_OBJECT;let n=os._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=lp._endpointCache[i];l(o)||(o=n.fetchJson(),lp._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new he(`Cesium ion asset ${e} is not an imagery asset.`);let s=r.externalType,a=pI.defaultFactoryCallback;r=Qe(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(s)&&(a=pI[s],!l(a)))throw new he(`Unrecognized Cesium ion imagery type: ${s}`);let d=await a(c,r,n),u=new lp(t);return d.errorEvent.addEventListener(function(h){h.provider=u,u._errorEvent.raiseEvent(h)}),u._tileCredits=os.getCreditsFromEndpoint(r,n),u._imageryProvider=d,u};lp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};lp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};lp.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};lp._endpointCache={};var Fl=lp;var eUn=y(x(),1),AJe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},hg=Object.freeze(AJe);function gJe(e){e=e??Q.EMPTY_OBJECT;let t=e.style??hg.AERIAL;return Fl.fromAssetId(t)}var fg=gJe;var uUn=y(x(),1);function Ls(){Ae.throwInstantiationError()}Object.defineProperties(Ls.prototype,{errorEvent:{get:Ae.throwInstantiationError},credit:{get:Ae.throwInstantiationError},tilingScheme:{get:Ae.throwInstantiationError},hasWaterMask:{get:Ae.throwInstantiationError},hasVertexNormals:{get:Ae.throwInstantiationError},availability:{get:Ae.throwInstantiationError}});var uue=[];Ls.getRegularGridIndices=function(e,t){let n=uue[e];l(n)||(uue[e]=n=[]);let i=n[t];return l(i)||(e*t<V.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),pue(e,t,i,0)),i};var mue=[];Ls.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=mue[e];l(n)||(mue[e]=n=[]);let i=n[t];if(!l(i)){let o=Ls.getRegularGridIndices(e,t),r=fue(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,d=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return i};var hue=[];Ls.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=hue[e];l(n)||(hue[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,d=r+a,u=fue(e,t),h=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,g=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,b=Pe.createTypedArray(c,d);pue(e,t,b,0),Ls.addSkirtIndices(h,p,g,f,o,b,r),i=n[t]={indices:b,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};Ls.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Ls.getSkirtIndexCount=function(e){return(e-4)*2*3};Ls.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Ls.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=yk(e,a,r,s),a+=e.length,s=yk(t,a,r,s),a+=t.length,s=yk(n,a,r,s),a+=n.length,yk(i,a,r,s)};Ls.addSkirtIndicesWithFilledCorners=function(e,t,n,i,o,r,s){Ls.addSkirtIndices(e,t,n,i,o,r,s);let a=Ls.getSkirtVertexCount(e,t,n,i),c=Ls.getSkirtIndexCount(a),d=s+c,u=e[0],h=i[0],p=n[0],g=t[0],f=o,b=f+e.length-1,C=b+1,E=C+t.length-1,T=E+1,S=T+n.length-1,_=S+1,R=_+i.length-1;r[d+0]=u,r[d+1]=f,r[d+2]=E,r[d+3]=g,r[d+4]=C,r[d+5]=S,r[d+6]=p,r[d+7]=T,r[d+8]=R,r[d+9]=h,r[d+10]=_,r[d+11]=b};function fue(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function pue(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,d=c+1,u=a+1;n[i++]=a,n[i++]=c,n[i++]=u,n[i++]=u,n[i++]=c,n[i++]=d,++o}++o}}function yk(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}Ls.heightmapTerrainQuality=.25;Ls.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Ls.heightmapTerrainQuality/(t*n)};Ls.prototype.requestTileGeometry=Ae.throwInstantiationError;Ls.prototype.getLevelMaximumGeometricError=Ae.throwInstantiationError;Ls.prototype.getTileDataAvailable=Ae.throwInstantiationError;Ls.prototype.loadTileDataAvailability=Ae.throwInstantiationError;var Do=Ls;var hUn=y(x(),1),_B=`uniform sampler2D u_texture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var pUn=y(x(),1),ZB=`in vec4 position;
in float webMercatorT;

uniform vec2 u_textureDimensions;

out vec2 v_textureCoordinates;

void main()
{
    v_textureCoordinates = vec2(position.x, webMercatorT);
    gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));
}
`;var EUn=y(x(),1);var gUn=y(x(),1),bJe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},Hn=Object.freeze(bJe);function AI(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=Hn.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}AI.createPlaceholder=function(e){let t=new AI(e,0,0,0);return t.addReference(),t.state=Hn.PLACEHOLDER,t};AI.prototype.addReference=function(){++this.referenceCount};AI.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),fe(this),0):this.referenceCount};AI.prototype.processStateMachine=function(e,t,n){this.state===Hn.UNLOADED&&!n&&(this.state=Hn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Hn.RECEIVED&&(this.state=Hn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Hn.READY&&t&&!this.texture;(this.state===Hn.TEXTURE_LOADED||i)&&(this.state=Hn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var gI=AI;var _Un=y(x(),1);function $K(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}$K.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};$K.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Hn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==Hn.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==Hn.FAILED&&r.state!==Hn.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===Hn.FAILED||i.state===Hn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var bI=$K;function Yi(e,t){this._imageryProvider=e,this._readyEvent=new Ce,this._errorEvent=new Ce,t=t??Q.EMPTY_OBJECT,e=e??Q.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Yi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Yi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Yi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Yi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Yi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Yi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Yi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Yi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??de.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new bI(gI.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=t.colorToAlphaThreshold??Yi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Yi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Yi.DEFAULT_BRIGHTNESS=1;Yi.DEFAULT_CONTRAST=1;Yi.DEFAULT_HUE=0;Yi.DEFAULT_SATURATION=1;Yi.DEFAULT_GAMMA=1;Yi.DEFAULT_SPLIT=Br.NONE;Yi.DEFAULT_MINIFICATION_FILTER=zt.LINEAR;Yi.DEFAULT_MAGNIFICATION_FILTER=ui.LINEAR;Yi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Yi.fromProviderAsync=function(e,t){let n=new Yi(void 0,t);return TJe(n,Promise.resolve(e)),n};Yi.fromWorldImagery=function(e){return e=e??Q.EMPTY_OBJECT,Yi.fromProviderAsync(fg({style:e.style}),e)};Yi.prototype.isBaseLayer=function(){return this._isBaseLayer};Yi.prototype.isDestroyed=function(){return!1};Yi.prototype.destroy=function(){return fe(this)};var bue=new de,Aue=new de,eJ=new de,yue=new de;Yi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return de.intersection(e.rectangle,t)};Yi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof hi&&e.rectangle.north<hi.MaximumLatitude&&e.rectangle.south>-hi.MaximumLatitude,s=de.intersection(o.rectangle,this._rectangle,bue),a=de.intersection(e.rectangle,s,Aue);if(!l(a)){if(!this.isBaseLayer())return!1;let Z=s,G=e.rectangle;a=Aue,G.south>=Z.north?a.north=a.south=Z.north:G.north<=Z.south?a.north=a.south=Z.south:(a.south=Math.max(G.south,Z.south),a.north=Math.min(G.north,Z.north)),G.west>=Z.east?a.west=a.east=Z.east:G.east<=Z.west?a.west=a.east=Z.west:(a.west=Math.max(G.west,Z.west),a.east=Math.min(G.east,Z.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),h=CJe(this,u,c);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),l(o.minimumLevel)){let Z=o.minimumLevel;h<Z&&(h=Z)}let g=o.tilingScheme,f=g.positionToTileXY(de.northwest(a),h),b=g.positionToTileXY(de.southeast(a),h),C=e.rectangle.width/512,E=e.rectangle.height/512,T=g.tileXYToRectangle(f.x,f.y,h);Math.abs(T.south-e.rectangle.north)<E&&f.y<b.y&&++f.y,Math.abs(T.east-e.rectangle.west)<C&&f.x<b.x&&++f.x;let S=g.tileXYToRectangle(b.x,b.y,h);Math.abs(S.north-e.rectangle.south)<E&&b.y>f.y&&--b.y,Math.abs(S.west-e.rectangle.east)<C&&b.x>f.x&&--b.x;let _=de.clone(e.rectangle,yue),R=g.tileXYToRectangle(f.x,f.y,h),L=de.intersection(R,s,eJ),W;r?(g.rectangleToNativeRectangle(_,_),g.rectangleToNativeRectangle(R,R),g.rectangleToNativeRectangle(L,L),g.rectangleToNativeRectangle(s,s),W=g.tileXYToNativeRectangle.bind(g),C=_.width/512,E=_.height/512):W=g.tileXYToRectangle.bind(g);let B,Y=0,N=1,A;!this.isBaseLayer()&&Math.abs(L.west-_.west)>=C&&(Y=Math.min(1,(L.west-_.west)/_.width)),!this.isBaseLayer()&&Math.abs(L.north-_.north)>=E&&(N=Math.max(0,(L.north-_.south)/_.height));let I=N;for(let Z=f.x;Z<=b.x;Z++)if(B=Y,R=W(Z,f.y,h),L=de.simpleIntersection(R,s,eJ),!!l(L)){Y=Math.min(1,(L.east-_.west)/_.width),Z===b.x&&(this.isBaseLayer()||Math.abs(L.east-_.east)<C)&&(Y=1),N=I;for(let G=f.y;G<=b.y;G++){if(A=N,R=W(Z,G,h),L=de.simpleIntersection(R,s,eJ),!l(L))continue;N=Math.max(0,(L.south-_.south)/_.height),G===b.y&&(this.isBaseLayer()||Math.abs(L.south-_.south)<E)&&(N=0);let w=new ce(B,N,Y,A),X=this.getImageryFromCache(Z,G,h);i.imagery.splice(n,0,new bI(X,w,r)),++n}}return!0};Yi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,bue),i=c.rectangleToNativeRectangle(i,yue)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new ce(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Yi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=Hn.RECEIVED,e.request=void 0,Ko.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===pi.CANCELLED){e.state=Hn.UNLOADED,e.request=void 0;return}e.state=Hn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Ko.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new pr({throttle:!1,throttleByServer:!0,type:Ys.IMAGERY});e.request=s,e.state=Hn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=Hn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Yi.prototype._createTextureWebGL=function(e,t){let n=new Ht({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Wt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Wt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?je.RGBA:je.RGB,sampler:n})};Yi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=Hn.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=Hn.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof hi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=Hn.TEXTURE_LOADED};function gue(e,t,n){return`${e}:${t}:${n}`}Yi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===zt.LINEAR&&i===ui.LINEAR&&!je.isCompressedFormat(t.pixelFormat)&&V.isPowerOfTwo(t.width)&&V.isPowerOfTwo(t.height)){n=zt.LINEAR_MIPMAP_LINEAR;let r=Yt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=gue(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new Ht({wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Ju.NICEST),t.sampler=d}else{let r=gue(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new Ht({wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Yi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof vi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new ll({persists:!0,owner:this,preExecute:function(c){xJe(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=Hn.READY,t.releaseReference()},canceled:function(){t.state=Hn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=Hn.READY};Yi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Yi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Yi.prototype.getImageryFromCache=function(e,t,n,i){let o=xue(e,t,n),r=this._imageryCache[o];return l(r)||(r=new gI(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Yi.prototype.removeImageryFromCache=function(e){let t=xue(e.x,e.y,e.level);delete this._imageryCache[t]};function xue(e,t,n){return JSON.stringify([e,t,n])}var xk={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new M,texture:void 0},yJe=rn.supportsTypedArrays()?new Float32Array(128):void 0;function xJe(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let C=new Float32Array(256),E=0;for(let L=0;L<64;++L){let W=L/63;C[E++]=0,C[E++]=W,C[E++]=1,C[E++]=W}let T={position:0,webMercatorT:1},S=Do.getRegularGridIndices(2,64),_=mt.createIndexBuffer({context:t,typedArray:S,usage:Xe.STATIC_DRAW,indexDatatype:Pe.UNSIGNED_SHORT});o.vertexArray=new si({context:t,attributes:[{index:T.position,vertexBuffer:mt.createVertexBuffer({context:t,typedArray:C,usage:Xe.STATIC_DRAW}),componentsPerAttribute:2},{index:T.webMercatorT,vertexBuffer:mt.createVertexBuffer({context:t,sizeInBytes:512,usage:Xe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:_});let R=new ze({sources:[ZB]});o.shaderProgram=cn.fromCache({context:t,vertexShaderSource:R,fragmentShaderSource:_B,attributeLocations:T}),o.sampler=new Ht({wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:zt.LINEAR,magnificationFilter:ui.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;xk.textureDimensions.x=r,xk.textureDimensions.y=s,xk.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),h=new Wt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});V.isPowerOfTwo(r)&&V.isPowerOfTwo(s)&&h.generateMipmap(Ju.NICEST);let p=i.south,g=i.north,f=yJe,b=0;for(let C=0;C<64;++C){let E=C/63,T=V.lerp(p,g,E);a=Math.sin(T);let _=(.5*Math.log((1+a)/(1-a))-c)*u;f[b++]=_,f[b++]=_}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=xk,e.vertexArray=o.vertexArray}function CJe(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof vi?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function EJe(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function TJe(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){EJe(e._errorEvent,i)}}var ds=Yi;var fDn=y(x(),1),tJ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},RB=tJ;var KDn=y(x(),1);var CDn=y(x(),1);var ADn=y(x(),1),nJ=class{constructor(t,n,i,o){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=o??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},yI=nJ;var SJe=new de,Cue=new de,IJe=new de,_Je=new de,ZJe=new de,RJe=new de,iJ=class e{constructor(t,n,i,o,r){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=o,this._imagery=r}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let o=n.imageryProvider,r=e._clampImageryLevel(o,i),s=de.intersection(o.rectangle,n.rectangle,SJe),a=o.tilingScheme,c=e._computeImageryRange(t,s,a,r),d=_Je;a.rectangleToNativeRectangle(t,d);let u=ZJe;a.rectangleToNativeRectangle(s,u);let h=(g,f,b)=>{let C=a.tileXYToRectangle(g,f,b),E=de.intersection(C,s,IJe);if(!l(E))return;let T=RJe;return a.rectangleToNativeRectangle(E,T),T};return e._computeImageryCoverages(n,c,r,d,h)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,o=t.maximumLevel??Number.POSITIVE_INFINITY,r=Math.min(o-1,Math.max(i,n));return Math.floor(r)}static _computeImageryRange(t,n,i,o){let r=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(de.northwest(r),o),a=i.positionToTileXY(de.southeast(r),o),c=new yI;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let d=t.width/512,u=t.height/512,h=i.tileXYToRectangle(c.minX,c.minY,o);Math.abs(h.south-t.north)<u&&c.minY<c.maxY&&++c.minY,Math.abs(h.east-t.west)<d&&c.minX<c.maxX&&++c.minX;let f=i.tileXYToRectangle(c.maxX,c.maxY,o);return Math.abs(f.north-t.south)<u&&c.maxY>c.minY&&--c.maxY,Math.abs(f.west-t.east)<d&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new de),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=de.intersection(t,n,Cue);return l(i)?i:e._clampRectangle(t,n,Cue)}static _computeImageryCoverages(t,n,i,o,r){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=r(a,n.maxY,i);if(l(c))for(let d=n.minY;d<=n.maxY;d++){let u=r(a,d,i);if(!l(u))continue;let h=e._localizeToCartesianRectangle(u,o,void 0),p=t.getImageryFromCache(a,d,i),g=new e(a,d,i,h,p);s.push(g)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new yI);let o=1/n.width,r=1/n.height;return i.minX=(t.west-n.west)*o,i.minY=(t.south-n.south)*r,i.maxX=(t.east-n.west)*o,i.maxY=(t.north-n.south)*r,i}},xI=iJ;var BDn=y(x(),1);var oJ=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,o=t.cartographicBoundingRectangle,r=t.numPositions;return e._createTextureCoordinates(i,r,o,n)}static _createTextureCoordinates(t,n,i,o){let r=new $e;$e.fromRectangle(i,o,r);let s=e.createProjectedPositions(t,o),a=e.computeTexCoords(s,r);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let o=dg.readAttributeAsTypedArray(t),r=t.type,s=Ut.getNumberOfComponents(r),a=e.createIterableCartesian3FromTypedArray(o,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new m,o=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<o;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let o of t)yield n(o)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new de);let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),o=Math.min(o,a.latitude),r=Math.max(r,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=o,n.east=r,n.west=s,n}static transformCartesians3(t,n){let i=new m;return e.map(t,r=>(F.multiplyByPoint(n,r,i),i))}static transformToCartographic(t,n){let i=new pe;return e.map(t,r=>(n.cartesianToCartographic(r,i),i))}static createProjectedPositions(t,n){let i=new m;return e.map(t,r=>(n.project(r,i),i))}static computeTexCoords(t,n){let i=new M,o=1/n.width,r=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*o,d=(a.y-n.y)*r,u=Math.min(Math.max(c,0),1),h=Math.min(Math.max(d,0),1);return i.x=u,i.y=h,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),o=0;for(let r of n)i[o*2+0]=r.x,i[o*2+1]=r.y,o++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:at.TEXCOORD,setIndex:0,componentDatatype:J.FLOAT,type:Ut.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new M(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},IC=oJ;var YDn=y(x(),1);var rJ=class{constructor(t,n,i,o){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=o}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},GB=rJ;var sJ=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new F,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let o=this._model.imageryLayers.indexOf(t);if(o===-1)throw new Ae("Imagery layer is not part of the model");let r=this._coveragesPerLayer;if(!l(r))throw new Ae("The coveragesPerLayer have not been computed yet");return r[o]}update(t){let n=this._model,r=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==r&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=r),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let o=0;o<i;o++){let r=n[o],s=t[o];this._deleteCoverages(r,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let o=0;o<i;o++)n[o].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=mt.createVertexBuffer({context:t,typedArray:r.typedArray,usage:Xe.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let o=t[i];l(o)&&(l(o.buffer)&&(o.buffer.isDestroyed()||o.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!F.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,o=e._obtainPrimitivePositionAttribute(i.primitive),r=o.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),d=c.length;for(let u=0;u<d;u++){let h=c[u],p=IC.createCartographicPositions(o,s,h),g=IC.computeCartographicBoundingRectangle(p),f=new GB(p,r,g,h);a.push(f)}return F.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let o=0;o<i;o++){let r=t.get(o),s=e._getEllipsoid(r);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),o=[...new Set(i)];return this._createImageryTexCoordAttributes(o)}static _extractProjections(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t.get(o),s=e._getProjection(r);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=IC.createTextureCoordinatesAttributeForMappedPositions(a,r);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],o=this._model.imageryLayers,r=o.length;for(let s=0;s<r;s++){let a=o.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,o=this._computeImageryLevel(t,i);return xI.createImageryCoverages(i,t,o)}_computeImageryLevel(t,n){let i=t.imageryProvider,r=i.tilingScheme.rectangle,s=1,a=n.width,c=r.width;n.height>n.width&&(a=n.height,c=r.height);let d=Math.log2(s*c/a);return xI._clampImageryLevel(i,d)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,o=i.length,r=!0;for(let s=0;s<o;s++){let a=i[s],c=a.length;for(let d=0;d<c;d++){let h=a[d].imagery;h.state===Hn.READY||h.state===Hn.FAILED||h.state===Hn.INVALID||(r=!1,h.processStateMachine(t,!1,!1))}}r&&n.resetDrawCommands(),this._allImageriesReady=r}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new Ae("The mappedPositions have not been computed yet");let i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.ellipsoid===t)return r}throw new Ae(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new Ae("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),fe(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new F);let o=t.sceneGraph;return F.clone(F.IDENTITY,i),F.multiply(i,t.modelMatrix,i),F.multiply(i,o.components.transform,i),F.multiply(i,o.axisCorrectionMatrix,i),F.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=Xt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new Ae("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},_C=sJ;var jDn=y(x(),1),aJ=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},VB=aJ;var GJe=!1,VJe=new de,LJe=new de,cJ=class e{static process(t,n,i){let o=t.model,r=n.modelPrimitiveImagery;if(!l(r)||!r.ready)return;let s=o.imageryLayers,a=_C._extractProjections(s),c=[...new Set(a)],d=e._computeIndexMapping(a,c),u=e._createImageryInputs(s,r,d);if(u.length===0)return;u.length>10&&(At("imagery-texture-units",`Warning: Draped imagery requires ${u.length} texture units, truncating`),u.length=10),e._addImageryTexCoordAttributesToRenderResources(r,t);let h=[];for(let p=0;p<s.length;p++)h.push(s.get(p));e._processImageryInputs(h,t,u,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let o of i)e._addImageryTexCoordAttributeToRenderResources(o,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Ut.getNumberOfComponents(t.type),o={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(o)}static _processImageryInputs(t,n,i,o){let r=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;r.addDefine("HAS_IMAGERY"),r.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(r,o),e._defineUniforms(r,s),e._buildSampleAndBlendFunction(r,s),e._createMainImageryShader(r,i,s);let c=n.uniformMap,d=e._createImageryUniforms(i);e._setImageryUniforms(c,d)}static _addAttributes(t,n){for(let r=0;r<n;r++)t.addAttribute("vec2",`a_imagery_texCoord_${r}`),t.addVarying("vec2",`v_imagery_texCoord_${r}`);let i="initializeImageryAttributes",o=`void ${i}()`;t.addFunction(i,o,be.VERTEX);for(let r=0;r<n;r++)t.addFunctionLines(i,[`v_imagery_texCoord_${r} = a_imagery_texCoord_${r};`])}static _computeImageryFlags(t){let n=new RB;for(let i=0;i<t.length;i++){let o=t[i];n.alpha|=o.alpha!==1,n.brightness|=o.brightness!==ds.DEFAULT_BRIGHTNESS,n.contrast|=o.contrast!==ds.DEFAULT_CONTRAST,n.hue|=o.hue!==ds.DEFAULT_HUE,n.saturation|=o.saturation!==ds.DEFAULT_SATURATION,n.gamma|=o.gamma!==ds.DEFAULT_GAMMA;let r=l(o.colorToAlpha)&&o.colorToAlphaThreshold>0;n.colorToAlpha|=r}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",be.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let o=i.join(", ");return`vec4 ${n}(${o})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",o=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,o,be.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),GJe&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || ","    abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || ","    abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || ","    abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{","    result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let o=`v_imagery_texCoord_${n}`,r=[];return r.push("blendedBaseColor"),r.push(`u_imageryTextures[${i}]`),r.push(`${o}`),r.push(`u_imageryTextureCoordinateRectangle[${i}]`),r.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&r.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&r.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&r.push(`u_imageryTextureContrast[${i}]`),t.hue&&r.push(`u_imageryTextureHue[${i}]`),t.saturation&&r.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&r.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&r.push(`u_imageryTextureColorToAlpha[${i}]`),r.join(", ")}static _createMainImageryShader(t,n,i){let o="blendBaseColorWithImagery";t.addFunction(o,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",be.FRAGMENT),t.addFunctionLines(o,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let r=0;r<n.length;r++){let a=n[r].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,r);t.addFunctionLines(o,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(o,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let o=0;o<n;o++){let r=t[o],s=r.imageryLayer,a=r.texture,c=r.textureCoordinateRectangle,d=r.textureTranslationAndScale;i.imageryTextures[o]=a,i.imageryTextureTranslationAndScale[o]=d,i.imageryTextureCoordinateRectangle[o]=c,i.imageryTextureAlpha[o]=s.alpha,i.imageryTextureBrightness[o]=s.brightness,i.imageryTextureContrast[o]=s.contrast,i.imageryTextureHue[o]=s.hue,i.imageryTextureSaturation[o]=s.saturation,i.imageryTextureOneOverGamma[o]=1/s.gamma;let u=i.imageryTextureColorToAlpha[o];if(l(u)||(u=new ce,i.imageryTextureColorToAlpha[o]=u),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;u.x=p.red,u.y=p.green,u.z=p.blue,u.w=s.colorToAlphaThreshold}else u.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let o=`u_${i}`;t[o]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let o=[];for(let r=0;r<t.length;r++){let s=t.get(r);if(!s.show)continue;let a=i[r],d=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,u=n.coveragesForImageryLayer(s);for(let h=0;h<u.length;h++){let p=u[h],g=e._createImageryInput(s,p,d,a);l(g)&&o.push(g)}}return o}static _createImageryInput(t,n,i,o){let r=n.imagery;if(r.state===Hn.FAILED||r.state===Hn.INVALID)return;let s=r.textureWebMercator;if(!l(s)&&(s=r.texture,!l(s))){r.state===Hn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${r.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,r.rectangle),c=n.textureCoordinateRectangle,d=new ce(c.minX,c.minY,c.maxX,c.maxY);return new VB(t,s,a,d,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,VJe),s=o.rectangleToNativeRectangle(i,LJe);return e._computeTextureTranslationAndScaleFromNative(r,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,o=1/n.height,r=t.west-n.west,s=t.south-n.south,a=r*i,c=s*o,d=t.width*i,u=t.height*o;return new ce(a,c,d,u)}static _computeIndexMapping(t,n){let i=[],o=t.length;for(let r=0;r<o;r++){let s=t[r],a=n.indexOf(s);i.push(a)}return i}},LB=cJ;var xvn=y(x(),1);var mvn=y(x(),1),WB=`#ifdef USE_IBL_LIGHTING
vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
{
    #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
        // Environment maps were provided, use them for IBL
        vec3 viewDirection = -normalize(position);
        vec3 iblColor = textureIBL(viewDirection, normal, material);
        return iblColor;
    #endif
    
    return vec3(0.0);
}
#endif

#ifdef USE_CLEARCOAT
vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
{
    vec3 viewDirection = -normalize(position);
    vec3 halfwayDirection = normalize(viewDirection + lightDirection);
    vec3 normal = material.clearcoatNormal;
    float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0);

    // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5.
    vec3 f0 = vec3(0.04);
    vec3 f90 = vec3(1.0);
    // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h).
    // This is to make it energy conserving with a simple layering function.
    float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
    vec3 F = fresnelSchlick2(f0, f90, NdotV);

    // compute specular reflection from direct lighting
    float roughness = material.clearcoatRoughness;
    float alphaRoughness = roughness * roughness;
    float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);
    vec3 directReflection = F * directStrength * NdotL;
    vec3 color = lightColorHdr * directReflection;

    #ifdef SPECULAR_IBL
        // Find the direction in which to sample the environment map
        vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
        vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
        color += iblColor * material.occlusion;
    #endif

    float clearcoatFactor = material.clearcoatFactor;
    vec3 clearcoatColor = color * clearcoatFactor;

    // Dim base layer based on transmission loss through clearcoat
    return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor;
}
#endif

#if defined(LIGHTING_PBR) && defined(HAS_NORMALS)
vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position)
{
    #ifdef USE_CUSTOM_LIGHT_COLOR
        vec3 lightColorHdr = model_lightColorHdr;
    #else
        vec3 lightColorHdr = czm_lightColorHdr;
    #endif

    vec3 viewDirection = -normalize(position);
    vec3 normal = material.normalEC;
    vec3 lightDirection = normalize(czm_lightDirectionEC);

    vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material);
    vec3 directColor = lightColorHdr * directLighting;

    // Accumulate colors from base layer
    vec3 color = directColor + material.emissive;
    #ifdef USE_IBL_LIGHTING
        color += computeIBL(position, normal, lightDirection, lightColorHdr, material);
    #endif

    #ifdef USE_CLEARCOAT
        color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material);
    #endif

    return color;
}
#endif

/**
 * Compute the material color under the current lighting conditions.
 * All other material properties are passed through so further stages
 * have access to them.
 *
 * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS}
 * @param {ProcessedAttributes} attributes
 */
void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
{
    #ifdef LIGHTING_PBR
        #ifdef HAS_NORMALS
            vec3 color = computePbrLighting(material, attributes.positionEC);
        #else
            vec3 color = material.diffuse * material.occlusion + material.emissive;
        #endif
        // In HDR mode, the frame buffer is in linear color space. The
        // post-processing stages (see PostProcessStageCollection) will handle
        // tonemapping. However, if HDR is not enabled, we must tonemap else large
        // values may be clamped to 1.0
        #ifndef HDR
            color = czm_pbrNeutralTonemapping(color);
        #endif
    #else // unlit
        vec3 color = material.diffuse;
    #endif

    #ifdef HAS_POINT_CLOUD_COLOR_STYLE
        // The colors resulting from point cloud styles are adjusted differently.
        color = czm_gammaCorrect(color);
    #elif !defined(HDR)
        // If HDR is not enabled, the frame buffer stores sRGB colors rather than
        // linear colors so the linear value must be converted.
        color = czm_linearToSrgb(color);
    #endif

    material.diffuse = color;
}
`;var fvn=y(x(),1),WJe={UNLIT:0,PBR:1},dp=Object.freeze(WJe);var Eue={name:"LightingPipelineStage"};Eue.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,be.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",be.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===dp.PBR?o.addDefine("LIGHTING_PBR",void 0,be.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,be.FRAGMENT),o.addFragmentLines(WB)};var FB=Eue;var Yvn=y(x(),1);var Evn=y(x(),1),BB=`// If the style color is white, it implies the feature has not been styled.
bool isDefaultStyleColor(vec3 color)
{
    return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
}

vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
{
    vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
    vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
    return color;
}

vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)
{
    return vec2(textureTransform * vec3(texCoord, 1.0));
}

#ifdef HAS_NORMAL_TEXTURE
vec2 getNormalTexCoords()
{
    vec2 texCoord = TEXCOORD_NORMAL;
    #ifdef HAS_NORMAL_TEXTURE_TRANSFORM
        texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0));
    #endif
    return texCoord;
}
#endif

#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE)
vec3 computeTangent(in vec3 position, in vec2 normalTexCoords)
{
    vec2 tex_dx = dFdx(normalTexCoords);
    vec2 tex_dy = dFdy(normalTexCoords);
    float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y;
    vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position);
    return tangent / determinant;
}
#endif

#ifdef USE_ANISOTROPY
struct NormalInfo {
    vec3 tangent;
    vec3 bitangent;
    vec3 normal;
    vec3 geometryNormal;
};

NormalInfo getNormalInfo(ProcessedAttributes attributes)
{
    vec3 geometryNormal = attributes.normalEC;
    #ifdef HAS_NORMAL_TEXTURE
        vec2 normalTexCoords = getNormalTexCoords();
    #endif

    #ifdef HAS_BITANGENTS
        vec3 tangent = attributes.tangentEC;
        vec3 bitangent = attributes.bitangentEC;
    #else // Assume HAS_NORMAL_TEXTURE
        vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords);
        tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent));
        vec3 bitangent = normalize(cross(geometryNormal, tangent));
    #endif

    #ifdef HAS_NORMAL_TEXTURE
        mat3 tbn = mat3(tangent, bitangent, geometryNormal);
        vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
        normalSample = 2.0 * normalSample - 1.0;
        #ifdef HAS_NORMAL_TEXTURE_SCALE
            normalSample.xy *= u_normalTextureScale;
        #endif
        vec3 normal = normalize(tbn * normalSample);
    #else
        vec3 normal = geometryNormal;
    #endif

    #ifdef HAS_DOUBLE_SIDED_MATERIAL
        if (czm_backFacing()) {
            tangent *= -1.0;
            bitangent *= -1.0;
            normal *= -1.0;
            geometryNormal *= -1.0;
        }
    #endif

    NormalInfo normalInfo;
    normalInfo.tangent = tangent;
    normalInfo.bitangent = bitangent;
    normalInfo.normal = normal;
    normalInfo.geometryNormal = geometryNormal;

    return normalInfo;
}
#endif

#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
{
    vec2 normalTexCoords = getNormalTexCoords();

    // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
    #ifdef HAS_BITANGENTS
        vec3 t = attributes.tangentEC;
        vec3 b = attributes.bitangentEC;
    #else
        vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
        t = normalize(t - geometryNormal * dot(geometryNormal, t));
        vec3 b = normalize(cross(geometryNormal, t));
    #endif

    mat3 tbn = mat3(t, b, geometryNormal);
    vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
    normalSample = 2.0 * normalSample - 1.0;
    #ifdef HAS_NORMAL_TEXTURE_SCALE
        normalSample.xy *= u_normalTextureScale;
    #endif
    return normalize(tbn * normalSample);
}
#endif

#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
{
    vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;
    #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM
        normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));
    #endif

    // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
    #ifdef HAS_BITANGENTS
        vec3 t = attributes.tangentEC;
        vec3 b = attributes.bitangentEC;
    #else
        vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
        t = normalize(t - geometryNormal * dot(geometryNormal, t));
        vec3 b = normalize(cross(geometryNormal, t));
    #endif

    mat3 tbn = mat3(t, b, geometryNormal);
    vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;
    normalSample = 2.0 * normalSample - 1.0;
    #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE
        normalSample.xy *= u_clearcoatNormalTextureScale;
    #endif
    return normalize(tbn * normalSample);
}
#endif

#ifdef HAS_NORMALS
vec3 computeNormal(ProcessedAttributes attributes)
{
    // Geometry normal. This is already normalized 
    vec3 normal = attributes.normalEC;

    #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
        normal = getNormalFromTexture(attributes, normal);
    #endif

    #ifdef HAS_DOUBLE_SIDED_MATERIAL
        if (czm_backFacing()) {
            normal = -normal;
        }
    #endif

    return normal;
}
#endif

#ifdef HAS_BASE_COLOR_TEXTURE
vec4 getBaseColorFromTexture()
{
    vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
    #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
        baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
    #endif

    vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));

    #ifdef HAS_BASE_COLOR_FACTOR
        baseColorWithAlpha *= u_baseColorFactor;
    #endif

    return baseColorWithAlpha;
}
#endif

#ifdef HAS_EMISSIVE_TEXTURE
vec3 getEmissiveFromTexture()
{
    vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
    #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
        emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
    #endif

    vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
    #ifdef HAS_EMISSIVE_FACTOR
        emissive *= u_emissiveFactor;
    #endif

    return emissive;
}
#endif

#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
void setSpecularGlossiness(inout czm_modelMaterial material)
{
    #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
        vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
        #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
            specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
        #endif

        vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
        vec3 specular = specularGlossiness.rgb;
        float glossiness = specularGlossiness.a;
        #ifdef HAS_LEGACY_SPECULAR_FACTOR
            specular *= u_legacySpecularFactor;
        #endif

        #ifdef HAS_GLOSSINESS_FACTOR
            glossiness *= u_glossinessFactor;
        #endif
    #else
        #ifdef HAS_LEGACY_SPECULAR_FACTOR
            vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0));
        #else
            vec3 specular = vec3(1.0);
        #endif

        #ifdef HAS_GLOSSINESS_FACTOR
            float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
        #else
            float glossiness = 1.0;
        #endif
    #endif

    #ifdef HAS_DIFFUSE_TEXTURE
        vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
        #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
            diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
        #endif

        vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
        #ifdef HAS_DIFFUSE_FACTOR
            diffuse *= u_diffuseFactor;
        #endif
    #elif defined(HAS_DIFFUSE_FACTOR)
        vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
    #else
        vec4 diffuse = vec4(1.0);
    #endif

    material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));
    // the specular glossiness extension's alpha overrides anything set
    // by the base material.
    material.alpha = diffuse.a;

    material.specular = specular;

    // glossiness is the opposite of roughness, but easier for artists to use.
    material.roughness = 1.0 - glossiness;
}
#elif defined(LIGHTING_PBR)
float setMetallicRoughness(inout czm_modelMaterial material)
{
    #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
        vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
        #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
            metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
        #endif

        vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
        float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
        float roughness = clamp(metallicRoughness.g, 0.0, 1.0);
        #ifdef HAS_METALLIC_FACTOR
            metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
        #endif

        #ifdef HAS_ROUGHNESS_FACTOR
            roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);
        #endif
    #else
        #ifdef HAS_METALLIC_FACTOR
            float metalness = clamp(u_metallicFactor, 0.0, 1.0);
        #else
            float metalness = 1.0;
        #endif

        #ifdef HAS_ROUGHNESS_FACTOR
            float roughness = clamp(u_roughnessFactor, 0.0, 1.0);
        #else
            float roughness = 1.0;
        #endif
    #endif

    // dielectrics use f0 = 0.04, metals use albedo as f0
    const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
    vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);

    material.specular = f0;

    // diffuse only applies to dielectrics.
    material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);

    // This is perceptual roughness. The square of this value is used for direct lighting
    material.roughness = roughness;

    return metalness;
}
#ifdef USE_SPECULAR
void setSpecular(inout czm_modelMaterial material, in float metalness)
{
    #ifdef HAS_SPECULAR_TEXTURE
        vec2 specularTexCoords = TEXCOORD_SPECULAR;
        #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM
            specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform);
        #endif
        float specularWeight = texture(u_specularTexture, specularTexCoords).a;
        #ifdef HAS_SPECULAR_FACTOR
            specularWeight *= u_specularFactor;
        #endif
    #else
        #ifdef HAS_SPECULAR_FACTOR
            float specularWeight = u_specularFactor;
        #else
            float specularWeight = 1.0;
        #endif
    #endif

    #ifdef HAS_SPECULAR_COLOR_TEXTURE
        vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR;
        #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM
            specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform);
        #endif
        vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb;
        vec3 specularColorFactor = czm_srgbToLinear(specularColorSample);
        #ifdef HAS_SPECULAR_COLOR_FACTOR
            specularColorFactor *= u_specularColorFactor;
        #endif
    #else
        #ifdef HAS_SPECULAR_COLOR_FACTOR
            vec3 specularColorFactor = u_specularColorFactor;
        #else
            vec3 specularColorFactor = vec3(1.0);
        #endif
    #endif
    material.specularWeight = specularWeight;
    vec3 f0 = material.specular;
    vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0));
    material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness);
}
#endif
#ifdef USE_ANISOTROPY
void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo)
{
    mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x);
    float anisotropyStrength = u_anisotropy.z;

    vec2 direction = vec2(1.0, 0.0);
    #ifdef HAS_ANISOTROPY_TEXTURE
        vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY;
        #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM
            anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform);
        #endif
        vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb;
        direction = anisotropySample.rg * 2.0 - vec2(1.0);
        anisotropyStrength *= anisotropySample.b;
    #endif

    direction = rotation * direction;
    mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal);
    vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0));
    vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT);

    material.anisotropicT = anisotropicT;
    material.anisotropicB = anisotropicB;
    material.anisotropyStrength = anisotropyStrength;
}
#endif
#ifdef USE_CLEARCOAT
void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes)
{
    #ifdef HAS_CLEARCOAT_TEXTURE
        vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT;
        #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM
            clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);
        #endif
        float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;
        #ifdef HAS_CLEARCOAT_FACTOR
            clearcoatFactor *= u_clearcoatFactor;
        #endif
    #else
        #ifdef HAS_CLEARCOAT_FACTOR
            float clearcoatFactor = u_clearcoatFactor;
        #else
            // PERFORMANCE_IDEA: this case should turn the whole extension off
            float clearcoatFactor = 0.0;
        #endif
    #endif

    #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE
        vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;
        #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM
            clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);
        #endif
        float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;
        #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
            clearcoatRoughness *= u_clearcoatRoughnessFactor;
        #endif
    #else
        #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
            float clearcoatRoughness = u_clearcoatRoughnessFactor;
        #else
            float clearcoatRoughness = 0.0;
        #endif
    #endif

    material.clearcoatFactor = clearcoatFactor;
    // This is perceptual roughness. The square of this value is used for direct lighting
    material.clearcoatRoughness = clearcoatRoughness;
    #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
        material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
    #else
        material.clearcoatNormal = attributes.normalEC;
    #endif
}
#endif
#endif

void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
{
    #ifdef USE_ANISOTROPY
        NormalInfo normalInfo = getNormalInfo(attributes);
        material.normalEC = normalInfo.normal;
    #elif defined(HAS_NORMALS)
        material.normalEC = computeNormal(attributes);
    #endif

    vec4 baseColorWithAlpha = vec4(1.0);
    // Regardless of whether we use PBR, set a base color
    #ifdef HAS_BASE_COLOR_TEXTURE
        baseColorWithAlpha = getBaseColorFromTexture();
    #elif defined(HAS_BASE_COLOR_FACTOR)
        baseColorWithAlpha = u_baseColorFactor;
    #endif

    #ifdef HAS_IMAGERY
    baseColorWithAlpha = blendBaseColorWithImagery(baseColorWithAlpha);
    #endif // HAS_IMAGERY

    #ifdef HAS_POINT_CLOUD_COLOR_STYLE
        baseColorWithAlpha = v_pointCloudColor;
    #elif defined(HAS_COLOR_0)
        vec4 color = attributes.color_0;
        // .pnts files store colors in the sRGB color space
        #ifdef HAS_SRGB_COLOR
            color = czm_srgbToLinear(color);
        #endif
        baseColorWithAlpha *= color;
    #endif

    #ifdef USE_CPU_STYLING
        baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
    #endif
    material.baseColor = baseColorWithAlpha;
    material.diffuse = baseColorWithAlpha.rgb;
    material.alpha = baseColorWithAlpha.a;

    #ifdef HAS_OCCLUSION_TEXTURE
        vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
        #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
            occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
        #endif
        material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
    #endif

    #ifdef HAS_EMISSIVE_TEXTURE
        material.emissive = getEmissiveFromTexture();
    #elif defined(HAS_EMISSIVE_FACTOR)
        material.emissive = u_emissiveFactor;
    #endif

    #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
        setSpecularGlossiness(material);
    #elif defined(LIGHTING_PBR)
        float metalness = setMetallicRoughness(material);
        #ifdef USE_SPECULAR
            setSpecular(material, metalness);
        #endif
        #ifdef USE_ANISOTROPY
            setAnisotropy(material, normalInfo);
        #endif
        #ifdef USE_CLEARCOAT
            setClearcoat(material, attributes);
        #endif
    #endif
}
`;var{Material:FJe,MetallicRoughness:lJ,SpecularGlossiness:dJ,Specular:Tue,Clearcoat:Sue}=Tn,Iue={name:"MaterialPipelineStage",_processTexture:Ad,_processTextureTransform:_ue};Iue.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:h}=n.context;wJe(i,r,s,d,u,h,c),l(i.specularGlossiness)?YJe(i.specularGlossiness,r,s,d,c):(l(i.specular)&&Xt.supportedExtensions.KHR_materials_specular&&NJe(i.specular,r,s,d,c),l(i.anisotropy)&&Xt.supportedExtensions.KHR_materials_anisotropy&&PJe(i.anisotropy,r,s,d,c),l(i.clearcoat)&&Xt.supportedExtensions.KHR_materials_clearcoat&&MJe(i.clearcoat,r,s,d,c),UJe(i.metallicRoughness,r,s,d,c));let p=Xt.getAttributeBySemantic(t,at.NORMAL),g=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading,f=e.lightingOptions;i.unlit||!p||a||g?f.lightingModel=dp.UNLIT:f.lightingModel=dp.PBR;let b=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=b;let C=e.alphaOptions;i.alphaMode===op.BLEND?C.pass=Ve.TRANSLUCENT:i.alphaMode===op.MASK&&(C.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,be.VERTEX),s.addUniform("float","u_pointDiameter",be.VERTEX),r.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),s.addFragmentLines(BB),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,be.BOTH)};function _ue(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,be.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,be.FRAGMENT),t[s]=function(){return n.transform}}function BJe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,be.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,be.FRAGMENT),t[s]=function(){return n.scale}}function Ad(e,t,n,i,o,r){e.addUniform("sampler2D",i,be.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,be.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,d=`TEXCOORD_${o}`;e.addDefine(d,c,be.FRAGMENT);let u=n.transform;l(u)&&!$.equals(u,$.IDENTITY)&&_ue(e,t,n,i,o);let{scale:h}=n;l(h)&&h!==1&&BJe(e,t,n,i,o)}function wJe(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:d,occlusionTexture:u}=e;l(a)&&!m.equals(a,FJe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",be.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,be.FRAGMENT),l(c)&&!s&&Ad(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(d)&&!s&&Ad(n,t,d,"u_normalTexture","NORMAL",o),l(u)&&!s&&Ad(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function YJe(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:d}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,be.FRAGMENT),l(r)&&!o&&Ad(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!ce.equals(s,dJ.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",be.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,be.FRAGMENT)),l(a)&&!o&&Ad(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!m.equals(c,dJ.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",be.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,be.FRAGMENT)),l(d)&&d!==dJ.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",be.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,be.FRAGMENT))}function NJe(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,be.FRAGMENT),l(r)&&!o&&Ad(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==Tue.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",be.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,be.FRAGMENT)),l(a)&&!o&&Ad(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!m.equals(c,Tue.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",be.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,be.FRAGMENT))}var XJe=new m;function PJe(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,be.FRAGMENT),l(a)&&!o&&Ad(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",be.FRAGMENT),t.u_anisotropy=function(){return m.fromElements(c,d,r,XJe)}}function MJe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,be.FRAGMENT),l(r)&&r!==Sue.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",be.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,be.FRAGMENT)),l(s)&&!o&&Ad(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==Sue.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",be.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,be.FRAGMENT)),l(c)&&!o&&Ad(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Ad(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function UJe(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,be.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Ad(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!ce.equals(s,lJ.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",be.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,be.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Ad(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==lJ.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",be.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,be.FRAGMENT));let d=e.roughnessFactor;l(d)&&d!==lJ.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",be.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,be.FRAGMENT))}var wB=Iue;var Pvn=y(x(),1);var Bl={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};Bl.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Bl.METADATA_PICKING_VALUE_TYPE,"float",be.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_STRING,"0.0",be.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",be.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",be.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",be.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",be.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",be.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Bl.METADATA_PICKING_VALUE_TYPE} value = ${Bl.METADATA_PICKING_VALUE_TYPE}(${Bl.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Bl.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Bl.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Bl.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Bl.METADATA_PICKING_VALUE_COMPONENT_W};`],be.FRAGMENT)};var iu=Bl;var Kvn=y(x(),1);var Uvn=y(x(),1),YB=`void morphTargetsStage(inout ProcessedAttributes attributes) 
{
    vec3 positionMC = attributes.positionMC;
    attributes.positionMC = getMorphedPosition(positionMC);

    #ifdef HAS_NORMALS
    vec3 normalMC = attributes.normalMC;
    attributes.normalMC = getMorphedNormal(normalMC);
    #endif

    #ifdef HAS_TANGENTS
    vec3 tangentMC = attributes.tangentMC;
    attributes.tangentMC = getMorphedTangent(tangentMC);
    #endif
}`;var Cc={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Cc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,be.VERTEX),zJe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,d=c.length;for(let u=0;u<d;u++){let h=c[u],p=h.semantic;p!==at.POSITION&&p!==at.NORMAL&&p!==at.TANGENT||(vJe(e,h,e.attributeIndex,a),e.attributeIndex++)}}HJe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,be.VERTEX),n.addVertexLines(YB);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Rt(s,e.uniformMap)};var DJe={attributeString:void 0,functionId:void 0};function vJe(e,t,n,i){let o=e.shaderBuilder;kJe(e,t,n);let r=QJe(t,DJe);OJe(o,r,i)}function kJe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Ut.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function QJe(e,t){switch(e.semantic){case at.POSITION:t.attributeString="Position",t.functionId=Cc.FUNCTION_ID_GET_MORPHED_POSITION;break;case at.NORMAL:t.attributeString="Normal",t.functionId=Cc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case at.TANGENT:t.attributeString="Tangent",t.functionId=Cc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function OJe(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function zJe(e){e.addFunction(Cc.FUNCTION_ID_GET_MORPHED_POSITION,Cc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,be.VERTEX),e.addFunctionLines(Cc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Cc.FUNCTION_ID_GET_MORPHED_NORMAL,Cc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,be.VERTEX),e.addFunctionLines(Cc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Cc.FUNCTION_ID_GET_MORPHED_TANGENT,Cc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,be.VERTEX),e.addFunctionLines(Cc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function HJe(e){e.addFunctionLines(Cc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Cc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Cc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var NB=Cc;var rkn=y(x(),1);var Zue={name:"PickingPipelineStage"};Zue.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)KJe(e,t,a,i);else if(l(a))JJe(e,i);else{let c=Rue(e),d=i.createPickId(c);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",be.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor"}};function Rue(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(Yr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function KJe(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Xt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Xt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",be.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return u.pickTexture??u.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function JJe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let h=0;h<n;h++){let p=Rue(e,h),g=t.createPickId(p);s.push(g),i[h]=g;let f=g.color;o[h*4+0]=D.floatToByte(f.red),o[h*4+1]=D.floatToByte(f.green),o[h*4+2]=D.floatToByte(f.blue),o[h*4+3]=D.floatToByte(f.alpha)}r._pickIds=i;let a=mt.createVertexBuffer({context:t,typedArray:o,usage:Xe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let d={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(d);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,be.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var XB=Zue;var Zkn=y(x(),1);var akn=y(x(),1),jJe={ADD:0,REPLACE:1},ar=Object.freeze(jJe);var lkn=y(x(),1),PB=`float getPointSizeFromAttenuation(vec3 positionEC) {
  // Variables are packed into a single vector to minimize gl.uniformXXX() calls
  float pointSize = model_pointCloudParameters.x;
  float geometricError = model_pointCloudParameters.y;
  float depthMultiplier = model_pointCloudParameters.z;

  float depth = -positionEC.z;
  return min((geometricError / depth) * depthMultiplier, pointSize);
}

#ifdef HAS_POINT_CLOUD_SHOW_STYLE
float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  float tiles3d_tileset_time = model_pointCloudParameters.w;
  return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#endif

#ifdef HAS_POINT_CLOUD_COLOR_STYLE
vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  float tiles3d_tileset_time = model_pointCloudParameters.w;
  return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
}
#endif

#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  float tiles3d_tileset_time = model_pointCloudParameters.w;
  return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#elif defined(HAS_POINT_CLOUD_ATTENUATION)
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  return getPointSizeFromAttenuation(v_positionEC);
}
#endif

#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
float pointCloudBackFaceCullingStage() {
  #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)
  // This needs to be computed in eye coordinates so we can't use attributes.normalMC
  return step(-v_normalEC.z, 0.0);
  #else
  return 1.0;
  #endif
}
#endif
`;var qJe=new ce,Vue={name:"PointCloudStylingPipelineStage"};Vue.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,d=!l(a)&&c;if(l(r)&&!d){let b=nje(a),C=ije(r,b);oje(i,C);let T=rje(C).indexOf("normalMC")>=0,S=Xt.getAttributeBySemantic(t,at.NORMAL);if(T&&!S)throw new he("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,be.VERTEX),C.styleTranslucent&&(e.alphaOptions.pass=Ve.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,be.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,be.VERTEX);let h,p,g;Yr.is3DTiles(o.type)&&(p=!0,h=o.content,g=h.tile.refine===ar.ADD),i.addUniform("vec4","model_pointCloudParameters",be.VERTEX),i.addVertexLines(PB);let f=e.uniformMap;f.model_pointCloudParameters=function(){let b=qJe,C=1;p&&(C=g?5:h.tileset.memoryAdjustedScreenSpaceError),b.x=u.maximumAttenuation??C,b.x*=n.pixelRatio;let E=$Je(e,t,u,h);b.y=E*u.geometricErrorScale;let T=n.context,S=n.camera.frustum,_;return n.mode===se.SCENE2D||S instanceof hn?_=Number.POSITIVE_INFINITY:_=T.drawingBufferHeight/n.camera.frustum.sseDenominator,b.z=_,p&&(b.w=h.tileset.timeSinceLoad),b}};var Gue=new m;function $Je(e,t,n,i){if(l(i)){let u=i.tile.geometricError;if(u>0)return u}if(l(n.baseResolution))return n.baseResolution;let o=Xt.getAttributeBySemantic(t,at.POSITION),r=o.count,s=e.runtimeNode.transform,a=m.subtract(o.max,o.min,Gue);a=F.multiplyByPointAsVector(s,a,Gue);let c=a.x*a.y*a.z;return V.cbrt(c/r)}var eje={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},tje={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function nje(e){let t=Qe(tje);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var uJ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function ije(e,t){let n=eje,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${uJ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${uJ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${uJ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function oje(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,be.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,be.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,be.VERTEX),e.addVertexLines(o))}function mJ(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function rje(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&mJ(t,o),l(n)&&mJ(n,o),l(i)&&mJ(i,o),o}var MB=Vue;var Xkn=y(x(),1);var Gkn=y(x(),1),UB=`void primitiveOutlineStage() {
    v_outlineCoordinates = a_outlineCoordinates;
}
`;var Lkn=y(x(),1),DB=`void primitiveOutlineStage(inout czm_modelMaterial material) {
    if (!model_showOutline) {
        return;
    }

    float outlineX = 
        texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
    float outlineY = 
        texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
    float outlineZ = 
        texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
    float outlineness = max(outlineX, max(outlineY, outlineZ));

    material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
}
`;var Lue={name:"PrimitiveOutlinePipelineStage"};Lue.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,be.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:Ut.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",be.FRAGMENT);let a=bC.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",be.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",be.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(UB),i.addFragmentLines(DB)};var vB=Lue;var kkn=y(x(),1);var Wue={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Fue,_count2DPositions:Bue,_countMorphTargetAttributes:wue,_countMaterialTextures:Yue,_countFeatureIdTextures:Nue,_countBinaryMetadata:Xue};Wue.process=function(e,t,n){let i=e.model,o=i.statistics;Fue(o,t),Bue(o,e.runtimePrimitive),wue(o,t),Yue(o,t.material),Nue(o,t.featureIds),Xue(o,i)};function Fue(e,t){let n=l(t.indices)?t.indices.count:Xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Be.POINTS?e.pointsLength+=n:Be.isTriangles(i)&&(e.trianglesLength+=sje(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let d=o[c];if(l(d.buffer)){let u=l(d.typedArray);e.addBuffer(d.buffer,u)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function sje(e,t){switch(e){case Be.TRIANGLES:return t/3;case Be.TRIANGLE_STRIP:case Be.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Bue(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function wue(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let d=s[c];l(d.buffer)&&e.addBuffer(d.buffer,i)}}}function Yue(e,t){let n=aje(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function aje(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function Nue(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Tn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Xue(e,t){let n=t.structuralMetadata;l(n)&&(cje(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function cje(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].textureReader;l(d.texture)&&e.addTexture(d.texture)}}}var kB=Wue;var r9n=y(x(),1);var lje=new F,dje=new F,Pue={name:"SceneMode2DPipelineStage"};Pue.process=function(e,t,n){let i=Xt.getAttributeBySemantic(t,at.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=F.multiplyTransformation(s,a,lje),d=hje(e,c,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let h=e.runtimeNode.node.instances;if(l(h))return;if(l(i.typedArray)){let b=Aje(i,c,d,n);u.positionBuffer2D=b,r._modelResources.push(b),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,be.VERTEX),o.addUniform("mat4","u_modelView2D",be.VERTEX);let p=F.fromTranslation(d.center,new F),g=n.context,f={u_modelView2D:function(){return F.multiplyTransformation(g.uniformState.view,p,dje)}};e.uniformMap=Rt(f,e.uniformMap)};var uje=new m,mje=new m;function hje(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,uje),o=no.computeActualEllipsoidPosition(n,i,i),r=F.multiplyByPoint(t,e.positionMax,mje),s=no.computeActualEllipsoidPosition(n,r,r);return ue.fromCornerPoints(o,s,new ue)}var Mue=new m;function fje(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=m.fromArray(e,s,Mue),c=m.multiplyComponents(a,r,a),d=m.add(c,o,c);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function pje(e,t,n,i){let o;l(e.quantization)?o=fje(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let d=m.fromArray(o,c,Mue);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=F.multiplyByPoint(t,d,d),h=no.computeActualEllipsoidPosition(i,u,u),p=m.subtract(h,n,h);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function Aje(e,t,n,i){let o=Qe(i);o.mode=se.COLUMBUS_VIEW;let r=n.center,s=pje(e,t,r,o),a=mt.createVertexBuffer({context:i.context,typedArray:s,usage:Xe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var QB=Pue;var h9n=y(x(),1);var a9n=y(x(),1),OB=`void skinningStage(inout ProcessedAttributes attributes) 
{
    mat4 skinningMatrix = getSkinningMatrix();
    mat3 skinningMatrixMat3 = mat3(skinningMatrix);

    vec4 positionMC = vec4(attributes.positionMC, 1.0);
    attributes.positionMC = vec3(skinningMatrix * positionMC);

    #ifdef HAS_NORMALS
    vec3 normalMC = attributes.normalMC;
    attributes.normalMC = skinningMatrixMat3 * normalMC;
    #endif

    #ifdef HAS_TANGENTS
    vec3 tangentMC = attributes.tangentMC;
    attributes.tangentMC = skinningMatrixMat3 * tangentMC;
    #endif
}`;var ZC={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};ZC.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,be.VERTEX),bje(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,be.VERTEX),n.addVertexLines(OB);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Rt(r,e.uniformMap)};function gje(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===at.JOINTS||r.semantic===at.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function bje(e,t){e.addFunction(ZC.FUNCTION_ID_GET_SKINNING_MATRIX,ZC.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,be.VERTEX),e.addFunctionLines(ZC.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=gje(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],d=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(ZC.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(ZC.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var zB=ZC;var x9n=y(x(),1);var p9n=y(x(),1),HB=`void verticalExaggerationStage(
  inout ProcessedAttributes attributes
) {
  // Compute the distance from the camera to the local center of curvature.
  vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);
  vec2 vertexAzimuth = normalize(vertexPositionENU.xy);
  // Curvature = 1 / radius of curvature.
  float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);
  float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;

  // Compute the approximate ellipsoid normal at the vertex position.
  // Uses a circular approximation for the Earth curvature along the geodesic.
  vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
  vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
  vec3 vertexNormal = normalize(centerToVertex);

  // Estimate the (sine of the) angle between the camera direction and the vertex normal
  float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);
  float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);
  float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);
  bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;

  // Approximate the change in height above the ellipsoid, from camera to vertex position.
  float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);
  float smallAngleVersine = 0.5 * sinTheta * sinTheta;
  float versine = isSmallAngle ? smallAngleVersine : exactVersine;
  float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;
  float vertexHeight = czm_eyeHeight + dHeight;

  // Transform the approximate vertex normal to model coordinates.
  vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;
  vertexNormalMC = normalize(vertexNormalMC);

  // Compute the exaggeration and apply it along the approximate vertex normal.
  float stretch = u_verticalExaggerationAndRelativeHeight.x;
  float shift = u_verticalExaggerationAndRelativeHeight.y;
  float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
  attributes.positionMC += exaggeration * vertexNormalMC;
}
`;var Uue={name:"VerticalExaggerationPipelineStage"},yje=new M;Uue.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(HB),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,be.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",be.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return M.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,yje)}};var KB=Uue;var Y9n=y(x(),1);var I9n=y(x(),1);var hJ={};function xje(e){let t=Pe.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function Cje(e,t){let n=t.length,i=Pe.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function Eje(e){let t=e-2,n=2+t*4,i=Pe.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function Tje(e,t){let i=t.length-2,o=2+i*4,r=Pe.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],d=t[a+1],u=t[a+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=c}return r}function Sje(e){let t=e-2,n=2+t*4,i=Pe.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function Ije(e,t){let i=t.length-2,o=2+i*4,r=Pe.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let d=t[c+1],u=t[c+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=a}return r}hJ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Be.TRIANGLES)return i?Cje(t,n):xje(t);if(e===Be.TRIANGLE_STRIP)return i?Tje(t,n):Eje(t);if(e===Be.TRIANGLE_FAN)return i?Ije(t,n):Sje(t)};hJ.getWireframeIndicesCount=function(e,t){return e===Be.TRIANGLES?t*2:e===Be.TRIANGLE_STRIP||e===Be.TRIANGLE_FAN?2+(t-2)*4:t};var CI=hJ;var Due={name:"WireframePipelineStage"};Due.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,be.FRAGMENT);let o=e.model,r=_je(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Be.LINES,e.count=CI.getWireframeIndicesCount(a,c)};function _je(e,t,n){let o=Xt.getAttributeBySemantic(e,at.POSITION).count,r=n.context.webgl2,s;if(l(t)){let u=t.buffer,h=t.count;l(u)&&r?(s=u.sizeInBytes===h?new Uint8Array(h):Pe.createTypedArray(o,h),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=CI.createWireframeIndices(a,o,s),d=Pe.fromSizeInBytes(c.BYTES_PER_ELEMENT);return mt.createIndexBuffer({context:n.context,typedArray:c,usage:Xe.STATIC_DRAW,indexDatatype:d})}var JB=Due;function vue(e){e=e??Q.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}vue.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,d=e.mode!==se.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(o.imageryLayers),f=l(r),C=!(f&&l(r.fragmentShaderText))||r.mode!==lg.REPLACE_MATERIAL,E=Xt.hasQuantizedAttributes(n.attributes),T=o.debugWireframe&&Be.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),S=o.pointCloudShading,_=l(S)&&S.attenuation,R=l(S)&&S.backFaceCulling,L=n.primitiveType===Be.POINTS&&(l(s)||_||R),W=o._enableShowOutline&&l(n.outlineCoordinates),B=l(n.edgeVisibility),Y=Zje(o,i,n),N=l(o.classificationType);d&&t.push(QB),t.push(uB),T&&t.push(JB),N&&t.push(QF),h&&t.push(NB),p&&t.push(zB),L&&t.push(MB),E&&t.push(iB),g&&(W?At("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(LB)),C&&t.push(wB),t.push(V0),t.push(fm),t.push(iu),Y.hasPropertyTable&&(t.push(W0),t.push(kF),t.push(HF)),u&&t.push(KB),f&&t.push(tB),t.push(FB),o.allowPicking&&t.push(XB),W&&t.push(vB),B&&(e.edgeVisibilityRequested=!0,t.push(aB),t.push(rB)),t.push(vF),t.push(kB)};function Zje(e,t,n){let i;return l(t.instances)&&(i=Xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var jB=vue;var xQn=y(x(),1);function fJ(e){e=e??Q.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],Rje(this)}Object.defineProperties(fJ.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function Rje(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let d=i[c].index,u=r[d];s.push(u);let h=n[c],p=kue(u,h,new F);a.push(p)}}function kue(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}fJ.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=kue(i,o,e[n])}};var qB=fJ;var RQn=y(x(),1);var EQn=y(x(),1);function Gje(){this.pass=void 0,this.alphaCutoff=void 0}var RC=Gje;function Vje(e){this.shaderBuilder=new EA,this.model=e,this.uniformMap={},this.alphaOptions=new RC,this.renderStateOptions=ke.getState(ke.fromCache({depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var $B=Vje;var PQn=y(x(),1);var VQn=y(x(),1),e2=`void silhouetteStage(inout vec4 color) {
    if(model_silhouettePass) {
        color = czm_gammaCorrect(model_silhouetteColor);
    }
}`;var WQn=y(x(),1),t2=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
     #ifdef HAS_NORMALS
     if(model_silhouettePass) {
          vec3 normal = normalize(czm_normal3D * attributes.normalMC);
          normal.x *= czm_projection[0][0];
          normal.y *= czm_projection[1][1];
          positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
    }
    #endif
}
`;var Ck={name:"ModelSilhouettePipelineStage"};Ck.silhouettesLength=0;Ck.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++Ck.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,be.BOTH),i.addVertexLines(t2),i.addFragmentLines(e2),i.addUniform("vec4","model_silhouetteColor",be.FRAGMENT),i.addUniform("float","model_silhouetteSize",be.VERTEX),i.addUniform("bool","model_silhouettePass",be.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Rt(o,e.uniformMap),e.hasSilhouette=!0};var n2=Ck;var OQn=y(x(),1);var UQn=y(x(),1),i2=`void modelSplitterStage()
{
    // Don't split when rendering the shadow map, because it is rendered from
    // the perspective of a totally different camera.
#ifndef SHADOW_MAP
    if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
#endif
}
`;var Ek={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Ek.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,be.FRAGMENT),i.addFragmentLines(i2);let o={};i.addUniform("float",Ek.SPLIT_DIRECTION_UNIFORM_NAME,be.FRAGMENT),o[Ek.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Rt(o,e.uniformMap)};var o2=Ek;var KQn=y(x(),1);function Lje(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Qe(e.uniformMap),this.alphaOptions=Qe(e.alphaOptions),this.renderStateOptions=Qe(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.primitiveRenderResources=[]}var r2=Lje;var a5n=y(x(),1);var $Qn=y(x(),1);function Wje(e){e=e??Q.EMPTY_OBJECT,this.lightingModel=e.lightingModel??dp.UNLIT}var s2=Wje;function Fje(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Qe(e.uniformMap),this.alphaOptions=Qe(e.alphaOptions),this.renderStateOptions=Qe(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new s2,this.pickId=void 0}var a2=Fje;var lOn=y(x(),1);var E5n=y(x(),1);function AJ(e){e=e??Q.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==qn.CESIUM_3D_TILE,this._classifies3DTiles=o!==qn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Nje(this)}function Bje(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Ct.KEEP,zFail:Ct.DECREMENT_WRAP,zPass:Ct.KEEP},backFunction:e,backOperation:{fail:Ct.KEEP,zFail:Ct.INCREMENT_WRAP,zPass:Ct.KEEP},reference:Qt.CESIUM_3D_TILE_MASK,mask:Qt.CESIUM_3D_TILE_MASK},stencilMask:Qt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL},depthMask:!1}}var wje={stencilTest:{enabled:!0,frontFunction:$n.NOT_EQUAL,frontOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},backFunction:$n.NOT_EQUAL,backOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},reference:0,mask:Qt.CLASSIFICATION_MASK},stencilMask:Qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND},Yje={stencilTest:{enabled:!0,frontFunction:$n.NOT_EQUAL,frontOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},backFunction:$n.NOT_EQUAL,backOperation:{fail:Ct.ZERO,zFail:Ct.ZERO,zPass:Ct.ZERO},reference:0,mask:Qt.CLASSIFICATION_MASK},stencilMask:Qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},zue=[];function Nje(e){let t=e._command,n=zue;if(e._useDebugWireframe){t.pass=Ve.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=c2(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Ve.TERRAIN_CLASSIFICATION,s=pJ(t,r),a=Que(t,r);n.length=0,n.push(s,a),e._commandListTerrain=c2(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Oue(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Ve.CESIUM_3D_TILE_CLASSIFICATION,s=pJ(t,r),a=Que(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=c2(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Oue(e,n,e._commandList3DTilesPicking))}}function c2(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let d=o[c],u=r[c];for(let h=0;h<a;h++){let p=t[h],g=nt.shallowClone(p);g.count=d,g.offset=u,n.push(g)}}return n}function pJ(e,t){let n=nt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ve.TERRAIN_CLASSIFICATION?$n.ALWAYS:$n.EQUAL,o=Bje(i);return n.renderState=ke.fromCache(o),n}function Que(e,t){let n=nt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ke.fromCache(wje),n}var Xje=[];function Oue(e,t,n){let i=ke.fromCache(Yje),o=t[0],r=t[1],s=nt.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=nt.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=Xje;return c.length=0,c.push(s,a),c2(e,c,n)}Object.defineProperties(AJ.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ue.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});AJ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){ni(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&ni(t,this._commandListTerrain),this._classifies3DTiles&&ni(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=pJ(this._command,o),s=zue;s.length=0,s.push(r),this._commandListIgnoreShow=c2(this,s,this._commandListIgnoreShow)}ni(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&ni(t,this._commandListTerrainPicking),this._classifies3DTiles&&ni(t,this._commandList3DTilesPicking)),t};var l2=AJ;var v5n=y(x(),1);function d2(e){e=e??Q.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o,this._primitiveRenderResources=n;let r=t.pass===Ve.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,d=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,h=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=ue.clone(t.boundingVolume),this._modelMatrix2D=new F,this._boundingVolume2D=new ue,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=d,this._needsSkipLevelOfDetailCommands=u,this._needsSilhouetteCommands=h,this._needsEdgeCommands=p,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._edgeCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,Pje(this)}function up(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}up.clone=function(e){return new up({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Pje(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;if(e._originalCommand=new up({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new up({command:Oje(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new up({command:$je(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new up({command:e4e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new up({command:zje(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new up({command:Hje(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let r=e._primitiveRenderResources;e._edgeCommand=new up({command:Kje(t,r,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand)}}Object.defineProperties(d2.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ue.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,Uje(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Dje(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,vje(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,kje(this))}}});function Mje(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=V.sign(n[13])*2*V.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Uje(e){let t=e.shadows,n=Rn.castShadows(t),i=Rn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function Dje(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Qe(r.renderState,!0);s.cull.enabled=t,r.renderState=ke.fromCache(s)}}}function vje(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Qe(r.renderState,!0);s.cull.face=t,r.renderState=ke.fromCache(s)}}}function kje(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}d2.prototype.pushCommands=function(e,t){let n=gJ(this,e);n&&!this._has2DCommands&&(Qje(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Mje(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Xh.ALL_OPAQUE&&VC(t,this._translucentCommand,n),i===Xh.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||VC(o._backfaceCommands,this._skipLodBackfaceCommand,n),Jje(this,r,n),VC(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){VC(t,this._silhouetteModelCommand,n);return}return VC(t,this._originalCommand,n),t}};d2.prototype.pushSilhouetteCommands=function(e,t){let n=gJ(this,e);return VC(t,this._silhouetteColorCommand,n),t};d2.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=gJ(this,e);return VC(t,this._edgeCommand,n),t};function VC(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function gJ(e,t){if(t.mode!==se.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*V.PI;return o<s&&r>s||o<-s&&r>-s}function GC(e,t){if(!l(t))return;let n=up.clone(t),i=nt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function Qje(e){GC(e,e._originalCommand),GC(e,e._translucentCommand),GC(e,e._skipLodBackfaceCommand),GC(e,e._skipLodStencilCommand),GC(e,e._silhouetteModelCommand),GC(e,e._silhouetteColorCommand),GC(e,e._edgeCommand)}function Oje(e){let t=nt.shallowClone(e);t.pass=Ve.TRANSLUCENT;let n=Qe(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=fn.ALPHA_BLEND,t.renderState=ke.fromCache(n),t}function zje(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=Qe(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ne.ALWAYS,backFunction:ne.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ke.fromCache(o),i}function Hje(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=Qe(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ve.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ve.TRANSLUCENT,o.depthMask=!1,o.blending=fn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ne.NOTEQUAL,backFunction:ne.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP}};let s=Qe(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ke.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function Kje(e,t){let n=t.edgeGeometry,i=nt.shallowClone(e);i.vertexArray=n.vertexArray,i.primitiveType=n.primitiveType,i.count=n.indexCount,l(n.shaderProgram)&&(i.shaderProgram=n.shaderProgram),i.pass=n.pass;let o=Qe(e.uniformMap);return o.u_isEdgePass=function(){return!0},i.uniformMap=o,i.castShadows=!1,i.receiveShadows=!1,i}function Jje(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=jje(o);if(r!==s){let a=qje(r),c=Qe(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ke.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function jje(e){return(e.renderState.stencilTest.reference&Qt.SKIP_LOD_MASK)>>>Qt.SKIP_LOD_BIT_SHIFT}function qje(e){return Qt.CESIUM_3D_TILE_MASK|e<<Qt.SKIP_LOD_BIT_SHIFT}function $je(e){let t=nt.shallowClone(e),n=Qe(e.renderState,!0);n.cull.enabled=!0,n.cull.face=wi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Qe(t.uniformMap),o=new M(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ke.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function e4e(e){let t=nt.shallowClone(e),n=Qe(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Qt.SKIP_LOD_MASK,i.reference=Qt.CESIUM_3D_TILE_MASK,i.frontFunction=$n.GREATER_OR_EQUAL,i.frontOperation.zPass=Ct.REPLACE,i.backFunction=$n.GREATER_OR_EQUAL,i.backOperation.zPass=Ct.REPLACE,n.stencilMask=Qt.CESIUM_3D_TILE_MASK|Qt.SKIP_LOD_MASK,t.renderState=ke.fromCache(n),t}var u2=d2;var Q5n=y(x(),1),m2=`precision highp float;

czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
    czm_modelVertexOutput vsOutput;
    vsOutput.positionMC = positionMC;
    vsOutput.pointSize = 1.0;
    return vsOutput;
}

void main()
{
    // Initialize the attributes struct with all
    // attributes except quantized ones.
    ProcessedAttributes attributes;
    initializeAttributes(attributes);

    #ifdef HAS_IMAGERY
    initializeImageryAttributes();
    #endif

    // Dequantize the quantized ones and add them to the
    // attributes struct.
    #ifdef USE_DEQUANTIZATION
    dequantizationStage(attributes);
    #endif

    #ifdef HAS_MORPH_TARGETS
    morphTargetsStage(attributes);
    #endif

    #ifdef HAS_SKINNING
    skinningStage(attributes);
    #endif

    #ifdef HAS_PRIMITIVE_OUTLINE
    primitiveOutlineStage();
    #endif

    // Compute the bitangent according to the formula in the glTF spec.
    // Normal and tangents can be affected by morphing and skinning, so
    // the bitangent should not be computed until their values are finalized.
    #ifdef HAS_BITANGENTS
    attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
    #endif

    FeatureIds featureIds;
    featureIdStage(featureIds, attributes);

    #ifdef HAS_SELECTED_FEATURE_ID
    SelectedFeature feature;
    selectedFeatureIdStage(feature, featureIds);
    // Handle any show properties that come from the style.
    cpuStylingStage(attributes.positionMC, feature);
    #endif

    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
    // The scene mode 2D pipeline stage and instancing stage add a different
    // model view matrix to accurately project the model to 2D. However, the
    // output positions and normals should be transformed by the 3D matrices
    // to keep the data the same for the fragment shader.
    mat4 modelView = czm_modelView3D;
    mat3 normal = czm_normal3D;
    #else
    // These are used for individual model projection because they will
    // automatically change based on the scene mode.
    mat4 modelView = czm_modelView;
    mat3 normal = czm_normal;
    #endif

    // Update the position for this instance in place
    #ifdef HAS_INSTANCING

        // The legacy instance stage is used when rendering i3dm models that
        // encode instances transforms in world space, as opposed to glTF models
        // that use EXT_mesh_gpu_instancing, where instance transforms are encoded
        // in object space.
        #ifdef USE_LEGACY_INSTANCING
        mat4 instanceModelView;
        mat3 instanceModelViewInverseTranspose;

        legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);

        modelView = instanceModelView;
        normal = instanceModelViewInverseTranspose;
        #else
        instancingStage(attributes);
        #endif

        #ifdef USE_PICKING
        v_pickColor = a_pickColor;
        #endif

    #endif

    Metadata metadata;
    MetadataClass metadataClass;
    MetadataStatistics metadataStatistics;
    metadataStage(metadata, metadataClass, metadataStatistics, attributes);

    #ifdef HAS_VERTICAL_EXAGGERATION
    verticalExaggerationStage(attributes);
    #endif

    #ifdef HAS_CUSTOM_VERTEX_SHADER
    czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
    customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
    #endif

    // Compute the final position in each coordinate system needed.
    // This returns the value that will be assigned to gl_Position.
    vec4 positionClip = geometryStage(attributes, modelView, normal);

    // This must go after the geometry stage as it needs v_positionWC
    #ifdef HAS_ATMOSPHERE
    atmosphereStage(attributes);
    #endif

    #ifdef ENABLE_CLIPPING_POLYGONS
    modelClippingPolygonsStage(attributes);
    #endif

    #ifdef HAS_SILHOUETTE
    silhouetteStage(attributes, positionClip);
    #endif

    #ifdef HAS_POINT_CLOUD_SHOW_STYLE
    float show = pointCloudShowStylingStage(attributes, metadata);
    #else
    float show = 1.0;
    #endif

    #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
    show *= pointCloudBackFaceCullingStage();
    #endif

    #ifdef HAS_POINT_CLOUD_COLOR_STYLE
    v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
    #endif

    #ifdef PRIMITIVE_TYPE_POINTS
        #ifdef HAS_CUSTOM_VERTEX_SHADER
        gl_PointSize = vsOutput.pointSize;
        #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
        gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
        #elif defined(HAS_POINT_DIAMETER)
        gl_PointSize = u_pointDiameter;
        #else
        gl_PointSize = 1.0;
        #endif
        
        gl_PointSize *= show;
    #endif

    // Important NOT to compute gl_Position = show * positionClip or we hit:
    // https://github.com/CesiumGS/cesium/issues/11270
    //
    // We will discard points with v_pointCloudShow == 0 in the fragment shader.
    gl_Position = positionClip;

    #ifdef HAS_POINT_CLOUD_SHOW_STYLE
    v_pointCloudShow = show;
    #endif
}
`;var z5n=y(x(),1),h2=`
precision highp float;

czm_modelMaterial defaultModelMaterial()
{
    czm_modelMaterial material;
    material.diffuse = vec3(0.0);
    material.specular = vec3(1.0);
    material.roughness = 1.0;
    material.occlusion = 1.0;
    material.normalEC = vec3(0.0, 0.0, 1.0);
    material.emissive = vec3(0.0);
    material.alpha = 1.0;
    return material;
}

vec4 handleAlpha(vec3 color, float alpha)
{
    #ifdef ALPHA_MODE_MASK
    if (alpha < u_alphaCutoff) {
        discard;
    }
    #endif

    return vec4(color, alpha);
}

SelectedFeature selectedFeature;

void main()
{
    #ifdef PRIMITIVE_TYPE_POINTS
    // Render points as circles
    float distanceToCenter = length(gl_PointCoord - vec2(0.5));
    if (distanceToCenter > 0.5) {
        discard;
    }
    #endif

    #ifdef HAS_POINT_CLOUD_SHOW_STYLE
        if (v_pointCloudShow == 0.0)
        {
            discard;
        }
    #endif

    #ifdef HAS_MODEL_SPLITTER
    modelSplitterStage();
    #endif

    czm_modelMaterial material = defaultModelMaterial();

    ProcessedAttributes attributes;
    geometryStage(attributes);

    FeatureIds featureIds;
    featureIdStage(featureIds, attributes);

    Metadata metadata;
    MetadataClass metadataClass;
    MetadataStatistics metadataStatistics;
    metadataStage(metadata, metadataClass, metadataStatistics, attributes);

    //========================================================================
    // When not picking metadata START
    #ifndef METADATA_PICKING_ENABLED

    #ifdef HAS_SELECTED_FEATURE_ID
    selectedFeatureIdStage(selectedFeature, featureIds);
    #endif

    #ifndef CUSTOM_SHADER_REPLACE_MATERIAL
    materialStage(material, attributes, selectedFeature);
    #endif

    #ifdef HAS_CUSTOM_FRAGMENT_SHADER
    customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
    #endif

    lightingStage(material, attributes);

    #ifdef HAS_SELECTED_FEATURE_ID
    cpuStylingStage(material, selectedFeature);
    #endif

    #ifdef HAS_MODEL_COLOR
    modelColorStage(material);
    #endif

    #ifdef HAS_PRIMITIVE_OUTLINE
    primitiveOutlineStage(material);
    #endif

    vec4 color = handleAlpha(material.diffuse, material.alpha);

    // When not picking metadata END
    //========================================================================
    #else
    //========================================================================
    // When picking metadata START

    vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
    metadataPickingStage(metadata, metadataClass, metadataValues);
    vec4 color = metadataValues;

    #endif
    // When picking metadata END
    //========================================================================

    #ifdef HAS_CLIPPING_PLANES
    modelClippingPlanesStage(color);
    #endif

    #ifdef ENABLE_CLIPPING_POLYGONS
    modelClippingPolygonsStage();
    #endif

    //========================================================================
    // When not picking metadata START
    #ifndef METADATA_PICKING_ENABLED

    #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
    silhouetteStage(color);
    #endif

    #ifdef HAS_ATMOSPHERE
    atmosphereStage(color, attributes);
    #endif

    #ifdef HAS_EDGE_VISIBILITY
    edgeVisibilityStage(color, featureIds);
    edgeDetectionStage(color, featureIds);
    #endif

    #endif
    // When not picking metadata END
    //========================================================================

    out_FragColor = color;
}

`;function Hue(){}Hue.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=t4e(e,n,t),o=n4e(e,i,t),r=e.model;return l(r.classificationType)?new l2({primitiveRenderResources:e,command:o}):new u2({primitiveRenderResources:e,command:o})};function t4e(e,t,n){t.addVertexLines(m2),t.addFragmentLines(h2);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function n4e(e,t,n){let i=i4e(e),o=new si({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===se.SCENE3D,d,u;if(!c&&!n.scene3DOnly&&r._projectTo2D)d=F.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new F),u=e.runtimePrimitive.boundingSphere2D;else{let E=c?a._computedModelMatrix:a._computedModelMatrix2D;d=F.multiplyTransformation(E,e.runtimeNode.computedTransform,new F),u=ue.transform(e.boundingSphere,d)}let h=Qe(ke.fromCache(e.renderStateOptions),!0);h.cull.face=Xt.getCullFace(d,e.primitiveType),h=ke.fromCache(h);let p=l(r.classificationType),g=p?!1:Rn.castShadows(r.shadows),f=p?!1:Rn.receiveShadows(r.shadows),b=p?void 0:e.pickId;return new nt({boundingVolume:u,modelMatrix:d,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:b,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:f})}function i4e(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var f2=Hue;function Oc(e){e=e??Q.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=Xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},o4e(this)}Object.defineProperties(Oc.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function o4e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Kue(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let T=0;T<s;T++){let S=r[T],_=new ZF({articulation:S,sceneGraph:e}),R=_.name;a[R]=_}let c=t.nodes,d=c.length;e._runtimeNodes=new Array(d);let h=n.nodes.length,p=F.IDENTITY;for(let T=0;T<h;T++){let S=n.nodes[T],_=Jue(e,S,p);e._rootNodes.push(_)}let g=t.skins,f=e._runtimeSkins,b=g.length;for(let T=0;T<b;T++){let S=g[T];f.push(new qB({skin:S,sceneGraph:e}))}let C=e._skinnedNodes,E=C.length;for(let T=0;T<E;T++){let S=C[T],_=e._runtimeNodes[S],L=c[S].skin.index;_._runtimeSkin=f[L],_.updateJointMatrices()}e.applyArticulations()}function Kue(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var r4e=new m;function s4e(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,r4e);if(!m.equals(i,m.ZERO))e._computedModelMatrix2D=Tt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Tt.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Jue(e,t,n){let i=[],o=Xt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let h=t.children[u],p=F.multiplyTransformation(n,o,new F),g=Jue(e,h,p);i.push(g)}let s=new DF({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let u=0;u<a;u++)s.runtimePrimitives.push(new jB({primitive:t.primitives[u],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let d=t.name;if(l(d)){let u=e._model,h=new BF(u,s);u._nodesByName[d]=h}return c}var a4e=new m,c4e=new m,l4e=new m,d4e=new m;Oc.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};Oc.prototype.buildRenderResources=function(e){let t=this._model,n=new $B(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let o=0;o<i.length;o++)i[o].process(n,t,e);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;r.configurePipeline();let s=r.pipelineStages,a=new r2(n,r);n.nodeRenderResources[o]=a;for(let c=0;c<s.length;c++)s[c].process(a,r.node,e);for(let c=0;c<r.runtimePrimitives.length;c++){let d=r.runtimePrimitives[c];d.configurePipeline(e);let u=d.pipelineStages,h=new a2(a,d);a.primitiveRenderResources[c]=h;for(let p=0;p<u.length;p++)u[p].process(h,d.primitive,e)}}return n};Oc.prototype.computeBoundingVolumes=function(e){let t=this._model,n=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,a4e),i=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,c4e);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;let s=e.nodeRenderResources[o],a=r.computedTransform;for(let c=0;c<r.runtimePrimitives.length;c++){let d=r.runtimePrimitives[c],u=s.primitiveRenderResources[c];d.boundingSphere=ue.clone(u.boundingSphere,new ue);let h=F.multiplyByPoint(a,u.positionMin,l4e),p=F.multiplyByPoint(a,u.positionMax,d4e);m.minimumByComponent(n,h,n),m.maximumByComponent(i,p,i)}}this._boundingSphere=ue.fromCornerPoints(n,i,new ue),this._boundingSphere=ue.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ue.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ue.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Oc.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let o=e.nodeRenderResources[n];for(let r=0;r<i.runtimePrimitives.length;r++){let s=i.runtimePrimitives[r],a=o.primitiveRenderResources[r],c=f2.buildModelDrawCommand(a,t);s.drawCommand=c}}};Oc.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(G0),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(IF),n.isClippingEnabled()&&t.push(VF),n.isClippingPolygonsEnabled()&&t.push(FF),n.hasSilhouette(e)&&t.push(n2),l(n.splitDirection)&&n.splitDirection!==Br.NONE&&t.push(o2),Yr.is3DTiles(n.type)&&t.push(xF),i&&t.push(TF))};Oc.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==se.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};Oc.prototype.updateModelMatrix=function(e,t){Kue(this,e),t.mode!==se.SCENE3D&&s4e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Oc.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function jue(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let d=t.getChild(c);jue(e,d,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let d=s[c];i(d,o)}}function Tk(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];jue(e,c,t,n,i)}}var u4e={backFaceCulling:void 0};Oc.prototype.updateBackFaceCulling=function(e){let t=u4e;t.backFaceCulling=e,Tk(this,!1,m4e,t)};function m4e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var h4e={shadowMode:void 0};Oc.prototype.updateShadows=function(e){let t=h4e;t.shadowMode=e,Tk(this,!1,f4e,t)};function f4e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var p4e={debugShowBoundingVolume:void 0};Oc.prototype.updateShowBoundingVolume=function(e){let t=p4e;t.debugShowBoundingVolume=e,Tk(this,!1,A4e,t)};function A4e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var que=[],$ue=[],g4e={frameState:void 0,hasSilhouette:void 0};Oc.prototype.pushDrawCommands=function(e){let t=que;t.length=0;let n=$ue;n.length=0;let i=g4e;i.hasSilhouette=this._model.hasSilhouette(e),i.frameState=e,Tk(this,!0,b4e,i),ni(e.commandList,t),ni(e.commandList,n)};function b4e(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=que,s=$ue,a=e.drawCommand;a.pushCommands(n,n.commandList),i&&!o.pick&&a.pushSilhouetteCommands(n,r),l(a.pushEdgeCommands)&&a.pushEdgeCommands(n,s)}Oc.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};Oc.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var p2=Oc;var DOn=y(x(),1);function w0(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Ft}Object.defineProperties(w0.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});w0.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};w0.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};w0.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};w0.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};w0.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};w0.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var A2=w0;var I3n=y(x(),1);var ime=y(cD(),1);var t3n=y(x(),1);var eme={},LC=Uint32Array.BYTES_PER_ELEMENT;eme.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=LC;let o=i.getUint32(t,!0);if(o!==1)throw new he(`Only Point Cloud tile version 1 is supported.  Version ${o} is not.`);t+=LC,t+=LC;let r=i.getUint32(t,!0);if(r===0)throw new he("Feature table must have a byte length greater than zero");t+=LC;let s=i.getUint32(t,!0);t+=LC;let a=i.getUint32(t,!0);t+=LC;let c=i.getUint32(t,!0);t+=LC;let d=Cr(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let h,p;a>0&&(h=Cr(n,t,a),Object.keys(h).length===0&&(h=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p),t+=c));let g=new Yh(d,u),f=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=f,!l(f))throw new he("Feature table global property: POINTS_LENGTH must be defined");let b=g.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(b)&&(b=m.unpack(b));let C=x4e(g,h);if(C.rtcCenter=b,C.pointsLength=f,!C.hasPositions){let E=C4e(g);C.positions=E,C.hasPositions=C.hasPositions||l(E)}if(!C.hasPositions)throw new he("Either POSITION or POSITION_QUANTIZED must be defined.");if(!C.hasNormals){let E=T4e(g);C.normals=E,C.hasNormals=C.hasNormals||l(E)}if(!C.hasColors){let E=E4e(g);C.colors=E,C.hasColors=C.hasColors||l(E),C.hasConstantColor=l(C.constantColor),C.isTranslucent=l(E)&&E.isTranslucent}if(!C.hasBatchIds){let E=S4e(g);C.batchIds=E,C.hasBatchIds=C.hasBatchIds||l(E)}if(C.hasBatchIds){let E=g.getGlobalProperty("BATCH_LENGTH");if(!l(E))throw new he("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");C.batchLength=E}return(l(h)||l(p))&&(C.batchTableJson=h,C.batchTableBinary=p),y4e(C),C};function y4e(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),o=[];for(let r of Object.keys(t)){let a=t[r].byteOffset;l(a)&&(i.includes(r)||o.push(r))}for(let r of o)At("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${r} that could not be resolved - skipping`),delete t[r]}function x4e(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,d,u,h,p;if(l(s)){o=s.properties;let f=s.byteOffset,b=s.byteLength;if(!l(o)||!l(f)||!l(b))throw new he("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+b),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),h=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:Rt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:h}}function C4e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",J.FLOAT,3),{name:at.POSITION,semantic:at.POSITION,typedArray:n,isQuantized:!1,componentDatatype:J.FLOAT,type:Ut.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",J.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",J.FLOAT,3);if(!l(i))throw new he("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",J.FLOAT,3);if(!l(r))throw new he("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:at.POSITION,semantic:at.POSITION,typedArray:n,isQuantized:!0,componentDatatype:J.FLOAT,type:Ut.VEC3,quantizedRange:o,quantizedVolumeOffset:m.unpack(r),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:J.UNSIGNED_SHORT,quantizedType:Ut.VEC3}}}function E4e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",J.UNSIGNED_BYTE,4),{name:at.COLOR,semantic:at.COLOR,setIndex:0,typedArray:n,componentDatatype:J.UNSIGNED_BYTE,type:Ut.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",J.UNSIGNED_BYTE,3),{name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n,componentDatatype:J.UNSIGNED_BYTE,type:Ut.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",J.UNSIGNED_SHORT,1),{name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n,componentDatatype:J.FLOAT,type:Ut.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",J.UNSIGNED_BYTE,4),o=i[3],r=D.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:at.COLOR,semantic:at.COLOR,setIndex:0,constantColor:r,componentDatatype:J.FLOAT,type:Ut.VEC4,isQuantized:!1,isTranslucent:s}}}function T4e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",J.FLOAT,3),{name:at.NORMAL,semantic:at.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:J.FLOAT,type:Ut.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",J.UNSIGNED_BYTE,2),{name:at.NORMAL,semantic:at.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Ut.VEC2,quantizedComponentDatatype:J.UNSIGNED_BYTE,componentDatatype:J.FLOAT,type:Ut.VEC3}}function S4e(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",J.UNSIGNED_SHORT,1);return{name:at.FEATURE_ID,semantic:at.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:J.fromTypedArray(n),type:Ut.SCALAR}}}var WC=eme;var I4e=Tn.Components,_4e=Tn.Scene,Z4e=Tn.Node,R4e=Tn.Primitive,G4e=Tn.Attribute,tme=Tn.Quantization,V4e=Tn.FeatureIdAttribute,L4e=Tn.Material,W4e=Tn.MetallicRoughness;function Y0(e){e=e??Q.EMPTY_OBJECT;let t=e.arrayBuffer,n=e.byteOffset??0;this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=e.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=ft.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(Y0.prototype=Object.create(Oi.prototype),Y0.prototype.constructor=Y0);Object.defineProperties(Y0.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Y0.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=WC.parse(this._arrayBuffer,this._byteOffset),this._state=ft.PROCESSING,this._promise=Promise.resolve(this)};Y0.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===ft.READY)return!0;if(this._state===ft.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=F4e(this,e.context)}return!1};function F4e(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=QA.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&B4e(e,i,r),Q4e(e,t),e._state=ft.READY,e}).catch(function(r){e.unload(),e._state=ft.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function B4e(e,t,n){e._state=ft.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:at.POSITION,typedArray:n.POSITION.array,componentDatatype:J.FLOAT,type:Ut.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=m.fromElements(c,c,c),u=m.unpack(a.minValues),h=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=h<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT,o.quantizedType=Ut.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:at.NORMAL,typedArray:n.NORMAL.array,componentDatatype:J.FLOAT,type:Ut.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=J.UNSIGNED_BYTE,o.quantizedType=Ut.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:J.UNSIGNED_BYTE,type:Ut.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:J.UNSIGNED_BYTE,type:Ut.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:at.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:J.fromTypedArray(a),type:Ut.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let d=c.data;r[a]={byteOffset:d.byteOffset,type:w4e(d.componentsPerAttribute),componentType:Y4e(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function w4e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Y4e(e){switch(e){case ne.BYTE:return"BYTE";case ne.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ne.SHORT:return"SHORT";case ne.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ne.INT:return"INT";case ne.UNSIGNED_INT:return"UNSIGNED_INT";case ne.DOUBLE:return"DOUBLE";case ne.FLOAT:return"FLOAT"}}function g2(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new tme,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new tme;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=m.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=m.divideByScalar(c,a,new m),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new G4e;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=_n.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=D.pack(t.constantColor,a)}else{let a=mt.createVertexBuffer({typedArray:i,context:n,usage:Xe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===at.POSITION&&s&&(r.typedArray=i),r}var nme,Sk;function N4e(e){if(!l(Sk)){nme=new ime.default(0),Sk=new Array(e);for(let t=0;t<e;++t)Sk[t]=nme.random()}return Sk}var X4e=new m,P4e=new m,M4e=new m;function U4e(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=N4e(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=m.fromElements(s,s,s,X4e),d=m.fromElements(a,a,a,P4e),u,h,p;if(e.isQuantized)c=m.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)h=Math.floor(r[u]*i),p=m.unpack(t,h*3,M4e),m.minimumByComponent(c,p,c),m.maximumByComponent(d,p,d);e.min=m.clone(c),e.max=m.clone(d)}var D4e={name:at.COLOR,semantic:at.COLOR,setIndex:0,constantColor:D.DARKGRAY,componentDatatype:J.FLOAT,type:Ut.VEC4,isQuantized:!1,isTranslucent:!1};function v4e(e,t,n){let i=[],o,r=t.positions;return l(r)&&(U4e(r),o=g2(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=g2(e,t.normals,n),i.push(o)),l(t.colors)?(o=g2(e,t.colors,n),i.push(o)):(o=g2(e,D4e,n),i.push(o)),l(t.batchIds)&&(o=g2(e,t.batchIds,n),i.push(o)),i}function k4e(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableJson,r=e.batchTableBinary,s=!l(e.batchIds);return l(r)||l(o)||e.hasDracoBatchTable?rg({count:n??i,batchTable:o,binaryBody:r,parseAsPropertyAttributes:s,customAttributeOutput:t}):new Sa({schema:{},propertyTables:[]})}function Q4e(e,t){let n=e._parsedContent,i=new W4e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new L4e;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=op.BLEND);let s=!l(n.normals);o.unlit=s;let a=new R4e;if(a.attributes=v4e(e,n,t),a.primitiveType=Be.POINTS,a.material=o,l(n.batchIds)){let g=new V4e;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new Z4e;c.index=0,c.primitives=[a];let d=new _4e;d.nodes=[c],d.upAxis=to.Z,d.forwardAxis=to.X;let u=new I4e;u.scene=d,u.nodes=[c];let h=[];u.structuralMetadata=k4e(n,h),h.length>0&&O4e(e,a,h,t),l(n.rtcCenter)&&(u.transform=F.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=F.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function O4e(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=mt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Xe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}Y0.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var b2=Y0;var k3n=y(x(),1);var z4e=new m,H4e=new m,K4e=new m,J4e=new F,j4e=new F,q4e=new F,$4e=new pe,e8e=new ue;function EI(e,t,n,i,o,r,s){if(!e._ready||n.mode===se.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,d=c._runtimeNodes;for(let u=0;u<d.length;u++){let h=d[u],p=h.node,g=F.clone(h.computedTransform,J4e),f=F.clone(c.computedModelMatrix,j4e),b=p.instances;l(b)&&b.transformInWorldSpace&&(f=F.multiplyTransformation(e.modelMatrix,c.components.transform,f),g=F.multiplyTransformation(c.axisCorrectionMatrix,h.computedTransform,g));let C=F.multiplyTransformation(f,g,q4e);n.mode!==se.SCENE3D&&(C=Tt.basisTo2D(n.mapProjection,C,C));let E=[];if(l(b)){let S=b.attributes[0].count,_=b.attributes[0].componentDatatype,R=12,L=h.transformsTypedArray;if(!l(L)){let W=h.instancingTransformsBuffer;l(W)&&n.context.webgl2&&(L=J.createTypedArray(_,S*R),W.getBufferData(L))}if(l(L))for(let W=0;W<S;W++){let B=W*R,Y=new F(L[B],L[B+1],L[B+2],L[B+3],L[B+4],L[B+5],L[B+6],L[B+7],L[B+8],L[B+9],L[B+10],L[B+11],0,0,0,1);b.transformInWorldSpace?(F.multiplyTransformation(Y,g,Y),F.multiplyTransformation(f,Y,Y)):F.multiplyTransformation(Y,C,Y),E.push(Y)}}E.length===0&&E.push(C);let T=h.runtimePrimitives.length;for(let S=0;S<T;S++){let _=h.runtimePrimitives[S],R=_.primitive;if(l(_.boundingSphere)&&!l(b)){let H=ue.transform(_.boundingSphere,C,e8e),ee=di.raySphere(t,H);if(!l(ee))continue}let L=Xt.getAttributeBySemantic(R,at.POSITION),W=L.byteOffset,B=L.byteStride,Y=L.count;if(!l(R.indices))continue;let N=R.indices.typedArray;if(!l(N)){let H=R.indices.buffer,ee=R.indices.count,z=R.indices.indexDatatype;l(H)&&n.context.webgl2&&(z===Pe.UNSIGNED_BYTE?N=new Uint8Array(ee):z===Pe.UNSIGNED_SHORT?N=new Uint16Array(ee):z===Pe.UNSIGNED_INT&&(N=new Uint32Array(ee)),H.getBufferData(N))}let A=L.typedArray,I=L.componentDatatype,Z=L.type,G=L.quantization;l(G)&&(I=L.quantization.componentDatatype,Z=L.quantization.type);let w=Ut.getNumberOfComponents(Z),X=J.getSizeInBytes(I),v=!l(A)&&l(B)&&B!==w*X,U=w,k=0;v&&(U=B/X,k=W/X);let P=Y*U;if(!l(A)){let H=L.buffer;l(H)&&n.context.webgl2&&(A=J.createTypedArray(I,P),H.getBufferData(A,v?0:W,0,P)),G&&L.normalized&&(A=_n.dequantize(A,I,Z,Y))}if(!l(N)||!l(A))return;r=r??ie.default,i=i??1,o=o??0;let O=N.length;for(let H=0;H<O;H+=3){let ee=N[H],z=N[H+1],te=N[H+2];for(let q of E){let me=bJ(A,ee,k,U,G,q,i,o,r,z4e),ye=bJ(A,z,k,U,G,q,i,o,r,H4e),oe=bJ(A,te,k,U,G,q,i,o,r,K4e),xe=di.rayTriangleParametric(t,me,ye,oe,e.backFaceCulling??!0);l(xe)&&xe<a&&xe>=0&&(a=xe)}}}}if(a!==Number.MAX_VALUE){if(s=xn.getPoint(t,a,s),n.mode!==se.SCENE3D){m.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,h=u.ellipsoid,p=u.unproject(s,$4e);h.cartographicToCartesian(p,s)}return s}}function bJ(e,t,n,i,o,r,s,a,c,d){let u=n+t*i;if(d.x=e[u],d.y=e[u+1],d.z=e[u+2],l(o))if(o.octEncoded){if(d=_n.octDecodeInRange(d,o.normalizationRange,d),o.octEncodedZXY){let h=d.x;d.x=d.z,d.z=d.y,d.y=h}}else d=m.multiplyComponents(d,o.quantizedVolumeStepSize,d),d=m.add(d,o.quantizedVolumeOffset,d);return d=F.multiplyByPoint(r,d,d),s!==1&&Eo.getPosition(d,c,s,a,d),d}var $3n=y(x(),1);var O3n=y(x(),1),yJ=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},y2=yJ;var xJ=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],o=n.length;for(let r=0;r<o;r++){let s=n[r],a=s.runtimeNode,c=s.runtimePrimitive,d=new _C(t,a,c);c.primitive.modelPrimitiveImagery=d,i.push(d)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,o=[];for(let r=0;r<i.length;r++){let s=i[r];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];o.push({runtimeNode:s,runtimePrimitive:c})}}return o}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new Ae("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let o=0;o<i;o++)n[o].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let o=0;o<n.length;o++){let r=n.get(o),s=i[o];if(r.show!==s.show||r.alpha!==s.alpha||r.brightness!==s.brightness||r.contrast!==s.contrast||r.hue!==s.hue||r.saturation!==s.saturation||r.gamma!==s.gamma||r.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let o=0;o<n.length;o++){let r=n.get(o);i[o]=new y2(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),fe(this)}},x2=xJ;function _o(e){e=e??Q.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Yr.GLTF,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new AF(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=D.clone(e.color),this._colorBlendMode=e.colorBlendMode??Dc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??D.RED;this._silhouetteColor=D.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Ve.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ue,this._initialRadius=void 0,this._heightReference=e.heightReference??tt.NONE,this._heightDirty=this._heightReference!==tt.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new sp(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?ss.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?Wh.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._modelImagery=new x2(this),this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Kx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new $A(e.environmentMapOptions);$A.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Rn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Yr.GLTF&&At("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let d=e.credit;typeof d=="string"&&(d=new bt(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Br.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??D.BLACK,this._classificationType=e.classificationType,this._statistics=new A2,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new Ce,this._readyEvent=new Ce,this._texturesReadyEvent=new Ce,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function CJ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function t8e(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new yF({model:e,propertyTable:s});n.push(a)}return n}function n8e(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=Xt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],d=Xt.getFeatureIdsByLabel(c.featureIds,n);if(l(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function SJ(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(_o.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){SJ(e,this._color)&&this.resetDrawCommands(),this._color=D.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!D.equals(e,this._silhouetteColor)){let t=SJ(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=D.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return sme(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Yr.GLTF&&At("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(ss.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Wh.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&($A.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});_o.prototype.getNode=function(e){return this._nodesByName[e]};_o.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};_o.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};_o.prototype.getExtension=function(e){return this._loader.components.extensions[e]};_o.prototype.makeStyleDirty=function(){this._styleDirty=!0};_o.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var i8e=new F,o8e=new $,r8e=new F;_o.prototype.update=function(e){let t=!1;try{t=s8e(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")CJ(this,i);else{let o=Xt.getError("model",this._resource,i);CJ(this,o)}}if(a8e(this,e),c8e(this,e),l8e(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=Xt.getError("model",this._resource,new he("Failed to load model."));CJ(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&t8e(this,o);let r=new p2({model:this,modelComponents:i});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!this._resourcesLoaded||e.mode===se.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(d8e(this),u8e(this),m8e(this,e),h8e(this),f8e(this,e),p8e(this,e),A8e(this,e),g8e(this,e),b8e(this,e),y8e(this,e),x8e(this,e),this._defaultTexture=e.context.defaultTexture,C8e(this,e),E8e(this,e),T8e(this),S8e(this,e),R8e(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),_8e(this),G8e(this,e),V8e(this),L8e(this,e)}};function s8e(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function a8e(e,t){l(e._customShader)&&e._customShader.update(t)}function c8e(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function l8e(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function d8e(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=n8e(t,e),e._styleDirty=!0,e.resetDrawCommands())}function u8e(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function m8e(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&rme(e)}function rme(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Xh.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function h8e(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function f8e(e,t){e._silhouetteDirty&&(ame(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function p8e(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function A8e(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function g8e(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function b8e(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function y8e(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function x8e(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function C8e(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function E8e(e,t){F.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix))}var N0=new m,EJ=new pe;function T8e(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===tt.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??ie.default,i=e.modelMatrix;N0.x=i[12],N0.y=i[13],N0.z=i[14];let o=n.cartesianToCartographic(N0);l(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(i,new F)),e._removeUpdateHeightCallback=t.updateHeight(o,ome(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=ome(e,n,o);pe.clone(o,EJ),EJ.height=r,s(EJ)}e._heightDirty=!1,e._updateModelMatrix=!0}function S8e(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;sme(e,n),I8e(e,n,t)}function sme(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=m.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ue.transform(e._boundingSphere,t,e._boundingSphere)}function I8e(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,N0),e._sceneMode!==se.SCENE3D&&no.computeActualEllipsoidPosition(n,N0,N0);let s=e._boundingSphere.radius,a=W8e(N0,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function _8e(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var Z8e=new $(1,0,0,0,0,1,0,-1,0);function R8e(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=o8e,s=i8e;if(s=F.multiply(o.uniformState.view3D,i,s),r=F.getRotation(s,r),r=$.transpose(r,r),e._iblReferenceFrameMatrix=$.multiply(Z8e,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=r8e;a=F.multiply(o.uniformState.view3D,i,a),a=F.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=F.inverseTranspose(a,e._clippingPlanesMatrix)}}function G8e(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function V8e(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=bt.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=bt.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=bt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function L8e(e,t){let n=B8e(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(w8e(e,t),e._sceneGraph.pushDrawCommands(t))}var TJ=new ue;function W8e(e,t,n){return TJ.center=e,TJ.radius=t,n.camera.getPixelSize(TJ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var Ik=new m;function ome(e,t,n){return function(i){rS(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,Ik);let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=Ik.x,o[13]=Ik.y,o[14]=Ik.z,e._heightDirty=!0}}var F8e=new m;function B8e(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===se.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=F.getTranslation(e.modelMatrix,F8e);no.computeActualEllipsoidPosition(t,s,s),r=m.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function w8e(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}_o.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};_o.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function ame(e){return e.context.stencilBuffer}_o.prototype.hasSilhouette=function(e){return ame(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};_o.prototype.hasSkipLevelOfDetail=function(e){if(!Yr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};_o.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};_o.prototype.pick=function(e,t,n,i,o){return EI(this,e,t,n,i,o)};_o.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};_o.prototype.isDestroyed=function(){return!1};_o.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,fe(this)};_o.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};_o.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};_o.fromGltfAsync=async function(e){e=e??Q.EMPTY_OBJECT;let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=e.basePath??"",o=Ge.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Ge.createIfNeeded(t);let r=new eu(n),a=l(e.content)?Yr.TILE_GLTF:Yr.GLTF,c=n.gltfResource,d=C2(r,a,e);d.resource=c,d.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),Xt.getError("model",c,g)}let u=e.gltfCallback;l(u)&&u(r.gltfJson);let h=new _o(d),p=h._resource.credits;if(l(p)){let g=p.length;for(let f=0;f<g;f++)h._resourceCredits.push(bt.clone(p[f]))}return h};_o.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new aF(t);try{await n.load();let i=C2(n,Yr.TILE_B3DM,e);return new _o(i)}catch(i){throw n.destroy(),i}};_o.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new b2(t);try{await n.load();let i=C2(n,Yr.TILE_PNTS,e);return new _o(i)}catch(i){throw n.destroy(),i}};_o.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new dF(t);try{await n.load();let i=C2(n,Yr.TILE_I3DM,e);return new _o(i)}catch(i){throw n.destroy(),i}};_o.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new cF(t),i=C2(n,Yr.TILE_GEOJSON,e);return new _o(i)};var Y8e=new D;_o.prototype.applyColorAndShow=function(e){let t=D.clone(this._color,Y8e),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):D.clone(D.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,SJ(t,this._color)&&this.resetDrawCommands()};_o.prototype.applyStyle=function(e){let t=this.type===Yr.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),rme(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function C2(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var Dh=_o;function us(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(us.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});us.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};us.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};us.prototype.getExtension=function(e){return this._model.getExtension(e)};us.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};us.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};us.prototype.applyDebugSettings=function(e,t){t=e?t:D.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};us.prototype.applyStyle=function(e){this._model.style=e};us.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:hd.REPEAT}),this._ready=!0)};us.prototype.isDestroyed=function(){return!1};us.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),fe(this)};us.fromGltf=async function(e,t,n,i){let o=new us(e,t,n),s=E2(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Dh.fromGltfAsync(s);return o._model=c,o};us.fromB3dm=async function(e,t,n,i,o){let r=new us(e,t,n),a=E2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let d=await Dh.fromB3dm(a);return r._model=d,r};us.fromI3dm=async function(e,t,n,i,o){let r=new us(e,t,n),a=E2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Dh.fromI3dm(a);return r._model=c,r};us.fromPnts=async function(e,t,n,i,o){let r=new us(e,t,n),a=E2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Dh.fromPnts(a);return r._model=c,r};us.fromGeoJson=async function(e,t,n,i){let o=new us(e,t,n),s=E2(e,t,o,{geoJson:i,resource:n}),a=await Dh.fromGeoJson(s);return o._model=a,o};us.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ie.WGS84,n)};function E2(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ve.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return Rt(i,o)}var ou=us;var nHn=y(x(),1);function gm(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(gm.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(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});gm.fromJson=function(e,t,n,i){let o=new gm(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};gm.prototype.hasProperty=function(e,t){return!1};gm.prototype.getFeature=function(e){};gm.prototype.applyDebugSettings=function(e,t){};gm.prototype.applyStyle=function(e){};gm.prototype.update=function(e,t){};gm.prototype.pick=function(e,t,n){};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){return fe(this)};var T2=gm;var $8n=y(x(),1);var o4n=y(x(),1);var _Kn=y(x(),1);var oHn=y(x(),1),S2=`uniform sampler2D u_atlas;
uniform float u_coarseDepthTestDistance;
uniform float u_threePointDepthTestDistance;

#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

in vec2 v_textureCoordinates;
in vec4 v_pickColor;
in vec4 v_color;
in float v_splitDirection;

#ifdef SDF
in vec4 v_outlineColor;
in float v_outlineWidth;
#endif

in vec4 v_compressed;                               // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
const float SHIFT_LEFT1 = 2.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;

#ifdef FS_THREE_POINT_DEPTH_CHECK
in vec4 v_textureCoordinateBounds;                  // the min and max x and y values for the texture coordinates
in vec4 v_originTextureCoordinateAndTranslate;      // texture coordinate at the origin, billboard translate (used for label glyphs)
in mat2 v_rotationMatrix;

const float SHIFT_LEFT12 = 4096.0;

const float SHIFT_RIGHT12 = 1.0 / 4096.0;
#endif

float getGlobeDepthAtCoords(vec2 st)
{
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
    if (logDepthOrDepth == 0.0)
    {
        return 0.0; // not on the globe
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
    return eyeCoordinate.z / eyeCoordinate.w;
}

#ifdef FS_THREE_POINT_DEPTH_CHECK
float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)
{
    vec2 lookupVector = imageSize * (depthLookupST - adjustedST);
    lookupVector = v_rotationMatrix * lookupVector;
    vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle.  Will be zero for billboards because dimensions and imageSize will be equal

    vec2 translation = v_originTextureCoordinateAndTranslate.zw;

    if (applyTranslate)
    {
        // this is only needed for labels where the horizontal origin is not LEFT
        // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT
        translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
    }

    vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
    return getGlobeDepthAtCoords(st);
}
#endif

#ifdef SDF

// Get the distance from the edge of a glyph at a given position sampling an SDF texture.
float getDistance(vec2 position)
{
    return texture(u_atlas, position).r;
}

// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
{
    float distance = getDistance(position);

    if (outlineWidth > 0.0)
    {
        // Don't get the outline edge exceed the SDF_EDGE
        float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
        float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
        vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
        float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
        return vec4(sdfColor.rgb, sdfColor.a * alpha);
    }
    else
    {
        float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
        return vec4(v_color.rgb, v_color.a * alpha);
    }
}
#endif

#ifdef FS_THREE_POINT_DEPTH_CHECK
void doThreePointDepthTest(float eyeDepth, bool applyTranslate) {

    if (eyeDepth < -u_threePointDepthTestDistance) return;
    float temp = v_compressed.z;
    temp = temp * SHIFT_RIGHT12;

    vec2 dimensions;
    dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
    dimensions.x = floor(temp);

    temp = v_compressed.w;
    temp = temp * SHIFT_RIGHT12;

    vec2 imageSize;
    imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;
    imageSize.x = floor(temp);

    vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;
    adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);

    float epsilonEyeDepth = v_compressed.x + czm_epsilon1;
    float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);

    // negative values go into the screen
    if (globeDepth1 == 0.0 || globeDepth1 < epsilonEyeDepth) return;

    float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner
    if (globeDepth2 == 0.0 || globeDepth2 < epsilonEyeDepth) return;

    float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner
    if (globeDepth3 == 0.0 || globeDepth3 < epsilonEyeDepth) return;

    // All three key points are occluded, discard the fragment (and by extension the entire billboard)            
    discard;
}
#endif

// Extra manual depth testing is done to allow more control over how a billboard is occluded 
// by the globe when near and far from the camera.
void doDepthTest(float globeDepth) {
    float temp = v_compressed.y;
    temp = temp * SHIFT_RIGHT1;
    float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
    bool enableDepthCheck = temp2 != 0.0;
    if (!enableDepthCheck) return;

    float eyeDepth = v_compressed.x;

#ifdef FS_THREE_POINT_DEPTH_CHECK
    // If the billboard is clamped to the ground and within a given distance, we do a 3-point depth test. This test is performed in the vertex shader, unless
    // vertex texture sampling is not supported, in which case we do it here.
    bool applyTranslate = floor(temp) != 0.0;
    doThreePointDepthTest(eyeDepth, applyTranslate);
    
#elif defined(VS_THREE_POINT_DEPTH_CHECK)
    // Since discarding vertices is not possible, the vertex shader sets eyeDepth to 0 to indicate the depth test failed. Apply the discard here.
    if (eyeDepth > -u_threePointDepthTestDistance) {
        if (eyeDepth == 0.0) {
            discard;
        }
        return;
    }
#endif

    // If we're far away, we just compare against a flat, camera-facing depth-plane at the ellipsoid's center.
    // If we're close, we compare against the globe depth texture (which includes depth from the 3D tile pass).

    if (globeDepth == 0.0) return; // Not on globe    
    float distanceToEllipsoidCenter = -length(czm_viewerPositionWC); // depth is negative by convention
    float testDistance = (eyeDepth > -u_coarseDepthTestDistance) ? globeDepth : distanceToEllipsoidCenter;
    if (eyeDepth < testDistance) {
        discard;
    }
}

void main()
{
    if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
    
    vec2 fragSt = gl_FragCoord.xy / czm_viewport.zw;
    float globeDepth = getGlobeDepthAtCoords(fragSt);
    doDepthTest(globeDepth);
    
    vec4 color = texture(u_atlas, v_textureCoordinates);

#ifdef SDF
    float outlineWidth = v_outlineWidth;
    vec4 outlineColor = v_outlineColor;

    // Get the current distance
    float distance = getDistance(v_textureCoordinates);

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    float smoothing = fwidth(distance);
    // Get an offset that is approximately half the distance to the neighbor pixels
    // 0.354 is approximately half of 1/sqrt(2)
    vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));

    // Sample the center point
    vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);

    // Sample the 4 neighbors
    vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
    vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
    vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
    vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);

    // Equally weight the center sample and the 4 neighboring samples
    color = (center + color1 + color2 + color3 + color4)/5.0;
#else
    // If no derivatives available (IE 10?), just do a single sample
    float smoothing = 1.0/32.0;
    color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
#endif

    color = czm_gammaCorrect(color);
#else
    color = czm_gammaCorrect(color);
    color *= czm_gammaCorrect(v_color);
#endif

// Fully transparent parts of the billboard are not pickable.
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
    if (color.a < 0.005)   // matches 0/255 and 1/255
    {
        discard;
    }
#else
// The billboard is rendered twice. The opaque pass discards translucent fragments
// and the translucent pass discards opaque fragments.
#ifdef OPAQUE
    if (color.a < 0.995)   // matches < 254/255
    {
        discard;
    }
#else
    if (color.a >= 0.995)  // matches 254/255 and 255/255
    {
        discard;
    }
#endif
#endif

#ifdef VECTOR_TILE
    color *= u_highlightColor;
#endif
    out_FragColor = color;

#ifdef LOG_DEPTH
    // If we've made it here, we passed our manual depth test, above. But the automatic depth test will
    // still run, and some fragments of the billboard may clip against the globe. To prevent that,
    // ensure the depth value we write out is in front of the globe depth.
    float depthArg = v_depthFromNearPlusOne;

    if (globeDepth != 0.0) { // On the globe
        float globeDepthFromNearPlusOne = (-globeDepth - czm_currentFrustum.x) + 1.0;
        float nudge = max(globeDepthFromNearPlusOne * 5e-6, czm_epsilon7);
        float globeOnTop = max(1.0, globeDepthFromNearPlusOne - nudge);
        depthArg = min(depthArg, globeOnTop);
    }

    czm_writeLogDepth(depthArg);
#endif
}`;var sHn=y(x(),1),I2=`uniform float u_threePointDepthTestDistance;
#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScale;
in vec4 positionLowAndRotation;
in vec4 compressedAttribute0;                       // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
in vec4 compressedAttribute1;                       // aligned axis, translucency by distance, image width
in vec4 compressedAttribute2;                       // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
in vec4 eyeOffset;                                  // eye offset in meters, 4 bytes free (texture range)
in vec4 scaleByDistance;                            // near, nearScale, far, farScale
in vec4 pixelOffsetScaleByDistance;                 // near, nearScale, far, farScale
in vec4 compressedAttribute3;                       // distance display condition near, far, disableDepthTestDistanceSq, dimensions
in vec2 sdf;                                        // sdf outline color (rgb) and width (w)
in float splitDirection;                            // splitDirection
#if defined(VS_THREE_POINT_DEPTH_CHECK) || defined(FS_THREE_POINT_DEPTH_CHECK)
in vec4 textureCoordinateBoundsOrLabelTranslate;    // the min and max x and y values for the texture coordinates
#endif
#ifdef VECTOR_TILE
in float a_batchId;
#endif

out vec2 v_textureCoordinates;
#ifdef FS_THREE_POINT_DEPTH_CHECK
out vec4 v_textureCoordinateBounds;
out vec4 v_originTextureCoordinateAndTranslate;
out mat2 v_rotationMatrix;
#endif
out vec4 v_compressed;                                 // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize

out vec4 v_pickColor;
out vec4 v_color;
out float v_splitDirection;
#ifdef SDF
out vec4 v_outlineColor;
out float v_outlineWidth;
#endif

const float UPPER_BOUND = 32768.0;

const float SHIFT_LEFT16 = 65536.0;
const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT8 = 256.0;
const float SHIFT_LEFT7 = 128.0;
const float SHIFT_LEFT5 = 32.0;
const float SHIFT_LEFT3 = 8.0;
const float SHIFT_LEFT2 = 4.0;
const float SHIFT_LEFT1 = 2.0;

const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;
const float SHIFT_RIGHT7 = 1.0 / 128.0;
const float SHIFT_RIGHT5 = 1.0 / 32.0;
const float SHIFT_RIGHT3 = 1.0 / 8.0;
const float SHIFT_RIGHT2 = 1.0 / 4.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;

vec4 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)
{
    // Note the halfSize cannot be computed in JavaScript because it is sent via
    // compressed vertex attributes that coerce it to an integer.
    vec2 halfSize = imageSize * scale * 0.5;
    halfSize *= ((direction * 2.0) - 1.0);

    vec2 originTranslate = origin * abs(halfSize);

#if defined(ROTATION) || defined(ALIGNED_AXIS)
    if (validAlignedAxis || rotation != 0.0)
    {
        float angle = rotation;
        if (validAlignedAxis)
        {
            vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);
            angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
                    (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
        }

        float cosTheta = cos(angle);
        float sinTheta = sin(angle);
        rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
        halfSize = rotationMatrix * halfSize;
    }
    else
    {
        rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
    }
#endif

    mpp = czm_metersPerPixel(positionEC);
    positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
    positionEC.xy += (translate + pixelOffset) * mpp;

    return positionEC;
}

#ifdef VS_THREE_POINT_DEPTH_CHECK
float getGlobeDepth(vec4 positionEC)
{
    vec4 posWC = czm_eyeToWindowCoordinates(positionEC);

    float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));

    if (globeDepth == 0.0)
    {
        return 0.0; // not on the globe
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
    return eyeCoordinate.z / eyeCoordinate.w;
}
#endif
void main()
{
    // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition

    // unpack attributes
    vec3 positionHigh = positionHighAndScale.xyz;
    vec3 positionLow = positionLowAndRotation.xyz;
    float scale = positionHighAndScale.w;

#if defined(ROTATION) || defined(ALIGNED_AXIS)
    float rotation = positionLowAndRotation.w;
#else
    float rotation = 0.0;
#endif

    float compressed = compressedAttribute0.x;

    vec2 pixelOffset;
    pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
    compressed -= pixelOffset.x * SHIFT_LEFT7;
    pixelOffset.x -= UPPER_BOUND;

    vec2 origin;
    origin.x = floor(compressed * SHIFT_RIGHT5);
    compressed -= origin.x * SHIFT_LEFT5;

    origin.y = floor(compressed * SHIFT_RIGHT3);
    compressed -= origin.y * SHIFT_LEFT3;

#ifdef FS_THREE_POINT_DEPTH_CHECK
    vec2 depthOrigin = origin.xy;
#endif
    origin -= vec2(1.0);

    float show = floor(compressed * SHIFT_RIGHT2);
    compressed -= show * SHIFT_LEFT2;

#ifdef INSTANCED
    vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
    vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
    vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
#else
    vec2 direction;
    direction.x = floor(compressed * SHIFT_RIGHT1);
    direction.y = compressed - direction.x * SHIFT_LEFT1;

    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);
#endif

    float temp = compressedAttribute0.y  * SHIFT_RIGHT8;
    pixelOffset.y = -(floor(temp) - UPPER_BOUND);

    vec2 translate;
    translate.y = (temp - floor(temp)) * SHIFT_LEFT16;

    temp = compressedAttribute0.z * SHIFT_RIGHT8;
    translate.x = floor(temp) - UPPER_BOUND;
    translate.x *= SHIFT_RIGHT2; // undo translateX scaling (helps preserve subpixel precision, see BillboardCollection.js attribute writer for more info)

    translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
    translate.y -= UPPER_BOUND;
    translate.y *= SHIFT_RIGHT2;

    temp = compressedAttribute1.x * SHIFT_RIGHT8;
    float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);

    vec2 imageSize = vec2(floor(temp), temp2);

#ifdef FS_THREE_POINT_DEPTH_CHECK
    float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
    float applyTranslate = 0.0;
    if (labelHorizontalOrigin != 0.0) // is a label, so set apply translate to true
    {
        applyTranslate = 1.0;
        labelHorizontalOrigin -= 2.0;
        depthOrigin.x = labelHorizontalOrigin + 1.0;
    }

    depthOrigin = vec2(1.0) - (depthOrigin * 0.5);
#endif

#ifdef EYE_DISTANCE_TRANSLUCENCY
    vec4 translucencyByDistance;
    translucencyByDistance.x = compressedAttribute1.z;
    translucencyByDistance.z = compressedAttribute1.w;

    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;

    temp = compressedAttribute1.y * SHIFT_RIGHT8;
    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif

#if defined(VS_THREE_POINT_DEPTH_CHECK) || defined(FS_THREE_POINT_DEPTH_CHECK)
    temp = compressedAttribute3.w;
    temp = temp * SHIFT_RIGHT12;

    vec2 dimensions;
    dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
    dimensions.x = floor(temp);
#endif

#ifdef ALIGNED_AXIS
    vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
    temp = compressedAttribute2.z * SHIFT_RIGHT5;
    bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
#else
    vec3 alignedAxis = vec3(0.0);
    bool validAlignedAxis = false;
#endif

    vec4 pickColor;
    vec4 color;

    temp = compressedAttribute2.y;
    temp = temp * SHIFT_RIGHT8;
    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor.r = floor(temp);

    temp = compressedAttribute2.x;
    temp = temp * SHIFT_RIGHT8;
    color.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    color.g = (temp - floor(temp)) * SHIFT_LEFT8;
    color.r = floor(temp);

    temp = compressedAttribute2.z * SHIFT_RIGHT8;
    bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
    temp = floor(temp) * SHIFT_RIGHT8;

    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor /= 255.0;

    color.a = floor(temp);
    color /= 255.0;

    ///////////////////////////////////////////////////////////////////////////

    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
    vec4 positionEC = czm_modelViewRelativeToEye * p;

    positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
    positionEC.xyz *= show;

    ///////////////////////////////////////////////////////////////////////////

#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
    float lengthSq;
    if (czm_sceneMode == czm_sceneMode2D)
    {
        // 2D camera distance is a special case
        // treat all billboards as flattened to the z=0.0 plane
        lengthSq = czm_eyeHeight2D.y;
    }
    else
    {
        lengthSq = dot(positionEC.xyz, positionEC.xyz);
    }
#endif

#ifdef EYE_DISTANCE_SCALING
    float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
    scale *= distanceScale;
    translate *= distanceScale;
    // push vertex behind near plane for clipping
    if (scale == 0.0)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

    float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
    // push vertex behind near plane for clipping
    if (translucency == 0.0)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

#ifdef EYE_DISTANCE_PIXEL_OFFSET
    float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
    pixelOffset *= pixelOffsetScale;
#endif

#ifdef DISTANCE_DISPLAY_CONDITION
    float nearSq = compressedAttribute3.x;
    float farSq = compressedAttribute3.y;
    if (lengthSq < nearSq || lengthSq > farSq)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

    mat2 rotationMatrix;
    float mpp;

    float enableDepthCheck = 1.0;
#ifdef DISABLE_DEPTH_DISTANCE
    float disableDepthTestDistanceSq = compressedAttribute3.z;
    if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
    {
        disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance;
    }

    if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0)
    {
        enableDepthCheck = 0.0;
    }
#endif

    v_compressed.y = enableDepthCheck;

#ifdef VS_THREE_POINT_DEPTH_CHECK
if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) {
    float depthsilon = 10.0;
    vec2 depthOrigin;
    // Horizontal origin for labels comes from a special attribute. If that value is 0, this is a billboard - use the regular origin. 
    // Otherwise, transform the label origin to -1, 0, 1 (right, center, left).
    depthOrigin.x = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
    depthOrigin.x = czm_branchFreeTernary(depthOrigin.x == 0.0, origin.x, depthOrigin.x - 2.0);
    depthOrigin.y = origin.y;

    vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
    float globeDepth1 = getGlobeDepth(pEC1);

    if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
    {
        vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
        float globeDepth2 = getGlobeDepth(pEC2);

        if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
        {
            vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
            float globeDepth3 = getGlobeDepth(pEC3);
            if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
            {
                // "Discard" this vertex, as three key points fail depth test.
                positionEC.xyz = vec3(0.0);
            }
        }
    }
}
#endif
    // Write out the eyespace depth before applying the screen space offset, but after potentially "discarding" the vertex
    // by setting its eyespace position to zero, via the three-point depth test above.
    v_compressed.x = positionEC.z;

    positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
    gl_Position = czm_projection * positionEC;
    v_textureCoordinates = textureCoordinates;

#ifdef LOG_DEPTH
    czm_vertexLogDepth();
#endif

#ifdef DISABLE_DEPTH_DISTANCE

    if (disableDepthTestDistanceSq != 0.0)
    {
        // Don't try to "multiply both sides" by w.  Greater/less-than comparisons won't work for negative values of w.
        float zclip = gl_Position.z / gl_Position.w;
        bool clipped = (zclip < -1.0 || zclip > 1.0);
        // disableDepthTestDistanceSq can be less than zero if it's explicitly set to -1 in JS (as a sentinel value equivalent to infinity)
        if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq)))
        {
            // Position z on the near plane.
            gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
            v_depthFromNearPlusOne = 1.0;
#endif
        }
    }
#endif

#ifdef FS_THREE_POINT_DEPTH_CHECK
    if (sizeInMeters) {
        translate /= mpp;
        dimensions /= mpp;
        imageSize /= mpp;
    }

#if defined(ROTATION) || defined(ALIGNED_AXIS)
    v_rotationMatrix = rotationMatrix;
#else
    v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
#endif
    float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));
    float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));

    float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));
    float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));

    v_compressed.y += applyTranslate * SHIFT_LEFT1;
    v_compressed.z = dw * SHIFT_LEFT12 + dh;
    v_compressed.w = iw * SHIFT_LEFT12 + ih;
    v_originTextureCoordinateAndTranslate.xy = depthOrigin;
    v_originTextureCoordinateAndTranslate.zw = translate;
    v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;

#endif

#ifdef SDF
    vec4 outlineColor;
    float outlineWidth;

    temp = sdf.x;
    temp = temp * SHIFT_RIGHT8;
    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor.r = floor(temp);

    temp = sdf.y;
    temp = temp * SHIFT_RIGHT8;
    float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor.a = floor(temp);
    outlineColor /= 255.0;

    v_outlineWidth = outlineWidth / 255.0;
    v_outlineColor = outlineColor;
    v_outlineColor.a *= translucency;
#endif

    v_pickColor = pickColor;

    v_color = color;
    v_color.a *= translucency;
    v_splitDirection = splitDirection;
}
`;var NHn=y(x(),1);var mHn=y(x(),1);var cHn=y(x(),1),N8e=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Ws=N8e;function vh(e){this._billboardCollection=e,this._id=void 0,this._loadState=Ws.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(vh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Ws.LOADED}},hasImage:{get:function(){return this._loadState!==Ws.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});vh.prototype.unload=async function(){this._loadState!==Ws.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Ws.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};vh.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let o=this._billboardCollection,r=o.billboardTextureCache,s=r.get(e);if(l(s)&&t.loadState===Ws.LOADING||t.loadState===Ws.LOADED){vh.clone(s,this);return}l(s)||(s=new vh(o),r.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Ws.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{a=c.addImage(e,t,n,i),a instanceof Promise&&(a=await a)}catch(u){if(s._loadState=Ws.ERROR,s._loadError=u,this._id!==e)return;this._loadState=Ws.ERROR,this._loadError=u;return}if(!l(a)||a===-1){if(s._loadState=Ws.FAILED,s._index=-1,this._id!==e)return;this._loadState=Ws.FAILED,this._index=-1;return}s._index=a,s._loadState=Ws.LOADED;let d=c.rectangles[a];s._width=d.width,s._height=d.height,this._id===e&&(this._index=a,this._loadState=Ws.LOADED,this._width=d.width,this._height=d.height,this.dirty=!0)};vh.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};vh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Ws.LOADING,i=await n}catch(o){this._loadState=Ws.ERROR,this._loadError=o;return}this._id===e&&(this._loadState=Ws.LOADED,this.setImageSubRegion(i,t))};vh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Ws.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};vh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};vh.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var pg=vh;function Ri(e,t){e=e??Q.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=Mt.clone(r)),this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),this._actualPosition=m.clone(this._position),this._pixelOffset=M.clone(e.pixelOffset??M.ZERO),this._translate=new M(0,0),this._eyeOffset=m.clone(e.eyeOffset??m.ZERO),this._heightReference=e.heightReference??tt.NONE,this._verticalOrigin=e.verticalOrigin??vn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Bi.CENTER,this._scale=e.scale??1,this._color=D.clone(e.color??D.WHITE),this._rotation=e.rotation??0,this._alignedAxis=m.clone(e.alignedAxis??m.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new pg(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=se.SCENE3D,this._clusterShow=!0,this._outlineColor=D.clone(e.outlineColor??D.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Br.NONE,this._positionFromParent=!1}var cme=Ri.SHOW_INDEX=0,Zk=Ri.POSITION_INDEX=1,fme=Ri.PIXEL_OFFSET_INDEX=2,X8e=Ri.EYE_OFFSET_INDEX=3,P8e=Ri.HORIZONTAL_ORIGIN_INDEX=4,M8e=Ri.VERTICAL_ORIGIN_INDEX=5,U8e=Ri.SCALE_INDEX=6,lme=Ri.IMAGE_INDEX_INDEX=7,dme=Ri.COLOR_INDEX=8,D8e=Ri.ROTATION_INDEX=9,v8e=Ri.ALIGNED_AXIS_INDEX=10,k8e=Ri.SCALE_BY_DISTANCE_INDEX=11,Q8e=Ri.TRANSLUCENCY_BY_DISTANCE_INDEX=12,O8e=Ri.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,z8e=Ri.DISTANCE_DISPLAY_CONDITION=14,H8e=Ri.DISABLE_DEPTH_DISTANCE=15;Ri.TEXTURE_COORDINATE_BOUNDS=16;var ume=Ri.SDF_INDEX=17,K8e=Ri.SPLIT_DIRECTION_INDEX=18;Ri.NUMBER_OF_PROPERTIES=19;function Tr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Ri.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Tr(this,cme))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),Tr(this,Zk))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Tr(this,Zk))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;M.equals(t,e)||(M.clone(e,t),Tr(this,fme))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),Tr(this,k8e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),Tr(this,Q8e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;kt.equals(t,e)||(this._pixelOffsetScaleByDistance=kt.clone(e,t),Tr(this,O8e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),Tr(this,X8e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Tr(this,P8e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Tr(this,M8e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Tr(this,U8e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;D.equals(t,e)||(D.clone(e,t),Tr(this,dme))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Tr(this,D8e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),Tr(this,v8e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Tr(this,lme))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Tr(this,lme))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Tr(this,dme))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),Tr(this,z8e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Tr(this,H8e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),Tr(this,Zk)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Tr(this,cme))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;D.equals(t,e)||(D.clone(e,t),Tr(this,ume))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Tr(this,ume))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Tr(this,K8e))}}});Ri.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ri.prototype._updateClamping=function(){Ri._updateClamping(this._billboardCollection,this)};var Rk=new pe;Ri._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ie.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===tt.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===tt.NONE||t._positionFromParent||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(d){let u=i.cartographicToCartesian(d,t._clampedPosition);rS(t._heightReference)&&(t._mode===se.SCENE3D?(d.height+=s.height,i.cartographicToCartesian(d,u)):u.x+=s.height),t._clampedPosition=u}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),pe.clone(s,Rk);let c=n.getHeight(s,t._heightReference);l(c)&&(Rk.height=c),a(Rk)};Ri.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Ri.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Ri.prototype.setImageTexture=function(e){pg.clone(e,this._imageTexture)};var mme=512;Ri.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Kn();return}let n;typeof t=="string"?n=t:t instanceof Ge?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Kn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&J8e(n)&&(this._imageWidth=Math.min(this._width,mme),this._imageHeight=Math.min(this._height,mme))};function J8e(e){return l(e)?ch(e)?e.startsWith("data:image/svg+xml"):hA(e)==="svg":!1}Ri.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Ri.prototype._setTranslate=function(e){let t=this._translate;M.equals(t,e)||(M.clone(e,t),Tr(this,fme))};Ri.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ri.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),Tr(this,Zk)};var hme=new ce;Ri._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===se.SCENE3D?t:(F.multiplyByPoint(i,t,hme),no.computeActualEllipsoidPosition(n,hme))};var pme=new m;Ri._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,pme),a=no.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return M.add(a,i,a),a};var _k=new M(0,0);Ri.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new M),M.clone(this._pixelOffset,_k),M.add(_k,this._translate,_k);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==se.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,Rk);o=a.cartographicToCartesian(c,pme),i=F.IDENTITY}return Ri._computeScreenSpacePosition(i,o,this._eyeOffset,_k,e,t)};Ri.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===Bi.RIGHT?s-=i:e.horizontalOrigin===Bi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===vn.BOTTOM||e.verticalOrigin===vn.BASELINE?a-=o:e.verticalOrigin===vn.CENTER&&(a-=o*.5),l(n)||(n=new $e),n.x=s,n.y=a,n.width=i,n.height=o,n};Ri.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&D.equals(this._color,e._color)&&M.equals(this._pixelOffset,e._pixelOffset)&&M.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Ri.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Zo=Ri;var PHn=y(x(),1),j8e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Jo=Object.freeze(j8e);var UHn=y(x(),1),q8e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},_a=Object.freeze(q8e);var $8e=Zo.SHOW_INDEX,_2=Zo.POSITION_INDEX,Ame=Zo.PIXEL_OFFSET_INDEX,gme=Zo.EYE_OFFSET_INDEX,e7e=Zo.HORIZONTAL_ORIGIN_INDEX,t7e=Zo.VERTICAL_ORIGIN_INDEX,n7e=Zo.SCALE_INDEX,FC=Zo.IMAGE_INDEX_INDEX,bme=Zo.COLOR_INDEX,i7e=Zo.ROTATION_INDEX,o7e=Zo.ALIGNED_AXIS_INDEX,yme=Zo.SCALE_BY_DISTANCE_INDEX,xme=Zo.TRANSLUCENCY_BY_DISTANCE_INDEX,Cme=Zo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Eme=Zo.DISTANCE_DISPLAY_CONDITION,r7e=Zo.DISABLE_DEPTH_DISTANCE,s7e=Zo.TEXTURE_COORDINATE_BOUNDS,Tme=Zo.SDF_INDEX,Sme=Zo.SPLIT_DIRECTION_INDEX,LJ=Zo.NUMBER_OF_PROPERTIES,Ro,a7e={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,splitDirection:12},c7e={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,splitDirection:13};function ym(e){e=e??Q.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new Tx),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._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(LJ),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Jo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._buffersUsage=[Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW],this._highlightColor=D.clone(D.WHITE),this._coarseDepthTestDistance=ie.default.minimumRadius/100,this._threePointDepthTestDistance=ie.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(ym.prototype,{length:{get:function(){return WJ(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)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}}});function Ime(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ym.prototype.add=function(e){let t=new Zo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};ym.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ym.prototype.removeAll=function(){Ime(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function WJ(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}ym.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};ym.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};ym.prototype.get=function(e){return WJ(this),this._billboards[e]};var IJ;function l7e(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=mt.createIndexBuffer({context:e,typedArray:o,usage:Xe.STATIC_DRAW,indexDatatype:Pe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function d7e(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=mt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Xe.STATIC_DRAW,indexDatatype:Pe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function u7e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=mt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Xe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}ym.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<LJ;++i){let o=n[i]===0?Xe.STATIC_DRAW:Xe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function m7e(e,t,n,i,o,r){let s=[{index:Ro.positionHighAndScale,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[_2]},{index:Ro.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[_2]},{index:Ro.compressedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Ame]},{index:Ro.compressedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[xme]},{index:Ro.compressedAttribute2,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[bme]},{index:Ro.eyeOffset,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[gme]},{index:Ro.scaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[yme]},{index:Ro.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Cme]},{index:Ro.compressedAttribute3,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Eme]},{index:Ro.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[s7e]},{index:Ro.splitDirection,componentsPerAttribute:1,componentDatatype:J.FLOAT,usage:n[Sme]}];i&&s.push({index:Ro.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:u7e(e)}),l(o)&&s.push({index:Ro.a_batchId,componentsPerAttribute:1,componentDatatype:J.FLOAT,bufferUsage:Xe.STATIC_DRAW}),r&&s.push({index:Ro.sdf,componentsPerAttribute:2,componentDatatype:J.FLOAT,usage:n[Tme]});let a=i?t:4*t;return new TA(e,s,a,i)}var _J=new ti;function _me(e,t,n,i){let o,r=n[Ro.positionHighAndScale],s=n[Ro.positionLowAndRotation],a=i._getActualPosition();e._mode===se.SCENE3D&&(ue.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),ti.fromCartesian(a,_J);let c=i.scale,d=i.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);let u=_J.high,h=_J.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c),s(o,h.x,h.y,h.z,d)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c),r(o+1,u.x,u.y,u.z,c),r(o+2,u.x,u.y,u.z,c),r(o+3,u.x,u.y,u.z,c),s(o+0,h.x,h.y,h.z,d),s(o+1,h.x,h.y,h.z,d),s(o+2,h.x,h.y,h.z,d),s(o+3,h.x,h.y,h.z,d))}var gd=new M,bm=32768,TI=65536,ZJ=4096,mp=256,h7e=128,f7e=32,p7e=8,Gk=4,A7e=1/256,Zme=0,Rme=2,Gme=3,Vme=1,FJ=new $e;function Lme(e,t,n,i){let o,r=n[Ro.compressedAttribute0],s=i.pixelOffset,a=s.x,c=s.y,d=i._translate,u=d.x,h=d.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+u),Math.abs(-c+h));let p=i.horizontalOrigin,g=i._verticalOrigin,f=i.show&&i.clusterShow;i.color.alpha===0&&(f=!1),g===vn.BASELINE&&(g=vn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===Bi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&g===vn.CENTER;let b=0,C=0,E=0,T=0;if(i.ready){let w=i.computeTextureCoordinates(FJ);b=w.x,C=w.y,E=w.width,T=w.height}let S=b+E,_=C+T,R=Math.floor(V.clamp(a,-bm,bm)+bm)*h7e;R+=(p+1)*f7e,R+=(g+1)*p7e,R+=(f?1:0)*Gk;let L=Math.floor(V.clamp(c,-bm,bm)+bm)*mp,W=Math.floor(V.clamp(u*Gk,-bm,bm)+bm)*mp,B=(V.clamp(h*Gk,-bm,bm)+bm)*A7e,Y=Math.floor(B),N=Math.floor((B-Y)*mp);L+=Y,W+=N,gd.x=b,gd.y=C;let A=_n.compressTextureCoordinates(gd);gd.x=S;let I=_n.compressTextureCoordinates(gd);gd.y=_;let Z=_n.compressTextureCoordinates(gd);gd.x=b;let G=_n.compressTextureCoordinates(gd);e._instanced?(o=i._index,r(o,R,L,W,A)):(o=i._index*4,r(o+0,R+Zme,L,W,A),r(o+1,R+Rme,L,W,I),r(o+2,R+Gme,L,W,Z),r(o+3,R+Vme,L,W,G))}function Wme(e,t,n,i){let o,r=n[Ro.compressedAttribute1],s=i.alignedAxis;m.equals(s,m.ZERO)||(e._shaderAlignedAxis=!0);let a=0,c=1,d=1,u=1,h=i.translucencyByDistance;l(h)&&(a=h.near,c=h.nearValue,d=h.far,u=h.farValue,(c!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let p=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,p);let g=V.clamp(p,0,TI),f=0;Math.abs(m.magnitudeSquared(s)-1)<V.EPSILON6&&(f=_n.octEncodeFloat(s)),c=V.clamp(c,0,1),c=c===1?255:c*255|0,g=g*mp+c,u=V.clamp(u,0,1),u=u===1?255:u*255|0,f=f*mp+u,e._instanced?(o=i._index,r(o,g,f,a,d)):(o=i._index*4,r(o+0,g,f,a,d),r(o+1,g,f,a,d),r(o+2,g,f,a,d),r(o+3,g,f,a,d))}function GJ(e,t,n,i){let o,r=n[Ro.compressedAttribute2],s=i.color,a=l(e._batchTable)?D.WHITE:i.getPickId(t.context).color,c=i.sizeInMeters?1:0,d=Math.abs(m.magnitudeSquared(i.alignedAxis)-1)<V.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&c===1;let u=i.height??0;e._maxSize=Math.max(e._maxSize,u);let h=i._labelHorizontalOrigin??-2;h+=2;let p=u*Gk+h,g=D.floatToByte(s.red),f=D.floatToByte(s.green),b=D.floatToByte(s.blue),C=g*TI+f*mp+b;g=D.floatToByte(a.red),f=D.floatToByte(a.green),b=D.floatToByte(a.blue);let E=g*TI+f*mp+b,T=D.floatToByte(s.alpha)*TI+D.floatToByte(a.alpha)*mp;T+=c*2+d,e._instanced?(o=i._index,r(o,C,E,T,p)):(o=i._index*4,r(o+0,C,E,T,p),r(o+1,C,E,T,p),r(o+2,C,E,T,p),r(o+3,C,E,T,p))}function VJ(e,t,n,i){let o,r=n[Ro.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==tt.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(gd.x=0,gd.y=0,i.ready){let d=i.computeTextureCoordinates(FJ);gd.x=d.width,gd.y=d.height}let c=_n.compressTextureCoordinates(gd);o=i._index,r(o,s.x,s.y,a,c)}else o=i._index*4,r(o+0,s.x,s.y,a,0),r(o+1,s.x,s.y,a,0),r(o+2,s.x,s.y,a,0),r(o+3,s.x,s.y,a,0)}function Fme(e,t,n,i){let o,r=n[Ro.scaleByDistance],s=0,a=1,c=1,d=1,u=i.scaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,d)):(o=i._index*4,r(o+0,s,a,c,d),r(o+1,s,a,c,d),r(o+2,s,a,c,d),r(o+3,s,a,c,d))}function Bme(e,t,n,i){let o,r=n[Ro.pixelOffsetScaleByDistance],s=0,a=1,c=1,d=1,u=i.pixelOffsetScaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,d)):(o=i._index*4,r(o+0,s,a,c,d),r(o+1,s,a,c,d),r(o+2,s,a,c,d),r(o+3,s,a,c,d))}function wme(e,t,n,i){let o,r=n[Ro.compressedAttribute3],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance,u=em(i.heightReference)&&t.context.depthTexture;d*=d,(u||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let h,p;l(i._labelDimensions)?(p=i._labelDimensions.x,h=i._labelDimensions.y):(p=i.width??0,h=i.height??0);let g=Math.floor(V.clamp(p,0,ZJ)),f=Math.floor(V.clamp(h,0,ZJ)),b=g*ZJ+f;e._instanced?(o=i._index,r(o,s,a,d,b)):(o=i._index*4,r(o+0,s,a,d,b),r(o+1,s,a,d,b),r(o+2,s,a,d,b),r(o+3,s,a,d,b))}function Yme(e,t,n,i){if(em(i.heightReference)){let p=e._scene,g=t.context,f=t.globeTranslucencyState.translucent,b=l(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=g.depthTexture&&!f&&b}let o,r=n[Ro.textureCoordinateBoundsOrLabelTranslate];if(Yt.maximumVertexTextureImageUnits>0){let p=0,g=0;l(i._labelTranslate)&&(p=i._labelTranslate.x,g=i._labelTranslate.y),e._instanced?(o=i._index,r(o,p,g,0,0)):(o=i._index*4,r(o+0,p,g,0,0),r(o+1,p,g,0,0),r(o+2,p,g,0,0),r(o+3,p,g,0,0));return}let s=0,a=0,c=0,d=0;if(i.ready){let p=i.computeTextureCoordinates(FJ);s=p.x,a=p.y,c=p.width,d=p.height}let u=s+c,h=a+d;e._instanced?(o=i._index,r(o,s,a,u,h)):(o=i._index*4,r(o+0,s,a,u,h),r(o+1,s,a,u,h),r(o+2,s,a,u,h),r(o+3,s,a,u,h))}function g7e(e,t,n,i){if(!l(e._batchTable))return;let o=n[Ro.a_batchId],r=i._batchIndex,s;e._instanced?(s=i._index,o(s,r)):(s=i._index*4,o(s+0,r),o(s+1,r),o(s+2,r),o(s+3,r))}function Nme(e,t,n,i){if(!e._sdf)return;let o,r=n[Ro.sdf],s=i.outlineColor,a=i.outlineWidth,c=D.floatToByte(s.red),d=D.floatToByte(s.green),u=D.floatToByte(s.blue),h=c*TI+d*mp+u,p=a/_a.RADIUS,g=D.floatToByte(s.alpha)*TI+D.floatToByte(p)*mp;e._instanced?(o=i._index,r(o,h,g)):(o=i._index*4,r(o+0,h+Zme,g),r(o+1,h+Rme,g),r(o+2,h+Gme,g),r(o+3,h+Vme,g))}function Xme(e,t,n,i){let o=n[Ro.splitDirection],r=0,s=i.splitDirection;l(s)&&(r=s);let a;e._instanced?(a=i._index,o(a,r)):(a=i._index*4,o(a+0,r),o(a+1,r),o(a+2,r),o(a+3,r))}function b7e(e,t,n,i){_me(e,t,n,i),Lme(e,t,n,i),Wme(e,t,n,i),GJ(e,t,n,i),VJ(e,t,n,i),Fme(e,t,n,i),Bme(e,t,n,i),wme(e,t,n,i),Yme(e,t,n,i),g7e(e,t,n,i),Nme(e,t,n,i),Xme(e,t,n,i)}function RJ(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,h=Zo._computeActualPosition(d,u,i,o);l(h)&&(d._setActualPosition(h),r?a.push(h):ue.expand(s,h,s))}r&&ue.fromPoints(a,s)}function y7e(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&RJ(e,i,i.length,t,r,!0)):n===se.MORPHING?RJ(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&RJ(e,o,e._billboardsToUpdateIndex,t,r,!1)}function x7e(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function C7e(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; 
in vec2 v_textureCoordinates; 
void main() 
{ 
    out_FragColor = texture(billboard_texture, v_textureCoordinates); 
} 
`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ve.OVERLAY,i}var E7e=[];ym.prototype.update=function(e){if(WJ(this),!this.show)return;let t=e.context;(!t.instancedArrays||!(Yt.maximumVertexTextureImageUnits>0))&&Ms("Billboard-unsupported-ANGLE_instanced_arrays","Beginning in CesiumJS 1.140, billboards and labels will require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053"),this._instanced=t.instancedArrays,Ro=this._instanced?c7e:a7e,IJ=this._instanced?d7e:l7e;let n=this._billboards,i=n.length,o=!0;for(let B=0;B<i;++B){let Y=n[B];l(Y.loadError)&&(console.error(`Error loading image for billboard: ${Y.loadError}`),Y.image=void 0),Y.textureDirty&&this._updateBillboard(Y,FC),Y.show&&(o=o&&Y.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;y7e(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,d=r.guid,u=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;let h,p=e.passes,g=p.pick;if(u||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let B=0;B<LJ;++B)c[B]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=m7e(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let B=0;B<i;++B){let Y=this._billboards[B];Y._dirty=!1,Y.textureDirty=!1,b7e(this,e,h,Y)}this._vaf.commit(IJ(t))}this._billboardsToUpdateIndex=0}else if(a>0){let B=E7e;B.length=0,(c[_2]||c[i7e]||c[n7e])&&B.push(_me),(c[FC]||c[Ame]||c[e7e]||c[t7e]||c[$8e])&&(B.push(Lme),this._instanced&&B.push(VJ)),(c[FC]||c[o7e]||c[xme])&&(B.push(Wme),B.push(GJ)),(c[FC]||c[bme])&&B.push(GJ),(c[FC]||c[gme])&&B.push(VJ),c[yme]&&B.push(Fme),c[Cme]&&B.push(Bme),(c[Eme]||c[r7e]||c[FC]||c[_2])&&B.push(wme),(c[FC]||c[_2])&&B.push(Yme),c[Tme]&&B.push(Nme),c[Sme]&&B.push(Xme);let Y=B.length;if(h=this._vaf.writers,a/i>.1){for(let N=0;N<a;++N){let A=s[N];A._dirty=!1,A.textureDirty=!1;for(let I=0;I<Y;++I)B[I](this,e,h,A)}this._vaf.commit(IJ(t))}else{for(let N=0;N<a;++N){let A=s[N];A._dirty=!1,A.textureDirty=!1;for(let I=0;I<Y;++I)B[I](this,e,h,A);this._instanced?this._vaf.subCommit(A._index,1):this._vaf.subCommit(A._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,b=F.IDENTITY;e.mode===se.SCENE3D?(b=this.modelMatrix,f=ue.clone(this._baseVolumeWC,this._boundingVolume)):f=ue.clone(this._baseVolume2D,this._boundingVolume),x7e(this,e,f);let C=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,C){this._blendOption===Jo.OPAQUE||this._blendOption===Jo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ke.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!0}):this._rsOpaque=void 0;let B=this._blendOption===Jo.TRANSLUCENT;this._blendOption===Jo.TRANSLUCENT||this._blendOption===Jo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ke.fromCache({depthTest:{enabled:!0,func:B?ne.LEQUAL:ne.LESS},depthMask:B,blending:fn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let E,T,S,_,R,L=Yt.maximumVertexTextureImageUnits>0;if(C||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){E=I2,T=S2,R=[],l(this._batchTable)&&(R.push("VECTOR_TILE"),E=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(E),T=this._batchTable.getFragmentShaderCallback(!1,void 0)(T)),S=new ze({defines:R,sources:[E]}),this._instanced&&S.defines.push("INSTANCED"),this._shaderRotation&&S.defines.push("ROTATION"),this._shaderAlignedAxis&&S.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&S.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&S.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&S.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&S.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&S.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(L?S.defines.push("VS_THREE_POINT_DEPTH_CHECK"):S.defines.push("FS_THREE_POINT_DEPTH_CHECK"));let B=1-_a.CUTOFF;this._sdf&&S.defines.push("SDF");let Y=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Jo.OPAQUE_AND_TRANSLUCENT&&(_=new ze({defines:["OPAQUE",Y],sources:[T]}),this._shaderClampToGround&&(L?_.defines.push("VS_THREE_POINT_DEPTH_CHECK"):_.defines.push("FS_THREE_POINT_DEPTH_CHECK")),this._sdf&&(_.defines.push("SDF"),_.defines.push(`SDF_EDGE ${B}`)),this._sp=cn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:S,fragmentShaderSource:_,attributeLocations:Ro}),_=new ze({defines:["TRANSLUCENT",Y],sources:[T]}),this._shaderClampToGround&&(L?_.defines.push("VS_THREE_POINT_DEPTH_CHECK"):_.defines.push("FS_THREE_POINT_DEPTH_CHECK")),this._sdf&&(_.defines.push("SDF"),_.defines.push(`SDF_EDGE ${B}`)),this._spTranslucent=cn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:S,fragmentShaderSource:_,attributeLocations:Ro})),this._blendOption===Jo.OPAQUE&&(_=new ze({defines:[Y],sources:[T]}),this._shaderClampToGround&&(L?_.defines.push("VS_THREE_POINT_DEPTH_CHECK"):_.defines.push("FS_THREE_POINT_DEPTH_CHECK")),this._sdf&&(_.defines.push("SDF"),_.defines.push(`SDF_EDGE ${B}`)),this._sp=cn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:S,fragmentShaderSource:_,attributeLocations:Ro})),this._blendOption===Jo.TRANSLUCENT&&(_=new ze({defines:[Y],sources:[T]}),this._shaderClampToGround&&(L?_.defines.push("VS_THREE_POINT_DEPTH_CHECK"):_.defines.push("FS_THREE_POINT_DEPTH_CHECK")),this._sdf&&(_.defines.push("SDF"),_.defines.push(`SDF_EDGE ${B}`)),this._spTranslucent=cn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:S,fragmentShaderSource:_,attributeLocations:Ro})),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}let W=e.commandList;if(p.render||p.pick){let B=this._colorCommands,Y=this._blendOption===Jo.OPAQUE,N=this._blendOption===Jo.OPAQUE_AND_TRANSLUCENT,A=this._vaf.va,I=A.length,Z=this._uniforms,G;l(this._batchTable)?(Z=this._batchTable.getUniformMapCallback()(Z),G=this._batchTable.getPickId()):G="v_pickColor",B.length=I;let w=N?I*2:I;for(let X=0;X<w;++X){let v=B[X];l(v)||(v=B[X]=new nt);let U=Y||N&&X%2===0;v.pass=U||!N?Ve.OPAQUE:Ve.TRANSLUCENT,v.owner=this;let k=N?Math.floor(X/2):X;v.boundingVolume=f,v.modelMatrix=b,v.count=A[k].indicesCount,v.shaderProgram=U?this._sp:this._spTranslucent,v.uniformMap=Z,v.vertexArray=A[k].va,v.renderState=U?this._rsOpaque:this._rsTranslucent,v.debugShowBoundingVolume=this.debugShowBoundingVolume,v.pickId=G,this._instanced&&(v.count=6,v.instanceCount=i),W.push(v)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=C7e(this,e.context)),W.push(this.debugCommand))}this._allBillboardsReady=o};ym.prototype.isDestroyed=function(){return!1};ym.prototype.destroy=function(){return l(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(),Ime(this._billboards),fe(this)};var ru=ym;var wKn=y(x(),1);var RKn=y(x(),1);function T7e(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var BC=T7e;function Ka(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,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),SI(this)}var S7e=new pe;Object.defineProperties(Ka.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=D.clone(e,this._color),SI(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,SI(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=D.clone(e,this._pointOutlineColor),SI(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,SI(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){l(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){let t=this._heightOffset??0,n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,S7e);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=D.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&SI(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(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});Ka.defaultColor=D.WHITE;Ka.defaultPointOutlineColor=D.BLACK;Ka.defaultPointOutlineWidth=0;Ka.defaultPointSize=8;function SI(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=e._color??Ka.defaultColor,i=e._pointOutlineColor??Ka.defaultPointOutlineColor,o=e._pointOutlineWidth??Ka.defaultPointOutlineWidth,r=e._pointSize??Ka.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(D.equals(n,s)&&D.equals(i,a)&&o===c&&r===d)return;e._billboardColor=D.clone(n,e._billboardColor),e._billboardOutlineColor=D.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([h,r,p,o]);t.setImage(g,BC(u,h,p,o,r))}Ka.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Ka.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Ka.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Ka.prototype.getPropertyInherited=function(e){return Ea.getPropertyInherited(this._content,this._batchId,e)};Ka.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Ka.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Ka.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Ka.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ag=Ka;var RJn=y(x(),1);var MKn=y(x(),1);function I7e(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let o=Math.round(n.actualBoundingBoxAscent),r=Math.round(n.actualBoundingBoxDescent),s=Math.max(o+r,1);return{width:n.width,height:s,ascent:o,descent:r,minx:-Math.round(n.actualBoundingBoxLeft)}}var wC;function _7e(e,t){if(e==="")return;t=t??Q.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??D.TRANSPARENT,a=t.padding??0,c=a*2,d=document.createElement("canvas");d.width=1,d.height=1,d.style.font=n;let u=d.getContext("2d",{willReadFrequently:!0});l(wC)||(l(u.imageSmoothingEnabled)?wC="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?wC="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?wC="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&(wC="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[wC]=!1,d.style.visibility="hidden",document.body.appendChild(d);let h=I7e(u,e);d.dimensions=h,document.body.removeChild(d),d.style.visibility="";let p=!/\S/.test(e),g=i&&!p?Math.ceil(r/2):0,f=g*2,b=-h.minx+g,C=Math.ceil(h.width)+b+c+g,E=h.height+c+f,T=h.ascent+a+g;if(d.width=C,d.height=E,u.font=n,u.lineJoin="round",u.lineWidth=r,u[wC]=!1,s!==D.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let S=t.strokeColor??D.BLACK;u.strokeStyle=S.toCssColorString(),u.strokeText(e,b+a,T)}if(o){let S=t.fillColor??D.WHITE;u.fillStyle=S.toCssColorString(),u.fillText(e,b+a,T)}return d}var YC=_7e;var Jme=y(Dme(),1);var sJn=y(x(),1);var kKn=y(x(),1),R7e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},cr=Object.freeze(R7e);var vme={},kme=0,G7e=256,V7e=new D(.165,.165,.165,.8),L7e=new M(7,5),vs=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function NC(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function R2(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function G2(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Ome(e){let t=vme[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(G2(n,"line-height"));isNaN(i)&&(i=void 0),t={family:G2(n,"font-family"),size:G2(n,"font-size").replace("px",""),style:G2(n,"font-style"),weight:G2(n,"font-weight"),lineHeight:i},document.body.removeChild(n),kme<G7e&&(vme[e._font]=t,kme++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function kh(e,t){e=e??Q.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=Mt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=D.clone(e.fillColor??D.WHITE),this._outlineColor=D.clone(e.outlineColor??D.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=D.clone(e.backgroundColor??V7e),this._backgroundPadding=M.clone(e.backgroundPadding??L7e),this._style=e.style??cr.FILL,this._verticalOrigin=e.verticalOrigin??vn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Bi.LEFT,this._pixelOffset=M.clone(e.pixelOffset??M.ZERO),this._eyeOffset=m.clone(e.eyeOffset??m.ZERO),this._position=m.clone(e.position??m.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??tt.NONE,this._distanceDisplayCondition=r,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=e.text??"",this._relativeSize=1,Ome(this),this._updateClamping()}Object.defineProperties(kh.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),R2(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=kh.filterUnsupportedCharacters(e);this._renderedText=kh.enableRightToLeftDetection?N7e(t):t,NC(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,NC(this),Ome(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;D.equals(t,e)||(D.clone(e,t),NC(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;D.equals(t,e)||(D.clone(e,t),NC(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,NC(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,NC(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!D.equals(t,e)){D.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;M.equals(t,e)||(M.clone(e,t),R2(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,NC(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!M.equals(t,e)){M.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!kt.equals(t,e)){this._translucencyByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!kt.equals(t,e)){this._pixelOffsetScaleByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!kt.equals(t,e)){this._scaleByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,R2(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),R2(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),R2(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Mt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});kh.prototype._updateClamping=function(){Zo._updateClamping(this._labelCollection,this)};kh.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new M);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Zo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};kh.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===vn.BOTTOM||e.verticalOrigin===vn.BASELINE?o-=s:e.verticalOrigin===vn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let d=0,u=0,h=e._glyphs,p=h.length;for(let g=0;g<p;++g){let f=h[g],b=f.billboard;if(!l(b))continue;let C=t.x+b._translate.x,E=t.y-b._translate.y,T=f.dimensions.width*a,S=f.dimensions.height*a;e.verticalOrigin===vn.BOTTOM||e.verticalOrigin===vn.BASELINE?E-=S:e.verticalOrigin===vn.CENTER&&(E-=S*.5),e._verticalOrigin===vn.TOP?E+=_a.PADDING*a:(e._verticalOrigin===vn.BOTTOM||e._verticalOrigin===vn.BASELINE)&&(E-=_a.PADDING*a),i=Math.min(i,C),o=Math.min(o,E),d=Math.max(d,C+T),u=Math.max(u,E+S)}r=d-i,s=u-o}return l(n)||(n=new $e),n.x=i,n.y=o,n.width=r,n.height=s,n};kh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};kh.prototype.equals=function(e){return this===e||l(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&&m.equals(this._position,e._position)&&D.equals(this._fillColor,e._fillColor)&&D.equals(this._outlineColor,e._outlineColor)&&D.equals(this._backgroundColor,e._backgroundColor)&&M.equals(this._backgroundPadding,e._backgroundPadding)&&M.equals(this._pixelOffset,e._pixelOffset)&&m.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};kh.prototype.isDestroyed=function(){return!1};kh.enableRightToLeftDetection=!1;function W7e(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=vs.LTR,a="",c=e.length;for(let d=0;d<c;++d){let u=e.charAt(d);t.test(u)?a=vs.RTL:n.test(u)?a=vs.LTR:i.test(u)?a=vs.BRACKETS:a=vs.WEAK,d===0&&(s=a),s===a&&a!==vs.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function F7e(e){return e.split("").reverse().join("")}function V2(e,t,n){return e.slice(0,t)+n+e.slice(t)}function B7e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var w7e="\u05D0-\u05EA",Y7e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Qme=new RegExp(`[${w7e}${Y7e}]`);function N7e(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Qme.test(o.charAt(0)),s=W7e(o,Qme),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],h=u.Type===vs.BRACKETS?B7e(u.Word):F7e(u.Word);r?u.Type===vs.RTL?(c=h+c,a=0):u.Type===vs.LTR?(c=V2(c,a,u.Word),a+=u.Word.length):(u.Type===vs.WEAK||u.Type===vs.BRACKETS)&&(u.Type===vs.WEAK&&s[d-1].Type===vs.BRACKETS?c=h+c:s[d-1].Type===vs.RTL?(c=h+c,a=0):s.length>d+1?s[d+1].Type===vs.RTL?(c=h+c,a=0):(c=V2(c,a,u.Word),a+=u.Word.length):c=V2(c,0,h)):u.Type===vs.RTL?c=V2(c,a,h):u.Type===vs.LTR?(c+=u.Word,a=c.length):(u.Type===vs.WEAK||u.Type===vs.BRACKETS)&&(d>0&&s[d-1].Type===vs.RTL?s.length>d+1?s[d+1].Type===vs.RTL?c=V2(c,a,h):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i<t.length-1&&(n+=`
`)}return n}var X0=kh;var jme=y(zme(),1);function P7e(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var M7e=1.2,Hme="ID_WHITE_PIXEL",BJ=new M(4,4),U7e=new $e(1,1,1,1);function D7e(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=BJ.x,o.height=BJ.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(Hme,o),n.addImageSubRegion(Hme,U7e)}let i=e.add({collection:t});return i.setImageTexture(n),i}var gg={};function v7e(e,t,n,i,o,r){return gg.font=t,gg.fillColor=n,gg.strokeColor=i,gg.strokeWidth=o,gg.padding=_a.PADDING,gg.fill=r===cr.FILL||r===cr.FILL_AND_OUTLINE,gg.stroke=r===cr.OUTLINE||r===cr.FILL_AND_OUTLINE,gg.backgroundColor=D.BLACK,YC(e,gg)}function wJ(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var k7e=new jme.default,Q7e=/\s/;function O7e(e,t){let n=t._renderedText,i=k7e.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/_a.FONT_SIZE,o<s)for(let p=o;p<s;++p)wJ(e,r[p]);r.length=o;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=D7e(c,e),t._backgroundBillboard=a),z7e(c,t,a);let d=e._glyphBillboardCollection,u=d.billboardTextureCache,h=e._textDimensionsCache;for(let p=0;p<o;++p){let g=i[p],f=t._verticalOrigin,b=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+f]),C=h[b],E=u.get(b);if(!l(E)||!l(C)){E=new pg(d),u.set(b,E);let R=`${t._fontStyle} ${t._fontWeight} ${_a.FONT_SIZE}px ${t._fontFamily}`,L=v7e(g,R,D.WHITE,D.WHITE,0,cr.FILL);if(C=L.dimensions,h[b]=C,L.width>0&&L.height>0&&!Q7e.test(g)){let W=(0,Jme.default)(L,{cutoff:_a.CUTOFF,radius:_a.RADIUS}),B=L.getContext("2d"),Y=L.width,N=L.height,A=B.getImageData(0,0,Y,N);for(let I=0;I<Y;I++)for(let Z=0;Z<N;Z++){let G=Z*Y+I,w=W[G]*255,X=G*4;A.data[X+0]=w,A.data[X+1]=w,A.data[X+2]=w,A.data[X+3]=w}B.putImageData(A,0,0),E.loadImage(b,L)}}let T=r[p];if(l(T)||(T=new P7e,T.dimensions=C,T.billboardTexture=E,r[p]=T),T.billboardTexture.id!==b&&(T.billboardTexture=E,T.dimensions=C),!E.hasImage){wJ(e,T);continue}let S=T.billboard,_=e._spareBillboards;l(S)||(_.length>0?S=_.pop():(S=d.add({collection:e}),S._labelDimensions=new M,S._labelTranslate=new M,S._positionFromParent=!0),T.billboard=S),S.setImageTexture(E),S.show=t._show,S.position=t._position,S.eyeOffset=t._eyeOffset,S.pixelOffset=t._pixelOffset,S.horizontalOrigin=Bi.LEFT,S.verticalOrigin=t._verticalOrigin,S.heightReference=t._heightReference,S.scale=t.totalScale,S.pickPrimitive=t,S.id=t._id,S.translucencyByDistance=t._translucencyByDistance,S.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,S.scaleByDistance=t._scaleByDistance,S.distanceDisplayCondition=t._distanceDisplayCondition,S.disableDepthTestDistance=t._disableDepthTestDistance,S._batchIndex=t._batchIndex,S.outlineColor=t.outlineColor,t.style===cr.FILL_AND_OUTLINE?(S.color=t._fillColor,S.outlineWidth=t.outlineWidth):t.style===cr.FILL?(S.color=t._fillColor,S.outlineWidth=0):t.style===cr.OUTLINE&&(S.color=D.TRANSPARENT,S.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function z7e(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(`
`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=n=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Bi.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function Kme(e,t,n){return t===Bi.CENTER?-e/2:t===Bi.RIGHT?-(e+n.x):n.x}var Nr=new M,H7e=new M;function K7e(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,d=t.length,u=e._backgroundBillboard,h=M.clone(l(u)?e._backgroundPadding:M.ZERO,H7e);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let Y=0;Y<d;++Y){if(n.charAt(Y)===`
`){r.push(i),++c,i=0;continue}let A=t[Y].dimensions;l(A)&&(a=Math.max(a,A.height-A.descent),s=Math.max(s,A.descent),i+=A.width-A.minx,Y<d-1&&(i+=t[Y+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,g=e.totalScale,f=e._horizontalOrigin,b=e._verticalOrigin,C=0,E=r[C],T=Kme(E,f,h),S=(l(e._lineHeight)?e._lineHeight:M7e*e._fontSize)/e._relativeSize,_=S*(c-1),R=o,L=p+_;l(u)&&(R+=h.x*2,L+=h.y*2,u._labelHorizontalOrigin=f),Nr.x=T*g,Nr.y=0;let W=!0,B=0;for(let Y=0;Y<d;++Y){if(n.charAt(Y)===`
`){++C,B+=S,E=r[C],T=Kme(E,f,h),Nr.x=T*g,W=!0;continue}let N=t[Y],A=N.dimensions;if(l(A)&&(b===vn.TOP?(Nr.y=A.height-a-h.y,Nr.y+=_a.PADDING):b===vn.CENTER?Nr.y=(_+A.height-a)/2:b===vn.BASELINE?(Nr.y=_,Nr.y-=_a.PADDING):(Nr.y=_+s+h.y,Nr.y-=_a.PADDING),Nr.y=(Nr.y-A.descent-B)*g,W&&(Nr.x-=_a.PADDING*g,W=!1),l(N.billboard)&&(N.billboard._setTranslate(Nr),N.billboard._labelDimensions.x=R,N.billboard._labelDimensions.y=L,N.billboard._labelHorizontalOrigin=f),Y<d-1)){let I=t[Y+1];Nr.x+=(A.width-A.minx+I.dimensions.minx)*g}}if(l(u)&&n.split(`
`).join("").length>0&&(f===Bi.CENTER?T=-o/2-h.x:f===Bi.RIGHT?T=-(o+h.x*2):T=0,Nr.x=T*g,b===vn.TOP?Nr.y=p-a-s:b===vn.CENTER?Nr.y=(p-a)/2-s:b===vn.BASELINE?Nr.y=-h.y-s:Nr.y=0,Nr.y=Nr.y*g,u.width=R,u.height=L,u._setTranslate(Nr),u._labelTranslate=M.clone(Nr,u._labelTranslate)),em(e.heightReference))for(let Y=0;Y<d;++Y){let A=t[Y].billboard;l(A)&&(A._labelTranslate=M.clone(Nr,A._labelTranslate))}}function qme(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)wJ(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),fe(t)}function hp(e){e=e??Q.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new ru({scene:this._scene,textureAtlas:new Tx({initialSize:BJ})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new pg(t),this._glyphBillboardCollection=new ru({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=D.clone(D.WHITE),this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Jo.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(hp.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}}});hp.prototype.add=function(e){let t=new X0(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};hp.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),qme(this,e),!0}return!1};hp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)qme(this,e[t]);e.length=0};hp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};hp.prototype.get=function(e){return this._labels[e]};hp.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let r=0;r<i;++r){let s=this._labelsToUpdate[r];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&(O7e(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(K7e(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let o=n.length>0?Jo.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};hp.prototype.isDestroyed=function(){return!1};hp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),fe(this)};var fp=hp;var Xjn=y(x(),1);var VJn=y(x(),1),L2=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 position2DHigh;
in vec3 position2DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 prevPosition2DHigh;
in vec3 prevPosition2DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec3 nextPosition2DHigh;
in vec3 nextPosition2DLow;
in vec4 texCoordExpandAndBatchIndex;

out vec2  v_st;
out float v_width;
out vec4 v_pickColor;
out float v_polylineAngle;

void main()
{
    float texCoord = texCoordExpandAndBatchIndex.x;
    float expandDir = texCoordExpandAndBatchIndex.y;
    bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;
    float batchTableIndex = texCoordExpandAndBatchIndex.w;

    vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);
    float width = widthAndShow.x + 0.5;
    float show = widthAndShow.y;

    if (width < 1.0)
    {
        show = 0.0;
    }

    vec4 pickColor = batchTable_getPickColor(batchTableIndex);

    vec4 p, prev, next;
    if (czm_morphTime == 1.0)
    {
        p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);
        prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);
        next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);
    }
    else if (czm_morphTime == 0.0)
    {
        p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
        prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);
        next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);
    }
    else
    {
        p = czm_columbusViewMorph(
                czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),
                czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),
                czm_morphTime);
        prev = czm_columbusViewMorph(
                czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),
                czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),
                czm_morphTime);
        next = czm_columbusViewMorph(
                czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),
                czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),
                czm_morphTime);
    }

    #ifdef DISTANCE_DISPLAY_CONDITION
        vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);
        vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);
        vec3 centerLow = centerLowAndRadius.xyz;
        float radius = centerLowAndRadius.w;
        vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);

        float lengthSq;
        if (czm_sceneMode == czm_sceneMode2D)
        {
            lengthSq = czm_eyeHeight2D.y;
        }
        else
        {
            vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);
            lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);
        }

        float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
        float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
        if (lengthSq < nearSq || lengthSq > farSq)
        {
            show = 0.0;
        }
    #endif

    float polylineAngle;
    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);
    gl_Position = czm_viewportOrthographic * positionWC * show;

    v_st.s = texCoord;
    v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);

    v_width = width;
    v_pickColor = pickColor;
    v_polylineAngle = polylineAngle;
}
`;var ejn=y(x(),1);var DJn=y(x(),1);var wl={};wl.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};wl.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var J7e=new pe;wl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,J7e).height}return i};var j7e=new F,q7e=new m,$me=new m,$7e=new an(m.UNIT_X,0),ehe=new m,e6e=new an(m.UNIT_X,0),t6e=new m,n6e=new m,NJ=[];function nhe(e,t,n){let i=NJ;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var Wk=new pe,Lk=new pe,P0=new m,XJ=new m,i6e=new m,YJ=new RA,W2=new Ac;function o6e(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,XJ),d=i.scaleToGeodeticSurface(t,i6e),u=wl.numberOfPoints(e,t,n),h=i.cartesianToCartographic(c,Wk),p=i.cartesianToCartographic(d,Lk),g=nhe(u,o,r);YJ.setEndPoints(h,p);let f=YJ.surfaceDistance/u,b=a;h.height=o;let C=i.cartographicToCartesian(h,P0);m.pack(C,s,b),b+=3;for(let E=1;E<u;E++){let T=YJ.interpolateUsingSurfaceDistance(E*f,Lk);T.height=g[E],C=i.cartographicToCartesian(T,P0),m.pack(C,s,b),b+=3}return b}function r6e(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,Wk),d=i.cartesianToCartographic(t,Lk),u=wl.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let h=nhe(u,o,r);W2.ellipsoid.equals(i)||(W2=new Ac(void 0,void 0,i)),W2.setEndPoints(c,d);let p=W2.surfaceDistance/u,g=a;c.height=o;let f=i.cartographicToCartesian(c,P0);m.pack(f,s,g),g+=3;for(let b=1;b<u;b++){let C=W2.interpolateUsingSurfaceDistance(b*p,Lk);C.height=h[b],f=i.cartographicToCartesian(C,P0),m.pack(f,s,g),g+=3}return g}wl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??F.IDENTITY;let o=F.inverseTransformation(t,j7e),r=F.multiplyByPoint(o,m.ZERO,q7e),s=m.normalize(F.multiplyByPointAsVector(o,m.UNIT_Y,$me),$me),a=an.fromPointNormal(r,s,$7e),c=m.normalize(F.multiplyByPointAsVector(o,m.UNIT_X,ehe),ehe),d=an.fromPointNormal(r,c,e6e),u=1;n.push(m.clone(e[0]));let h=n[0],p=e.length;for(let g=1;g<p;++g){let f=e[g];if(an.getPointDistance(d,h)<0||an.getPointDistance(d,f)<0){let b=di.lineSegmentPlane(h,f,a,t6e);if(l(b)){let C=m.multiplyByScalar(s,5e-9,n6e);an.getPointDistance(a,h)<0&&m.negate(C,C),n.push(m.add(b,C,new m)),i.push(u+1),m.negate(C,C),n.push(m.add(b,C,new m)),u=1}}n.push(m.clone(e[g])),u++,h=f}i.push(u)}return{positions:n,lengths:i}};wl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ie.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let b=i.scaleToGeodeticSurface(t[0],XJ);if(o=r?o[0]:o,o!==0){let C=i.geodeticSurfaceNormal(b,P0);m.multiplyByScalar(C,o,C),m.add(b,C,b)}return[b.x,b.y,b.z]}let s=e.minDistance;if(!l(s)){let b=e.granularity??V.RADIANS_PER_DEGREE;s=V.chordLength(b,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=wl.numberOfPoints(t[c],t[c+1],s);let d=(a+1)*3,u=new Array(d),h=0;for(c=0;c<n-1;c++){let b=t[c],C=t[c+1],E=r?o[c]:o,T=r?o[c+1]:o;h=o6e(b,C,s,i,E,T,u,h)}NJ.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,Wk);g.height=r?o[n-1]:o;let f=i.cartographicToCartesian(g,P0);return m.pack(f,u,d-3),u};var the=new pe,s6e=new pe;wl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ie.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let E=i.scaleToGeodeticSurface(t[0],XJ);if(o=r?o[0]:o,o!==0){let T=i.geodeticSurfaceNormal(E,P0);m.multiplyByScalar(T,o,T),m.add(E,T,E)}return[E.x,E.y,E.z]}let s=e.granularity??V.RADIANS_PER_DEGREE,a=0,c,d=i.cartesianToCartographic(t[0],the),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],s6e),a+=wl.numberOfPointsRhumbLine(d,u,s),d=pe.clone(u,the);let h=(a+1)*3,p=new Array(h),g=0;for(c=0;c<n-1;c++){let E=t[c],T=t[c+1],S=r?o[c]:o,_=r?o[c+1]:o;g=r6e(E,T,s,i,S,_,p,g)}NJ.length=0;let f=t[n-1],b=i.cartesianToCartographic(f,Wk);b.height=r?o[n-1]:o;let C=i.cartographicToCartesian(b,P0);return m.pack(C,p,h-3),p};wl.generateCartesianArc=function(e){let t=wl.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};wl.generateCartesianRhumbArc=function(e){let t=wl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};var zi=wl;function su(e,t){e=e??Q.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=ho.fromType(ho.ColorType,{color:new D(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Mo(n,m.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=zi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(ohe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ue.fromPoints(this._actualPositions),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ue}var ihe=su.POSITION_INDEX=0,a6e=su.SHOW_INDEX=1,c6e=su.WIDTH_INDEX=2,l6e=su.MATERIAL_INDEX=3,F2=su.POSITION_SIZE_INDEX=4,d6e=su.DISTANCE_DISPLAY_CONDITION=5,ohe=su.NUMBER_OF_PROPERTIES=6;function bg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(su.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,bg(this,a6e))}},positions:{get:function(){return this._positions},set:function(e){let t=Mo(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&bg(this,F2),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ue.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),bg(this,ihe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,bg(this,l6e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,bg(this,c6e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,bg(this,F2)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),bg(this,d6e))}}});su.prototype.update=function(){let e=F.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[ihe]>0||this._propertiesChanged[F2]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=zi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ue.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)bg(this,F2);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){bg(this,F2);break}}};su.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};su.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<ohe-1;++t)e[t]=0};su.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var xm=su;var u6e=xm.SHOW_INDEX,m6e=xm.WIDTH_INDEX,MJ=xm.POSITION_INDEX,h6e=xm.MATERIAL_INDEX,rhe=xm.POSITION_SIZE_INDEX,f6e=xm.DISTANCE_DISPLAY_CONDITION,mhe=xm.NUMBER_OF_PROPERTIES,bd={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 Qh(e){e=e??Q.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(mhe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Xe.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=D.clone(D.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Qh.prototype,{length:{get:function(){return UJ(this),this._polylines.length}}});Qh.prototype.add=function(e){let t=new xm(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Qh.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Qh.prototype.removeAll=function(){DJ(this),ghe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Qh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Qh.prototype.get=function(e){return UJ(this),this._polylines[e]};function p6e(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:J.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:J.FLOAT,componentsPerAttribute:2}];e._batchTable=new Rx(t,n,e._polylines.length)}var hhe=new ti,fhe=new ce,phe=new M;Qh.prototype.update=function(e){if(UJ(this),this._polylines.length===0||!this.show)return;C6e(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Yt.maximumVertexTextureImageUnits===0)throw new he("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");p6e(this,t),this._createBatchTable=!1}if(this._createVertexArray||g6e(this))che(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==se.SCENE3D){let d=c.length;for(let u=0;u<d;++u)i=c[u],i.update()}if(o[rhe]||o[h6e])che(this,t,n);else{let d=c.length,u=this._polylineBuckets;for(let h=0;h<d;++h){i=c[h],o=i._propertiesChanged;let p=i._bucket,g=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[MJ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=u[f].lengthOfPositions}if((o[u6e]||o[m6e])&&this._batchTable.setBatchedAttribute(i._index,0,new M(i._width,i._show)),this._batchTable.attributes.length>2){if(o[MJ]||o[rhe]){let f=e.mode===se.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,b=ti.fromCartesian(f.center,hhe),C=ce.fromElements(b.low.x,b.low.y,b.low.z,f.radius,fhe);this._batchTable.setBatchedAttribute(i._index,2,b.high),this._batchTable.setBatchedAttribute(i._index,3,C)}if(o[f6e]){let f=phe;f.x=0,f.y=Number.MAX_VALUE;let b=i.distanceDisplayCondition;l(b)&&(f.x=b.near,f.y=b.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<mhe;++c)o[c]=0;let r=F.IDENTITY;e.mode===se.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ke.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ke.fromCache({blending:fn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;A6e(this,e,c,r)}};var B2=new ue,she=new ue;function A6e(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,d=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=d.length;for(let f=0;f<g;++f){let b=d[f],C=b.buckets,E=C.length;for(let T=0;T<E;++T){let S=C[T],_=S.offset,R=S.bucket.shaderProgram,L=S.bucket.polylines,W=L.length,B,Y,N=0,A,I;for(let Z=0;Z<W;++Z){let G=L[Z],w=y6e(G._material);if(w!==B){if(l(B)&&N>0){let k=Y.isTranslucent();a>=s?(A=new nt({owner:e}),n.push(A)):A=n[a],++a,I=Rt(p(Y._uniforms),e._uniformMap),A.boundingVolume=ue.clone(B2,A.boundingVolume),A.modelMatrix=i,A.shaderProgram=R,A.vertexArray=b.va,A.renderState=k?e._translucentRS:e._opaqueRS,A.pass=k?Ve.TRANSLUCENT:Ve.OPAQUE,A.debugShowBoundingVolume=u,A.pickId="v_pickColor",A.uniformMap=I,A.count=N,A.offset=_,_+=N,N=0,c=!0,r.push(A)}Y=G._material,Y.update(o),B=w}let X=G._locatorBuckets,v=X.length;for(let k=0;k<v;++k){let P=X[k];P.locator===S&&(N+=P.count)}let U;t.mode===se.SCENE3D?U=G._boundingVolumeWC:t.mode===se.COLUMBUS_VIEW?U=G._boundingVolume2D:t.mode===se.SCENE2D?l(G._boundingVolume2D)&&(U=ue.clone(G._boundingVolume2D,she),U.center.x=0):l(G._boundingVolumeWC)&&l(G._boundingVolume2D)&&(U=ue.union(G._boundingVolumeWC,G._boundingVolume2D,she)),c?(c=!1,ue.clone(U,B2)):ue.union(U,B2,B2)}l(B)&&N>0&&(a>=s?(A=new nt({owner:e}),n.push(A)):A=n[a],++a,I=Rt(p(Y._uniforms),e._uniformMap),A.boundingVolume=ue.clone(B2,A.boundingVolume),A.modelMatrix=i,A.shaderProgram=R,A.vertexArray=b.va,A.renderState=Y.isTranslucent()?e._translucentRS:e._opaqueRS,A.pass=Y.isTranslucent()?Ve.TRANSLUCENT:Ve.OPAQUE,A.debugShowBoundingVolume=u,A.pickId="v_pickColor",A.uniformMap=I,A.count=N,A.offset=_,c=!0,r.push(A)),B=void 0}}n.length=a}Qh.prototype.isDestroyed=function(){return!1};Qh.prototype.destroy=function(){return Ahe(this),DJ(this),ghe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),fe(this)};function g6e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[MJ]?(i.bufferUsage!==Xe.STREAM_DRAW&&(t=!0,i.bufferUsage=Xe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Xe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Xe.STATIC_DRAW):i.frameCount--),t}var ahe=[0,0,0];function che(e,t,n){e._createVertexArray=!1,DJ(e),Ahe(e),x6e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,h=e._polylineBuckets,p,g;for(p in h)h.hasOwnProperty(p)&&(g=h[p],g.updateShader(t,r,s),u+=g.lengthOfPositions);if(u>0){let f=e._mode,b=new Float32Array(6*u*3),C=new Float32Array(u*4),E,T=0,S=0,_=0;for(p in h)if(h.hasOwnProperty(p)){g=h[p],g.write(b,C,T,S,_,r,t,n),f===se.MORPHING&&(l(E)||(E=new Float32Array(6*u*3)),g.writeForMorph(E,T));let I=g.lengthOfPositions;T+=6*I*3,S+=I*4,_+=I*4,c=g.updateIndices(i,a,d,c)}let R=e._positionBufferUsage.bufferUsage,L=Xe.STATIC_DRAW;e._positionBuffer=mt.createVertexBuffer({context:t,typedArray:b,usage:R});let W;l(E)&&(W=mt.createVertexBuffer({context:t,typedArray:E,usage:R})),e._texCoordExpandAndBatchIndexBuffer=mt.createVertexBuffer({context:t,typedArray:C,usage:L});let B=3*Float32Array.BYTES_PER_ELEMENT,Y=4*Float32Array.BYTES_PER_ELEMENT,N=0,A=i.length;for(let I=0;I<A;++I)if(o=i[I],o.length>0){let Z=new Uint16Array(o),G=mt.createIndexBuffer({context:t,typedArray:Z,usage:Xe.STATIC_DRAW,indexDatatype:Pe.UNSIGNED_SHORT});N+=a[I];let w=6*(I*(B*V.SIXTY_FOUR_KILOBYTES)-N*B),X=B+w,v=B+X,U=B+v,k=B+U,P=B+k,O=I*(Y*V.SIXTY_FOUR_KILOBYTES)-N*Y,H=[{index:bd.position3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*B},{index:bd.position3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*B},{index:bd.position2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*B},{index:bd.position2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*B},{index:bd.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:v,strideInBytes:6*B},{index:bd.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:U,strideInBytes:6*B},{index:bd.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:v,strideInBytes:6*B},{index:bd.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:U,strideInBytes:6*B},{index:bd.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:k,strideInBytes:6*B},{index:bd.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:P,strideInBytes:6*B},{index:bd.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:k,strideInBytes:6*B},{index:bd.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:P,strideInBytes:6*B},{index:bd.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:J.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:O}],ee,z,te,q;f===se.SCENE3D?(z=e._positionBuffer,ee="vertexBuffer",te=ahe,q="value"):f===se.SCENE2D||f===se.COLUMBUS_VIEW?(z=ahe,ee="value",te=e._positionBuffer,q="vertexBuffer"):(z=W,ee="vertexBuffer",te=e._positionBuffer,q="vertexBuffer"),H[0][ee]=z,H[1][ee]=z,H[2][q]=te,H[3][q]=te,H[4][ee]=z,H[5][ee]=z,H[6][q]=te,H[7][q]=te,H[8][ee]=z,H[9][ee]=z,H[10][q]=te,H[11][q]=te;let me=new si({context:t,attributes:H,indexBuffer:G});e._vertexArrays.push({va:me,buckets:d[I]})}}}function b6e(e,t){return t instanceof Wt?t.id:t}var Fk=[];function y6e(e){let t=ho._uniformList[e.type],n=t.length;Fk.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];Fk[i]=r,Fk[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(Fk,b6e)}`}function x6e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,d=i[c.type];l(d)||(d=i[c.type]=new pp(c,t,n)),d.addPolyline(a)}}}function C6e(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function UJ(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function DJ(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function Ahe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Qh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function ghe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function PJ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function pp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}pp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};pp.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),i.push("CLIP_POLYLINE");let o=new ze({defines:i,sources:[`in vec4 v_pickColor;
`,this.material.shaderSource,Bx]}),r=t.getVertexShaderCallback()(L2),s=new ze({defines:i,sources:[Kd,r]});this.shaderProgram=cn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:bd})};function bhe(e){return m.dot(m.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(an.ORIGIN_ZX_PLANE)===Jt.INTERSECTING}pp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===se.SCENE3D||!bhe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var ra=new m,Cm=new m,Em=new m,Bk=new m,E6e=new ce,T6e=new M;pp.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,d=a.ellipsoid.maximumRadius*V.PI,u=this.polylines,h=u.length;for(let p=0;p<h;++p){let g=u[p],f=g.width,b=g.show&&f>0,C=g._index,E=this.getSegments(g,a),T=E.positions,S=E.lengths,_=T.length,R=g.getPickId(s).color,L=0,W=0,B;for(let v=0;v<_;++v){v===0?g._loop?B=T[_-2]:(B=Bk,m.subtract(T[0],T[1],B),m.add(T[0],B,B)):B=T[v-1],m.clone(B,Cm),m.clone(T[v],ra),v===_-1?g._loop?B=T[1]:(B=Bk,m.subtract(T[_-1],T[_-2],B),m.add(T[_-1],B,B)):B=T[v+1],m.clone(B,Em);let U=S[L];v===W+U&&(W+=U,++L);let k=v-W===0,P=v===W+S[L]-1;c===se.SCENE2D&&(Cm.z=0,ra.z=0,Em.z=0),(c===se.SCENE2D||c===se.MORPHING)&&(k||P)&&d-Math.abs(ra.x)<1&&((ra.x<0&&Cm.x>0||ra.x>0&&Cm.x<0)&&m.clone(ra,Cm),(ra.x<0&&Em.x>0||ra.x>0&&Em.x<0)&&m.clone(ra,Em));let O=k?2:0,H=P?2:4;for(let ee=O;ee<H;++ee){ti.writeElements(ra,e,n),ti.writeElements(Cm,e,n+6),ti.writeElements(Em,e,n+12);let z=ee-2<0?-1:1;t[o]=v/(_-1),t[o+1]=2*(ee%2)-1,t[o+2]=z,t[o+3]=C,n+=18,o+=4}}let Y=E6e;Y.x=D.floatToByte(R.red),Y.y=D.floatToByte(R.green),Y.z=D.floatToByte(R.blue),Y.w=D.floatToByte(R.alpha);let N=T6e;N.x=f,N.y=b?1:0;let A=c===se.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,I=ti.fromCartesian(A.center,hhe),Z=I.high,G=ce.fromElements(I.low.x,I.low.y,I.low.z,A.radius,fhe),w=phe;w.x=0,w.y=Number.MAX_VALUE;let X=g.distanceDisplayCondition;l(X)&&(w.x=X.near,w.y=X.far),r.setBatchedAttribute(C,0,N),r.setBatchedAttribute(C,1,Y),r.attributes.length>2&&(r.setBatchedAttribute(C,2,Z),r.setBatchedAttribute(C,3,G),r.setBatchedAttribute(C,4,w))}};var S6e=new m,I6e=new m,_6e=new m,lhe=new m;pp.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,d=a.length,u=0,h=0;for(let p=0;p<d;++p){let g;p===0?s._loop?g=a[d-2]:(g=lhe,m.subtract(a[0],a[1],g),m.add(a[0],g,g)):g=a[p-1],g=F.multiplyByPoint(n,g,I6e);let f=F.multiplyByPoint(n,a[p],S6e),b;p===d-1?s._loop?b=a[1]:(b=lhe,m.subtract(a[d-1],a[d-2],b),m.add(a[d-1],b,b)):b=a[p+1],b=F.multiplyByPoint(n,b,_6e);let C=c[u];p===h+C&&(h+=C,++u);let E=p-h===0,T=p===h+c[u]-1,S=E?2:0,_=T?2:4;for(let R=S;R<_;++R)ti.writeElements(f,e,t),ti.writeElements(g,e,t+6),ti.writeElements(b,e,t+12),t+=18}}};var Z6e=new Array(1);pp.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new PJ(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let h=0;h<u;++h){let p=d[h];p._locatorBuckets=[];let g;if(this.mode===se.SCENE3D){g=Z6e;let b=p._actualPositions.length;if(b>0)g[0]=b;else continue}else g=p._segments.lengths;let f=g.length;if(f>0){let b=0;for(let C=0;C<f;++C){let E=g[C]-1;for(let T=0;T<E;++T)c+4>V.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:b}),b=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new PJ(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),b+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:b}),c+4>V.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new PJ(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};pp.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var II={positions:void 0,lengths:void 0},dhe=new Array(1),R6e=new m,G6e=new pe;pp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===se.SCENE3D)return dhe[0]=n.length,II.positions=n,II.lengths=dhe,II;bhe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=R6e;for(let d=0;d<s;++d)a=n[d],c=F.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,G6e)));if(o.length>0){e._boundingVolume2D=ue.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(d.z,d.x,d.y)}return II.positions=o,II.lengths=e._segments.lengths,II};var uhe;pp.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*V.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=uhe,c=6*s*3;!l(a)||a.length<c?a=uhe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,h=d.lengths,p=0,g=0,f=0,b;s=u.length;for(let C=0;C<s;++C){C===0?t._loop?b=u[s-2]:(b=Bk,m.subtract(u[0],u[1],b),m.add(u[0],b,b)):b=u[C-1],m.clone(b,Cm),m.clone(u[C],ra),C===s-1?t._loop?b=u[1]:(b=Bk,m.subtract(u[s-1],u[s-2],b),m.add(u[s-1],b,b)):b=u[C+1],m.clone(b,Em);let E=h[g];C===f+E&&(f+=E,++g);let T=C-f===0,S=C===f+h[g]-1;o===se.SCENE2D&&(Cm.z=0,ra.z=0,Em.z=0),(o===se.SCENE2D||o===se.MORPHING)&&(T||S)&&r-Math.abs(ra.x)<1&&((ra.x<0&&Cm.x>0||ra.x>0&&Cm.x<0)&&m.clone(ra,Cm),(ra.x<0&&Em.x>0||ra.x>0&&Em.x<0)&&m.clone(ra,Em));let _=T?2:0,R=S?2:4;for(let L=_;L<R;++L)ti.writeElements(ra,a,p),ti.writeElements(Cm,a,p+6),ti.writeElements(Em,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Oh=Qh;function M0(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._heightReference=e.heightReference,this._billboardCollection=new ru({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new fp({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Oh,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(M0.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function V6e(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+de.packedLength+ie.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,de.pack(n,s,a),a+=de.packedLength,ie.pack(t,s,a),s}var L6e=new Jn("createVectorTilePoints",5),W6e=new m;function F6e(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=V6e(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=L6e.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3,g=e._heightReference??tt.NONE;for(let f=0;f<p;++f){let b=h[f],C=m.unpack(n,f*3,W6e),E=c.add();E.position=C,E._batchIndex=b,E.heightReference=g;let T=d.add();T.text=" ",T.position=C,T._batchIndex=b,T.heightReference=g;let S=u.add();S.positions=[m.clone(C),m.clone(C)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}M0.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],d=n.get(a),u=i.get(a),h=o.get(a);t[c]=new Ag(e,c,d,u,h)}};M0.prototype.applyDebugSettings=function(e,t){e?(D.clone(t,this._billboardCollection._highlightColor),D.clone(t,this._labelCollection._highlightColor),D.clone(t,this._polylineCollection._highlightColor)):(D.clone(D.WHITE,this._billboardCollection._highlightColor),D.clone(D.WHITE,this._labelCollection._highlightColor),D.clone(D.WHITE,this._polylineCollection._highlightColor))};function B6e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=Ag.defaultPointSize,s.color=Ag.defaultColor,s.pointOutlineColor=Ag.defaultPointOutlineColor,s.pointOutlineWidth=Ag.defaultPointOutlineWidth,s.labelColor=D.WHITE,s.labelOutlineColor=D.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=cr.FILL,s.labelText=void 0,s.backgroundColor=new D(.165,.165,.165,.8),s.backgroundPadding=new M(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=D.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Bi.CENTER,s.verticalOrigin=vn.CENTER,s.labelHorizontalOrigin=Bi.RIGHT,s.labelVerticalOrigin=vn.BASELINE}}var w6e=new D,Y6e=new D,N6e=new D,X6e=new D,P6e=new D,M6e=new D,w2=new kt,Y2=new kt,vJ=new Mt;M0.prototype.applyStyle=function(e,t){if(!l(e)){B6e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,w6e)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Y6e)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,N6e)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,X6e)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,P6e)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(w2.near=a.x,w2.nearValue=a.y,w2.far=a.z,w2.farValue=a.w,s.scaleByDistance=w2):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(Y2.near=a.x,Y2.nearValue=a.y,Y2.far=a.z,Y2.farValue=a.w,s.translucencyByDistance=Y2):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(vJ.near=a.x,vJ.far=a.y,s.distanceDisplayCondition=vJ):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,M6e)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};M0.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=F6e(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};M0.prototype.isDestroyed=function(){return!1};M0.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(),fe(this)};var N2=M0;var b4n=y(x(),1);function yg(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=e.ellipsoid??ie.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??m.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._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=qn.BOTH}Object.defineProperties(yg.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function U6e(e){let t=new Float64Array(3+m.packedLength+ie.packedLength+de.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,m.pack(e._center,t,n),n+=m.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,de.pack(e._rectangle,t,n),t}function D6e(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=tn.unpack(t,n),n+=tn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=D.unpack(t,n);n+=D.packedLength;let d=t[n++],u=t[n++],h=t[n++],p=new Array(h);for(let g=0;g<h;++g)p[g]=t[n++];s[a]=new $f({color:c,offset:d,count:u,batchIds:p})}}var v6e=new Jn("createVectorTilePolygons",5),k6e=new D;function Q6e(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(de.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,f=s.length;for(let b=0;b<f;++b){let C=g.getColor(b,k6e);s[b]=C.toRgba()}a=e._packedBuffer=U6e(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],d={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},u=e._polygonMinimumHeights,h=e._polygonMaximumHeights;l(u)&&l(h)&&(u=u.slice(),h=h.slice(),c.push(u.buffer,h.buffer),d.minimumHeights=u,d.maximumHeights=h);let p=v6e.scheduleTask(d,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(g.packedBuffer),b=f[0];D6e(e,f),e._indices=Pe.getSizeInBytes(b)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),O6e(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function O6e(e){l(e._primitive)||(e._primitive=new eC({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)}yg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};yg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};yg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};yg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};yg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Q6e(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};yg.prototype.isDestroyed=function(){return!1};yg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var X2=yg;var k4n=y(x(),1);var x4n=y(x(),1),P2=`in vec4 currentPosition;
in vec4 previousPosition;
in vec4 nextPosition;
in vec2 expandAndWidth;
in float a_batchId;

uniform mat4 u_modifiedModelView;

void main()
{
    float expandDir = expandAndWidth.x;
    float width = abs(expandAndWidth.y) + 0.5;
    bool usePrev = expandAndWidth.y < 0.0;

    vec4 p = u_modifiedModelView * currentPosition;
    vec4 prev = u_modifiedModelView * previousPosition;
    vec4 next = u_modifiedModelView * nextPosition;

    float angle;
    vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);
    gl_Position = czm_viewportOrthographic * positionWC;
}
`;function zh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.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._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=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=D.clone(D.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(zh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function z6e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+ie.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,de.pack(t,a,c),c+=de.packedLength,ie.pack(o,a,c),c+=ie.packedLength,m.pack(r,a,c),a}var H6e=new Jn("createVectorTilePolylines",5),_I={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function K6e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=z6e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=H6e.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let h=u.indexDatatype;e._indices=h===Pe.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),J6e(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function J6e(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let d=mt.createVertexBuffer({context:t,typedArray:i,usage:Xe.STATIC_DRAW}),u=mt.createVertexBuffer({context:t,typedArray:n,usage:Xe.STATIC_DRAW}),h=mt.createVertexBuffer({context:t,typedArray:o,usage:Xe.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:r,usage:Xe.STATIC_DRAW}),g=mt.createVertexBuffer({context:t,typedArray:s,usage:Xe.STATIC_DRAW}),f=mt.createIndexBuffer({context:t,typedArray:a,usage:Xe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Pe.UNSIGNED_SHORT:Pe.UNSIGNED_INT}),b=[{index:_I.previousPosition,vertexBuffer:d,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:_I.currentPosition,vertexBuffer:u,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:_I.nextPosition,vertexBuffer:h,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:_I.expandAndWidth,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:2},{index:_I.a_batchId,vertexBuffer:g,componentDatatype:J.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new si({context:t,attributes:b,indexBuffer:f}),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}}var M2=new F,yhe=new m;function j6e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,M2),F.multiplyByPoint(M2,e._center,yhe),F.setTranslation(M2,yhe,M2),M2},u_highlightColor:function(){return e._highlightColor}})}function q6e(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ke.fromCache({blending:fn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var $6e=`uniform vec4 u_highlightColor; 
void main()
{
    out_FragColor = u_highlightColor;
}
`;function eqe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(P2),o=n.getFragmentShaderCallback(!1,void 0,!1)($6e),r=new ze({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Kd,i]}),s=new ze({defines:["VECTOR_TILE"],sources:[o]});e._sp=cn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:_I})}function tqe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ve.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}zh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,d=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let u=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let h=o[r],p=o[r+1]-h;for(s=0;s<p;++s){let g=(h+s)*3;u[d++]=i[g],u[d++]=i[g+1],u[d++]=i[g+2]}}return u};zh.prototype.getPositions=function(e){return zh.getPolylinePositions(this,e)};zh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ea(e,r)}};zh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function nqe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=D.WHITE}}var iqe=new D,oqe=D.WHITE,rqe=!0;zh.prototype.applyStyle=function(e,t){if(!l(e)){nqe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,iqe):oqe,s.show=l(e.show)?e.show.evaluate(s):rqe}};zh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=K6e(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}j6e(this,t),eqe(this,t),q6e(this);let n=e.passes;(n.render||n.pick)&&tqe(this,e)};zh.prototype.isDestroyed=function(){return!1};zh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),fe(this)};var XC=zh;var R8n=y(x(),1);var O4n=y(x(),1),U2=`in vec3 startEllipsoidNormal;
in vec3 endEllipsoidNormal;
in vec4 startPositionAndHeight;
in vec4 endPositionAndHeight;
in vec4 startFaceNormalAndVertexCorner;
in vec4 endFaceNormalAndHalfWidth;
in float a_batchId;

uniform mat4 u_modifiedModelView;
uniform vec2 u_minimumMaximumVectorHeights;

out vec4 v_startPlaneEC;
out vec4 v_endPlaneEC;
out vec4 v_rightPlaneEC;
out float v_halfWidth;
out vec3 v_volumeUpEC;

void main()
{
    // vertex corner IDs
    //          3-----------7
    //         /|   left   /|
    //        / | 1       / |
    //       2-----------6  5  end
    //       | /         | /
    // start |/  right   |/
    //       0-----------4
    //
    float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end
    float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top

    vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
    vec3 right = normalize(cross(forward, startEllipsoidNormal));

    vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
    position.xyz += forward * isEnd;

    v_volumeUpEC = czm_normal * normalize(cross(right, forward));

    // Push for volume height
    float offset;
    vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);

    // offset height to create volume
    offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
    offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
    position.xyz += offset * ellipsoidNormal;

    // move from RTC to EC
    position = u_modifiedModelView * position;
    right = czm_normal * right;

    // Push for width in a direction that is in the start or end plane and in a plane with right
    // N = normalEC ("right-facing" direction for push)
    // R = right
    // p = angle between N and R
    // w = distance to push along R if R == N
    // d = distance to push along N
    //
    //   N   R
    //  {  p| }      * cos(p) = dot(N, R) = w / d
    //  d  |  |w    * d = w / dot(N, R)
    //    { | }
    //       o---------- polyline segment ---->
    //
    vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
    scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
    vec3 miterPushNormal = czm_normal * normalize(scratchNormal);

    offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC
    offset = offset / dot(miterPushNormal, right);
    position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));

    gl_Position = czm_depthClamp(czm_projection * position);

    position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
    vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
    v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
    v_rightPlaneEC = vec4(right, -dot(right, position.xyz));

    position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
    vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
    v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
    v_halfWidth = endFaceNormalAndHalfWidth.w;
}
`;var H4n=y(x(),1),D2=`in vec4 v_startPlaneEC;
in vec4 v_endPlaneEC;
in vec4 v_rightPlaneEC;
in float v_halfWidth;
in vec3 v_volumeUpEC;

uniform vec4 u_highlightColor;
void main()
{
    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));

    // Discard for sky
    if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
    eyeCoordinate /= eyeCoordinate.w;

    float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);

    // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction
    halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));

    // Check distance of the eye coordinate against the right-facing plane
    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);

    // Check eye coordinate against the mitering planes
    float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
    float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);

    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }
    out_FragColor = u_highlightColor;

    czm_writeDepthClamp();
}
`;function xg(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,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._minimumMaximumVectorHeights=new M(Zi._defaultMinTerrainHeight,Zi._defaultMaxTerrainHeight),this._boundingVolume=tn.fromRectangle(e.rectangle,Zi._defaultMinTerrainHeight,Zi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=D.clone(D.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(xg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function sqe(e,t,n){let i=Zi.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;tn.fromRectangle(c,o,r,n,a)}function aqe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+ie.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,de.pack(t,a,c),c+=de.packedLength,ie.pack(o,a,c),c+=ie.packedLength,m.pack(r,a,c),a}var cqe=new Jn("createVectorTileClampedPolylines"),U0={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function lqe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=aqe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=cqe.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let h=u.indexDatatype;e._indices=h===Pe.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),dqe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function dqe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let h=mt.createVertexBuffer({context:t,typedArray:n,usage:Xe.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:i,usage:Xe.STATIC_DRAW}),g=mt.createVertexBuffer({context:t,typedArray:o,usage:Xe.STATIC_DRAW}),f=mt.createVertexBuffer({context:t,typedArray:r,usage:Xe.STATIC_DRAW}),b=mt.createVertexBuffer({context:t,typedArray:s,usage:Xe.STATIC_DRAW}),C=mt.createVertexBuffer({context:t,typedArray:a,usage:Xe.STATIC_DRAW}),E=mt.createVertexBuffer({context:t,typedArray:c,usage:Xe.STATIC_DRAW}),T=mt.createIndexBuffer({context:t,typedArray:d,usage:Xe.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Pe.UNSIGNED_SHORT:Pe.UNSIGNED_INT}),S=[{index:U0.startEllipsoidNormal,vertexBuffer:h,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:U0.endEllipsoidNormal,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:U0.startPositionAndHeight,vertexBuffer:g,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:U0.endPositionAndHeight,vertexBuffer:f,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:U0.startFaceNormalAndVertexCorner,vertexBuffer:b,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:U0.endFaceNormalAndHalfWidth,vertexBuffer:C,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:U0.a_batchId,vertexBuffer:E,componentDatatype:J.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new si({context:t,attributes:S,indexBuffer:T}),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._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var v2=new F,xhe=new m;function uqe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,v2),F.multiplyByPoint(v2,e._center,xhe),F.setTranslation(v2,xhe,v2),v2},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Che(e){return ke.fromCache({cull:{enabled:!0,face:wi.FRONT},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:$n.EQUAL,frontOperation:{fail:Ct.KEEP,zFail:Ct.KEEP,zPass:Ct.KEEP},backFunction:$n.EQUAL,backOperation:{fail:Ct.KEEP,zFail:Ct.KEEP,zPass:Ct.KEEP},reference:Qt.CESIUM_3D_TILE_MASK,mask:Qt.CESIUM_3D_TILE_MASK}})}function mqe(e){l(e._rs)||(e._rs=Che(!1),e._rs3DTiles=Che(!0))}function hqe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(U2),o=n.getFragmentShaderCallback(!1,void 0,!0)(D2),r=new ze({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Kd,i]}),s=new ze({defines:["VECTOR_TILE"],sources:[o]});e._sp=cn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:U0})}function fqe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ve.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=nt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===qn.TERRAIN||i===qn.BOTH)&&t.commandList.push(n),(i===qn.CESIUM_3D_TILE||i===qn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}xg.prototype.getPositions=function(e){return XC.getPolylinePositions(this,e)};xg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ea(e,r)}};xg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function pqe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=D.WHITE}}var Aqe=new D,gqe=D.WHITE,bqe=!0;xg.prototype.applyStyle=function(e,t){if(!l(e)){pqe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,Aqe):gqe,s.show=l(e.show)?e.show.evaluate(s):bqe}};function yqe(e){return Zi.initialize().then(function(){sqe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}xg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=yqe(this).then(lqe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}uqe(this,t),hqe(this,t),mqe(this);let n=e.passes;(n.render||n.pick)&&fqe(this,e)};xg.prototype.isDestroyed=function(){return!1};xg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),fe(this)};var k2=xg;var B8n=y(x(),1);var kJ=32767,xqe=new pe,Cqe=new m;function Eqe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);_n.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let h=s[u],p=a[u],g=c[u],f=V.lerp(t.west,t.east,h/kJ),b=V.lerp(t.south,t.north,p/kJ),C=V.lerp(n,i,g/kJ),E=pe.fromRadians(f,b,C,xqe),T=o.cartographicToCartesian(E,Cqe);m.pack(T,d,u*3)}return d}var Q2=Eqe;function Kh(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,Zqe(this,i,o)}Object.defineProperties(Kh.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function Tqe(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Sqe(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let d=l(n)||l(i)||l(o),u=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(d&&u)throw new he("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var Hh=Uint32Array.BYTES_PER_ELEMENT;function Iqe(e){return new XC(e)}function _qe(e){return new k2(e)}function Zqe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=Hh;let r=o.getUint32(n,!0);if(r!==1)throw new he(`Only Vector tile version 1 is supported.  Version ${r} is not.`);n+=Hh;let s=o.getUint32(n,!0);if(n+=Hh,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Hh,a===0)throw new he("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Hh;let d=o.getUint32(n,!0);n+=Hh;let u=o.getUint32(n,!0);n+=Hh;let h=o.getUint32(n,!0);n+=Hh;let p=o.getUint32(n,!0);n+=Hh;let g=o.getUint32(n,!0);n+=Hh;let f=o.getUint32(n,!0);n+=Hh;let b=Cr(i,n,a);n+=a;let C=new Uint8Array(t,n,c);n+=c;let E,T;d>0&&(E=Cr(i,n,d),n+=d,u>0&&(T=new Uint8Array(t,n,u),T=new Uint8Array(T),n+=u));let S=b.POLYGONS_LENGTH??0,_=b.POLYLINES_LENGTH??0,R=b.POINTS_LENGTH??0,L=S+_+R,W=new Rh(e,L,E,T,Tqe(e));if(e._batchTable=W,L===0)return;let B=new Yh(b,C),Y=B.getGlobalProperty("REGION");if(!l(Y))throw new he("Feature table global property: REGION must be defined");let N=de.unpack(Y),A=Y[4],I=Y[5],Z=e._tile.computedTransform,G=B.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(G)?(G=m.unpack(G),F.multiplyByPoint(Z,G,G)):(G=de.center(N),G.height=V.lerp(A,I,.5),G=ie.WGS84.cartographicToCartesian(G));let w=Sqe(b,C);if(n+=(4-n%4)%4,S>0){B.featuresLength=S;let v=B.getPropertyArray("POLYGON_COUNTS",J.UNSIGNED_INT,1)??B.getPropertyArray("POLYGON_COUNT",J.UNSIGNED_INT,1);if(!l(v))throw new he("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=B.getPropertyArray("POLYGON_INDEX_COUNTS",J.UNSIGNED_INT,1)??B.getPropertyArray("POLYGON_INDEX_COUNT",J.UNSIGNED_INT,1);if(!l(U))throw new he("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=v.reduce(function(te,q){return te+q*2},0),P=U.reduce(function(te,q){return te+q},0),O=new Uint32Array(t,n,P);n+=h;let H=new Uint16Array(t,n,k);n+=p;let ee,z;l(b.POLYGON_MINIMUM_HEIGHTS)&&l(b.POLYGON_MAXIMUM_HEIGHTS)&&(ee=B.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",J.FLOAT,1),z=B.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",J.FLOAT,1)),e._polygons=new X2({positions:H,counts:v,indexCounts:U,indices:O,minimumHeight:A,maximumHeight:I,polygonMinimumHeights:ee,polygonMaximumHeights:z,center:G,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:W,batchIds:w.polygons,modelMatrix:Z})}let X=e._tileset;if(_>0){B.featuresLength=_;let v=B.getPropertyArray("POLYLINE_COUNTS",J.UNSIGNED_INT,1)??B.getPropertyArray("POLYLINE_COUNT",J.UNSIGNED_INT,1);if(!l(v))throw new he("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let U=B.getPropertyArray("POLYLINE_WIDTHS",J.UNSIGNED_SHORT,1);if(!l(U)){U=new Uint16Array(_);for(let ee=0;ee<_;++ee)U[ee]=2}let k=v.reduce(function(ee,z){return ee+z*3},0),P=new Uint16Array(t,n,k);n+=g;let O=X.examineVectorLinesFunction;if(l(O)){let ee=Q2(new Uint16Array(P),N,A,I,ie.WGS84);Rqe(ee,v,w.polylines,W,e.url,O)}let H=Iqe;l(X.classificationType)&&(H=_qe),e._polylines=H({positions:P,widths:U,counts:v,batchIds:w.polylines,minimumHeight:A,maximumHeight:I,center:G,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:W,classificationType:X.classificationType,keepDecodedPositions:X.vectorKeepDecodedPositions})}if(R>0){let v=new Uint16Array(t,n,R*3);n+=f,e._points=new N2({positions:v,batchIds:w.points,minimumHeight:A,maximumHeight:I,rectangle:N,batchTable:W,heightReference:X.heightReference,scene:X.scene})}}function QJ(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}Kh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Kh.prototype.getFeature=function(e){return l(this._features)||QJ(this),this._features[e]};Kh.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};Kh.prototype.applyStyle=function(e){l(this._features)||QJ(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};Kh.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||QJ(this),this._batchTable.update(e,t),this._ready=!0)};Kh.prototype.pick=function(e,t,n){};Kh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};Kh.prototype.isDestroyed=function(){return!1};Kh.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(),fe(this)};function Rqe(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let d=t[c]*3,u=e.slice(a,a+d);a+=d,r(u,n[c],o,i)}}var O2=Kh;var g6n=y(x(),1);var r6n=y(x(),1);var r7n=y(x(),1);function Ja(){}Ja._maxSortingConcurrency=Math.max(rn.hardwareConcurrency-1,1);Ja._sorterTaskProcessor=void 0;Ja._taskProcessorReady=!1;Ja._error=void 0;Ja._getSorterTaskProcessor=function(){if(!l(Ja._sorterTaskProcessor)){let e=new Jn("gaussianSplatSorter",Ja._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?Ja._taskProcessorReady=!0:Ja._error=new he("Gaussian splat sorter could not be initialized.")}).catch(t=>{Ja._error=t}),Ja._sorterTaskProcessor=e}return Ja._sorterTaskProcessor};Ja.radixSortIndexes=function(e){let t=Ja._getSorterTaskProcessor();if(l(Ja._error))throw Ja._error;if(Ja._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var ZI=Ja;var u7n=y(x(),1);function ja(){}ja._maxSortingConcurrency=Math.max(rn.hardwareConcurrency-1,1);ja._textureTaskProcessor=void 0;ja._taskProcessorReady=!1;ja._error=void 0;ja._getTextureTaskProcessor=function(){if(!l(ja._textureTaskProcessor)){let e=new Jn("gaussianSplatTextureGenerator",ja._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?ja._taskProcessorReady=!0:ja._error=new he("Gaussian splat sorter could not be initialized.")}).catch(t=>{ja._error=t}),ja._textureTaskProcessor=e}return ja._textureTaskProcessor};ja.generateFromAttributes=function(e){let t=ja._getTextureTaskProcessor();if(l(ja._error))throw ja._error;if(!ja._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var z2=ja;var b7n=y(x(),1);function Gqe(e){let t=new EA;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=ke.getState(ke.fromCache({depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL}})),this.alphaOptions=new RC,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,be.FRAGMENT)}var H2=Gqe;var x7n=y(x(),1),K2=`//
// Vertex shader for Gaussian splats.

// The splats are rendered as quads in view space. Splat attributes are loaded from a texture with precomputed 3D covariance.

// Passes local quad coordinates and color to the fragment shader for Gaussian evaluation. 
//
// Discards splats outside the view frustum or with negligible screen size.
//
#if defined(HAS_SPHERICAL_HARMONICS)
const uint coefficientCount[3] = uint[3](3u,8u,15u);
const float SH_C1 = 0.48860251;
const float SH_C2[5] = float[5](
         1.092548430,
        -1.09254843,
        0.315391565,
        -1.09254843,
        0.546274215
);

const float SH_C3[7] = float[7](
         -0.59004358,
        2.890611442,
        -0.45704579,
        0.373176332,
        -0.45704579,
        1.445305721,
        -0.59004358
);

//Retrieve SH coefficient. Currently RG32UI format
uvec2 loadSHCoeff(uint splatID, int index) {
    ivec2 shTexSize = textureSize(u_sphericalHarmonicsTexture, 0);
    uint dims = coefficientCount[uint(u_sphericalHarmonicsDegree)-1u];
    uint splatsPerRow = uint(shTexSize.x) / dims;
    uint shIndex = (splatID%splatsPerRow) * dims + uint(index);
    ivec2 shPosCoord = ivec2(shIndex, splatID / splatsPerRow);
    return texelFetch(u_sphericalHarmonicsTexture, shPosCoord, 0).rg;
}

//Unpack RG32UI half float coefficients to vec3
vec3 halfToVec3(uvec2 packed) {
    return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x);
}

vec3 loadAndExpandSHCoeff(uint splatID, int index) {
    uvec2 coeff = loadSHCoeff(splatID, index);
    return halfToVec3(coeff);
}

vec3 evaluateSH(uint splatID, vec3 viewDir) {
    vec3 result = vec3(0.0);
    int coeffIndex = 0;
    float x = viewDir.x, y = viewDir.y, z = viewDir.z;

    if (u_sphericalHarmonicsDegree >= 1.) {
        vec3 sh1 = loadAndExpandSHCoeff(splatID, coeffIndex++);
        vec3 sh2 = loadAndExpandSHCoeff(splatID, coeffIndex++);
        vec3 sh3 = loadAndExpandSHCoeff(splatID, coeffIndex++);
        result += -SH_C1 * y * sh1 + SH_C1 * z * sh2 - SH_C1 * x * sh3;

        if (u_sphericalHarmonicsDegree >= 2.) {
            float xx = x * x;
            float yy = y * y;
            float zz = z * z;
            float xy = x * y;
            float yz = y * z;
            float xz = x * z;

            vec3 sh4 = loadAndExpandSHCoeff(splatID, coeffIndex++);
            vec3 sh5 = loadAndExpandSHCoeff(splatID, coeffIndex++);
            vec3 sh6 = loadAndExpandSHCoeff(splatID, coeffIndex++);
            vec3 sh7 = loadAndExpandSHCoeff(splatID, coeffIndex++);
            vec3 sh8 = loadAndExpandSHCoeff(splatID, coeffIndex++);
            result += SH_C2[0] * xy * sh4 +
                    SH_C2[1] * yz * sh5 +
                    SH_C2[2] * (2.0f * zz - xx - yy) * sh6 +
                    SH_C2[3] * xz * sh7 +
                    SH_C2[4] * (xx - yy) * sh8;

            if (u_sphericalHarmonicsDegree >= 3.) {
                vec3 sh9 = loadAndExpandSHCoeff(splatID, coeffIndex++);
                vec3 sh10 = loadAndExpandSHCoeff(splatID, coeffIndex++);
                vec3 sh11 = loadAndExpandSHCoeff(splatID, coeffIndex++);
                vec3 sh12 = loadAndExpandSHCoeff(splatID, coeffIndex++);
                vec3 sh13 = loadAndExpandSHCoeff(splatID, coeffIndex++);
                vec3 sh14 = loadAndExpandSHCoeff(splatID, coeffIndex++);
                vec3 sh15 = loadAndExpandSHCoeff(splatID, coeffIndex++);
                result += SH_C3[0] * y * (3.0f * xx - yy) * sh9 +
                        SH_C3[1] * xy * z * sh10 +
                        SH_C3[2] * y * (4.0f * zz - xx - yy) * sh11 +
                        SH_C3[3] * z * (2.0f * zz - 3.0f * xx - 3.0f * yy) * sh12 +
                        SH_C3[4] * x * (4.0f * zz - xx - yy) * sh13 +
                        SH_C3[5] * z * (xx - yy) * sh14 +
                        SH_C3[6] * x * (xx - 3.0f * yy) * sh15;
            }
        }
    }
    return result;
}
#endif

// Transforms and projects splat covariance into screen space and extracts the major and minor axes of the Gaussian ellipsoid
// which is used to calculate the vertex position in clip space.
vec4 calcCovVectors(vec3 viewPos, mat3 Vrk) {
    vec4 t = vec4(viewPos, 1.0);
    vec2 focal = vec2(czm_projection[0][0] * czm_viewport.z, czm_projection[1][1] * czm_viewport.w);

    vec2 J1 = focal / t.z;
    vec2 J2 = -focal * vec2(t.x, t.y) / (t.z * t.z);
    mat3 J = mat3(
        J1.x, 0.0, J2.x,
        0.0, J1.y, J2.y,
        0.0, 0.0, 0.0
    );

    mat3 R = mat3(czm_modelView);

    //transform our covariance into view space
    //ensures orientation is correct
    mat3 Vrk_view = R * Vrk * transpose(R);
    mat3 cov = transpose(J) * Vrk_view * J;

    float diagonal1 = cov[0][0] + .3;
    float offDiagonal = cov[0][1];
    float diagonal2 = cov[1][1] + .3;

    float mid = 0.5 * (diagonal1 + diagonal2);
    float radius = length(vec2((diagonal1 - diagonal2) * 0.5, offDiagonal));
    float lambda1 = mid + radius;
    float lambda2 = max(mid - radius, 0.1);

    vec2 diagonalVector = normalize(vec2(offDiagonal, lambda1 - diagonal1));

    return vec4(
        min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector,
        min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x)
    );
}

highp vec4 discardVec = vec4(0.0, 0.0, 2.0, 1.0);

void main() {
    uint texIdx = uint(a_splatIndex);
    ivec2 posCoord = ivec2((texIdx & 0x3ffu) << 1, texIdx >> 10);
    vec4 splatPosition = vec4( uintBitsToFloat(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))) );

    vec4 splatViewPos = czm_modelView * vec4(splatPosition.xyz, 1.0);
    vec4 clipPosition = czm_projection * splatViewPos;

    float clip = 1.2 * clipPosition.w;
    if (clipPosition.z < -clip || clipPosition.x < -clip || clipPosition.x > clip ||
        clipPosition.y < -clip || clipPosition.y > clip) {
        gl_Position = vec4(0.0, 0.0, 2.0, 1.0);
        return;
    }

    ivec2 covCoord = ivec2(((texIdx & 0x3ffu) << 1) | 1u, texIdx >> 10);
    uvec4 covariance = uvec4(texelFetch(u_splatAttributeTexture, covCoord, 0));

    gl_Position = clipPosition;

    vec2 u1 = unpackHalf2x16(covariance.x) ;
    vec2 u2 = unpackHalf2x16(covariance.y);
    vec2 u3 = unpackHalf2x16(covariance.z);
    mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y);

    vec4 covVectors = calcCovVectors(splatViewPos.xyz, Vrk);

    if (dot(covVectors.xy, covVectors.xy) < 4.0 && dot(covVectors.zw, covVectors.zw) < 4.0) {
        gl_Position = discardVec;
        return;
    }

    vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.;

    gl_Position += vec4((corner.x * covVectors.xy + corner.y * covVectors.zw) / czm_viewport.zw * gl_Position.w, 0, 0);
    gl_Position.z = clamp(gl_Position.z, -abs(gl_Position.w), abs(gl_Position.w));

    v_vertPos = corner ;
    v_splatColor = vec4(covariance.w & 0xffu, (covariance.w >> 8) & 0xffu, (covariance.w >> 16) & 0xffu, (covariance.w >> 24) & 0xffu) / 255.0;
#if defined(HAS_SPHERICAL_HARMONICS)
    vec4 splatWC = czm_inverseView * splatViewPos;
    vec3 viewDirModel = normalize(u_inverseModelRotation * (splatWC.xyz - u_cameraPositionWC.xyz));

    v_splatColor.rgb += evaluateSH(texIdx, viewDirModel).rgb;
#endif
    v_splitDirection = u_splitDirection;
}`;var E7n=y(x(),1),J2=`//
// Fragment shader for Gaussian splats.
// Renders a Gaussian splat within a quad, discarding fragments outside the unit circle.
// Applies an approximate Gaussian falloff based on distance from the center and outputs
// a color modulated by the alpha and Gaussian weight.
//
void main() {
    if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;

    float A = -dot(v_vertPos, v_vertPos);
    if (A < -4.) {
        discard;
    }

    float B = exp(A * 4.) * v_splatColor.a ;
    out_FragColor = vec4(v_splatColor.rgb * B , B);
}
`;var RI=new F,The=new F,D0=new F,Vqe=new F,yd={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4};function Lqe(e,t){return new Wt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:je.RG_INTEGER,pixelDatatype:ve.UNSIGNED_INT,flipY:!1,sampler:Ht.NEAREST})}function Ehe(e,t){return new Wt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:je.RGBA_INTEGER,pixelDatatype:ve.UNSIGNED_INT,flipY:!1,sampler:Ht.NEAREST})}function au(e){e=e??Q.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._prevViewMatrix=new F,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=Br.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._rootTransform=void 0,this._axisCorrectionMatrix=Xt.getAxisCorrectionMatrix(to.Y,to.X,new F),this._isDestroyed=!1,this._sorterState=yd.IDLE,this._sorterPromise=void 0,this._sorterError=void 0}Object.defineProperties(au.prototype,{ready:{get:function(){return this._ready}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});au.prototype._wrappedUpdate=function(e){this._baseTilesetUpdate.call(this._tileset,e),this.update(e)};au.prototype.destroy=function(){this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,l(this.gaussianSplatTexture)&&(this.gaussianSplatTexture.destroy(),this.gaussianSplatTexture=void 0);let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),fe(this)};au.prototype.isDestroyed=function(){return this._isDestroyed};au.prototype.onTileLoad=function(e){this._dirty=!0};au.prototype.onTileVisible=function(e){};au.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=Tt.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let o=i._rootTransform,r=F.multiplyTransformation(t,i._axisCorrectionMatrix,RI);F.multiplyTransformation(r,e.content.worldTransform,r);let s=F.multiply(e.tileset.modelMatrix,o,The),a=F.inverse(s,D0),c=F.multiplyTransformation(a,r,RI),d=e.content.positions,u=e.content.rotations,h=e.content.scales,p=Xt.getAttributeBySemantic(n,at.POSITION).typedArray,g=Xt.getAttributeBySemantic(n,at.ROTATION).typedArray,f=Xt.getAttributeBySemantic(n,at.SCALE).typedArray,b=new m,C=new Me,E=new m;for(let T=0;T<p.length/3;++T)b.x=p[T*3],b.y=p[T*3+1],b.z=p[T*3+2],C.x=g[T*4],C.y=g[T*4+1],C.z=g[T*4+2],C.w=g[T*4+3],E.x=f[T*3],E.y=f[T*3+1],E.z=f[T*3+2],F.fromTranslationQuaternionRotationScale(b,C,E,D0),F.multiplyTransformation(c,D0,D0),F.getTranslation(D0,b),F.getRotation(D0,C),F.getScale(D0,E),d[T*3]=b.x,d[T*3+1]=b.y,d[T*3+2]=b.z,u[T*4]=C.x,u[T*4+1]=C.y,u[T*4+2]=C.z,u[T*4+3]=C.w,h[T*3]=E.x,h[T*3+1]=E.y,h[T*3+2]=E.z};au.generateSplatTexture=function(e,t){e._gaussianSplatTexturePending=!0;let n=z2.generateFromAttributes({attributes:{positions:new Float32Array(e._positions),scales:new Float32Array(e._scales),rotations:new Float32Array(e._rotations),colors:new Uint8Array(e._colors)},count:e._numSplats});if(!l(n)){e._gaussianSplatTexturePending=!1;return}n.then(i=>{if(!e._gaussianSplatTexture)e.gaussianSplatTexture=Ehe(t.context,i);else if(e._lastTextureHeight!==i.height||e._lastTextureWidth!==i.width){let o=e.gaussianSplatTexture;e._gaussianSplatTexture=Ehe(t.context,i),o.destroy()}else e.gaussianSplatTexture.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:i.data}});e._vertexArray=void 0,e._lastTextureHeight=i.height,e._lastTextureWidth=i.width,e._hasGaussianSplatTexture=!0,e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,(!l(e._indexes)||e._indexes.length<e._numSplats)&&(e._indexes=new Uint32Array(e._numSplats));for(let o=0;o<e._numSplats;++o)e._indexes[o]=o}).catch(i=>{console.error("Error generating Gaussian splat texture:",i),e._gaussianSplatTexturePending=!1})};au.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new H2(e),{shaderBuilder:o}=i,r=i.renderStateOptions;r.cull.enabled=!1,r.depthMask=!1,r.depthTest.enabled=!0,r.blending=fn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Ve.GAUSSIAN_SPLATS,o.addAttribute("vec2","a_screenQuadPosition"),o.addAttribute("float","a_splatIndex"),o.addVarying("vec4","v_splatColor"),o.addVarying("vec2","v_vertPos"),o.addUniform("float","u_splitDirection",be.VERTEX),o.addVarying("float","v_splitDirection"),o.addUniform("highp usampler2D","u_splatAttributeTexture",be.VERTEX),o.addUniform("float","u_sphericalHarmonicsDegree",be.VERTEX),o.addUniform("float","u_splatScale",be.VERTEX),o.addUniform("vec3","u_cameraPositionWC",be.VERTEX),o.addUniform("mat3","u_inverseModelRotation",be.VERTEX);let s=i.uniformMap,a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},e._sphericalHarmonicsDegree>0&&(o.addDefine("HAS_SPHERICAL_HARMONICS","1",be.VERTEX),o.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",be.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return m.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){let b=e._tileset,C=F.multiply(b.modelMatrix,e._rootTransform,RI);return F.getRotation(F.inverse(C,D0),Vqe)},s.u_splitDirection=function(){return e.splitDirection},i.instanceCount=e._numSplats,i.count=4,i.primitiveType=Be.TRIANGLE_STRIP,o.addVertexLines(K2),o.addFragmentLines(J2);let c=o.buildShaderProgram(t.context),d=Qe(ke.fromCache(i.renderStateOptions),!0);d.cull.face=Xt.getCullFace(n.modelMatrix,Be.TRIANGLE_STRIP),d=ke.fromCache(d);let u={screenQuadPosition:0,splatIndex:2},h=new Tn.Attribute;if(h.name="_SPLAT_INDEXES",h.typedArray=e._indexes,h.componentDatatype=J.UNSIGNED_INT,h.type=Ut.SCALAR,h.normalized=!1,h.count=i.instanceCount,h.constant=0,h.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let b=new pt({attributes:{screenQuadPosition:new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...h,variableName:"splatIndex"}},primitiveType:Be.TRIANGLE_STRIP});e._vertexArray=si.fromGeometry({context:t.context,geometry:b,attributeLocations:u,bufferUsage:Xe.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let p=F.multiply(n.modelMatrix,e._rootTransform,The),g=e._vertexArray,f=new nt({boundingVolume:n.boundingSphere,modelMatrix:p,uniformMap:s,renderState:d,vertexArray:g,shaderProgram:c,cull:r.cull.enabled,pass:Ve.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Be.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=f};au.prototype.update=function(e){let t=this._tileset;if(!(!t.show||t._selectedTiles.length===0)){if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}if(e.passes.pick!==!0){if(this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection),this._sorterState===yd.IDLE){if(!this._dirty&&F.equals(e.camera.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&t._selectedTiles.length!==this.selectedTileLength){this._numSplats=0,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._shData=void 0,this._needsGaussianSplatTexture=!0,this._gaussianSplatTexturePending=!1;let n=t._selectedTiles,i=n.reduce((s,a)=>s+a.content.pointsLength,0),o=(s,a,c)=>{let d,u=0;for(let h of n){let p=h.content,g=a(p),f=l(c)?c:Ut.getNumberOfComponents(g.type),b=l(g.typedArray)?g.typedArray:g;l(d)||(d=J.createTypedArray(s,i*f)),d.set(b,u),u+=b.length}return d},r=()=>{let s=0;for(let a of n){let c=a.content.packedSphericalHarmonicsData;if(a.content.sphericalHarmonicsDegree>0){if(!l(this._shData)){let d;switch(a.content.sphericalHarmonicsDegree){case 1:d=9;break;case 2:d=24;break;case 3:d=45}this._shData=new Uint32Array(i*(d*(2/3)))}this._shData.set(c,s),s+=c.length}}};this._positions=o(J.FLOAT,s=>s.positions,3),this._scales=o(J.FLOAT,s=>s.scales,3),this._rotations=o(J.FLOAT,s=>s.rotations,4),this._colors=o(J.UNSIGNED_BYTE,s=>Xt.getAttributeBySemantic(s.gltfPrimitive,at.COLOR)),r(),this._sphericalHarmonicsDegree=n[0].content.sphericalHarmonicsDegree,this._numSplats=i,this.selectedTileLength=t._selectedTiles.length}if(this._numSplats===0)return;if(this._needsGaussianSplatTexture){if(!this._gaussianSplatTexturePending&&(au.generateSplatTexture(this,e),l(this._shData))){let n=this.sphericalHarmonicsTexture,i=Yt.maximumTextureSize,o=t._selectedTiles[0].content.sphericalHarmonicsCoefficientCount/3,r=Math.floor(i/o),s=r*(o*2),a=new Uint32Array(i*Math.ceil(this._numSplats/r)*2),c=0;for(let d=0;c<this._shData.length;d+=i*2)a.set(this._shData.subarray(c,c+s),d),c+=s;this.sphericalHarmonicsTexture=Lqe(e.context,{data:a,width:i,height:Math.ceil(this._numSplats/r)}),l(n)&&n.destroy()}return}if(F.clone(e.camera.viewMatrix,this._prevViewMatrix),F.multiply(e.camera.viewMatrix,this._rootTransform,RI),l(this._sorterPromise)||(this._sorterPromise=ZI.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(RI),count:this._numSplats},sortType:"Index"})),!l(this._sorterPromise)){this._sorterState=yd.WAITING;return}this._sorterPromise.catch(n=>{this._sorterState=yd.ERROR,this._sorterError=n}),this._sorterPromise.then(n=>{this._indexes=n,this._sorterState=yd.SORTED})}else if(this._sorterState===yd.WAITING){if(l(this._sorterPromise)||(this._sorterPromise=ZI.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(RI),count:this._numSplats},sortType:"Index"})),!l(this._sorterPromise)){this._sorterState=yd.WAITING;return}this._sorterPromise.catch(n=>{this._sorterState=yd.ERROR,this._sorterError=n}),this._sorterPromise.then(n=>{this._indexes=n,this._sorterState=yd.SORTED}),this._sorterState=yd.SORTING}else{if(this._sorterState===yd.SORTING)return;if(this._sorterState===yd.SORTED)au.buildGSplatDrawCommand(this,e),this._sorterState=yd.IDLE,this._dirty=!1,this._sorterPromise=void 0;else if(this._sorterState===yd.ERROR)throw this._sorterError}this._dirty=!1}}};var GI=au;function cu(e,t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._loader=e,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new GI({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0}cu.tilesetRequiresGaussianSplattingExt=function(e){let t=!1;return e.isGltfExtensionRequired instanceof Function&&(t=e.isGltfExtensionRequired("KHR_gaussian_splatting")&&e.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),e.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Ms("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions

Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),t};Object.defineProperties(cu.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return this.gltfPrimitive.attributes[0].count}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this.gltfPrimitive.attributes.reduce((e,t)=>e+t.byteLength,0)}},texturesByteLength:{get:function(){let e=this._tileset.gaussianSplatPrimitive.gaussianSplatTexture,t=this._tileset.gaussianSplatPrimitive.selectedTileLength;return!l(e)||t===0?0:e.sizeInBytes/t}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},transformed:{get:function(){return this._transformed}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}},positions:{get:function(){return this._positions}},rotations:{get:function(){return this._rotations}},scales:{get:function(){return this._scales}},sphericalHarmonicsCoefficientCount:{get:function(){return this._sphericalHarmonicsCoefficientCount}},sphericalHarmonicsDegree:{get:function(){return this._sphericalHarmonicsDegree}},packedSphericalHarmonicsData:{get:function(){return this._packedSphericalHarmonicsData}}});function Wqe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function Fqe(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var She=new ArrayBuffer(4),Bqe=new Float32Array(She),wqe=new Uint32Array(She);function OJ(e){Bqe[0]=e;let t=wqe[0],n=t>>31&1,i=t>>23&255,o=t&8388607,r;if(i===255)r=n<<15|31744|(o?512:0);else if(i===0)r=n<<15;else{let s=i-127+15;s>=31?r=n<<15|31744:s<=0?r=n<<15:r=n<<15|s<<10|o>>>13}return r}function Yqe(e){let t=Wqe(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),s=parseInt(e.slice(o+n.length),10);return{l:r,n:s}}function Nqe(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),o=new Uint32Array(i),r=e.gltfPrimitive.attributes.filter(d=>d.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}r.sort((d,u)=>d.name<u.name?-1:d.name>u.name?1:0);let c=s*(2/3);for(let d=0;d<r.length;d++){let{l:u,n:h}=Yqe(r[d].name);for(let p=0;p<e.pointsLength;p++){let g=a[u-1]*2/3,f=p*c+g+h*2,b=p*3;o[f]=OJ(r[d].typedArray[b])|OJ(r[d].typedArray[b+1])<<16,o[f+1]=OJ(r[d].typedArray[b+2])}}return o}cu.fromGltf=async function(e,t,n,i){let o=n,r=Ge.createIfNeeded(o),s={releaseGltfJson:!1,upAxis:to.Y,forwardAxis:to.Z};l(i.asset)?(s.gltfJson=i,s.baseResource=r,s.gltfResource=r):i instanceof Uint8Array?(s.typedArray=i,s.baseResource=r,s.gltfResource=r):s.gltfResource=Ge.createIfNeeded(i);let a=new eu(s);try{await a.load()}catch(c){throw a.destroy(),new he(`Failed to load glTF: ${c.message}`)}return new cu(a,e,t,n)};cu.prototype.update=function(e,t){let n=this._loader;if(this._ready){!this._transformed&&e.root.content.ready&&(GI.transformTile(this._tile),this._transformed=!0);return}if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=n.components.scene.nodes[0].primitives[0],this.worldTransform=n.components.scene.nodes[0].matrix,this._ready=!0,this._positions=new Float32Array(Xt.getAttributeBySemantic(this.gltfPrimitive,at.POSITION).typedArray),this._rotations=new Float32Array(Xt.getAttributeBySemantic(this.gltfPrimitive,at.ROTATION).typedArray),this._scales=new Float32Array(Xt.getAttributeBySemantic(this.gltfPrimitive,at.SCALE).typedArray);let{l:i,n:o}=Fqe(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=i,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=Nqe(this);return}this._resourcesLoaded=n.process(t)};cu.prototype.hasProperty=function(e,t){return!1};cu.prototype.getFeature=function(e){};cu.prototype.applyDebugSettings=function(e,t){};cu.prototype.applyStyle=function(e){};cu.prototype.pick=function(e,t,n){};cu.prototype.isDestroyed=function(){return this.isDestroyed};cu.prototype.destroy=function(){return this.splatPrimitive=void 0,l(this._tileset.gaussianSplatPrimitive)&&!this._tileset.gaussianSplatPrimitive.isDestroyed()&&this._tileset.gaussianSplatPrimitive.destroy(),this._tileset.gaussianSplatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),fe(this)};var v0=cu;var Ihe={b3dm:function(e,t,n,i,o){return ou.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return ou.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return ou.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return qL.fromTileType(e,t,n,i,o,Ihe)},externalTileset:function(e,t,n,i){return T2.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new tW(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new O2(e,t,n,i,o)},subt:function(e,t,n,i,o){return YS.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return YS.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new he("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return v0.tilesetRequiresGaussianSplattingExt(e)?v0.fromGltf(e,t,n,c):ou.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return v0.tilesetRequiresGaussianSplattingExt(e)?v0.fromGltf(e,t,n,i):ou.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return ou.fromGeoJson(e,t,n,i)}},PC=Ihe;var G6n=y(x(),1),Xqe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},lr=Object.freeze(Xqe);var L6n=y(x(),1),Jh={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Jh.isBinaryFormat=function(e){switch(e){case Jh.BATCHED_3D_MODEL:case Jh.INSTANCED_3D_MODEL:case Jh.COMPOSITE:case Jh.POINT_CLOUD:case Jh.VECTOR:case Jh.GEOMETRY:case Jh.IMPLICIT_SUBTREE:case Jh.VOXEL_BINARY:case Jh.GLTF_BINARY:return!0;default:return!1}};var sa=Object.freeze(Jh);var F6n=y(x(),1),Pqe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Tm=Object.freeze(Pqe);var w6n=y(x(),1),Za={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},Cg=new Array(Za.NUMBER_OF_PASSES);Cg[Za.RENDER]=Object.freeze({pass:Za.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Cg[Za.PICK]=Object.freeze({pass:Za.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Cg[Za.SHADOW]=Object.freeze({pass:Za.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Cg[Za.PRELOAD]=Object.freeze({pass:Za.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Cg[Za.PRELOAD_FLIGHT]=Object.freeze({pass:Za.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Cg[Za.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Za.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Cg[Za.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Za.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Cg[Za.MOST_DETAILED_PICK]=Object.freeze({pass:Za.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Za.getPassOptions=function(e){return Cg[e]};var nr=Object.freeze(Za);var X6n=y(x(),1);function Ap(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Ap.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(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});Ap.prototype.hasProperty=function(e,t){return!1};Ap.prototype.getFeature=function(e){};Ap.prototype.applyDebugSettings=function(e,t){};Ap.prototype.applyStyle=function(e){};Ap.prototype.update=function(e,t){};Ap.prototype.pick=function(e,t,n){};Ap.prototype.isDestroyed=function(){return!1};Ap.prototype.destroy=function(){return fe(this)};var VI=Ap;var K6n=y(x(),1);var D6n=y(x(),1);function Eg(e){e=e??Q.EMPTY_OBJECT;let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Eg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Eg.prototype.hasProperty=function(e){return zn.hasProperty(e,this._properties,this._class)};Eg.prototype.hasPropertyBySemantic=function(e){return zn.hasPropertyBySemantic(e,this._properties,this._class)};Eg.prototype.getPropertyIds=function(e){return zn.getPropertyIds(this._properties,this._class,e)};Eg.prototype.getProperty=function(e){return zn.getProperty(e,this._properties,this._class)};Eg.prototype.setProperty=function(e,t){return zn.setProperty(e,t,this._properties,this._class)};Eg.prototype.getPropertyBySemantic=function(e){return zn.getPropertyBySemantic(e,this._properties,this._class)};Eg.prototype.setPropertyBySemantic=function(e,t){return zn.setPropertyBySemantic(e,t,this._properties,this._class)};var j2=Eg;function zJ(e,t){let n=Ti(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){zJ._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??Q.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new j2({content:n,class:o})}}zJ._oneTimeWarning=At;var MC=zJ;var $6n=y(x(),1);function Mqe(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=Ti(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var UC=Mqe;var dqn=y(x(),1);var iqn=y(x(),1);function Tg(e){e=e??Q.EMPTY_OBJECT;let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Tg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Tg.prototype.hasProperty=function(e){return zn.hasProperty(e,this._properties,this._class)};Tg.prototype.hasPropertyBySemantic=function(e){return zn.hasPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.getPropertyIds=function(e){return zn.getPropertyIds(this._properties,this._class,e)};Tg.prototype.getProperty=function(e){return zn.getProperty(e,this._properties,this._class)};Tg.prototype.setProperty=function(e,t){return zn.setProperty(e,t,this._properties,this._class)};Tg.prototype.getPropertyBySemantic=function(e){return zn.getPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.setPropertyBySemantic=function(e,t){return zn.setPropertyBySemantic(e,t,this._properties,this._class)};var q2=Tg;function HJ(e,t){let n=Ti(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){HJ._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??Q.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new q2({tile:n,class:o})}}HJ._oneTimeWarning=At;var $2=HJ;var Wqn=y(x(),1);var gqn=y(x(),1);function Uqe(e){let t=new Uint8Array(e),n=Zh(t);if(n==="glTF"&&(n="glb"),sa.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Dqe(t);if(l(i.root))return{contentType:sa.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:sa.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:sa.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:sa.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:sa.VOXEL_JSON,jsonPayload:i};throw new he("Invalid tile content.")}function Dqe(e){let t;try{t=Cr(e)}catch{throw new he("Invalid tile content.")}return t}var Sg=Uqe;function Sm(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=Lc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(Sm.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function KJ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function _he(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}Sm.prototype.requestInnerContents=function(){if(!vqe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;KJ(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=kqe(this,n,t,this._tile._contentState);return Qqe(this)};function vqe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!Lc.serverHasOpenSlots(n,t[n]))return!1;return Lc.heapHasOpenSlots(e.length)}function kqe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new pr({throttle:!0,throttleByServer:!0,type:Ys.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let d=o.fetchArrayBuffer();if(l(d))return d.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===pi.CANCELLED){_he(e,i);return}return KJ(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===pi.CANCELLED){_he(e,i);return}KJ(e,-1),Zhe(e,t,u)}})}async function Qqe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>Oqe(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(l),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function Oqe(e,t,n){if(l(t))try{let i=Sg(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===sa.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===sa.GEOMETRY||i.contentType===sa.VECTOR;let a,c=PC[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=MC(o,d));let u=UC(o,d);return l(u)&&(a.group=new Jx({metadata:u})),a}catch(i){Zhe(e,n,i)}}function Zhe(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Sm.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};Sm.prototype.hasProperty=function(e,t){return!1};Sm.prototype.getFeature=function(e){};Sm.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Sm.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Sm.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};Sm.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=m.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};Sm.prototype.isDestroyed=function(){return!1};Sm.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var ew=Sm;var _$n=y(x(),1);var a$n=y(x(),1);var Dqn=y(x(),1);var Rhe=Math.cos,Ghe=Math.sin,zqe=Math.sqrt,JJ={};JJ.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,d=e.boundingRectangle,u=c.latitude-e.granYCos*i+o*e.granXSin,h=Rhe(u),p=Ghe(u),g=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,b=h*Rhe(f),C=h*Ghe(f),E=a.x*b,T=a.y*C,S=zqe(E*b+T*C+g*p);if(r.x=E/S,r.y=T/S,r.z=g/S,n){let _=e.stNwCorner;l(_)?(u=_.latitude-e.stGranYCos*i+o*e.stGranXSin,f=_.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(f-e.stWest)*e.lonScalar,s.y=(u-e.stSouth)*e.latScalar):(s.x=(f-d.west)*e.lonScalar,s.y=(u-d.south)*e.latScalar)}};var Hqe=new ki,Im=new m,Kqe=new pe,wk=new m,tw=new vi;function Vhe(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,d=n*a,u=Math.sin(t),h=i*u,p=n*u;tw._ellipsoid=ie.default,Im=tw.project(e,Im),Im=m.subtract(Im,wk,Im);let g=ki.fromRotation(t,Hqe);Im=ki.multiplyByVector(g,Im,Im),Im=m.add(Im,wk,Im),e=tw.unproject(Im,e),r-=1,s-=1;let f=e.latitude,b=f+r*p,C=f-c*s,E=f-c*s+r*p,T=Math.max(f,b,C,E),S=Math.min(f,b,C,E),_=e.longitude,R=_+r*d,L=_+s*h,W=_+s*h+r*d,B=Math.max(_,R,L,W),Y=Math.min(_,R,L,W);return{north:T,south:S,east:B,west:Y,granYCos:c,granYSin:h,granXCos:d,granXSin:p,nwCorner:e}}JJ.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,d=e.north,u=e.south,h=!1,p=!1;d===V.PI_OVER_TWO&&(h=!0),u===-V.PI_OVER_TWO&&(p=!0);let g,f=d-u;c>a?g=V.TWO_PI-c+a:g=a-c;let b=Math.ceil(g/t)+1,C=Math.ceil(f/t)+1,E=g/(b-1),T=f/(C-1),S=de.northwest(e,r),_=de.center(e,Kqe);(n!==0||i!==0)&&(_.longitude<S.longitude&&(_.longitude+=V.TWO_PI),tw._ellipsoid=ie.default,wk=tw.project(_,wk));let R=T,L=E,W=0,B=0,Y=de.clone(e,o),N={granYCos:R,granYSin:W,granXCos:L,granXSin:B,nwCorner:S,boundingRectangle:Y,width:b,height:C,northCap:h,southCap:p};if(n!==0){let A=Vhe(S,n,E,T,_,b,C);d=A.north,u=A.south,a=A.east,c=A.west,N.granYCos=A.granYCos,N.granYSin=A.granYSin,N.granXCos=A.granXCos,N.granXSin=A.granXSin,Y.north=d,Y.south=u,Y.east=a,Y.west=c}if(i!==0){n=n-i;let A=de.northwest(Y,s),I=Vhe(A,n,E,T,_,b,C);N.stGranYCos=I.granYCos,N.stGranXCos=I.granXCos,N.stGranYSin=I.granYSin,N.stGranXSin=I.granXSin,N.stNwCorner=A,N.stWest=I.west,N.stSouth=I.south}return N};var aa=JJ;var Jqe=new ue,jqe=new ue,qqe=new m,$qe=new de;function Lhe(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,d=0,u=4;r&&(c-=1,a-=1,d+=1,u-=2),s&&(c-=1,a-=1,d+=1,u-=2),d+=c*o+2*a-u;let h=new Float64Array(d*3),p=0,g=0,f,b=qqe;if(r)aa.computePosition(t,n,!1,g,0,b),h[p++]=b.x,h[p++]=b.y,h[p++]=b.z;else for(f=0;f<o;f++)aa.computePosition(t,n,!1,g,f,b),h[p++]=b.x,h[p++]=b.y,h[p++]=b.z;for(f=o-1,g=1;g<i;g++)aa.computePosition(t,n,!1,g,f,b),h[p++]=b.x,h[p++]=b.y,h[p++]=b.z;if(g=i-1,!s)for(f=o-2;f>=0;f--)aa.computePosition(t,n,!1,g,f,b),h[p++]=b.x,h[p++]=b.y,h[p++]=b.z;for(f=0,g=i-2;g>0;g--)aa.computePosition(t,n,!1,g,f,b),h[p++]=b.x,h[p++]=b.y,h[p++]=b.z;let C=h.length/3*2,E=Pe.createTypedArray(h.length/3,C),T=0;for(let _=0;_<h.length/3-1;_++)E[T++]=_,E[T++]=_+1;E[T++]=h.length/3-1,E[T++]=0;let S=new pt({attributes:new yn,primitiveType:Be.LINES});return S.attributes.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:h}),S.indices=E,S}function e$e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Lhe(e,t),s=t.height,a=t.width,c=Si.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=c.length,u=new Float64Array(d*2);u.set(c);let h=Si.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(h,d),r.attributes.position.values=u;let p=t.northCap,g=t.southCap,f=4;p&&(f-=1),g&&(f-=1);let b=(u.length/3+f)*2,C=Pe.createTypedArray(u.length/3,b);d=u.length/6;let E=0;for(let S=0;S<d-1;S++)C[E++]=S,C[E++]=S+1,C[E++]=S+d,C[E++]=S+d+1;C[E++]=d-1,C[E++]=0,C[E++]=d+d-1,C[E++]=d,C[E++]=0,C[E++]=d;let T;if(p)T=s-1;else{let S=a-1;C[E++]=S,C[E++]=S+d,T=a+s-2}if(C[E++]=T,C[E++]=T+d,!g){let S=a+T-1;C[E++]=S,C[E]=S+d}return r.indices=C,r}function WI(e){e=e??Q.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??V.RADIANS_PER_DEGREE,i=e.ellipsoid??ie.default,o=e.rotation??0,r=e.height??0,s=e.extrudedHeight??r;this._rectangle=de.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}WI.packedLength=de.packedLength+ie.packedLength+5;WI.pack=function(e,t,n){return n=n??0,de.pack(e._rectangle,t,n),n+=de.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var Whe=new de,Fhe=ie.clone(ie.UNIT_SPHERE),LI={rectangle:Whe,ellipsoid:Fhe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};WI.unpack=function(e,t,n){t=t??0;let i=de.unpack(e,t,Whe);t+=de.packedLength;let o=ie.unpack(e,t,Fhe);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t];return l(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=ie.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=d===-1?void 0:d,n):(LI.granularity=r,LI.height=s,LI.rotation=a,LI.extrudedHeight=c,LI.offsetAttribute=d===-1?void 0:d,new WI(LI))};var t$e=new pe;WI.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=aa.computeOptions(t,e._granularity,e._rotation,0,$qe,t$e),o,r;if(V.equalsEpsilon(t.north,t.south,V.EPSILON10)||V.equalsEpsilon(t.east,t.west,V.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!V.equalsEpsilon(s,a,0,V.EPSILON2),d;if(c){if(o=e$e(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===mn.TOP?g=g.fill(1,0,p/2):(d=e._offsetAttribute===mn.NONE?0:1,g=g.fill(d)),o.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let u=ue.fromRectangle3D(t,n,s,jqe),h=ue.fromRectangle3D(t,n,a,Jqe);r=ue.union(u,h)}else{if(o=Lhe(e,i),o.attributes.position.values=Si.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===mn.NONE?0:1;let h=new Uint8Array(u/3).fill(d);o.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=ue.fromRectangle3D(t,n,s)}return new pt({attributes:o.attributes,indices:o.indices,primitiveType:Be.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var DC=WI;function BI(e){this.rectangle=de.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new m,this.northeastCornerCartesian=new m,this.westNormal=new m,this.southNormal=new m,this.eastNormal=new m,this.northNormal=new m;let t=e.ellipsoid??ie.WGS84;s$e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(BI.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});BI.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=tn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var Bhe=new m,Yk=new m,whe=new m,n$e=new m,i$e=new m,o$e=new m,r$e=new m,_m=new pe,Yhe=new an(m.UNIT_X,0),FI=new xn;function s$e(e,t,n){n.cartographicToCartesian(de.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(de.northeast(t),e.northeastCornerCartesian),_m.longitude=t.west,_m.latitude=(t.south+t.north)*.5,_m.height=0;let i=n.cartographicToCartesian(_m,o$e),o=m.cross(i,m.UNIT_Z,n$e);m.normalize(o,e.westNormal),_m.longitude=t.east;let r=n.cartographicToCartesian(_m,r$e),s=m.cross(m.UNIT_Z,r,Bhe);m.normalize(s,e.eastNormal);let a=m.subtract(i,r,Bhe);m.magnitude(a)===0&&(a=m.clone(o,a));let c=m.normalize(a,i$e),d=t.south,u;if(d>0){_m.longitude=(t.west+t.east)*.5,_m.latitude=d;let b=n.cartographicToCartesian(_m,FI.origin);m.clone(c,FI.direction);let C=an.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Yhe);di.rayPlane(FI,C,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(b,Yk)}else u=n.geodeticSurfaceNormalCartographic(de.southeast(t),Yk);let h=m.cross(u,a,whe);m.normalize(h,e.southNormal);let p=t.north,g;if(p<0){_m.longitude=(t.west+t.east)*.5,_m.latitude=p;let b=n.cartographicToCartesian(_m,FI.origin);m.negate(c,FI.direction);let C=an.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Yhe);di.rayPlane(FI,C,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(b,Yk)}else g=n.geodeticSurfaceNormalCartographic(de.northwest(t),Yk);let f=m.cross(a,g,whe);m.normalize(f,e.northNormal)}var a$e=new m,c$e=new m,l$e=new m(0,-1,0),d$e=new m(0,0,-1),Nhe=new m;function u$e(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!de.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,g=e.eastNormal,f=e.northNormal;t.mode!==se.SCENE3D&&(d=t.mapProjection.project(de.southwest(e.rectangle),a$e),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(de.northeast(e.rectangle),c$e),u.z=u.y,u.y=u.x,u.x=0,h=l$e,g=m.UNIT_Y,p=d$e,f=m.UNIT_Z);let b=m.subtract(i,d,Nhe),C=m.dot(b,h),E=m.dot(b,p),T=m.subtract(i,u,Nhe),S=m.dot(T,g),_=m.dot(T,f);C>0?r+=C*C:S>0&&(r+=S*S),E>0?r+=E*E:_>0&&(r+=_*_)}let s,a,c;if(t.mode===se.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let d=s-c;r+=d*d}else if(s<a){let d=a-s;r+=d*d}return Math.sqrt(r)}BI.prototype.distanceToCamera=function(e){let t=u$e(this,e);if(e.mode===se.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};BI.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};BI.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new DC({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Bt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:qt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new pn({translucent:!1,flat:!0}),asynchronous:!1})};var lu=BI;var mei=y(x(),1);var K$n=y(x(),1);var W$n=y(x(),1);var nw={},m$e=new m,Xhe=new m,Phe=new m,Mhe=new m,Uhe=new tn;nw.validOutline=function(e){let n=tn.fromPoints(e,Uhe).halfAxes,i=$.getColumn(n,0,Xhe),o=$.getColumn(n,1,Phe),r=$.getColumn(n,2,Mhe),s=m.magnitude(i),a=m.magnitude(o),c=m.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};nw.computeProjectTo2DArguments=function(e,t,n,i){let o=tn.fromPoints(e,Uhe),r=o.halfAxes,s=$.getColumn(r,0,Xhe),a=$.getColumn(r,1,Phe),c=$.getColumn(r,2,Mhe),d=m.magnitude(s),u=m.magnitude(a),h=m.magnitude(c),p=Math.min(d,u,h);if(d===0&&(u===0||h===0)||u===0&&h===0)return!1;let g,f;return(p===u||p===h)&&(g=s),p===d?g=a:p===h&&(f=a),(p===d||p===u)&&(f=c),m.normalize(g,n),m.normalize(f,i),m.clone(o.center,t),!0};function Dhe(e,t,n,i,o){let r=m.subtract(e,t,m$e),s=m.dot(n,r),a=m.dot(i,r);return M.fromElements(s,a,o)}nw.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Dhe(i[r],e,t,n);return o}};nw.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Dhe(i,e,t,n,o)}};var Ig=nw;function h$e(e){let t=e.length,n=new Float64Array(t*3),i=Pe.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:n})});return new pt({attributes:s,indices:i,primitiveType:Be.LINES})}function vC(e){e=e??Q.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ei.computeHierarchyPackedLength(t,m)+1}vC.fromPositions=function(e){e=e??Q.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new vC(t)};vC.pack=function(e,t,n){return n=n??0,n=ei.packPolygonHierarchy(e._polygonHierarchy,t,n,m),t[n]=e.packedLength,t};var f$e={polygonHierarchy:{}};vC.unpack=function(e,t,n){t=t??0;let i=ei.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new vC(f$e)),n._polygonHierarchy=i,n.packedLength=o,n};vC.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Mo(n,m.equalsEpsilon,!0),n.length<3||!Ig.validOutline(n))return;let o=ei.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let d=new Bt({geometry:h$e(o[c])});r.push(d)}let s=Dn.combineInstances(r)[0],a=ue.fromPoints(t.positions);return new pt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Zm=vC;var Nk=new pe;function iw(e){let t=UA.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??ie.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=T$e(t,n,i,o);this._boundingPlanes=r;let s=Z$e(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=oj(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=m.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=oj(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=oj(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();Nk=o.cartesianToCartographic(c,Nk),Nk.height=(i+n)/2,this.center=o.cartographicToCartesian(Nk,c),this._boundingSphere=ue.fromPoints(s)}var p$e=new m,A$e=new pe,g$e=new m,b$e=new pe,y$e=new m,x$e=new m,C$e=new m,E$e=new m;function T$e(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,p$e),a=i.cartesianToCartographic(r,A$e);a.height=n;let c=i.cartographicToCartesian(a,g$e),d=an.fromPointNormal(c,s);o[0]=d;let u=0,h,p=[],g,f;for(h=0;h<4;h++){g=e.getVertex(h),p[h]=g,f=i.cartesianToCartographic(g,b$e),f.height=t;let C=an.getPointDistance(d,i.cartographicToCartesian(f,y$e));C<u&&(u=C)}let b=an.clone(d);for(b.normal=m.negate(b.normal,b.normal),b.distance=b.distance*-1+u,o[1]=b,h=0;h<4;h++){g=p[h];let C=p[(h+1)%4],E=i.geodeticSurfaceNormal(g,x$e),T=m.subtract(C,g,E$e),S=m.cross(T,E,C$e);S=m.normalize(S,S),o[2+h]=an.fromPointNormal(g,S)}return o}var kC=new m,QC=new m,OC=new m,jJ=new m,qJ=new m,$J=new m,S$e=new m,I$e=new m,_$e=new m,ej=new m,tj=new m,nj=new m,k0=new m,gp=new $;function vhe(e,t,n){kC=e.normal,QC=t.normal,OC=n.normal,jJ=m.multiplyByScalar(e.normal,-e.distance,jJ),qJ=m.multiplyByScalar(t.normal,-t.distance,qJ),$J=m.multiplyByScalar(n.normal,-n.distance,$J),ej=m.multiplyByScalar(m.cross(QC,OC,S$e),m.dot(jJ,kC),ej),tj=m.multiplyByScalar(m.cross(OC,kC,I$e),m.dot(qJ,QC),tj),nj=m.multiplyByScalar(m.cross(kC,QC,_$e),m.dot($J,OC),nj),gp[0]=kC.x,gp[1]=QC.x,gp[2]=OC.x,gp[3]=kC.y,gp[4]=QC.y,gp[5]=OC.y,gp[6]=kC.z,gp[7]=QC.z,gp[8]=OC.z;let i=$.determinant(gp);return k0=m.add(ej,tj,k0),k0=m.add(k0,nj,k0),new m(k0.x/i,k0.y/i,k0.z/i)}function Z$e(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=vhe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=vhe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var ij=new m,wI=new m;function oj(e,t){let n=[];for(let i=0;i<4;i++)ij=m.subtract(t[(i+1)%4],t[i],ij),wI=m.cross(e.normal,ij,wI),wI=m.normalize(wI,wI),n[i]=m.clone(wI);return n}Object.defineProperties(iw.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var rj=new m;iw.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;an.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):an.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,an.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=sj(an.projectPointOntoPlane(c,t,rj),i[0],c,o),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=khe(t,p[0],p[1]),m.distance(a,t)}let u=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=sj(an.projectPointOntoPlane(c,t,rj),i[r],c,this._edgeNormals[n[r]]),h=m.distanceSquared(a,t),h<u&&(u=h);return Math.sqrt(u)}else if(n.length>3)return a=sj(an.projectPointOntoPlane(this._boundingPlanes[1],t,rj),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+d)%4]):m.distance(t,this._vertices[4+(n[1]-2+d)%4])};var R$e=new m,G$e=new m;function khe(e,t,n){let i=m.subtract(n,t,R$e),o=m.subtract(e,t,G$e),r=m.dot(i,o);if(r<=0)return t;let s=m.dot(i,i);return r>=s?n:(r=r/s,new m((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var V$e=new an(m.UNIT_X,0);function sj(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let d=an.fromPointNormal(t[c],i[c],V$e);an.getPointDistance(d,e)<0||(a=khe(e,t[c],t[(c+1)%4]),r=m.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}iw.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)m.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Jt.INSIDE:n===this._vertices.length?Jt.OUTSIDE:Jt.INTERSECTING};iw.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new Zm({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Zm.createGeometry(n),o=new Bt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:qt.fromColor(e)}}),r=new Zm({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Zm.createGeometry(r),a=new Bt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:qt.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new Zm({polygonHierarchy:{positions:this._planeVertices[2+d]}}),h=Zm.createGeometry(u);c[d]=new Bt({geometry:h,id:"outline",modelMatrix:t,attributes:{color:qt.fromColor(e)}})}return new Nn({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new pn({translucent:!1,flat:!0}),asynchronous:!1})};var ow=iw;var vei=y(x(),1);var Wei=y(x(),1);var Zei=y(x(),1);var L$e=new m(1,1,1),Xk=Math.cos,Pk=Math.sin;function YI(e){e=e??Q.EMPTY_OBJECT;let t=e.radii??L$e,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??V.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??V.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),d=Math.round(e.subdivisions??128);this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=d,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}YI.packedLength=2*m.packedLength+8;YI.pack=function(e,t,n){return n=n??0,m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var Qhe=new m,Ohe=new m,_g={radii:Qhe,innerRadii:Ohe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};YI.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,Qhe);t+=m.packedLength;let o=m.unpack(e,t,Ohe);t+=m.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=d,n._slicePartitions=u,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):(_g.minimumClock=r,_g.maximumClock=s,_g.minimumCone=a,_g.maximumCone=c,_g.stackPartitions=d,_g.slicePartitions=u,_g.subdivisions=h,_g.offsetAttribute=p===-1?void 0:p,new YI(_g))};YI.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ie.fromCartesian3(t),d=e._slicePartitions+1,u=e._stackPartitions+1;d=Math.round(d*Math.abs(o-i)/V.TWO_PI),u=Math.round(u*Math.abs(s-r)/V.PI),d<2&&(d=2),u<2&&(u=2);let h=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,f=!1,b=!1;g&&(p=2,r>0&&(f=!0,h+=d),s<Math.PI&&(b=!0,h+=d));let C=a*p*(u+d),E=new Float64Array(C*3),T=2*(C+h-(d+u)*p),S=Pe.createTypedArray(C,T),_,R,L,W,B=0,Y=new Array(u),N=new Array(u);for(_=0;_<u;_++)W=r+_*(s-r)/(u-1),Y[_]=Pk(W),N[_]=Xk(W);let A=new Array(a),I=new Array(a);for(_=0;_<a;_++)L=i+_*(o-i)/(a-1),A[_]=Pk(L),I[_]=Xk(L);for(_=0;_<u;_++)for(R=0;R<a;R++)E[B++]=t.x*Y[_]*I[R],E[B++]=t.y*Y[_]*A[R],E[B++]=t.z*N[_];if(g)for(_=0;_<u;_++)for(R=0;R<a;R++)E[B++]=n.x*Y[_]*I[R],E[B++]=n.y*Y[_]*A[R],E[B++]=n.z*N[_];for(Y.length=a,N.length=a,_=0;_<a;_++)W=r+_*(s-r)/(a-1),Y[_]=Pk(W),N[_]=Xk(W);for(A.length=d,I.length=d,_=0;_<d;_++)L=i+_*(o-i)/(d-1),A[_]=Pk(L),I[_]=Xk(L);for(_=0;_<a;_++)for(R=0;R<d;R++)E[B++]=t.x*Y[_]*I[R],E[B++]=t.y*Y[_]*A[R],E[B++]=t.z*N[_];if(g)for(_=0;_<a;_++)for(R=0;R<d;R++)E[B++]=n.x*Y[_]*I[R],E[B++]=n.y*Y[_]*A[R],E[B++]=n.z*N[_];for(B=0,_=0;_<u*p;_++){let w=_*a;for(R=0;R<a-1;R++)S[B++]=w+R,S[B++]=w+R+1}let Z=u*a*p;for(_=0;_<d;_++)for(R=0;R<a-1;R++)S[B++]=Z+_+R*d,S[B++]=Z+_+(R+1)*d;if(g)for(Z=u*a*p+d*a,_=0;_<d;_++)for(R=0;R<a-1;R++)S[B++]=Z+_+R*d,S[B++]=Z+_+(R+1)*d;if(g){let w=u*a*p,X=w+a*d;if(f)for(_=0;_<d;_++)S[B++]=w+_,S[B++]=X+_;if(b)for(w+=a*d-d,X+=a*d-d,_=0;_<d;_++)S[B++]=w+_,S[B++]=X+_}let G=new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:E})});if(l(e._offsetAttribute)){let w=E.length,X=e._offsetAttribute===mn.NONE?0:1,v=new Uint8Array(w/3).fill(X);G.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})}return new pt({attributes:G,indices:S,primitiveType:Be.LINES,boundingSphere:ue.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var du=YI;function NI(e){let t=e.radius??1,i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new du(i),this._workerName="createSphereOutlineGeometry"}NI.packedLength=du.packedLength;NI.pack=function(e,t,n){return du.pack(e._ellipsoidGeometry,t,n)};var W$e=new du,zC={radius:void 0,radii:new m,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};NI.unpack=function(e,t,n){let i=du.unpack(e,t,W$e);return zC.stackPartitions=i._stackPartitions,zC.slicePartitions=i._slicePartitions,zC.subdivisions=i._subdivisions,l(n)?(m.clone(i._radii,zC.radii),n._ellipsoidGeometry=new du(zC),n):(zC.radius=i._radii.x,new NI(zC))};NI.createGeometry=function(e){return du.createGeometry(e._ellipsoidGeometry)};var Zg=NI;function XI(e,t){t===0&&(t=V.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(XI.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}}});XI.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,m.distance(t.center,e.camera.positionWC)-t.radius)};XI.prototype.intersectPlane=function(e){return ue.intersectPlane(this._boundingSphere,e)};XI.prototype.update=function(e,t){m.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};XI.prototype.createDebugVolume=function(e){let t=new Zg({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:qt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new pn({translucent:!1,flat:!0}),asynchronous:!1})};var Rg=XI;var nti=y(x(),1);var F$e=new m,B$e=new m,w$e=new m,Y$e=new m;function HC(e,t,n){n=m.cross(e,t,n);let i=m.magnitude(n);return m.multiplyByScalar(n,V.EPSILON7/i,n)}function aj(e,t){let n=m.normalize(e,Y$e),i=m.equalsEpsilon(n,m.UNIT_X,V.EPSILON6)?m.UNIT_Y:m.UNIT_X;return HC(e,i,t)}function zhe(e){let t=$.getColumn(e,0,F$e),n=$.getColumn(e,1,B$e),i=$.getColumn(e,2,w$e),o=m.equals(t,m.ZERO),r=m.equals(n,m.ZERO),s=m.equals(i,m.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=V.EPSILON7,e[4]=V.EPSILON7,e[8]=V.EPSILON7,e):(o&&!r&&!s?t=HC(n,i,t):!o&&r&&!s?n=HC(t,i,n):!o&&!r&&s?i=HC(n,t,i):o?r?s||(t=aj(i,t),n=HC(i,t,n)):(t=aj(n,t),i=HC(n,t,i)):(n=aj(t,n),i=HC(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function PI(e,t){t=zhe(t),this._orientedBoundingBox=new tn(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(PI.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});PI.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};PI.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};PI.prototype.update=function(e,t){m.clone(e,this._orientedBoundingBox.center),t=zhe(t),$.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};PI.prototype.createDebugVolume=function(e){let t=new gh({minimum:new m(-1,-1,-1),maximum:new m(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:qt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new pn({translucent:!1,flat:!0}),asynchronous:!1})};var xd=PI;function Sr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||Ti(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=F.multiply(a,this.transform,new F),d=l(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(d,this.transform,new F),this.computedTransform=c,this.metadata=$2(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;l(s)&&l(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let h;l(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,Sr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&Sr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?ar.REPLACE:ar.ADD):l(i)?p=i.refine:p=ar.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,f=!1,b,C,E;if(t=Ge.createIfNeeded(t),r)b=lr.UNLOADED,C=t.clone();else if(l(s)){let R=s.uri;l(s.url)&&(Sr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),R=s.url),R===""?(Sr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new VI(e,this),f=!0,b=lr.READY):(b=lr.UNLOADED,C=t.getDerivedResource({url:R}),E=Lc.getServerKey(C.getUrlComponent()))}else g=new VI(e,this),f=!0,b=lr.READY;this._content=g,this._contentResource=C,this._contentState=b,this._expiredContent=void 0,this._serverKey=E,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!f,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let T=n.expire,S,_;l(T)&&(S=T.duration,l(T.date)&&(_=j.fromIso8601(T.date))),this.expireDuration=S,this.expireDate=_,this.lastStyleTime=0,this._optimChildrenWithinParent=Tm.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,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._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=D.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 j,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Sr._deprecationWarning=Ms;Object.defineProperties(Sr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new D),D.clone(this._color)},set:function(e){this._color=D.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===lr.READY}},contentUnloaded:{get:function(){return this._contentState===lr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===lr.EXPIRED}},contentFailed:{get:function(){return this._contentState===lr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Q0=new m;function N$e(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,Q0),c=m.add(s.positionWC,a,Q0),d=m.subtract(c,r,Q0);if(m.magnitude(d)>o){let _=m.normalize(d,Q0),R=m.multiplyByScalar(_,o,Q0),L=m.add(r,R,Q0),W=m.subtract(L,s.positionWC,Q0),B=m.normalize(W,Q0);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,B))}else e._foveatedFactor=0;let p=e.refine===ar.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===nr.PRELOAD_FLIGHT||n._pass===nr.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),b=n.foveatedConeSize*f;if(e._foveatedFactor<=b)return!1;let C=f-b,E=V.clamp((e._foveatedFactor-b)/C,0,1),T=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,E),S=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-T<=S}var qhe=new j;Sr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,d=a.frustum,u=c.drawingBufferWidth,h=c.drawingBufferHeight*o,p;if(e.mode===se.SCENE2D||d instanceof hn){let g=d.offCenterFrustum;l(g)&&(d=g);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,h);p=s/f}else{let g=Math.max(this._distanceToCamera,V.EPSILON7),f=d.sseDenominator;if(p=s*h/(g*f),i.dynamicScreenSpaceError){let b=i._dynamicScreenSpaceErrorComputedDensity,C=i.dynamicScreenSpaceErrorFactor,E=V.fog(g,b)*C;p-=E}}return p/=e.pixelRatio,p};function X$e(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function P$e(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}Sr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:Ps.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==Ps.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=P$e(n,this),this._priorityProgressiveResolution=X$e(n,this),this.priorityDeferred=N$e(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Sr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=j.now(qhe);j.lessThan(this.expireDate,e)&&(this._contentState=lr.EXPIRED,this._expiredContent=this._content)}};function M$e(e){if(!l(e.expireDuration))return;let t=j.now(qhe);j.addSeconds(t,e.expireDuration,t),l(e.expireDate)?j.lessThan(e.expireDate,t)&&j.clone(t,e.expireDate):e.expireDate=j.clone(t)}function U$e(e){return function(){return e._priority}}Sr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?D$e(this):k$e(this)};function D$e(e){let t=e._content,n=e._tileset;if(!l(t)){let o=Ti(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new ew(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=lr.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=lr.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=lr.FAILED,o})}async function v$e(e,t,n,i,o){let r=e._contentState;e._contentState=lr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===pi.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=lr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===pi.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await Q$e(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=lr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=lr.FAILED,a}}function k$e(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new pr({throttle:!0,throttleByServer:!0,type:Ys.TILES3D,priorityFunction:U$e(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return v$e(e,o,i,n,r)}async function Q$e(e,t){let n=Sg(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===sa.GEOMETRY||n.contentType===sa.VECTOR,(n.contentType===sa.IMPLICIT_SUBTREE||n.contentType===sa.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===sa.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=PC[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,d=e.implicitCoordinates;o.metadata=c.getContentMetadataView(d,0)}else e.hasImplicitContent||(o.metadata=MC(i,s));let a=UC(i,s);return l(a)&&(o.group=new Jx({metadata:a})),o}Sr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Sr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=lr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=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 $he=new ue;function lj(e,t){if(t.mode!==se.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,$he);e._boundingVolume2D=new Rg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._boundingVolume2D:e._boundingVolume}function O$e(e,t){if(t.mode!==se.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,$he);e._contentBoundingVolume2D=new Rg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Sr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=lj(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Jt.INSIDE,a===Jt.OUTSIDE)return Ps.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Jt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Sr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Jt.INSIDE;if(this._visibilityPlaneMask===Ps.MASK_INSIDE)return Jt.INSIDE;let t=e.cullingVolume,n=O$e(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Jt.INSIDE,s===Jt.OUTSIDE)return Jt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Jt.OUTSIDE,s===Jt.INSIDE)return Jt.OUTSIDE}return t.computeVisibility(n)};Sr.prototype.distanceToTile=function(e){return lj(this,e).distanceToCamera(e)};var z$e=new m;Sr.prototype.distanceToTileCenter=function(e){let n=lj(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,z$e);return m.dot(e.camera.directionWC,i)};Sr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var efe=new $,tfe=new m,H$e=new $,dj=new m,nfe=new de,ife=new tn,cj=new F;function K$e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],dj),o=$.fromArray(e,3,H$e);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,efe);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new xd(i,o)}function Hhe(e,t,n,i){let o=de.unpack(e,0,nfe),r=e[4],s=e[5],a=tn.fromRectangle(o,r,s,ie.WGS84,ife),c=a.center,d=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,cj),cj),c=F.multiplyByPoint(t,c,c);let u=F.getMatrix3(t,efe);return d=$.multiply(u,d,d),l(i)&&i instanceof xd?(i.update(c,d),i):new xd(c,d)}function J$e(e,t,n,i){if(!F.equalsEpsilon(t,n,V.EPSILON8))return i instanceof xd?Hhe(e,t,n,i):Hhe(e,t,n,void 0);let o=de.unpack(e,0,nfe);return i instanceof lu?(i.rectangle=de.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ie.WGS84),i):new lu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function j$e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],dj),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,tfe),s=m.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new Rg(i,o)}Sr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=A0.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new he("boundingVolume must be defined");if(Ti(e,"3DTILES_bounding_volume_S2"))return new ow(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=K$e(r,t,n);return this._verticalExaggeration!==1&&Khe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=J$e(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof xd?Khe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Eo.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Eo.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ie.WGS84))),c}if(l(a)){let c=j$e(a,t,n);if(this._verticalExaggeration!==1){let d=Eo.getPosition(c.center,ie.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,dj),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new he("boundingVolume must contain a sphere, region, or box")};var q$e=m.unpackArray(new Array(24).fill(0));function Khe(e,t,n){let i=e.boundingVolume.computeCorners(q$e).map(r=>Eo.getPosition(r,ie.WGS84,t,n,r)),o=tn.fromPoints(i,ife);e.update(o.center,o.halfAxes)}Sr.prototype.updateTransform=function(e,t){e=e??F.IDENTITY;let n=F.multiplyTransformation(e,this.transform,cj),i=!F.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&F.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.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()};Sr.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,tfe),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function $$e(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=D.WHITE:c=D.DARKGRAY:c=D.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=qt.toValue(c,d.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(D.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(D.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=D.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function eet(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=lr.FAILED,o}}function tet(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function net(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}Sr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;tet(this,e),net(this,e),$$e(this,e,t,n),eet(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===Ve.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var Jhe=[];Sr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(M$e(this),this._selectedFrame=0,this.lastStyleTime=0,j.now(this._loadTimestamp),this._contentState=lr.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Jhe;try{this._content.update(e,t)}catch(i){throw this._contentState=lr.FAILED,i}Jhe.length=0,t.commandList=n};function jhe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function Mk(e,t,n){return Math.max(V.normalize(e,t,n)-V.EPSILON7,0)}Sr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,d=o,u=c+d,h=r,p=Math.pow(10,u),g=u+h,f=r,b=Math.pow(10,g),C=g+f,E=Math.pow(10,C),T=Mk(this._depth,n.depth,i.depth);T=t?1-T:T;let _=!e.isSkippingLevelOfDetail&&this.refine===ar.REPLACE?Mk(this._priorityHolder._distanceToCamera,n.distance,i.distance):Mk(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),R=jhe(_,a,s),L=this._priorityProgressiveResolution?0:p,W=Mk(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),B=jhe(W,d,c),Y=this.priorityDeferred?b:0,N=e._pass===nr.PRELOAD_FLIGHT?0:E;this._priority=T+R+L+B+Y+N};Sr.prototype.isDestroyed=function(){return!1};Sr.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(),fe(this)};var Rm=Sr;var uni=y(x(),1);var eni=y(x(),1);function Gg(e){e=e??Q.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Gg.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Gg.prototype.hasProperty=function(e){return zn.hasProperty(e,this._properties,this._class)};Gg.prototype.hasPropertyBySemantic=function(e){return zn.hasPropertyBySemantic(e,this._properties,this._class)};Gg.prototype.getPropertyIds=function(e){return zn.getPropertyIds(this._properties,this._class,e)};Gg.prototype.getProperty=function(e){return zn.getProperty(e,this._properties,this._class)};Gg.prototype.setProperty=function(e,t){return zn.setProperty(e,t,this._properties,this._class)};Gg.prototype.getPropertyBySemantic=function(e){return zn.getPropertyBySemantic(e,this._properties,this._class)};Gg.prototype.setPropertyBySemantic=function(e,t){return zn.setPropertyBySemantic(e,t,this._properties,this._class)};var MI=Gg;var rni=y(x(),1);function Vg(e){e=e??Q.EMPTY_OBJECT;let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Vg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Vg.prototype.hasProperty=function(e){return zn.hasProperty(e,this._properties,this._class)};Vg.prototype.hasPropertyBySemantic=function(e){return zn.hasPropertyBySemantic(e,this._properties,this._class)};Vg.prototype.getPropertyIds=function(e){return zn.getPropertyIds(this._properties,this._class,e)};Vg.prototype.getProperty=function(e){return zn.getProperty(e,this._properties,this._class)};Vg.prototype.setProperty=function(e,t){return zn.setProperty(e,t,this._properties,this._class)};Vg.prototype.getPropertyBySemantic=function(e){return zn.getPropertyBySemantic(e,this._properties,this._class)};Vg.prototype.setPropertyBySemantic=function(e,t){return zn.setPropertyBySemantic(e,t,this._properties,this._class)};var rw=Vg;function ofe(e){e=e??Q.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new rw({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let d=0;d<c;d++){let u=a[d];s.push(new MI({group:u,class:n.classes[u.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let d=0;d<c;d++){let u=r[d];if(a.hasOwnProperty(u)){let h=a[u];s.push(new MI({id:u,group:a[u],class:n.classes[h.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(ofe.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var KC=ofe;var gni=y(x(),1);var rfe={},iet=new m;rfe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof xd||i instanceof lu){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Tm.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof xd||a instanceof lu)){e._optimChildrenWithinParent=Tm.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=m.subtract(c.center,o.center,iet),u=m.magnitude(d);m.divideByScalar(d,u,d);let h=Math.abs(o.halfAxes[0]*d.x)+Math.abs(o.halfAxes[1]*d.y)+Math.abs(o.halfAxes[2]*d.z)+Math.abs(o.halfAxes[3]*d.x)+Math.abs(o.halfAxes[4]*d.y)+Math.abs(o.halfAxes[5]*d.z)+Math.abs(o.halfAxes[6]*d.x)+Math.abs(o.halfAxes[7]*d.y)+Math.abs(o.halfAxes[8]*d.z),p=Math.abs(c.halfAxes[0]*d.x)+Math.abs(c.halfAxes[1]*d.y)+Math.abs(c.halfAxes[2]*d.z)+Math.abs(c.halfAxes[3]*d.x)+Math.abs(c.halfAxes[4]*d.y)+Math.abs(c.halfAxes[5]*d.z)+Math.abs(c.halfAxes[6]*d.x)+Math.abs(c.halfAxes[7]*d.y)+Math.abs(c.halfAxes[8]*d.z);if(h<=p+u){e._optimChildrenWithinParent=Tm.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Tm.USE_OPTIMIZATION};var sw=rfe;var Sni=y(x(),1);var xni=y(x(),1);function aw(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(aw.prototype,{length:{get:function(){return this._length}}});function oet(e,t,n){this.item=e,this.previous=t,this.next=n}aw.prototype.add=function(e){let t=new oet(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function sfe(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(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}aw.prototype.remove=function(e){l(e)&&(sfe(this,e),--this._length)};aw.prototype.splice=function(e,t){if(e===t)return;sfe(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var cw=aw;function JC(){this._list=new cw,this._sentinel=this._list.add(),this._trimTiles=!1}JC.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};JC.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};JC.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};JC.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};JC.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};JC.prototype.trim=function(){this._trimTiles=!0};var lw=JC;var Vni=y(x(),1);function Uk(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 mj(e,t){let n;return t==="_loadTimestamp"?n=j.toDate(e).getTime():n=e,n}Uk.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=mj(e,n),this._referenceMaximum[n]=mj(t,n)};function ret(e,t){let n=e.tilePropertyName;if(l(n)){let i=mj(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var uj=[new D(.1,.1,.1,1),new D(.153,.278,.878,1),new D(.827,.231,.49,1),new D(.827,.188,.22,1),new D(1,.592,.259,1),new D(1,.843,0,1)];Uk.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=ret(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+V.EPSILON7,c=V.clamp(i-o,0,s)/s,d=uj.length-1,u=c*d,h=Math.floor(u),p=Math.ceil(u),g=u-h,f=uj[h],b=uj[p],C=D.clone(D.WHITE);C.red=V.lerp(f.red,b.red,g),C.green=V.lerp(f.green,b.green,g),C.blue=V.lerp(f.blue,b.blue,g),e._debugColor=C};Uk.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var dw=Uk;var Bni=y(x(),1);function UI(){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.texturesReferenceCounterById={},this.batchTableByteLength=0}UI.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};UI.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};UI.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof ou))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};UI.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof ou))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};UI.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,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.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var jh=UI;var Nni=y(x(),1);function uw(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(uw.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});uw.prototype.makeDirty=function(){this._styleDirty=!0};uw.prototype.resetDirty=function(){this._styleDirty=!1};uw.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var mw=uw;var Qni=y(x(),1);function set(e,t,n){let i=Ti(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!Ti(o,"3DTILES_bounding_volume_S2")&&!Ti(o,"3DTILES_bounding_volume_cylinder"))throw new he("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Ge({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=aet(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Qe(a,!0));let c=new Ge({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=cet(t),this.subdivisionScheme=Zs[i.subdivisionScheme],this.branchingFactor=Zs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function aet(e){if(Ti(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function cet(e){let t=Qe(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var bp=set;var $ni=y(x(),1);var Hni=y(x(),1);var hw={};function afe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function hj(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function cfe(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function fj(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}hw.encode2D=function(e,t){return(afe(e)|afe(t)<<1)>>>0};hw.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=cfe(e),t[1]=cfe(e>>1),t};hw.encode3D=function(e,t,n){return hj(e)|hj(t)<<1|hj(n)<<2};hw.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=fj(e),t[1]=fj(e>>1),t[2]=fj(e>>2),t};var O0=hw;function dr(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===Zs.OCTREE&&(this.z=e.z)}Object.defineProperties(dr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Zs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Zs.OCTREE?O0.encode3D(this.x,this.y,this.z):O0.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Zs.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});dr.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===Zs.OCTREE){let o=(this.z<<e.level)+e.z;return new dr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new dr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};dr.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===Zs.OCTREE){let r=Math.floor(this.z/t);return new dr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new dr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};dr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===Zs.OCTREE){let r=e.z%n;return new dr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new dr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};dr.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===Zs.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new dr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new dr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};dr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};dr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};dr.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===Zs.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};dr.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===Zs.OCTREE?this.z===e.z:!0)};dr.prototype.isImplicitTilesetRoot=function(){return this.level===0};dr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};dr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};dr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Zs.OCTREE&&(e.z=this.z),e};var lfe=[0,0,0];dr.fromMortonIndex=function(e,t,n,i){let o;return e===Zs.OCTREE?(o=O0.decode3D(i,lfe),new dr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=O0.decode2D(i,lfe),new dr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};dr.fromTileIndex=function(e,t,n){let i,o,r;return e===Zs.OCTREE?(i=Math.floor(V.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(V.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),dr.fromMortonIndex(e,t,i,r)};var yp=dr;var mii=y(x(),1);var sii=y(x(),1);function Lg(){}Lg.selectTiles=function(e,t){Ae.throwInstantiationError()};Lg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Lg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Lg.selectTile=function(e,t){if(e.contentVisibility(t)===Jt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Lg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Lg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Lg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!det(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function det(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}Lg.updateTile=function(e,t){dfe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,het(e),e._shouldSelect=!1,e._finalResolution=!0};function dfe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];dfe(r,t),e._visible=r._visible;return}if(uet(e,t)){e._visible=!1;return}let i=e.refine===ar.REPLACE,o=e._optimChildrenWithinParent===Tm.USE_OPTIMIZATION;if(i&&o&&n&&!met(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function uet(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==ar.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function met(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function het(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Ra=Lg;function ufe(){}var fw={stack:new Il,stackMaximumLength:0};ufe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Ra,s=fw.stack;for(s.push(i);s.length>0;){fw.stackMaximumLength=Math.max(fw.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===ar.ADD,d=a.refine===ar.REPLACE,u=fet(a);u&&pet(a,s,t),(c||d&&!u)&&(Aet(e,a),o(a,t),get(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return fw.stack.trim(fw.stackMaximumLength),n};function fet(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function pet(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function Aet(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function get(e,t){e.contentAvailable&&e.contentVisibility(t)!==Jt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var pw=ufe;var bii=y(x(),1);function mfe(){}var Aw={stack:new Il,stackMaximumLength:0},gw={stack:new Il,stackMaximumLength:0};mfe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ra.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;yet(n,t),Aw.stack.trim(Aw.stackMaximumLength),gw.stack.trim(gw.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function pj(e,t){e.contentAvailable&&Ra.selectTile(e,t)}function bet(e,t,n){let i=e.refine===ar.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Ra;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(Ra.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,h=!1,p=-1,g=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let b=r[f];if(b.isVisible?(t.push(b),b._foveatedFactor<g&&(p=f,g=b._foveatedFactor),h=!0):(d||o.loadSiblings)&&(b._foveatedFactor<g&&(p=f,g=b._foveatedFactor),a(b,n),c(b,n)),d){let C;b._inRequestVolume?b.hasRenderableContent?C=b.contentAvailable:C=xet(b,n):C=!1,u=u&&C}}if(h||(u=!1),p!==-1&&i){let f=r[p];f._wasMinPriorityChild=!0;let b=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;b._foveatedFactor=Math.min(f._foveatedFactor,b._foveatedFactor),b._distanceToCamera=Math.min(f._distanceToCamera,b._distanceToCamera);for(let C=0;C<r.length;++C)r[C]._priorityHolder=b}return u}function yet(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Ra,a=Aw.stack;for(a.push(e);a.length>0;){Aw.stackMaximumLength=Math.max(Aw.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?bet(c,a,t)&&u:!1;let h=!c._refines&&u;c.hasRenderableContent?c.refine===ar.ADD?(pj(c,t),o(c,t)):c.refine===ar.REPLACE&&(o(c,t),h&&pj(c,t)):(n._emptyTiles.push(c),o(c,t),h&&pj(c,t)),r(c,t),s(c,t)}}function xet(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Ra,s=!0,a=gw.stack;for(a.push(e);a.length>0;){gw.stackMaximumLength=Math.max(gw.stackMaximumLength,a.length);let c=a.pop(),d=c.children,u=d.length,h=!c.hasRenderableContent&&n(c);if(!h&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),h)for(let p=0;p<u;++p){let g=d[p];a.push(g)}}return e.hasEmptyContent||s}var bw=mfe;var Sii=y(x(),1);function hfe(){}var yw={stack:new Il,stackMaximumLength:0},xw={stack:new Il,stackMaximumLength:0},Wg={stack:new Il,stackMaximumLength:0,ancestorStack:new Il,ancestorStackMaximumLength:0},Cet=2;hfe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ra.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Ret(n,t),Get(n,t),yw.stack.trim(yw.stackMaximumLength),xw.stack.trim(xw.stackMaximumLength),Wg.stack.trim(Wg.stackMaximumLength),Wg.ancestorStack.trim(Wg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Eet(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Ra,r=xw.stack;for(r.push(e);r.length>0;){xw.stackMaximumLength=Math.max(xw.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let d=a[c];d.isVisible&&(d.contentAvailable?(n(d,t),i(d,t),o(d,t)):d._depth-e._depth<Cet&&r.push(d))}}}function Dk(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Eet(e,t)}function Tet(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function Iet(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function _et(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Ra;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(Ra.sortChildrenByDistanceToCamera);let c=!1;for(let d=0;d<o.length;++d){let u=o[d];u.isVisible?(t.push(u),c=!0):i.loadSiblings&&(s(u,n),a(u,n))}return c}function Zet(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function Ret(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Ra,c=yw.stack;for(c.push(e);c.length>0;){yw.stackMaximumLength=Math.max(yw.stackMaximumLength,c.length);let d=c.pop();Tet(d,t);let u=d.parent,h=!l(u)||u._refines;d._refines=o(d)?_et(d,c,t)&&h:!1;let p=!d._refines&&h;d.hasRenderableContent?d.refine===ar.ADD?(Dk(d,t),r(d,t)):d.refine===ar.REPLACE&&(Zet(d,i)?(r(d,t),p&&Dk(d,t)):p?(Dk(d,t),r(d,t)):Iet(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&Dk(d,t)),s(d,t),a(d,t)}}function Get(e,t){let{selectTile:n,canTraverse:i}=Ra,{stack:o,ancestorStack:r}=Wg,s;for(o.push(e);o.length>0||r.length>0;){if(Wg.stackMaximumLength=Math.max(Wg.stackMaximumLength,o.length),Wg.ancestorStackMaximumLength=Math.max(Wg.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===ar.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let d=a.children;for(let u=0;u<d.length;++u){let h=d[u];h.isVisible&&o.push(h)}}}}var Cw=hfe;var Wii=y(x(),1);function ca(){this._layers=[],this.layerAdded=new Ce,this.layerRemoved=new Ce,this.layerMoved=new Ce,this.layerShownOrHidden=new Ce}Object.defineProperties(ca.prototype,{length:{get:function(){return this._layers.length}}});ca.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};ca.prototype.addImageryProvider=function(e,t){let n=new ds(e);return this.add(n,t),n};ca.prototype.remove=function(e,t){t=t??!0;let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};ca.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};ca.prototype.contains=function(e){return this.indexOf(e)!==-1};ca.prototype.indexOf=function(e){return this._layers.indexOf(e)};ca.prototype.get=function(e){return this._layers[e]};function vk(e,t){return e.indexOf(t)}function ffe(e,t,n){let i=e._layers;if(t=V.clamp(t,0,i.length-1),n=V.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}ca.prototype.raise=function(e){let t=vk(this._layers,e);ffe(this,t,t+1)};ca.prototype.lower=function(e){let t=vk(this._layers,e);ffe(this,t,t-1)};ca.prototype.raiseToTop=function(e){let t=vk(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))};ca.prototype.lowerToBottom=function(e){let t=vk(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Vet=new de;function pfe(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];de.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],d=c.readyImagery;if(!l(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!l(u.pickFeatures)||!de.contains(d.rectangle,t))continue;let h=Vet,p=1/1024;h.west=V.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),h.east=V.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),h.south=V.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),h.north=V.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),de.contains(h,t)&&i(d)}}ca.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(pfe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};ca.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(pfe(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let d=s[c],u=r[c];if(l(d)&&d.length>0)for(let h=0;h<d.length;++h){let p=d[h];p.imageryLayer=u,l(p.position)||(p.position=i),a.push(p)}}return a})};ca.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ca.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ca.prototype.isDestroyed=function(){return!1};ca.prototype.destroy=function(){return this.removeAll(!0),fe(this)};ca.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var jC=ca;function ir(e){e=e??Q.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new lw,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._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Il,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new mw,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._addHeightCallbacks=[],this._statistics=new jh,this._statisticsLast=new jh,this._statisticsPerPass=new Array(nr.NUMBER_OF_PASSES);for(let o=0;o<nr.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new jh;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 dw(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=V.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ie.WGS84,this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new jC(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??V.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Rn.ENABLED,this.show=e.show??!0,this.colorBlendMode=ld.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new sp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new ng,this.loadProgress=new Ce,this.allTilesLoaded=new Ce,this.initialTilesLoaded=new Ce,this.tileLoad=new Ce,this.tileUnload=new Ce,this.tileFailed=new Ce,this.tileVisible=new Ce,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&ss.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&Wh.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Kx,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new $A(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??D.BLACK,this.splitDirection=e.splitDirection??Br.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&At("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(ir.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Wh.setOwner(e,this,"_clippingPolygons")}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Ms("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}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,Tfe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});ir.fromIonAssetId=async function(e,t){let n=await os.fromAssetId(e);return ir.fromUrl(n,t)};ir.fromUrl=async function(e,t){t=t??Q.EMPTY_OBJECT;let n=Ge.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await ir.loadJson(n),r=await Let(n,o),s=new ir(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,Tfe(s);let c=l(o.asset.gltfUpAxis)?to.fromName(o.asset.gltfUpAxis):to.Y,d=t.modelUpAxis??c,u=t.modelForwardAxis??to.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=d,s._modelForwardAxis=u,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>Zi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Tt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};ir.loadJson=function(e){return Ge.createIfNeeded(e).fetchJson()};ir.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};ir.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new he("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new he("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&ir.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Afe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===ar.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let h=d[u],p=Afe(this,e,h,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&sw.checkChildrenWithinParent(c)}return s};function Afe(e,t,n,i){if(!(l(n.implicitTiling)||Ti(n,"3DTILES_implicit_tiling")))return new Rm(e,t,n,i);let r=e.schema,s=new bp(t,n,r),a=new yp({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=Qe(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let h=new Rm(e,t,u,i);return h.implicitTileset=s,h.implicitCoordinates=a,h}async function Let(e,t){let n=Ti(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Li.getSchemaLoader({resource:e});else if(l(n.schema))i=Li.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new KC({schema:i.schema,metadataJson:n});return Li.unload(i),o}var gfe=new m,Wet=new pe,Fet=new F,Bet=new m,wet=new m,Yet=new m,Net=new m;function Xet(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof lu)n=m.normalize(a.positionWC,gfe),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let b=F.inverseTransformation(c.computedTransform,Fet),C=t.mapProjection.ellipsoid,E=d.boundingVolume,T=F.multiplyByPoint(b,E.center,Bet);if(m.magnitude(T)>C.minimumRadius){let S=pe.fromCartesian(T,C,Wet);n=m.normalize(a.positionWC,gfe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=S.height*2}else{let S=F.multiplyByPoint(b,a.positionWC,wet);if(n=m.UNIT_Z,i=F.multiplyByPointAsVector(b,a.directionWC,Yet),i=m.normalize(i,i),o=S.z,d instanceof xd){let _=$.getColumn(E.halfAxes,2,Net),R=m.magnitude(_);r=T.z-R,s=T.z+R}else if(d instanceof Rg){let _=E.radius;r=T.z-_,s=T.z+_}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*u,p=s,g=V.clamp((o-h)/(p-h),0,1),f=1-Math.abs(m.dot(i,n));f=f*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function Pet(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{xfe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?$et(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function yfe(e,t){return e._priority-t._priority}ir.prototype.postPassesUpdate=function(e){l(this._root)&&(Met(this,e),ttt(this,e),this._cache.unloadTiles(this,Efe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};ir.prototype.prePassesUpdate=function(e){if(!l(this._root))return;zet(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=j.clone(e.time)),this._timeSinceLoad=Math.max(j.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&Xet(this,e),e.newFrame&&this._cache.reset()};function Met(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==lr.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function Uet(e){let t=e._requestedTiles;t.sort(yfe);for(let n=0;n<t.length;++n)Pet(e,t[n])}function xfe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function Det(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==lr.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var vet=new pe,ket=new pe,Qet=new m;function Oet(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=pe.clone(r.positionCartographic,vet),c=pe.fromCartesian(o.center,s,ket);l(c)&&(a.height=c.height);let d=pe.toCartesian(a,s,Qet);m.distance(d,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{l(r.callback)&&r.callback(),r.invoked=!1}))}}function zet(e,t){Det(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let d=n[c];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,xfe(u,e,d)}}e.totalMemoryUsageInBytes<i?Ket(e):a&&n.length>0&&Het(e)}function Het(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(yfe)}function Ket(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var kk=new m,Jet={maximumFractionDigits:3};function bfe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Jet):Math.round(t).toLocaleString()}function Aj(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=m.clone(i,kk);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=m.normalize(i,kk);r=m.multiplyByScalar(r,.75*n,kk),o=m.add(r,i,kk)}return o}function gj(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=`
Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=`
Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=`
Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=`
Triangles: ${e.content.trianglesLength}`,o++),i+=`
Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=`
Texture Memory: ${bfe(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${bfe(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=`
- ${s[a]}`;o+=s.length}else i+=`
Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function jet(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:Aj(e.debugPickedTile),a=gj(e.debugPickedTile,e,s);a.pixelOffset=new M(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];gj(a,e,Aj(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&gj(a,e,Aj(a))}}e._tileDebugLabels.update(t)}function qet(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new li({stencil:0,pass:Ve.CESIUM_3D_TILE,renderState:ke.fromCache({stencilMask:Qt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,h=i.length;for(let f=0;f<s.length;++f){let b=s[f];u&&d.raiseEvent(b),Oet(e,b,t),b.update(e,t,n),c.incrementSelectionCounts(b.content),++c.selected}let p=e._emptyTiles;for(let f=0;f<p.length;++f)p[f].update(e,t,n);let g=i.length-h;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,b=f.length;i.length+=b;for(let C=g-1;C>=0;--C)i[h+b+C]=i[h+C];for(let C=0;C<b;++C)i[h+C]=f[C]}g=i.length-r,c.numberOfCommands=g,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new fp),jet(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Cfe=[];function $et(e,t){let n=t,i=Cfe;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(ett(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Efe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function ett(e,t){e._cache.unloadTile(e,t,Efe),t.destroy()}ir.prototype.trimLoadedTiles=function(){this._cache.trim()};function ttt(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;jh.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function ntt(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 itt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function ott(e,t,n,i){if(t.mode===se.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,ntt(e),itt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Uet(e),qet(e,t,i),jh.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function Tfe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(bt.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new bt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}ir.prototype.getTraversal=function(e){let{pass:t}=e;return t===nr.MOST_DETAILED_PRELOAD||t===nr.MOST_DETAILED_PICK?pw:this.isSkippingLevelOfDetail?Cw:bw};ir.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ir.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===nr.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===nr.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===nr.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=nr.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,d=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let u=this._clippingPolygons;l(u)&&u.enabled&&u.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=ott(this,e,h,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};ir.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ir.prototype.isDestroyed=function(){return!1};ir.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=Cfe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,fe(this)};ir.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};ir.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ir.supportedExtensions[e[t]])throw new he(`Unsupported 3D Tiles Extension: ${e[t]}`)};var rtt=new xn,stt=new m,att=new pe;ir.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ie.WGS84);let i=rtt,o=n.cartographicToCartesian(e,i.direction);m.normalize(i.direction,i.direction),i.direction=m.normalize(o,i.direction),i.direction=m.negate(o,i.direction),i.origin=m.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,stt);if(l(r))return n.cartesianToCartographic(r,att)?.height};ir.prototype.updateHeight=function(e,t,n){n=n??ie.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var ctt=new Or,ltt=new m;ir.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let d=i[c],u=di.raySphere(e,d.contentBoundingVolume.boundingSphere,ctt);!l(u)||!l(d.content)||r.push(d)}let s=r.length;r.sort((c,d)=>{let u=ue.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=ue.distanceSquaredTo(d.contentBoundingVolume.boundingSphere,e.origin);return u-h});let a;for(let c=0;c<s;++c){let u=r[c].content.pick(e,t,ltt);if(l(u))return a=m.clone(u,n),a}};ir.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};ir.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var ks=ir;var dtt=new F;function z0(e,t){t.collectionChanged.addEventListener(z0.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Ft,this._onCollectionChanged(t,t.values,[],[])}z0.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),h;u&&(h=s.computeModelMatrix(e,dtt),c=Ge.createIfNeeded(K.getValueOrUndefined(a._uri,e)));let p=l(d)?d.tilesetPrimitive:void 0;if(!u){l(p)&&(p.show=!1);continue}(!l(d)||c.url!==d.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],utt(c,n,s,i)),l(p)&&(p.show=!0,l(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=K.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};z0.prototype.isDestroyed=function(){return!1};z0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(z0.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)bj(this,e[i],t,n);return fe(this)};z0.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return gt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ue.clone(i.boundingSphere,t),gt.DONE):gt.FAILED:gt.PENDING};z0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(bj(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],bj(this,r,a,c),s.remove(r.id)};function bj(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function utt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await ks.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var Ew=z0;var uri=y(x(),1);var mtt=D.WHITE,htt=D.BLACK,ftt=new M(2,2);function DI(e){e=e??Q.EMPTY_OBJECT,this._definitionChanged=new Ce,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(DI.prototype,{isConstant:{get:function(){return K.isConstant(this._evenColor)&&K.isConstant(this._oddColor)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:ge("evenColor"),oddColor:ge("oddColor"),repeat:ge("repeat")});DI.prototype.getType=function(e){return"Checkerboard"};var ptt=new j;DI.prototype.getValue=function(e,t){return l(e)||(e=j.now(ptt)),l(t)||(t={}),t.lightColor=K.getValueOrClonedDefault(this._evenColor,e,mtt,t.lightColor),t.darkColor=K.getValueOrClonedDefault(this._oddColor,e,htt,t.darkColor),t.repeat=K.getValueOrDefault(this._repeat,e,ftt),t};DI.prototype.equals=function(e){return this===e||e instanceof DI&&K.equals(this._evenColor,e._evenColor)&&K.equals(this._oddColor,e._oddColor)&&K.equals(this._repeat,e._repeat)};var vI=DI;var Gri=y(x(),1);var Eri=y(x(),1);var Sfe={id:void 0};function Tw(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function zc(e){this._owner=e,this._entities=new Ft,this._addedEntities=new Ft,this._removedEntities=new Ft,this._changedEntities=new Ft,this._suspendCount=0,this._collectionChanged=new Ce,this._id=Kn(),this._show=!0,this._firing=!1,this._refire=!1}zc.prototype.suspendEvents=function(){this._suspendCount++};zc.prototype.resumeEvents=function(){this._suspendCount--,Tw(this)};Object.defineProperties(zc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});zc.prototype.computeAvailability=function(){let e=Ke.MAXIMUM_VALUE,t=Ke.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;j.lessThan(a,e)&&!a.equals(Ke.MINIMUM_VALUE)&&(e=a),j.greaterThan(c,t)&&!c.equals(Ke.MAXIMUM_VALUE)&&(t=c)}}return Ke.MAXIMUM_VALUE.equals(e)&&(e=Ke.MINIMUM_VALUE),Ke.MINIMUM_VALUE.equals(t)&&(t=Ke.MAXIMUM_VALUE),new Wn({start:e,stop:t})};zc.prototype.add=function(e){e instanceof xr||(e=new xr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new Ae(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(zc.prototype._onEntityDefinitionChanged,this),Tw(this),e};zc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};zc.prototype.contains=function(e){return this._entities.get(e.id)===e};zc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(zc.prototype._onEntityDefinitionChanged,this),Tw(this),!0):!1};zc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(zc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),Tw(this)};zc.prototype.getById=function(e){return this._entities.get(e)};zc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Sfe.id=e,t=new xr(Sfe),this.add(t)),t};zc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),Tw(this)};var Ga=zc;var Qk={id:void 0},kI=new Array(2);function yj(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function Ife(e,t,n,i){kI[0]=n,kI[1]=i.id,t[JSON.stringify(kI)]=i.definitionChanged.addEventListener(ms.prototype._onDefinitionChanged,e)}function _fe(e,t,n,i){kI[0]=n,kI[1]=i.id;let o=JSON.stringify(kI);t[o](),t[o]=void 0}function H0(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,d,u=e._composite,h=new Ga(e),p=e._eventHash,g;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(ms.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--)s=a[c],_fe(e,p,g,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(ms.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--){s=a[c],Ife(e,p,g,s);let b=h.getById(s.id);l(b)||(b=u.getById(s.id),l(b)?yj(b):(Qk.id=s.id,b=new xr(Qk)),h.add(b)),b.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=h.values;for(r=0;r<f.length;r++)u.add(f[r]);u.resumeEvents()}function ms(e,t){this._owner=t,this._composite=new Ga(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Kn(),this._eventHash={},H0(this),this._shouldRecomposite=!1}Object.defineProperties(ms.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}}});ms.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),H0(this)};ms.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),H0(this),!0):!1};ms.prototype.removeAllCollections=function(){this._collections.length=0,H0(this)};ms.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};ms.prototype.contains=function(e){return this._composite.contains(e)};ms.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};ms.prototype.getCollection=function(e){return this._collections[e]};ms.prototype.getCollectionsLength=function(){return this._collections.length};function Ok(e,t){return e.indexOf(t)}function Zfe(e,t,n){let i=e._collections;if(t=V.clamp(t,0,i.length-1),n=V.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,H0(e)}ms.prototype.raiseCollection=function(e){let t=Ok(this._collections,e);Zfe(this,t,t+1)};ms.prototype.lowerCollection=function(e){let t=Ok(this._collections,e);Zfe(this,t,t-1)};ms.prototype.raiseCollectionToTop=function(e){let t=Ok(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),H0(this))};ms.prototype.lowerCollectionToBottom=function(e){let t=Ok(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),H0(this))};ms.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};ms.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(H0(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};ms.prototype.computeAvailability=function(){return this._composite.computeAvailability()};ms.prototype.getById=function(e){return this._composite.getById(e)};ms.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,d,u=n.length,h=this._eventHash,p=e.id;for(s=0;s<u;s++){let f=n[s];_fe(this,h,p,f);let b=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(b),l(c)&&(l(d)||(d=r.getById(b),yj(d)),d.merge(c));l(d)||r.removeById(b),d=void 0}let g=t.length;for(s=0;s<g;s++){let f=t[s];Ife(this,h,p,f);let b=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(b),l(c)&&(l(d)||(d=r.getById(b),l(d)?yj(d):(Qk.id=b,d=new xr(Qk),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};ms.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),d=c[t],u=!l(d),h=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let f=g[t];if(l(f)){if(h)if(h=!1,l(f.merge)&&l(f.clone))d=f.clone(d);else{d=f;break}d.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=d};var xj=ms;var isi=y(x(),1);var Jri=y(x(),1);var Lri=y(x(),1);function Cj(){this._removalFunctions=[]}Cj.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};Cj.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Xr=Cj;var Dri=y(x(),1);function Sj(e,t){return j.compare(e.start,t.start)}function hs(e){if(this._intervals=[],this._changedEvent=new Ce,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(hs.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});hs.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof hs))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!Wn.equals(n[r],i[r],t))return!1;return!0};hs.prototype.get=function(e){return this._intervals[e]};hs.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};hs.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};hs.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};hs.prototype.contains=function(e){return this.indexOf(e)>=0};var Ej=new Wn;hs.prototype.indexOf=function(e){let t=this._intervals;Ej.start=e,Ej.stop=e;let n=bo(t,Ej,Sj);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Wn.contains(t[n-1],e)?n-1:~n)};hs.prototype.findInterval=function(e){e=e??Q.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};hs.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||j.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=bo(n,e,Sj);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=j.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(j.greaterThan(e.stop,n[i-1].stop)?e=new Wn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Wn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=j.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Wn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Wn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=j.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Wn({start:e.start,stop:j.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:j.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Wn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};hs.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=bo(t,e,Sj);n<0&&(n=~n);let i=!1;for(n>0&&(j.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(j.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Wn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Wn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Wn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&j.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Wn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Wn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(j.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Wn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};hs.prototype.intersect=function(e,t,n){let i=new hs,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],d=a[r];if(j.lessThan(c.stop,d.start))++o;else if(j.lessThan(d.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,d.data)||!l(t)&&d.data===c.data){let u=Wn.intersect(c,d,new Wn,n);u.isEmpty||i.addInterval(u,t)}j.lessThan(c.stop,d.stop)||c.stop.equals(d.stop)&&!c.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};hs.fromJulianDateArray=function(e,t){l(t)||(t=new hs);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,d,u=0;a&&(++u,d=new Wn({start:Ke.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d));for(let h=0;h<i-1;++h){let p=n[h],g=n[h+1];d=new Wn({start:p,stop:g,isStartIncluded:t.length===u?r:!0,isStopIncluded:h===i-2?s:!1}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d),p=g}return c&&(d=new Wn({start:n[i-1],stop:Ke.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var Hc=new mA,Sw=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Tj(e,t,n){l(n)||(n=new j),j.toGregorianDate(e,Hc);let i=Hc.millisecond+t.millisecond,o=Hc.second+t.second,r=Hc.minute+t.minute,s=Hc.hour+t.hour,a=Hc.day+t.day,c=Hc.month+t.month,d=Hc.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),Sw[2]=sh(d)?29:28;a>Sw[c]||c>=13;)a>Sw[c]&&(a-=Sw[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),Sw[2]=sh(d)?29:28;return Hc.millisecond=i,Hc.second=o,Hc.minute=r,Hc.hour=s,Hc.day=a,Hc.month=c,Hc.year=d,j.fromGregorianDate(Hc,n)}var Att=new j,gtt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Rfe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(gtt);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),j.toGregorianDate(j.fromIso8601(e,Att),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var Iw=new mA;hs.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=j.fromIso8601(n[0]),o=j.fromIso8601(n[1]),r=[];if(!Rfe(n[2],Iw))r.push(i,o);else{let s=j.clone(i);for(r.push(s);j.compare(s,o)<0;)s=Tj(s,Iw),j.compare(o,s)<=0&&j.clone(o,s),r.push(s)}return hs.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};hs.fromIso8601DateArray=function(e,t){return hs.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return j.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};hs.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,c=i.length;for(let d=0;d<c;++d)(Rfe(i[d],Iw)||d===0)&&(o&&l(a)?s=Tj(a,Iw):s=Tj(n,Iw),r.push(s),a=s);return hs.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var fs=hs;function btt(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function qC(){this._eventHelper=new Xr,this._definitionChanged=new Ce,this._intervals=new fs,this._intervals.changedEvent.addEventListener(qC.prototype._intervalsChanged,this)}Object.defineProperties(qC.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var ytt=new j;qC.prototype.getValue=function(e,t){l(e)||(e=j.now(ytt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};qC.prototype.equals=function(e){return this===e||e instanceof qC&&this._intervals.equals(e._intervals,K.equals)};qC.prototype._intervalsChanged=function(){btt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Kc=qC;function K0(){this._definitionChanged=new Ce,this._composite=new Kc,this._composite.definitionChanged.addEventListener(K0.prototype._raiseDefinitionChanged,this)}Object.defineProperties(K0.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});K0.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var xtt=new j;K0.prototype.getValue=function(e,t){l(e)||(e=j.now(xtt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};K0.prototype.equals=function(e){return this===e||e instanceof K0&&this._composite.equals(e._composite,K.equals)};K0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var QI=K0;var usi=y(x(),1);function J0(e){this._referenceFrame=e??eo.FIXED,this._definitionChanged=new Ce,this._composite=new Kc,this._composite.definitionChanged.addEventListener(J0.prototype._raiseDefinitionChanged,this)}Object.defineProperties(J0.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}}});var Ctt=new j;J0.prototype.getValue=function(e,t){return l(e)||(e=j.now(Ctt)),this.getValueInReferenceFrame(e,eo.FIXED,t)};J0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};J0.prototype.equals=function(e){return this===e||e instanceof J0&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,K.equals)};J0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var qa=J0;var sci=y(x(),1);var sai=y(x(),1);var hsi=y(x(),1),Ett={ROUNDED:0,MITERED:1,BEVELED:2},Hi=Object.freeze(Ett);var Xsi=y(x(),1);var Rsi=y(x(),1);var $a=[new m,new m],Ttt=new m,Stt=new m,Itt=new m,_tt=new m,Ztt=new m,Rtt=new m,Gtt=new m,Vtt=new m,Ltt=new m,OI=new m,zk=new m,_w={},Ij=new pe;function Wtt(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];Ij=t.cartesianToCartographic(o,Ij),n[i]=Ij.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function _j(e,t,n,i){let o=e[0],r=e[1],s=m.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),d;if(t===n){for(d=0;d<a;d++)c[d]=t;return c.push(n),c}let h=(n-t)/a;for(d=1;d<a;d++){let p=t+d*h;c[d]=p}return c[0]=t,c.push(n),c}var Hk=new m,Kk=new m;function Ftt(e,t,n,i){let o=new Ss(n,i),r=o.projectPointOntoPlane(m.add(n,e,Hk),Hk),s=o.projectPointOntoPlane(m.add(n,t,Kk),Kk),a=M.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var Btt=new m(-1,0,0),$C=new F,wtt=new F,Zj=new $,Ytt=$.IDENTITY.clone(),Ntt=new m,Xtt=new ce,Gfe=new m;function Fg(e,t,n,i,o,r,s,a){let c=Ntt,d=Xtt;$C=Tt.eastNorthUpToFixedFrame(e,o,$C),c=F.multiplyByPointAsVector($C,Btt,c),c=m.normalize(c,c);let u=Ftt(c,t,e,o);Zj=$.fromRotationZ(u,Zj),Gfe.z=r,$C=F.multiplyTransformation($C,F.fromRotationTranslation(Zj,Gfe,wtt),$C);let h=Ytt;h[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)d=m.fromArray(n,g,d),d=$.multiplyByVector(h,d,d),d=F.multiplyByPoint($C,d,d),i.push(d.x,d.y,d.z);return i}var Ptt=new m;function Rj(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=m.fromArray(e,a,Ptt);i=Fg(c,t,n,i,o,r[a/3],s,1)}return i}function Mtt(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let d=a.x-r,u=a.y-s;i[o++]=d,i[o++]=0,i[o++]=u,i[o++]=d,i[o++]=0,i[o++]=u}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function Vfe(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var Lfe=new Me,Wfe=new m,Ffe=new $;function Bfe(e,t,n,i,o,r,s,a,c,d){let u=m.angleBetween(m.subtract(t,e,OI),m.subtract(n,e,zk)),h=i===Hi.BEVELED?0:Math.ceil(u/V.toRadians(5)),p;o?p=$.fromQuaternion(Me.fromAxisAngle(m.negate(e,OI),u/(h+1),Lfe),Ffe):p=$.fromQuaternion(Me.fromAxisAngle(e,u/(h+1),Lfe),Ffe);let g,f;if(t=m.clone(t,Wfe),h>0){let b=d?2:1;for(let C=0;C<h;C++)t=$.multiplyByVector(p,t,t),g=m.subtract(t,e,OI),g=m.normalize(g,g),o||(g=m.negate(g,g)),f=r.scaleToGeodeticSurface(t,zk),s=Fg(f,g,a,s,r,c,1,b)}else g=m.subtract(t,e,OI),g=m.normalize(g,g),o||(g=m.negate(g,g)),f=r.scaleToGeodeticSurface(t,zk),s=Fg(f,g,a,s,r,c,1,1),n=m.clone(n,Wfe),g=m.subtract(n,e,OI),g=m.normalize(g,g),o||(g=m.negate(g,g)),f=r.scaleToGeodeticSurface(n,zk),s=Fg(f,g,a,s,r,c,1,1);return s}_w.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];M.equals(r,s)||n.push(s)}return n};_w.angleIsGreaterThanPi=function(e,t,n,i){let o=new Ss(n,i),r=o.projectPointOntoPlane(m.add(n,e,Hk),Hk),s=o.projectPointOntoPlane(m.add(n,t,Kk),Kk);return s.x*r.y-s.y*r.x>=0};var Utt=new m,Dtt=new m;_w.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=Wtt(e,r),a=i._granularity,c=i._cornerType,d=o?Mtt(t,n):Vfe(t,n),u=o?Vfe(t,n):void 0,h=n.height/2,p=n.width/2,g=e.length,f=[],b=o?[]:void 0,C=Ttt,E=Stt,T=Itt,S=_tt,_=Ztt,R=Rtt,L=Gtt,W=Vtt,B=Ltt,Y=e[0],N=e[1];S=r.geodeticSurfaceNormal(Y,S),C=m.subtract(N,Y,C),C=m.normalize(C,C),W=m.cross(S,C,W),W=m.normalize(W,W);let A=s[0],I=s[1];o&&(b=Fg(Y,W,u,b,r,A+h,1,1)),B=m.clone(Y,B),Y=N,E=m.negate(C,E);let Z,G;for(let v=1;v<g-1;v++){let U=o?2:1;if(N=e[v+1],Y.equals(N)){At("Positions are too close and are considered equivalent with rounding error.");continue}C=m.subtract(N,Y,C),C=m.normalize(C,C),S=r.geodeticSurfaceNormal(Y,S);let k=m.multiplyByScalar(S,m.dot(C,S),Utt);m.subtract(C,k,k),m.normalize(k,k);let P=m.multiplyByScalar(S,m.dot(E,S),Dtt);if(m.subtract(E,P,P),m.normalize(P,P),!V.equalsEpsilon(Math.abs(m.dot(k,P)),1,V.EPSILON7)){T=m.add(C,E,T),T=m.normalize(T,T),T=m.cross(T,S,T),T=m.cross(S,T,T),T=m.normalize(T,T);let H=1/Math.max(.25,m.magnitude(m.cross(T,E,OI))),ee=_w.angleIsGreaterThanPi(C,E,Y,r);ee?(_=m.add(Y,m.multiplyByScalar(T,H*p,T),_),R=m.add(_,m.multiplyByScalar(W,p,R),R),$a[0]=m.clone(B,$a[0]),$a[1]=m.clone(R,$a[1]),Z=_j($a,A+h,I+h,a),G=zi.generateArc({positions:$a,granularity:a,ellipsoid:r}),f=Rj(G,W,d,f,r,Z,1),W=m.cross(S,C,W),W=m.normalize(W,W),L=m.add(_,m.multiplyByScalar(W,p,L),L),c===Hi.ROUNDED||c===Hi.BEVELED?Bfe(_,R,L,c,ee,r,f,d,I+h,o):(T=m.negate(T,T),f=Fg(Y,T,d,f,r,I+h,H,U)),B=m.clone(L,B)):(_=m.add(Y,m.multiplyByScalar(T,H*p,T),_),R=m.add(_,m.multiplyByScalar(W,-p,R),R),$a[0]=m.clone(B,$a[0]),$a[1]=m.clone(R,$a[1]),Z=_j($a,A+h,I+h,a),G=zi.generateArc({positions:$a,granularity:a,ellipsoid:r}),f=Rj(G,W,d,f,r,Z,1),W=m.cross(S,C,W),W=m.normalize(W,W),L=m.add(_,m.multiplyByScalar(W,-p,L),L),c===Hi.ROUNDED||c===Hi.BEVELED?Bfe(_,R,L,c,ee,r,f,d,I+h,o):f=Fg(Y,T,d,f,r,I+h,H,U),B=m.clone(L,B)),E=m.negate(C,E)}else f=Fg(B,W,d,f,r,A+h,1,1),B=Y;A=I,I=s[v+1],Y=N}$a[0]=m.clone(B,$a[0]),$a[1]=m.clone(Y,$a[1]),Z=_j($a,A+h,I+h,a),G=zi.generateArc({positions:$a,granularity:a,ellipsoid:r}),f=Rj(G,W,d,f,r,Z,1),o&&(b=Fg(Y,W,u,b,r,I+h,1,1)),g=f.length;let w=o?g+b.length:g,X=new Float64Array(w);return X.set(f),o&&X.set(b,g),X};var qh=_w;var Vj={},zI=new m,Pfe=new m,vtt=new m,wfe=new m,Yl=[new m,new m],Mfe=new m,Ufe=new m,Dfe=new m,ktt=new m,Qtt=new m,Ott=new m,ztt=new m,Htt=new m,Ktt=new m,Jtt=new m,Yfe=new Me,Nfe=new $;function Jk(e,t,n,i,o){let r=m.angleBetween(m.subtract(t,e,zI),m.subtract(n,e,Pfe)),s=i===Hi.BEVELED?1:Math.ceil(r/V.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let d;o?d=$.fromQuaternion(Me.fromAxisAngle(m.negate(e,zI),r/s,Yfe),Nfe):d=$.fromQuaternion(Me.fromAxisAngle(e,r/s,Yfe),Nfe);let u=0;t=m.clone(t,zI);for(let h=0;h<s;h++)t=$.multiplyByVector(d,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function jtt(e){let t=Mfe,n=Ufe,i=Dfe,o=e[1];n=m.fromArray(e[1],o.length-3,n),i=m.fromArray(e[0],0,i),t=m.midpoint(n,i,t);let r=Jk(t,n,i,Hi.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=m.fromArray(a,a.length-3,n),i=m.fromArray(o,0,i),t=m.midpoint(n,i,t);let c=Jk(t,n,i,Hi.ROUNDED,!1);return[r,c]}function Xfe(e,t,n,i){let o=zI;return i?o=m.add(e,t,o):(t=m.negate(t,t),o=m.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function Gj(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=m.multiplyByScalar(t,n,zI),a=m.negate(s,Pfe),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let h=m.fromArray(e,u,vtt),p=m.add(h,a,wfe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let g=m.add(h,s,wfe);r[d--]=g.z,r[d--]=g.y,r[d--]=g.x}return i.push(o,r),i}Vj.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var qtt=new m,$tt=new m;Vj.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Mfe,c=Ufe,d=Dfe,u=ktt,h=Qtt,p=Ott,g=ztt,f=Htt,b=Ktt,C=Jtt,E=[],T=s?[]:void 0,S=s?[]:void 0,_=n[0],R=n[1];c=m.normalize(m.subtract(R,_,c),c),a=i.geodeticSurfaceNormal(_,a),u=m.normalize(m.cross(a,c,u),u),s&&(T.push(u.x,u.y,u.z),S.push(a.x,a.y,a.z)),g=m.clone(_,g),_=R,d=m.negate(c,d);let L,W=[],B,Y=n.length;for(B=1;B<Y-1;B++){a=i.geodeticSurfaceNormal(_,a),R=n[B+1],c=m.normalize(m.subtract(R,_,c),c);let A=m.multiplyByScalar(a,m.dot(c,a),qtt);m.subtract(c,A,A),m.normalize(A,A);let I=m.multiplyByScalar(a,m.dot(d,a),$tt);if(m.subtract(d,I,I),m.normalize(I,I),!V.equalsEpsilon(Math.abs(m.dot(A,I)),1,V.EPSILON7)){h=m.normalize(m.add(c,d,h),h),h=m.cross(h,a,h),h=m.cross(a,h,h),h=m.normalize(h,h);let G=o/Math.max(.25,m.magnitude(m.cross(h,d,zI))),w=qh.angleIsGreaterThanPi(c,d,_,i);h=m.multiplyByScalar(h,G,h),w?(f=m.add(_,h,f),C=m.add(f,m.multiplyByScalar(u,o,C),C),b=m.add(f,m.multiplyByScalar(u,o*2,b),b),Yl[0]=m.clone(g,Yl[0]),Yl[1]=m.clone(C,Yl[1]),L=zi.generateArc({positions:Yl,granularity:t,ellipsoid:i}),E=Gj(L,u,o,E),s&&(T.push(u.x,u.y,u.z),S.push(a.x,a.y,a.z)),p=m.clone(b,p),u=m.normalize(m.cross(a,c,u),u),b=m.add(f,m.multiplyByScalar(u,o*2,b),b),g=m.add(f,m.multiplyByScalar(u,o,g),g),r===Hi.ROUNDED||r===Hi.BEVELED?W.push({leftPositions:Jk(f,p,b,r,w)}):W.push({leftPositions:Xfe(_,m.negate(h,h),b,w)})):(b=m.add(_,h,b),C=m.add(b,m.negate(m.multiplyByScalar(u,o,C),C),C),f=m.add(b,m.negate(m.multiplyByScalar(u,o*2,f),f),f),Yl[0]=m.clone(g,Yl[0]),Yl[1]=m.clone(C,Yl[1]),L=zi.generateArc({positions:Yl,granularity:t,ellipsoid:i}),E=Gj(L,u,o,E),s&&(T.push(u.x,u.y,u.z),S.push(a.x,a.y,a.z)),p=m.clone(f,p),u=m.normalize(m.cross(a,c,u),u),f=m.add(b,m.negate(m.multiplyByScalar(u,o*2,f),f),f),g=m.add(b,m.negate(m.multiplyByScalar(u,o,g),g),g),r===Hi.ROUNDED||r===Hi.BEVELED?W.push({rightPositions:Jk(b,p,f,r,w)}):W.push({rightPositions:Xfe(_,h,f,w)})),d=m.negate(c,d)}_=R}a=i.geodeticSurfaceNormal(_,a),Yl[0]=m.clone(g,Yl[0]),Yl[1]=m.clone(_,Yl[1]),L=zi.generateArc({positions:Yl,granularity:t,ellipsoid:i}),E=Gj(L,u,o,E),s&&(T.push(u.x,u.y,u.z),S.push(a.x,a.y,a.z));let N;return r===Hi.ROUNDED&&(N=jtt(E)),{positions:E,corners:W,lefts:T,normals:S,endPositions:N}};var oo=Vj;var Qfe=new m,Ofe=new m,jk=new m,qk=new m,ent=new m,zfe=new m,j0=new m,HI=new m;function Hfe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function $h(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,d=m.normalize(m.cross(n,t,j0),j0);r.normal&&oo.addAttribute(s,t,i,o),r.tangent&&oo.addAttribute(a,d,i,o),r.bitangent&&oo.addAttribute(c,n,i,o)}function Kfe(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new yn,d,u=0,h=0,p,g=0,f;for(p=0;p<i.length;p+=2)f=i[p].length-3,u+=f,g+=f*2,h+=i[p+1].length-3;for(u+=3,h+=3,p=0;p<o.length;p++){d=o[p];let q=o[p].leftPositions;l(q)?(f=q.length,u+=f,g+=f):(f=o[p].rightPositions.length,h+=f,g+=f)}let b=l(r),C;b&&(C=r[0].length-3,u+=C,h+=C,C/=3,g+=C*6);let E=u+h,T=new Float64Array(E),S=t.normal?new Float32Array(E):void 0,_=t.tangent?new Float32Array(E):void 0,R=t.bitangent?new Float32Array(E):void 0,L={normals:S,tangents:_,bitangents:R},W=0,B=E-1,Y,N,A,I,Z=Qfe,G=Ofe,w,X,v=C/2,U=Pe.createTypedArray(E/3,g),k=0;if(b){X=jk,w=qk;let q=r[0];for(Z=m.fromArray(a,0,Z),G=m.fromArray(s,0,G),p=0;p<v;p++)X=m.fromArray(q,(v-1-p)*3,X),w=m.fromArray(q,(v+p)*3,w),oo.addAttribute(T,w,W),oo.addAttribute(T,X,void 0,B),$h(L,Z,G,W,B,t),N=W/3,I=N+1,Y=(B-2)/3,A=Y-1,U[k++]=Y,U[k++]=N,U[k++]=A,U[k++]=A,U[k++]=N,U[k++]=I,W+=3,B-=3}let P=0,O=0,H=i[P++],ee=i[P++];T.set(H,W),T.set(ee,B-ee.length+1),G=m.fromArray(s,O,G);let z,te;for(f=ee.length-3,p=0;p<f;p+=3)z=n.geodeticSurfaceNormal(m.fromArray(H,p,j0),j0),te=n.geodeticSurfaceNormal(m.fromArray(ee,f-p,HI),HI),Z=m.normalize(m.add(z,te,Z),Z),$h(L,Z,G,W,B,t),N=W/3,I=N+1,Y=(B-2)/3,A=Y-1,U[k++]=Y,U[k++]=N,U[k++]=A,U[k++]=A,U[k++]=N,U[k++]=I,W+=3,B-=3;for(z=n.geodeticSurfaceNormal(m.fromArray(H,f,j0),j0),te=n.geodeticSurfaceNormal(m.fromArray(ee,f,HI),HI),Z=m.normalize(m.add(z,te,Z),Z),O+=3,p=0;p<o.length;p++){let q;d=o[p];let me=d.leftPositions,ye=d.rightPositions,oe,xe,Ee=zfe,Le=jk,Se=qk;if(Z=m.fromArray(a,O,Z),l(me)){for($h(L,Z,G,void 0,B,t),B-=3,oe=I,xe=A,q=0;q<me.length/3;q++)Ee=m.fromArray(me,q*3,Ee),U[k++]=oe,U[k++]=xe-q-1,U[k++]=xe-q,oo.addAttribute(T,Ee,void 0,B),Le=m.fromArray(T,(xe-q-1)*3,Le),Se=m.fromArray(T,oe*3,Se),G=m.normalize(m.subtract(Le,Se,G),G),$h(L,Z,G,void 0,B,t),B-=3;Ee=m.fromArray(T,oe*3,Ee),Le=m.subtract(m.fromArray(T,xe*3,Le),Ee,Le),Se=m.subtract(m.fromArray(T,(xe-q)*3,Se),Ee,Se),G=m.normalize(m.add(Le,Se,G),G),$h(L,Z,G,W,void 0,t),W+=3}else{for($h(L,Z,G,W,void 0,t),W+=3,oe=A,xe=I,q=0;q<ye.length/3;q++)Ee=m.fromArray(ye,q*3,Ee),U[k++]=oe,U[k++]=xe+q,U[k++]=xe+q+1,oo.addAttribute(T,Ee,W),Le=m.fromArray(T,oe*3,Le),Se=m.fromArray(T,(xe+q)*3,Se),G=m.normalize(m.subtract(Le,Se,G),G),$h(L,Z,G,W,void 0,t),W+=3;Ee=m.fromArray(T,oe*3,Ee),Le=m.subtract(m.fromArray(T,(xe+q)*3,Le),Ee,Le),Se=m.subtract(m.fromArray(T,xe*3,Se),Ee,Se),G=m.normalize(m.negate(m.add(Se,Le,G),G),G),$h(L,Z,G,void 0,B,t),B-=3}for(H=i[P++],ee=i[P++],H.splice(0,3),ee.splice(ee.length-3,3),T.set(H,W),T.set(ee,B-ee.length+1),f=ee.length-3,O+=3,G=m.fromArray(s,O,G),q=0;q<ee.length;q+=3)z=n.geodeticSurfaceNormal(m.fromArray(H,q,j0),j0),te=n.geodeticSurfaceNormal(m.fromArray(ee,f-q,HI),HI),Z=m.normalize(m.add(z,te,Z),Z),$h(L,Z,G,W,B,t),I=W/3,N=I-1,A=(B-2)/3,Y=A+1,U[k++]=Y,U[k++]=N,U[k++]=A,U[k++]=A,U[k++]=N,U[k++]=I,W+=3,B-=3;W-=3,B+=3}if(Z=m.fromArray(a,a.length-3,Z),$h(L,Z,G,W,B,t),b){W+=3,B-=3,X=jk,w=qk;let q=r[1];for(p=0;p<v;p++)X=m.fromArray(q,(C-p-1)*3,X),w=m.fromArray(q,p*3,w),oo.addAttribute(T,X,void 0,B),oo.addAttribute(T,w,W),$h(L,Z,G,W,B,t),I=W/3,N=I-1,A=(B-2)/3,Y=A+1,U[k++]=Y,U[k++]=N,U[k++]=A,U[k++]=A,U[k++]=N,U[k++]=I,W+=3,B-=3}if(c.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:T}),t.st){let q=new Float32Array(E/3*2),me,ye,oe=0;if(b){u/=3,h/=3;let xe=Math.PI/(C+1);ye=1/(u-C+1),me=1/(h-C+1);let Ee,Le=C/2;for(p=Le+1;p<C+1;p++)Ee=V.PI_OVER_TWO+xe*p,q[oe++]=me*(1+Math.cos(Ee)),q[oe++]=.5*(1+Math.sin(Ee));for(p=1;p<h-C+1;p++)q[oe++]=p*me,q[oe++]=0;for(p=C;p>Le;p--)Ee=V.PI_OVER_TWO-p*xe,q[oe++]=1-me*(1+Math.cos(Ee)),q[oe++]=.5*(1+Math.sin(Ee));for(p=Le;p>0;p--)Ee=V.PI_OVER_TWO-xe*p,q[oe++]=1-ye*(1+Math.cos(Ee)),q[oe++]=.5*(1+Math.sin(Ee));for(p=u-C;p>0;p--)q[oe++]=p*ye,q[oe++]=1;for(p=1;p<Le+1;p++)Ee=V.PI_OVER_TWO+xe*p,q[oe++]=ye*(1+Math.cos(Ee)),q[oe++]=.5*(1+Math.sin(Ee))}else{for(u/=3,h/=3,ye=1/(u-1),me=1/(h-1),p=0;p<h;p++)q[oe++]=p*me,q[oe++]=0;for(p=u;p>0;p--)q[oe++]=(p-1)*ye,q[oe++]=1}c.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:q})}return t.normal&&(c.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:L.normals})),t.tangent&&(c.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:L.tangents})),t.bitangent&&(c.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:L.bitangents})),{attributes:c,indices:U}}function tnt(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Qfe,f=Ofe,b=jk,C=qk,E=ent,T=zfe,S=c;for(d=0;d<s;d+=3){let _=S+c;g=m.fromArray(n,d,g),f=m.fromArray(n,d+s,f),b=m.fromArray(n,(d+3)%s,b),f=m.subtract(f,g,f),b=m.subtract(b,g,b),C=m.normalize(m.cross(f,b,C),C),t.normal&&(oo.addAttribute(u,C,_),oo.addAttribute(u,C,_+3),oo.addAttribute(u,C,S),oo.addAttribute(u,C,S+3)),(t.tangent||t.bitangent)&&(T=m.fromArray(i,d,T),t.bitangent&&(oo.addAttribute(p,T,_),oo.addAttribute(p,T,_+3),oo.addAttribute(p,T,S),oo.addAttribute(p,T,S+3)),t.tangent&&(E=m.normalize(m.cross(T,C,E),E),oo.addAttribute(h,E,_),oo.addAttribute(h,E,_+3),oo.addAttribute(h,E,S),oo.addAttribute(h,E,S+3))),S+=6}if(t.normal){for(u.set(i),d=0;d<s;d+=3)u[d+s]=-i[d],u[d+s+1]=-i[d+1],u[d+s+2]=-i[d+2];e.normal.values=u}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let _=e.tangent.values;h.set(_),h.set(_,s),e.tangent.values=h}}if(t.st){let u=e.st.values,h=new Float32Array(a*6);h.set(u),h.set(u,a);let p=a*2;for(let g=0;g<2;g++){for(h[p++]=u[0],h[p++]=u[1],d=2;d<a;d+=2){let f=u[d],b=u[d+1];h[p++]=f,h[p++]=b,h[p++]=f,h[p++]=b}h[p++]=u[0],h[p++]=u[1]}e.st.values=h}return e}function Lj(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function nnt(e,t){let n=new we({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=oo.computePositions(e),r=Kfe(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,d=r.indices,u=c.position.values,h=u.length,p=new Float64Array(h*6),g=new Float64Array(h);g.set(u);let f=new Float64Array(h*4);u=Si.scaleToGeodeticHeight(u,s,i),f=Lj(u,0,f),g=Si.scaleToGeodeticHeight(g,a,i),f=Lj(g,h*2,f),p.set(u),p.set(g,h),p.set(f,h*2),c.position.values=p,c=tnt(c,t);let b,C=h/3;if(e.shadowVolume){let Y=c.normal.values;h=Y.length;let N=new Float32Array(h*6);for(b=0;b<h;b++)Y[b]=-Y[b];N.set(Y,h),N=Lj(Y,h*4,N),c.extrudeDirection=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let Y=new Uint8Array(C*6);if(e.offsetAttribute===mn.TOP)Y=Y.fill(1,0,C).fill(1,C*2,C*4);else{let N=e.offsetAttribute===mn.NONE?0:1;Y=Y.fill(N)}c.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Y})}let E=d.length,T=C+C,S=Pe.createTypedArray(p.length/3,E*2+T*3);S.set(d);let _=E;for(b=0;b<E;b+=3){let Y=d[b],N=d[b+1],A=d[b+2];S[_++]=A+C,S[_++]=N+C,S[_++]=Y+C}let R,L,W,B;for(b=0;b<T;b+=2)R=b+T,L=R+T,W=R+1,B=L+1,S[_++]=R,S[_++]=L,S[_++]=W,S[_++]=W,S[_++]=L,S[_++]=B;return{attributes:c,indices:S}}var vfe=new m,Zw=new m,Vm=new pe;function kfe(e,t,n,i,o,r){let s=m.subtract(t,e,vfe);m.normalize(s,s);let a=n.geodeticSurfaceNormal(e,Zw),c=m.cross(s,a,vfe);m.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,h=r.latitude,p=r.longitude;m.add(e,c,Zw),n.cartesianToCartographic(Zw,Vm);let g=Vm.latitude,f=Vm.longitude;d=Math.min(d,g),u=Math.min(u,f),h=Math.max(h,g),p=Math.max(p,f),m.subtract(e,c,Zw),n.cartesianToCartographic(Zw,Vm),g=Vm.latitude,f=Vm.longitude,d=Math.min(d,g),u=Math.min(u,f),h=Math.max(h,g),p=Math.max(p,f),o.latitude=d,o.longitude=u,r.latitude=h,r.longitude=p}var Gm=new m,Rw=new m,Cd=new pe,Ed=new pe;function Jfe(e,t,n,i,o){e=Hfe(e,t);let r=Mo(e,m.equalsEpsilon),s=r.length;if(s<2||n<=0)return new de;let a=n*.5;Cd.latitude=Number.POSITIVE_INFINITY,Cd.longitude=Number.POSITIVE_INFINITY,Ed.latitude=Number.NEGATIVE_INFINITY,Ed.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===Hi.ROUNDED){let p=r[0];m.subtract(p,r[1],Gm),m.normalize(Gm,Gm),m.multiplyByScalar(Gm,a,Gm),m.add(p,Gm,Rw),t.cartesianToCartographic(Rw,Vm),c=Vm.latitude,d=Vm.longitude,Cd.latitude=Math.min(Cd.latitude,c),Cd.longitude=Math.min(Cd.longitude,d),Ed.latitude=Math.max(Ed.latitude,c),Ed.longitude=Math.max(Ed.longitude,d)}for(let p=0;p<s-1;++p)kfe(r[p],r[p+1],t,a,Cd,Ed);let u=r[s-1];m.subtract(u,r[s-2],Gm),m.normalize(Gm,Gm),m.multiplyByScalar(Gm,a,Gm),m.add(u,Gm,Rw),kfe(u,Rw,t,a,Cd,Ed),i===Hi.ROUNDED&&(t.cartesianToCartographic(Rw,Vm),c=Vm.latitude,d=Vm.longitude,Cd.latitude=Math.min(Cd.latitude,c),Cd.longitude=Math.min(Cd.longitude,d),Ed.latitude=Math.max(Ed.latitude,c),Ed.longitude=Math.max(Ed.longitude,d));let h=l(o)?o:new de;return h.north=Ed.latitude,h.south=Cd.latitude,h.east=Ed.longitude,h.west=Cd.longitude,h}function wg(e){e=e??Q.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._vertexFormat=we.clone(e.vertexFormat??we.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Hi.ROUNDED,this._granularity=e.granularity??V.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*m.packedLength+ie.packedLength+we.packedLength+7}wg.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var jfe=ie.clone(ie.UNIT_SPHERE),qfe=new we,Bg={positions:void 0,ellipsoid:jfe,vertexFormat:qfe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};wg.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let f=0;f<i;++f,t+=m.packedLength)o[f]=m.unpack(e,t);let r=ie.unpack(e,t,jfe);t+=ie.packedLength;let s=we.unpack(e,t,qfe);t+=we.packedLength;let a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=ie.clone(r,n._ellipsoid),n._vertexFormat=we.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=d,n._cornerType=u,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Bg.positions=o,Bg.width=a,Bg.height=c,Bg.extrudedHeight=d,Bg.cornerType=u,Bg.granularity=h,Bg.shadowVolume=p,Bg.offsetAttribute=g===-1?void 0:g,new wg(Bg))};wg.computeRectangle=function(e,t){e=e??Q.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??ie.default,r=e.cornerType??Hi.ROUNDED;return Jfe(n,o,i,r,t)};wg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Hfe(t,i);let o=Mo(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!V.equalsEpsilon(r,s,0,V.EPSILON2),c=e._vertexFormat,d={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},u;if(a)d.height=r,d.extrudedHeight=s,d.shadowVolume=e._shadowVolume,d.offsetAttribute=e._offsetAttribute,u=nnt(d,c);else{let g=oo.computePositions(d);if(u=Kfe(g,c,i),u.attributes.position.values=Si.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let f=e._offsetAttribute===mn.NONE?0:1,b=u.attributes.position.values.length,C=new Uint8Array(b/3).fill(f);u.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}}let h=u.attributes,p=ue.fromVertices(h.position.values,void 0,3);return c.position||(u.attributes.position.values=void 0),new pt({attributes:h,indices:u.indices,primitiveType:Be.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};wg.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new wg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:we.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(wg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Jfe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var eE=wg;var Iai=y(x(),1);var $fe=new m,epe=new m,int=new m;function ont(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function tpe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new yn,a,c=0,d=0,u,h=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,c+=p,h+=p/3*4,d+=i[u+1].length-3;for(c+=3,d+=3,u=0;u<o.length;u++){a=o[u];let w=o[u].leftPositions;l(w)?(p=w.length,c+=p,h+=p/3*2):(p=o[u].rightPositions.length,d+=p,h+=p/3*2)}let g=l(r),f;g&&(f=r[0].length-3,c+=f,d+=f,f/=3,h+=f*4);let b=c+d,C=new Float64Array(b),E=0,T=b-1,S,_,R,L,W,B,Y=f/2,N=Pe.createTypedArray(b/3,h+4),A=0;if(N[A++]=E/3,N[A++]=(T-2)/3,g){n.push(E/3),B=$fe,W=epe;let w=r[0];for(u=0;u<Y;u++)B=m.fromArray(w,(Y-1-u)*3,B),W=m.fromArray(w,(Y+u)*3,W),oo.addAttribute(C,W,E),oo.addAttribute(C,B,void 0,T),_=E/3,L=_+1,S=(T-2)/3,R=S-1,N[A++]=S,N[A++]=R,N[A++]=_,N[A++]=L,E+=3,T-=3}let I=0,Z=i[I++],G=i[I++];for(C.set(Z,E),C.set(G,T-G.length+1),p=G.length-3,n.push(E/3,(T-2)/3),u=0;u<p;u+=3)_=E/3,L=_+1,S=(T-2)/3,R=S-1,N[A++]=S,N[A++]=R,N[A++]=_,N[A++]=L,E+=3,T-=3;for(u=0;u<o.length;u++){let w;a=o[u];let X=a.leftPositions,v=a.rightPositions,U,k=int;if(l(X)){for(T-=3,U=R,n.push(L),w=0;w<X.length/3;w++)k=m.fromArray(X,w*3,k),N[A++]=U-w-1,N[A++]=U-w,oo.addAttribute(C,k,void 0,T),T-=3;n.push(U-Math.floor(X.length/6)),t===Hi.BEVELED&&n.push((T-2)/3+1),E+=3}else{for(E+=3,U=L,n.push(R),w=0;w<v.length/3;w++)k=m.fromArray(v,w*3,k),N[A++]=U+w,N[A++]=U+w+1,oo.addAttribute(C,k,E),E+=3;n.push(U+Math.floor(v.length/6)),t===Hi.BEVELED&&n.push(E/3-1),T-=3}for(Z=i[I++],G=i[I++],Z.splice(0,3),G.splice(G.length-3,3),C.set(Z,E),C.set(G,T-G.length+1),p=G.length-3,w=0;w<G.length;w+=3)L=E/3,_=L-1,R=(T-2)/3,S=R+1,N[A++]=S,N[A++]=R,N[A++]=_,N[A++]=L,E+=3,T-=3;E-=3,T+=3,n.push(E/3,(T-2)/3)}if(g){E+=3,T-=3,B=$fe,W=epe;let w=r[1];for(u=0;u<Y;u++)B=m.fromArray(w,(f-u-1)*3,B),W=m.fromArray(w,u*3,W),oo.addAttribute(C,B,void 0,T),oo.addAttribute(C,W,E),L=E/3,_=L-1,R=(T-2)/3,S=R+1,N[A++]=S,N[A++]=R,N[A++]=_,N[A++]=L,E+=3,T-=3;n.push(E/3)}else n.push(E/3,(T-2)/3);return N[A++]=E/3,N[A++]=(T-2)/3,s.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:C}),{attributes:s,indices:N,wallIndices:n}}function rnt(e){let t=e.ellipsoid,n=oo.computePositions(e),i=tpe(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,d=a.position.values,u=d.length,h=new Float64Array(u);h.set(d);let p=new Float64Array(u*2);if(d=Si.scaleToGeodeticHeight(d,r,t),h=Si.scaleToGeodeticHeight(h,s,t),p.set(d),p.set(h,u),a.position.values=p,u/=3,l(e.offsetAttribute)){let S=new Uint8Array(u*2);if(e.offsetAttribute===mn.TOP)S=S.fill(1,0,u);else{let _=e.offsetAttribute===mn.NONE?0:1;S=S.fill(_)}a.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:S})}let g,f=c.length,b=Pe.createTypedArray(p.length/3,(f+o.length)*2);b.set(c);let C=f;for(g=0;g<f;g+=2){let S=c[g],_=c[g+1];b[C++]=S+u,b[C++]=_+u}let E,T;for(g=0;g<o.length;g++)E=o[g],T=E+u,b[C++]=E,b[C++]=T;return{attributes:a,indices:b}}function Gw(e){e=e??Q.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Hi.ROUNDED,this._granularity=e.granularity??V.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*m.packedLength+ie.packedLength+6}Gw.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var npe=ie.clone(ie.UNIT_SPHERE),q0={positions:void 0,ellipsoid:npe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};Gw.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=m.packedLength)o[p]=m.unpack(e,t);let r=ie.unpack(e,t,npe);t+=ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t];return l(n)?(n._positions=o,n._ellipsoid=ie.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=d,n._granularity=u,n._offsetAttribute=h===-1?void 0:h,n):(q0.positions=o,q0.width=s,q0.height=a,q0.extrudedHeight=c,q0.cornerType=d,q0.granularity=u,q0.offsetAttribute=h===-1?void 0:h,new Gw(q0))};Gw.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=ont(t,i);let o=Mo(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!V.equalsEpsilon(r,s,0,V.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},d;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,d=rnt(c);else{let p=oo.computePositions(c);if(d=tpe(p,c.cornerType),d.attributes.position.values=Si.scaleToGeodeticHeight(d.attributes.position.values,r,i),l(e._offsetAttribute)){let g=d.attributes.position.values.length,f=e._offsetAttribute===mn.NONE?0:1,b=new Uint8Array(g/3).fill(f);d.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let u=d.attributes,h=ue.fromVertices(u.position.values,void 0,3);return new pt({attributes:u,indices:d.indices,primitiveType:Be.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var Vw=Gw;var Nai=y(x(),1);var snt=new mi(0);function Nl(e){Ei.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Nl.prototype=Object.create(Ei.prototype),Nl.prototype.constructor=Nl);Object.defineProperties(Nl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Nl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&pl.isSupported(this._scene)};Nl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Nl.prototype._computeCenter=Ae.throwInstantiationError;Nl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Ei.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&At(At.geometryZIndex),this._zIndex=o.zIndex??snt,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new Th(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Ox(this._scene,a,r,s)}};Nl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Ei.prototype.destroy.call(this)};Nl.getGeometryHeight=function(e,t){if(!l(e)){t!==tt.NONE&&At(At.geometryHeightReference);return}return em(t)?0:e};Nl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==tt.NONE&&At(At.geometryExtrudedHeightReference);return}return em(t)?Nl.CLAMP_TO_GROUND:e};Nl.CLAMP_TO_GROUND="clamp";Nl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=tt.NONE),(!l(n)||!l(i))&&(i=tt.NONE);let o=0;if(t!==tt.NONE&&o++,i===tt.RELATIVE_TO_GROUND&&o++,o===2)return mn.ALL;if(o===1)return mn.TOP};var ii=Nl;var ipe=new D,ope=m.ZERO,rpe=new m,spe=new de;function ant(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 ef(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new ant(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(ef.prototype=Object.create(ii.prototype),ef.prototype.constructor=ef);ef.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,ipe)),l(o)||(o=D.WHITE),i.color=qt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,ope,rpe))),new Bt({id:t,geometry:new eE(this._options),attributes:i})};ef.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,ipe),o={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(i),distanceDisplayCondition:jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,ope,rpe))),new Bt({id:t,geometry:new Vw(this._options),attributes:o})};ef.prototype._computeCenter=function(e,t){let n=K.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return m.clone(n[Math.floor(n.length/2)],t)};ef.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Ei.prototype._isHidden.call(this,e,t)};ef.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.width)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.cornerType)||!K.isConstant(t.zIndex)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};ef.prototype._setStaticOptions=function(e,t){let n=K.getValueOrUndefined(t.height,Ke.MINIMUM_VALUE),i=K.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,tt.NONE),o=K.getValueOrUndefined(t.extrudedHeight,Ke.MINIMUM_VALUE),r=K.getValueOrDefault(t.extrudedHeightReference,Ke.MINIMUM_VALUE,tt.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ke.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ke.MINIMUM_VALUE),s.granularity=K.getValueOrUndefined(t.granularity,Ke.MINIMUM_VALUE),s.cornerType=K.getValueOrUndefined(t.cornerType,Ke.MINIMUM_VALUE),s.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,o,r),s.height=ii.getGeometryHeight(n,i),o=ii.getGeometryExtrudedHeight(o,r),o===ii.CLAMP_TO_GROUND&&(o=Zi.getMinimumMaximumHeights(eE.computeRectangle(s,spe)).minimumTerrainHeight),s.extrudedHeight=o};ef.DynamicGeometryUpdater=KI;function KI(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(KI.prototype=Object.create(Ci.prototype),KI.prototype.constructor=KI);KI.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Ci.prototype._isHidden.call(this,e,t,n)};KI.prototype._setOptions=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,tt.NONE),s=K.getValueOrUndefined(t.extrudedHeight,n),a=K.getValueOrDefault(t.extrudedHeightReference,n,tt.NONE);l(s)&&!l(o)&&(o=0),i.positions=K.getValueOrUndefined(t.positions,n),i.width=K.getValueOrUndefined(t.width,n),i.granularity=K.getValueOrUndefined(t.granularity,n),i.cornerType=K.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(o,r,s,a),i.height=ii.getGeometryHeight(o,r),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Zi.getMinimumMaximumHeights(eE.computeRectangle(i,spe)).minimumTerrainHeight),i.extrudedHeight=s};var Lw=ef;var Bli=y(x(),1);var lci=y(x(),1);function $k(){Ae.throwInstantiationError()}Object.defineProperties($k.prototype,{name:{get:Ae.throwInstantiationError},clock:{get:Ae.throwInstantiationError},entities:{get:Ae.throwInstantiationError},isLoading:{get:Ae.throwInstantiationError},changedEvent:{get:Ae.throwInstantiationError},errorEvent:{get:Ae.throwInstantiationError},loadingEvent:{get:Ae.throwInstantiationError},show:{get:Ae.throwInstantiationError},clustering:{get:Ae.throwInstantiationError}});$k.prototype.update=function(e){Ae.throwInstantiationError()};$k.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var ps=$k;var Rli=y(x(),1);var Aci=y(x(),1);function xp(e,t){this._ellipsoid=e,this._cameraPosition=new m,this._cameraPositionInScaledSpace=new m,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(xp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=m.magnitudeSquared(n)-1;m.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var ape=new m;xp.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,ape);return Fj(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};xp.prototype.isScaledSpacePointVisible=function(e){return Fj(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var cnt=new m;xp.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=cnt,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),Fj(e,o,i)};xp.prototype.computeHorizonCullingPoint=function(e,t,n){return dpe(this._ellipsoid,e,t,n)};var cpe=ie.clone(ie.UNIT_SPHERE);xp.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=lpe(this._ellipsoid,n,cpe);return dpe(o,e,t,i)};xp.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return upe(this._ellipsoid,e,t,n,i,o)};xp.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=lpe(this._ellipsoid,o,cpe);return upe(s,e,t,n,i,r)};var lnt=[];xp.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=de.subsample(e,t,0,lnt),o=ue.fromPoints(i);if(!(m.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var dnt=new m;function lpe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,dnt);e=ie.fromCartesian3(i,n)}return e}function dpe(e,t,n,i){l(i)||(i=new m);let o=fpe(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=mpe(e,c,o);if(d<0)return;r=Math.max(r,d)}return hpe(o,r,i)}var e9=new m;function upe(e,t,n,i,o,r){l(r)||(r=new m),i=i??3,o=o??m.ZERO;let s=fpe(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){e9.x=n[c]+o.x,e9.y=n[c+1]+o.y,e9.z=n[c+2]+o.z;let u=mpe(e,e9,s);if(u<0)return;a=Math.max(a,u)}return hpe(s,a,r)}function Fj(e,t,n){let i=t,o=n,r=m.subtract(e,i,ape),s=-m.dot(r,i);return!(o<0?s>0:s>o&&s*s/m.magnitudeSquared(r)>o)}var unt=new m,mnt=new m;function mpe(e,t,n){let i=e.transformPositionToScaledSpace(t,unt),o=m.magnitudeSquared(i),r=Math.sqrt(o),s=m.divideByScalar(i,r,mnt);o=Math.max(1,o),r=Math.max(1,r);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function hpe(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var Wj=new m;function fpe(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,Wj),m.normalize(Wj,Wj))}var tf=xp;var Lci=y(x(),1);function qr(e,t){e=e??Q.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=Mt.clone(o)),this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),this._actualPosition=m.clone(this._position),this._color=D.clone(e.color??D.WHITE),this._outlineColor=D.clone(e.outlineColor??D.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Br.NONE}var ppe=qr.SHOW_INDEX=0,bpe=qr.POSITION_INDEX=1,hnt=qr.COLOR_INDEX=2,fnt=qr.OUTLINE_COLOR_INDEX=3,pnt=qr.OUTLINE_WIDTH_INDEX=4,Ant=qr.PIXEL_SIZE_INDEX=5,gnt=qr.SCALE_BY_DISTANCE_INDEX=6,bnt=qr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,ynt=qr.DISTANCE_DISPLAY_CONDITION_INDEX=8,xnt=qr.DISABLE_DEPTH_DISTANCE_INDEX=9,Cnt=qr.SPLIT_DIRECTION_INDEX=10;qr.NUMBER_OF_PROPERTIES=11;function uu(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(qr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,uu(this,ppe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),uu(this,bpe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),uu(this,gnt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),uu(this,bnt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,uu(this,Ant))}},color:{get:function(){return this._color},set:function(e){let t=this._color;D.equals(t,e)||(D.clone(e,t),uu(this,hnt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;D.equals(t,e)||(D.clone(e,t),uu(this,fnt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,uu(this,pnt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),uu(this,ynt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,uu(this,xnt))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(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,uu(this,ppe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,uu(this,Cnt))}}});qr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};qr.prototype._getActualPosition=function(){return this._actualPosition};qr.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),uu(this,bpe)};var Ape=new ce;qr._computeActualPosition=function(e,t,n){return t.mode===se.SCENE3D?e:(F.multiplyByPoint(n,e,Ape),no.computeActualEllipsoidPosition(t,Ape))};var gpe=new ce;qr._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,ce.fromElements(t.x,t.y,t.z,1,gpe),gpe);return no.worldToWindowCoordinates(n,o,i)};qr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new M);let i=n.modelMatrix,o=qr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};qr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new $e),n.x=r,n.y=s,n.width=a,n.height=c,n};qr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&D.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&D.equals(this._outlineColor,e._outlineColor)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};qr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var la=qr;var cli=y(x(),1);var Fci=y(x(),1),$0=`in vec4 v_color;
in vec4 v_outlineColor;
in float v_innerPercent;
in float v_pixelDistance;
in vec4 v_pickColor;
in float v_splitDirection;

void main()
{
    if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;

    // The distance in UV space from this fragment to the center of the point, at most 0.5.
    float distanceToCenter = length(gl_PointCoord - vec2(0.5));
    // The max distance stops one pixel shy of the edge to leave space for anti-aliasing.
    float maxDistance = max(0.0, 0.5 - v_pixelDistance);
    float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);
    float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);

    vec4 color = mix(v_outlineColor, v_color, innerAlpha);
    color.a *= wholeAlpha;

// Fully transparent parts of the billboard are not pickable.
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
    if (color.a < 0.005)   // matches 0/255 and 1/255
    {
        discard;
    }
#else
// The billboard is rendered twice. The opaque pass discards translucent fragments
// and the translucent pass discards opaque fragments.
#ifdef OPAQUE
    if (color.a < 0.995)   // matches < 254/255
    {
        discard;
    }
#else
    if (color.a >= 0.995)  // matches 254/255 and 255/255
    {
        discard;
    }
#endif
#endif

    out_FragColor = czm_gammaCorrect(color);
    czm_writeLogDepth();
}
`;var wci=y(x(),1),Ww=`uniform float u_maxTotalPointSize;

in vec4 positionHighAndSize;
in vec4 positionLowAndOutline;
in vec4 compressedAttribute0;                                        // color, outlineColor, pick color
in vec4 compressedAttribute1;                                        // show, translucency by distance, some free space
in vec4 scaleByDistance;                                             // near, nearScale, far, farScale
in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection;    // near, far, disableDepthTestDistance, splitDirection

out vec4 v_color;
out vec4 v_outlineColor;
out float v_innerPercent;
out float v_pixelDistance;
out vec4 v_pickColor;
out float v_splitDirection;

const float SHIFT_LEFT8 = 256.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;

void main()
{
    // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition

    // unpack attributes
    vec3 positionHigh = positionHighAndSize.xyz;
    vec3 positionLow = positionLowAndOutline.xyz;
    float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
    float totalSize = positionHighAndSize.w + outlineWidthBothSides;
    float outlinePercent = outlineWidthBothSides / totalSize;
    // Scale in response to browser-zoom.
    totalSize *= czm_pixelRatio;

    float temp = compressedAttribute1.x * SHIFT_RIGHT8;
    float show = floor(temp);

#ifdef EYE_DISTANCE_TRANSLUCENCY
    vec4 translucencyByDistance;
    translucencyByDistance.x = compressedAttribute1.z;
    translucencyByDistance.z = compressedAttribute1.w;

    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;

    temp = compressedAttribute1.y * SHIFT_RIGHT8;
    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif

    ///////////////////////////////////////////////////////////////////////////

    vec4 color;
    vec4 outlineColor;
    vec4 pickColor;

    // compressedAttribute0.z => pickColor.rgb

    temp = compressedAttribute0.z * SHIFT_RIGHT8;
    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor.r = floor(temp);

    // compressedAttribute0.x => color.rgb

    temp = compressedAttribute0.x * SHIFT_RIGHT8;
    color.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    color.g = (temp - floor(temp)) * SHIFT_LEFT8;
    color.r = floor(temp);

    // compressedAttribute0.y => outlineColor.rgb

    temp = compressedAttribute0.y * SHIFT_RIGHT8;
    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor.r = floor(temp);

    // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a

    temp = compressedAttribute0.w * SHIFT_RIGHT8;
    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor = pickColor / 255.0;

    temp = floor(temp) * SHIFT_RIGHT8;
    outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor /= 255.0;
    color.a = floor(temp);
    color /= 255.0;

    ///////////////////////////////////////////////////////////////////////////

    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
    vec4 positionEC = czm_modelViewRelativeToEye * p;

    ///////////////////////////////////////////////////////////////////////////

#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
    float lengthSq;
    if (czm_sceneMode == czm_sceneMode2D)
    {
        // 2D camera distance is a special case
        // treat all billboards as flattened to the z=0.0 plane
        lengthSq = czm_eyeHeight2D.y;
    }
    else
    {
        lengthSq = dot(positionEC.xyz, positionEC.xyz);
    }
#endif

#ifdef EYE_DISTANCE_SCALING
    totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
#endif
    if (totalSize > 0.0) {
        // Add padding for anti-aliasing on both sides.
        totalSize += 3.0;
    }

    // Clamp to max point size.
    totalSize = min(totalSize, u_maxTotalPointSize);
    // If size is too small, push vertex behind near plane for clipping.
    // Note that context.minimumAliasedPointSize "will be at most 1.0".
    if (totalSize < 1.0)
    {
        positionEC.xyz = vec3(0.0);
        totalSize = 1.0;
    }

    float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
    // push vertex behind near plane for clipping
    if (translucency < 0.004)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

#ifdef DISTANCE_DISPLAY_CONDITION
    float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;
    float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y;
    if (lengthSq < nearSq || lengthSq > farSq) {
        // push vertex behind camera to force it to be clipped
        positionEC.xyz = vec3(0.0, 0.0, 1.0);
    }
#endif

    gl_Position = czm_projection * positionEC;
    czm_vertexLogDepth();

#ifdef DISABLE_DEPTH_DISTANCE
    float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z;
    if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
    {
        disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
    }

    if (disableDepthTestDistance != 0.0)
    {
        // Don't try to "multiply both sides" by w.  Greater/less-than comparisons won't work for negative values of w.
        float zclip = gl_Position.z / gl_Position.w;
        bool clipped = (zclip < -1.0 || zclip > 1.0);
        if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
        {
            // Position z on the near plane.
            gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
            czm_vertexLogDepth(vec4(czm_currentFrustum.x));
#endif
        }
    }
#endif

    v_color = color;
    v_color.a *= translucency * show;
    v_outlineColor = outlineColor;
    v_outlineColor.a *= translucency * show;

    v_innerPercent = 1.0 - outlinePercent;
    v_pixelDistance = 2.0 / totalSize;
    gl_PointSize = totalSize * show;
    gl_Position *= show;

    v_pickColor = pickColor;
    v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
}
`;var Ent=la.SHOW_INDEX,Yj=la.POSITION_INDEX,ype=la.COLOR_INDEX,Tnt=la.OUTLINE_COLOR_INDEX,Snt=la.OUTLINE_WIDTH_INDEX,Int=la.PIXEL_SIZE_INDEX,xpe=la.SCALE_BY_DISTANCE_INDEX,Cpe=la.TRANSLUCENCY_BY_DISTANCE_INDEX,Epe=la.DISTANCE_DISPLAY_CONDITION_INDEX,_nt=la.DISABLE_DEPTH_DISTANCE_INDEX,Znt=la.SPLIT_DIRECTION_INDEX,Nj=la.NUMBER_OF_PROPERTIES,Jc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Lm(e){e=e??Q.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(Nj),this._maxPixelSize=1,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Jo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW,Xe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Lm.prototype,{length:{get:function(){return Xj(this),this._pointPrimitives.length}}});function Tpe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Lm.prototype.add=function(e){let t=new la(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Lm.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Lm.prototype.removeAll=function(){Tpe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Xj(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}Lm.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Lm.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Lm.prototype.get=function(e){return Xj(this),this._pointPrimitives[e]};Lm.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Nj;++i){let o=n[i]===0?Xe.STATIC_DRAW:Xe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Rnt(e,t,n){return new TA(e,[{index:Jc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Yj]},{index:Jc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Yj]},{index:Jc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[ype]},{index:Jc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Cpe]},{index:Jc.scaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[xpe]},{index:Jc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Epe]}],t)}var Bj=new ti;function Spe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===se.SCENE3D&&(ue.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),ti.fromCartesian(r,Bj);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Jc.positionHighAndSize],d=Bj.high;c(o,d.x,d.y,d.z,s);let u=n[Jc.positionLowAndOutline],h=Bj.low;u(o,h.x,h.y,h.z,a)}var t9=65536,Fw=256;function Ipe(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=D.floatToByte(r.red),d=D.floatToByte(r.green),u=D.floatToByte(r.blue),h=c*t9+d*Fw+u;c=D.floatToByte(a.red),d=D.floatToByte(a.green),u=D.floatToByte(a.blue);let p=c*t9+d*Fw+u;c=D.floatToByte(s.red),d=D.floatToByte(s.green),u=D.floatToByte(s.blue);let g=c*t9+d*Fw+u,f=D.floatToByte(r.alpha)*t9+D.floatToByte(a.alpha)*Fw+D.floatToByte(s.alpha),b=n[Jc.compressedAttribute0];b(o,h,p,g,f)}function _pe(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,d=i.translucencyByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let u=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(u=!1),s=V.clamp(s,0,1),s=s===1?255:s*255|0;let h=(u?1:0)*Fw+s;c=V.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[Jc.compressedAttribute1];g(o,h,p,r,a)}function Zpe(e,t,n,i){let o=i._index,r=n[Jc.scaleByDistance],s=0,a=1,c=1,d=1,u=i.scaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,d)}function Rpe(e,t,n,i){let o=i._index,r=n[Jc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let u=0,h=i.splitDirection;l(h)&&(u=h),r(o,s,a,d,u)}function Gnt(e,t,n,i){Spe(e,t,n,i),Ipe(e,t,n,i),_pe(e,t,n,i),Zpe(e,t,n,i),Rpe(e,t,n,i)}function wj(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,h=la._computeActualPosition(u,i,o);l(h)&&(d._setActualPosition(h),r?a.push(h):ue.expand(s,h,s))}r&&ue.fromPoints(a,s)}function Vnt(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&wj(e,i,i.length,t,r,!0)):n===se.MORPHING?wj(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&wj(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function Lnt(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var Wnt=[];Lm.prototype.update=function(e){if(Xj(this),!this.show)return;this._maxTotalPointSize=Yt.maximumAliasedPointSize,Vnt(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,d=e.passes,u=d.pick;if(s||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<Nj;++R)r[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Rnt(c,n,this._buffersUsage),a=this._vaf.writers;for(let R=0;R<n;++R){let L=this._pointPrimitives[R];L._dirty=!1,Gnt(this,c,a,L)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let R=Wnt;R.length=0,(r[Yj]||r[Snt]||r[Int])&&R.push(Spe),(r[ype]||r[Tnt])&&R.push(Ipe),(r[Ent]||r[Cpe])&&R.push(_pe),r[xpe]&&R.push(Zpe),(r[Epe]||r[_nt]||r[Znt])&&R.push(Rpe);let L=R.length;if(a=this._vaf.writers,o/n>.1){for(let W=0;W<o;++W){let B=i[W];B._dirty=!1;for(let Y=0;Y<L;++Y)R[Y](this,c,a,B)}this._vaf.commit()}else{for(let W=0;W<o;++W){let B=i[W];B._dirty=!1;for(let Y=0;Y<L;++Y)R[Y](this,c,a,B);this._vaf.subCommit(B._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=F.IDENTITY;e.mode===se.SCENE3D?(p=this.modelMatrix,h=ue.clone(this._baseVolumeWC,this._boundingVolume)):h=ue.clone(this._baseVolume2D,this._boundingVolume),Lnt(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Jo.OPAQUE||this._blendOption===Jo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ke.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Jo.TRANSLUCENT||this._blendOption===Jo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ke.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!1,blending:fn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,b;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new ze({sources:[Ww]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Jo.OPAQUE_AND_TRANSLUCENT&&(b=new ze({defines:["OPAQUE"],sources:[$0]}),this._sp=cn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:b,attributeLocations:Jc}),b=new ze({defines:["TRANSLUCENT"],sources:[$0]}),this._spTranslucent=cn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:b,attributeLocations:Jc})),this._blendOption===Jo.OPAQUE&&(b=new ze({sources:[$0]}),this._sp=cn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:b,attributeLocations:Jc})),this._blendOption===Jo.TRANSLUCENT&&(b=new ze({sources:[$0]}),this._spTranslucent=cn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:b,attributeLocations:Jc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let C,E,T,S,_=e.commandList;if(d.render||u){let R=this._colorCommands,L=this._blendOption===Jo.OPAQUE,W=this._blendOption===Jo.OPAQUE_AND_TRANSLUCENT;C=this._vaf.va,E=C.length,R.length=E;let B=W?E*2:E;for(S=0;S<B;++S){let Y=L||W&&S%2===0;T=R[S],l(T)||(T=R[S]=new nt),T.primitiveType=Be.POINTS,T.pass=Y||!W?Ve.OPAQUE:Ve.TRANSLUCENT,T.owner=this;let N=W?Math.floor(S/2):S;T.boundingVolume=h,T.modelMatrix=p,T.shaderProgram=Y?this._sp:this._spTranslucent,T.uniformMap=this._uniforms,T.vertexArray=C[N].va,T.renderState=Y?this._rsOpaque:this._rsTranslucent,T.debugShowBoundingVolume=this.debugShowBoundingVolume,T.pickId="v_pickColor",_.push(T)}}};Lm.prototype.isDestroyed=function(){return!1};Lm.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(),Tpe(this._pointPrimitives),fe(this)};var JI=Lm;var dli=y(x(),1),Gpe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Pj=1,Bw=8,Yw=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==Pj)throw new Error(`Got v${o} data when expected v${Pj}.`);let r=Gpe[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=Gpe.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,Bw,t),this.coords=new this.ArrayType(this.data,Bw+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Bw+s+a+c),this.ids=new this.IndexArrayType(this.data,Bw,t),this.coords=new this.ArrayType(this.data,Bw+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Pj<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Uj(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],d=[];for(;c.length;){let u=c.pop()||0,h=c.pop()||0,p=c.pop()||0;if(h-p<=a){for(let C=p;C<=h;C++){let E=s[2*C],T=s[2*C+1];E>=t&&E<=i&&T>=n&&T<=o&&d.push(r[C])}continue}let g=p+h>>1,f=s[2*g],b=s[2*g+1];f>=t&&f<=i&&b>=n&&b<=o&&d.push(r[g]),(u===0?t<=f:n<=b)&&(c.push(p),c.push(g-1),c.push(1-u)),(u===0?i>=f:o>=b)&&(c.push(g+1),c.push(h),c.push(1-u))}return d}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],d=i*i;for(;a.length;){let u=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let C=p;C<=h;C++)Vpe(r[2*C],r[2*C+1],t,n)<=d&&c.push(o[C]);continue}let g=p+h>>1,f=r[2*g],b=r[2*g+1];Vpe(f,b,t,n)<=d&&c.push(o[g]),(u===0?t-i<=f:n-i<=b)&&(a.push(p),a.push(g-1),a.push(1-u)),(u===0?t+i>=f:n+i>=b)&&(a.push(g+1),a.push(h),a.push(1-u))}return c}};function Uj(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Lpe(e,t,s,i,o,r),Uj(e,t,n,i,s-1,1-r),Uj(e,t,n,s+1,o,1-r)}function Lpe(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+g)),b=Math.min(o,Math.floor(n+(d-u)*p/d+g));Lpe(e,t,n,f,b,r)}let s=t[2*n+r],a=i,c=o;for(ww(e,t,i,n),t[2*o+r]>s&&ww(e,t,i,o);a<c;){for(ww(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?ww(e,t,i,c):(c++,ww(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function ww(e,t,n,i){Mj(e,n,i),Mj(t,2*n,2*i),Mj(t,2*n+1,2*i+1)}function Mj(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Vpe(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function nf(e){e=e??Q.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=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 Ce,this.show=e.show??!0}function Wpe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var Fnt=new $e;function Fpe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=X0.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=Zo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=la.getScreenSpaceBoundingBox(e,t,o)),Wpe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&wpe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=X0.getScreenSpaceBoundingBox(s,t,Fnt);Wpe(a,n),o=$e.union(o,a,o)}return o}function Bnt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&wpe(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Bpe(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function wpe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function Dj(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===se.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),d=o._clusterBillboards&&l(a.id._billboard),u=o._clusterPoints&&l(a.id._point);if(c&&(u||d))continue;let h=a.computeScreenSpacePosition(n);l(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}var wnt=new $e,Ynt=new $e,Nnt=new $e;function Xnt(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new fp({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new ru({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new JI;let d=e._pixelRange,u=e._minimumClusterSize,h=e._previousClusters,p=[],g=e._previousHeight,f=n.camera.positionCartographic.height,b=n.ellipsoid,C=n.camera.positionWC,E=new tf(b,C),T=[];e._clusterLabels&&Dj(i,T,n,E,e),e._clusterBillboards&&Dj(o,T,n,E,e),e._clusterPoints&&Dj(r,T,n,E,e);let S,_,R,L,W,B,Y,N,A,I,Z,G;if(T.length>0){let w=new Yw(T.length,64,Float64Array);for(let X=0;X<T.length;++X)w.add(T[X].coord.x,T[X].coord.y);if(w.finish(),f<g)for(R=h.length,S=0;S<R;++S){let X=h[S];if(!E.isPointVisible(X.position))continue;let v=Zo._computeScreenSpacePosition(F.IDENTITY,X.position,m.ZERO,M.ZERO,n);if(!l(v))continue;let U=1-f/g,k=X.width=X.width*U,P=X.height=X.height*U;k=Math.max(k,X.minimumWidth),P=Math.max(P,X.minimumHeight);let O=v.x-k*.5,H=v.y-P*.5,ee=v.x+k,z=v.y+P;for(W=w.range(O,H,ee,z),B=W.length,I=0,A=[],_=0;_<B;++_)Y=W[_],N=T[Y],N.clustered||(++I,Z=N.collection,G=N.index,A.push(Z.get(G).id));if(I>=u)for(Bpe(X.position,I,A,e),p.push(X),_=0;_<B;++_)T[W[_]].clustered=!0}for(R=T.length,S=0;S<R;++S){let X=T[S];if(X.clustered)continue;X.clustered=!0,Z=X.collection,G=X.index;let v=Z.get(G);L=Fpe(v,X.coord,d,e,wnt);let U=$e.clone(L,Ynt);W=w.range(L.x,L.y,L.x+L.width,L.y+L.height),B=W.length;let k=m.clone(v.position);for(I=1,A=[v.id],_=0;_<B;++_)if(Y=W[_],N=T[Y],!N.clustered){let P=N.collection.get(N.index),O=Fpe(P,N.coord,d,e,Nnt);m.add(P.position,k,k),$e.union(U,O,U),++I,A.push(P.id)}if(I>=u){let P=m.multiplyByScalar(k,1/I,k);for(Bpe(P,I,A,e),p.push({position:P,width:U.width,height:U.height,minimumWidth:L.width,minimumHeight:L.height}),_=0;_<B;++_)T[W[_]].clustered=!0}else Bnt(v,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=f}}nf.prototype._initialize=function(e){this._scene=e;let t=Xnt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(nf.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}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function kj(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,d=this[n];d.length>0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function Qj(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}nf.prototype.getLabel=kj("_labelCollection",fp,"_unusedLabelIndices","labelIndex");nf.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,Qj(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};nf.prototype.getBillboard=kj("_billboardCollection",ru,"_unusedBillboardIndices","billboardIndex");nf.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,Qj(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};nf.prototype.getPoint=kj("_pointCollection",JI,"_unusedPointIndices","pointIndex");nf.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,Qj(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function vj(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Pnt(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,vj(e._labelCollection),vj(e._billboardCollection),vj(e._pointCollection))}nf.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,Pnt(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};nf.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),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(),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};var mu=nf;function Oj(e){this._name=e,this._clock=void 0,this._changed=new Ce,this._error=new Ce,this._isLoading=!1,this._loading=new Ce,this._entityCollection=new Ga(this),this._entityCluster=new mu}Object.defineProperties(Oj.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){ps.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});Oj.prototype.update=function(e){return!0};var Nw=Oj;var Ndi=y(x(),1);var edi=y(x(),1);var Nli=y(x(),1);var Ype={};Ype.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,d=new Float64Array(c*3),u,h=0,p=0,g=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u<i;u++){let b=u/i*V.TWO_PI,C=Math.cos(b),E=Math.sin(b),T=C*n,S=E*n,_=C*t,R=E*t;d[p+g]=T,d[p+g+1]=S,d[p+g+2]=s,d[p+f]=_,d[p+f+1]=R,d[p+f+2]=r,p+=3,o&&(d[h++]=T,d[h++]=S,d[h++]=s,d[h++]=_,d[h++]=R,d[h++]=r)}return d};var tE=Ype;var zj=new M,Mnt=new m,Unt=new m,Dnt=new m,vnt=new m;function Yg(e){e=e??Q.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??we.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=we.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Yg.packedLength=we.packedLength+5;Yg.pack=function(e,t,n){return n=n??0,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var Npe=new we,jI={vertexFormat:Npe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Yg.unpack=function(e,t,n){t=t??0;let i=we.unpack(e,t,Npe);t+=we.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=we.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(jI.length=o,jI.topRadius=r,jI.bottomRadius=s,jI.slices=a,jI.offsetAttribute=c===-1?void 0:c,new Yg(jI))};Yg.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,d=tE.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(c*2):void 0,h=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,g=o.bitangent?new Float32Array(c*3):void 0,f,b=o.normal||o.tangent||o.bitangent;if(b){let W=o.tangent||o.bitangent,B=0,Y=0,N=0,A=Math.atan2(i-n,t),I=Mnt;I.z=Math.sin(A);let Z=Math.cos(A),G=Dnt,w=Unt;for(f=0;f<r;f++){let X=f/r*V.TWO_PI,v=Z*Math.cos(X),U=Z*Math.sin(X);b&&(I.x=v,I.y=U,W&&(G=m.normalize(m.cross(m.UNIT_Z,I,G),G)),o.normal&&(h[B++]=I.x,h[B++]=I.y,h[B++]=I.z,h[B++]=I.x,h[B++]=I.y,h[B++]=I.z),o.tangent&&(p[Y++]=G.x,p[Y++]=G.y,p[Y++]=G.z,p[Y++]=G.x,p[Y++]=G.y,p[Y++]=G.z),o.bitangent&&(w=m.normalize(m.cross(I,G,w),w),g[N++]=w.x,g[N++]=w.y,g[N++]=w.z,g[N++]=w.x,g[N++]=w.y,g[N++]=w.z))}for(f=0;f<r;f++)o.normal&&(h[B++]=0,h[B++]=0,h[B++]=-1),o.tangent&&(p[Y++]=1,p[Y++]=0,p[Y++]=0),o.bitangent&&(g[N++]=0,g[N++]=-1,g[N++]=0);for(f=0;f<r;f++)o.normal&&(h[B++]=0,h[B++]=0,h[B++]=1),o.tangent&&(p[Y++]=1,p[Y++]=0,p[Y++]=0),o.bitangent&&(g[N++]=0,g[N++]=1,g[N++]=0)}let C=12*r-12,E=Pe.createTypedArray(c,C),T=0,S=0;for(f=0;f<r-1;f++)E[T++]=S,E[T++]=S+2,E[T++]=S+3,E[T++]=S,E[T++]=S+3,E[T++]=S+1,S+=2;for(E[T++]=s-2,E[T++]=0,E[T++]=1,E[T++]=s-2,E[T++]=1,E[T++]=s-1,f=1;f<r-1;f++)E[T++]=s+f+1,E[T++]=s+f,E[T++]=s;for(f=1;f<r-1;f++)E[T++]=a,E[T++]=a+f,E[T++]=a+f+1;let _=0;if(o.st){let W=Math.max(n,i);for(f=0;f<c;f++){let B=m.fromArray(d,f*3,vnt);u[_++]=(B.x+W)/(2*W),u[_++]=(B.y+W)/(2*W)}}let R=new yn;o.position&&(R.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(R.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(R.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(R.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(R.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),zj.x=t*.5,zj.y=Math.max(i,n);let L=new ue(m.ZERO,M.magnitude(zj));if(l(e._offsetAttribute)){t=d.length;let W=e._offsetAttribute===mn.NONE?0:1,B=new Uint8Array(t/3).fill(W);R.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new pt({attributes:R,indices:E,primitiveType:Be.TRIANGLES,boundingSphere:L,offsetAttribute:e._offsetAttribute})};var Hj;Yg.getUnitCylinder=function(){return l(Hj)||(Hj=Yg.createGeometry(new Yg({topRadius:1,bottomRadius:1,length:1,vertexFormat:we.POSITION_ONLY}))),Hj};var Xw=Yg;var pdi=y(x(),1);var Kj=new M;function qI(e){e=e??Q.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}qI.packedLength=6;qI.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var nE={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};qI.unpack=function(e,t,n){t=t??0;let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(nE.length=i,nE.topRadius=o,nE.bottomRadius=r,nE.slices=s,nE.numberOfVerticalLines=a,nE.offsetAttribute=c===-1?void 0:c,new qI(nE))};qI.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=tE.computePositions(t,n,i,o,!1),c=o*2,d;if(r>0){let b=Math.min(r,o);d=Math.round(o/b),c+=b}let u=Pe.createTypedArray(s,c*2),h=0,p;for(p=0;p<o-1;p++)u[h++]=p,u[h++]=p+1,u[h++]=p+o,u[h++]=p+1+o;if(u[h++]=o-1,u[h++]=0,u[h++]=o+o-1,u[h++]=o,r>0)for(p=0;p<o;p+=d)u[h++]=p,u[h++]=p+o;let g=new yn;g.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:a}),Kj.x=t*.5,Kj.y=Math.max(i,n);let f=new ue(m.ZERO,M.magnitude(Kj));if(l(e._offsetAttribute)){t=a.length;let b=e._offsetAttribute===mn.NONE?0:1,C=new Uint8Array(t/3).fill(b);g.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}return new pt({attributes:g,indices:u,primitiveType:Be.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var Pw=qI;var Xpe=m.ZERO,Ppe=new m,knt=new m,Mpe=new D;function Qnt(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 hu(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new Qnt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(hu.prototype=Object.create(Ei.prototype),hu.prototype.constructor=hu);Object.defineProperties(hu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});hu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=jn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Mpe)),l(a)||(a=D.WHITE),s.color=qt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Xpe,Ppe))),new Bt({id:t,geometry:new Xw(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};hu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,Mpe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(i),distanceDisplayCondition:jn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Xpe,Ppe))),new Bt({id:t,geometry:new Pw(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};hu.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};hu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Ei.prototype._isHidden.call(this,e,t)};hu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!K.isConstant(t.slices)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.numberOfVerticalLines)};hu.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,tt.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ke.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ke.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ke.MINIMUM_VALUE),i.slices=K.getValueOrUndefined(t.slices,Ke.MINIMUM_VALUE),i.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,Ke.MINIMUM_VALUE),i.offsetAttribute=n!==tt.NONE?mn.ALL:void 0};hu.prototype._onEntityPropertyChanged=YA;hu.DynamicGeometryUpdater=$I;function $I(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&($I.prototype=Object.create(Ci.prototype),$I.prototype.constructor=$I);$I.prototype._isHidden=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(e.position,n,knt);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ci.prototype._isHidden.call(this,e,t,n)};$I.prototype._setOptions=function(e,t,n){let i=K.getValueOrDefault(t.heightReference,n,tt.NONE),o=this._options;o.length=K.getValueOrUndefined(t.length,n),o.topRadius=K.getValueOrUndefined(t.topRadius,n),o.bottomRadius=K.getValueOrUndefined(t.bottomRadius,n),o.slices=K.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==tt.NONE?mn.ALL:void 0};var Mw=hu;var Npi=y(x(),1);var Pdi=y(x(),1),Ont={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},As=Object.freeze(Ont);var Udi=y(x(),1),znt={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},wo=Object.freeze(znt);var vdi=y(x(),1),Hnt={NONE:0,HOLD:1,EXTRAPOLATE:2},fu=Object.freeze(Hnt);var Qdi=y(x(),1),Upe=y(Md(),1);function Knt(e){let t=new Upe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Ng=Knt;var Kdi=y(x(),1);var Jnt=V.factorial;function Jj(e,t,n,i,o,r){let s=0,a,c,d;if(i>0){for(c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(r.push(c),s+=Jj(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(s*=e-n[t[c]])}return s}var n9={type:"Hermite"};n9.getRequiredDataPoints=function(e,t){return t=t??0,Math.max(Math.floor((e+1)/(t+1)),2)};n9.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,d,u,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let C=new Array(h);for(p[r]=C,s=0;s<h;s++)C[s]=[]}let g=h,f=new Array(g);for(r=0;r<g;r++)f[r]=r;let b=h-1;for(c=0;c<i;c++){for(s=0;s<g;s++)u=f[s]*i+c,p[c][0].push(n[u]);for(r=1;r<g;r++){let C=!1;for(s=0;s<g-r;s++){let E=t[f[s]],T=t[f[s+r]],S;T-E<=0?(u=f[s]*i+i*r+c,S=n[u],p[c][r].push(S/Jnt(r))):(S=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(S/(T-E))),C=C||S!==0}C||(b=r-1)}}for(a=0,d=0;a<=d;a++)for(r=a;r<=b;r++){let C=Jj(e,f,t,a,r,[]);for(c=0;c<i;c++){let E=p[c][r][0];o[c+a*i]+=E*C}}return o};var jnt=[];n9.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let E=0;E<a;E++)s[E]=0;let c=t.length,d=new Array(c*(o+1)),u;for(u=0;u<c;u++)for(let E=0;E<o+1;E++)d[u*(o+1)+E]=u;let h=d.length,p=jnt,g=qnt(p,d,t,n,i,o),f=[],b=h*(h+1)/2,C=Math.min(g,r);for(let E=0;E<=C;E++)for(u=E;u<=g;u++){f.length=0;let T=Jj(e,d,t,E,u,f),S=Math.floor(u*(1-u)/2)+h*u;for(let _=0;_<i;_++){let R=Math.floor(_*b),L=p[R+S];s[_+E*i]+=L*T}}return s};function qnt(e,t,n,i,o,r){let s,a,c=-1,d=t.length,u=d*(d+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+h,e[p+s]=i[a];for(let g=1;g<d;g++){let f=0,b=Math.floor(g*(1-g)/2)+d*g,C=!1;for(s=0;s<d-g;s++){let E=n[t[s]],T=n[t[s+g]],S,_;if(T-E<=0)a=t[s]*o*(r+1)+o*g+h,S=i[a],_=S/V.factorial(g),e[p+b+f]=_,f++;else{let R=Math.floor((g-1)*(2-g)/2)+d*(g-1);S=e[p+R+s+1]-e[p+R+s],_=S/(T-E),e[p+b+f]=_,f++}C=C||S!==0}C&&(c=Math.max(c,g))}}return c}var Uw=n9;var qdi=y(x(),1);var jj={type:"Lagrange"};jj.getRequiredDataPoints=function(e){return Math.max(e+1,2)};jj.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let d=t[r]-t[s];c*=(e-t[s])/d}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var Dw=jj;var tui=y(x(),1);var qj={type:"Linear"};qj.getRequiredDataPoints=function(e){return 2};qj.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],d=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+d*s-c*a)/(d-c);return o};var iE=qj;var oui=y(x(),1);function jc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}jc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new jc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};jc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new jc(e.clock,e.cone,e.magnitude)};jc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new jc(e.clock,e.cone,1)};jc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};jc.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};jc.prototype.equals=function(e){return jc.equals(this,e)};jc.prototype.clone=function(e){return jc.clone(this,e)};jc.prototype.equalsEpsilon=function(e,t){return jc.equalsEpsilon(this,e,t)};jc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var vw=jc;var Hw=y(Md(),1);var Eui=y(x(),1);var pui=y(x(),1);var sui=y(x(),1),$j;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?$j=function(){return performance.now()}:$j=function(){return Date.now()};var Ni=$j;function e4(e){e=e??Q.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=j.clone(t):l(n)?t=j.clone(n):l(i)?t=j.addDays(i,-1,new j):t=j.now(),l(n)?n=j.clone(n):n=j.clone(t),l(i)?i=j.clone(i):i=j.addDays(n,1,new j),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??As.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new Ce,this.onStop=new Ce,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ni(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??wo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(e4.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){j.equals(this._currentTime,e)||(this._clockStep===wo.SYSTEM_CLOCK&&(this._clockStep=wo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===wo.SYSTEM_CLOCK&&(this._clockStep=wo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===wo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=j.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===wo.SYSTEM_CLOCK&&(this._clockStep=wo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});e4.prototype.tick=function(){let e=Ni(),t=j.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===wo.SYSTEM_CLOCK)t=j.now(t);else{let i=this._multiplier;if(n===wo.TICK_DEPENDENT)t=j.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=j.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===As.CLAMPED)j.lessThan(t,r)?t=j.clone(r,t):j.greaterThan(t,s)&&(t=j.clone(s,t),this.onStop.raiseEvent(this));else if(o===As.LOOP_STOP)for(j.lessThan(t,r)&&(t=j.clone(r,t));j.greaterThan(t,s);)t=j.addSeconds(r,j.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var of=e4;function oE(){this._definitionChanged=new Ce,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(oE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:bl("startTime"),stopTime:bl("stopTime"),currentTime:bl("currentTime"),clockRange:bl("clockRange"),clockStep:bl("clockStep"),multiplier:bl("multiplier")});oE.prototype.clone=function(e){return l(e)||(e=new oE),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};oE.prototype.equals=function(e){return this===e||l(e)&&j.equals(this.startTime,e.startTime)&&j.equals(this.stopTime,e.stopTime)&&j.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};oE.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};oE.prototype.getValue=function(e){return l(e)||(e=new of),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var rf=oE;var Wui=y(x(),1);var $nt=D.WHITE,eit=.1,tit=new M(8,8),nit=new M(0,0),iit=new M(1,1);function e_(e){e=e??Q.EMPTY_OBJECT,this._definitionChanged=new Ce,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}Object.defineProperties(e_.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._cellAlpha)&&K.isConstant(this._lineCount)&&K.isConstant(this._lineThickness)&&K.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ge("color"),cellAlpha:ge("cellAlpha"),lineCount:ge("lineCount"),lineThickness:ge("lineThickness"),lineOffset:ge("lineOffset")});e_.prototype.getType=function(e){return"Grid"};var oit=new j;e_.prototype.getValue=function(e,t){return l(e)||(e=j.now(oit)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,$nt,t.color),t.cellAlpha=K.getValueOrDefault(this._cellAlpha,e,eit),t.lineCount=K.getValueOrClonedDefault(this._lineCount,e,tit,t.lineCount),t.lineThickness=K.getValueOrClonedDefault(this._lineThickness,e,iit,t.lineThickness),t.lineOffset=K.getValueOrClonedDefault(this._lineOffset,e,nit,t.lineOffset),t};e_.prototype.equals=function(e){return this===e||e instanceof e_&&K.equals(this._color,e._color)&&K.equals(this._cellAlpha,e._cellAlpha)&&K.equals(this._lineCount,e._lineCount)&&K.equals(this._lineThickness,e._lineThickness)&&K.equals(this._lineOffset,e._lineOffset)};var t_=e_;var Mui=y(x(),1);function n_(e){this._definitionChanged=new Ce,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(n_.prototype,{isConstant:{get:function(){return K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ge("color")});n_.prototype.getType=function(e){return"PolylineArrow"};var rit=new j;n_.prototype.getValue=function(e,t){return l(e)||(e=j.now(rit)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,D.WHITE,t.color),t};n_.prototype.equals=function(e){return this===e||e instanceof n_&&K.equals(this._color,e._color)};var i_=n_;var Kui=y(x(),1);var sit=D.WHITE,ait=D.TRANSPARENT,cit=16,lit=255;function o_(e){e=e??Q.EMPTY_OBJECT,this._definitionChanged=new Ce,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_.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._gapColor)&&K.isConstant(this._dashLength)&&K.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ge("color"),gapColor:ge("gapColor"),dashLength:ge("dashLength"),dashPattern:ge("dashPattern")});o_.prototype.getType=function(e){return"PolylineDash"};var dit=new j;o_.prototype.getValue=function(e,t){return l(e)||(e=j.now(dit)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,sit,t.color),t.gapColor=K.getValueOrClonedDefault(this._gapColor,e,ait,t.gapColor),t.dashLength=K.getValueOrDefault(this._dashLength,e,cit,t.dashLength),t.dashPattern=K.getValueOrDefault(this._dashPattern,e,lit,t.dashPattern),t};o_.prototype.equals=function(e){return this===e||e instanceof o_&&K.equals(this._color,e._color)&&K.equals(this._gapColor,e._gapColor)&&K.equals(this._dashLength,e._dashLength)&&K.equals(this._dashPattern,e._dashPattern)};var r_=o_;var omi=y(x(),1);var uit=D.WHITE,mit=.25,hit=1;function s_(e){e=e??Q.EMPTY_OBJECT,this._definitionChanged=new Ce,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(s_.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ge("color"),glowPower:ge("glowPower"),taperPower:ge("taperPower")});s_.prototype.getType=function(e){return"PolylineGlow"};var fit=new j;s_.prototype.getValue=function(e,t){return l(e)||(e=j.now(fit)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,uit,t.color),t.glowPower=K.getValueOrDefault(this._glowPower,e,mit,t.glowPower),t.taperPower=K.getValueOrDefault(this._taperPower,e,hit,t.taperPower),t};s_.prototype.equals=function(e){return this===e||e instanceof s_&&K.equals(this._color,e._color)&&K.equals(this._glowPower,e._glowPower)&&K.equals(this._taperPower,e._taperPower)};var a_=s_;var hmi=y(x(),1);var pit=D.WHITE,Ait=D.BLACK,git=1;function c_(e){e=e??Q.EMPTY_OBJECT,this._definitionChanged=new Ce,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}Object.defineProperties(c_.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._outlineColor)&&K.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ge("color"),outlineColor:ge("outlineColor"),outlineWidth:ge("outlineWidth")});c_.prototype.getType=function(e){return"PolylineOutline"};var bit=new j;c_.prototype.getValue=function(e,t){return l(e)||(e=j.now(bit)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,pit,t.color),t.outlineColor=K.getValueOrClonedDefault(this._outlineColor,e,Ait,t.outlineColor),t.outlineWidth=K.getValueOrDefault(this._outlineWidth,e,git),t};c_.prototype.equals=function(e){return this===e||e instanceof c_&&K.equals(this._color,e._color)&&K.equals(this._outlineColor,e._outlineColor)&&K.equals(this._outlineWidth,e._outlineWidth)};var ey=c_;var Cmi=y(x(),1);function Xg(e,t){this._value=void 0,this._definitionChanged=new Ce,this._eventHelper=new Xr,this._referenceFrame=t??eo.FIXED,this.setValue(e)}Object.defineProperties(Xg.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!K.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var yit=new j;Xg.prototype.getValue=function(e,t){return l(e)||(e=j.now(yit)),this.getValueInReferenceFrame(e,eo.FIXED,t)};Xg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};Xg.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Xg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Xg.prototype.equals=function(e){return this===e||e instanceof Xg&&this._referenceFrame===e._referenceFrame&&K.arrayEquals(this._value,e._value)};Xg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Pg=Xg;var Rmi=y(x(),1);function ty(e){this._value=void 0,this._definitionChanged=new Ce,this._eventHelper=new Xr,this.setValue(e)}Object.defineProperties(ty.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!K.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var xit=new j;ty.prototype.getValue=function(e,t){l(e)||(e=j.now(xit));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};ty.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,ty.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};ty.prototype.equals=function(e){return this===e||e instanceof ty&&K.arrayEquals(this._value,e._value)};ty.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var l_=ty;var Bmi=y(x(),1);function rE(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(pu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function pu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new Ce,e.collectionChanged.addEventListener(pu.prototype._onCollectionChanged,this)}Object.defineProperties(pu.prototype,{isConstant:{get:function(){return K.isConstant(rE(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=rE(this);return l(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 rE(this)}}});pu.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new pu(e,n,i)};var Cit=new j;pu.prototype.getValue=function(e,t){let n=rE(this);return l(e)||(e=j.now(Cit)),l(n)?n.getValue(e,t):void 0};pu.prototype.getValueInReferenceFrame=function(e,t,n){let i=rE(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};pu.prototype.getType=function(e){let t=rE(this);return l(t)?t.getType(e):void 0};pu.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};pu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};pu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(pu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=rE(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Mg=pu;var Xmi=y(x(),1);var Eit={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-V.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+V.TWO_PI:o}},Wm=Eit;var nhi=y(x(),1);var Omi=y(x(),1);var Dpe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function vpe(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function kpe(e,t){return e instanceof j?e:typeof e=="string"?j.fromIso8601(e):j.addSeconds(t,e,new j)}var t4=[],n4=[];function i9(e,t,n,i,o){let r=0,s,a,c,d,u,h;for(;r<i.length;){u=kpe(i[r],e),c=bo(t,u,j.compare);let p=0,g=0;if(c<0){for(c=~c,d=c*o,a=void 0,h=t[c];r<i.length&&(u=kpe(i[r],e),!(l(a)&&j.compare(a,u)>=0||l(h)&&j.compare(u,h)>=0));){for(t4[p++]=u,r=r+1,s=0;s<o;s++)n4[g++]=i[r],r=r+1;a=u}p>0&&(n4.length=g,vpe(n,d,n4),t4.length=p,vpe(t,c,t4))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function Fm(e,t){let n=e;n===Number&&(n=Dpe);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let d=t[c];d===Number&&(d=Dpe);let u=d.packedLength;i+=u,o+=d.packedInterpolationLength??u,s[c]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=iE,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new Ce,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=fu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=fu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Fm.prototype,{isConstant:{get:function(){return this._values.length===0}},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))}}});var Tit=new j;Fm.prototype.getValue=function(e,t){l(e)||(e=j.now(Tit));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=bo(n,e,j.compare);if(a<0){if(a=~a,a===0){let _=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===fu.NONE||o!==0&&j.secondsDifference(_,e)>o)return;if(this._backwardExtrapolationType===fu.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let _=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===fu.NONE||o!==0&&j.secondsDifference(e,_)>o)return;if(this._forwardExtrapolationType===fu.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,d=this._yTable,u=this._interpolationAlgorithm,h=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let _=Math.min(u.getRequiredDataPoints(this._interpolationDegree,p),i);_!==this._numberOfPoints&&(this._numberOfPoints=_,c.length=_,d.length=_*h)}let g=this._numberOfPoints-1;if(g<1)return;let f=0,b=i-1;if(b-f+1>=g+1){let _=a-(g/2|0)-1;_<f&&(_=f);let R=_+g;R>b&&(R=b,_=R-g,_<f&&(_=f)),f=_,b=R}let E=b-f+1;for(let _=0;_<E;++_)c[_]=j.secondsDifference(n[f+_],n[b]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,f,b,d);else{let _=0,R=this._packedLength,L=f*R,W=(b+1)*R;for(;L<W;)d[_]=s[L],L++,_++}let T=j.secondsDifference(e,n[b]),S;if(p===0||!l(u.interpolate))S=u.interpolateOrderZero(T,c,d,h,this._interpolationResult);else{let _=Math.floor(h/(p+1));S=u.interpolate(T,c,d,_,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(S,s,f,b,t):r.unpack(S,0,t)}return r.unpack(s,a*this._packedLength,t)};Fm.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Fm.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}i9(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Fm.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let d=n[c],u=i.length;for(let h=0;h<u;h++)i[h].pack(d[h],a,a.length)}i9(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Fm.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Fm.prototype.addSamplesPackedArray=function(e,t){i9(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Fm.prototype.removeSample=function(e){let t=bo(this._times,e,j.compare);return t<0?!1:(Qpe(this,t,1),!0)};function Qpe(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Fm.prototype.removeSamples=function(e){let t=this._times,n=bo(t,e.start,j.compare);n<0?n=~n:e.isStartIncluded||++n;let i=bo(t,e.stop,j.compare);i<0?i=~i:e.isStopIncluded&&++i,Qpe(this,n,i-n)};Fm.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!j.equals(a[r],c[r]))return!1;let d=this._values,u=e._values;for(s=d.length,r=0;r<s;r++)if(d[r]!==u[r])return!1;return!0};Fm._mergeNewSamples=i9;var Au=Fm;function Bm(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=m}this._numberOfDerivatives=t,this._property=new Au(m,n),this._definitionChanged=new Ce,this._referenceFrame=e??eo.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Bm.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}}});var Sit=new j;Bm.prototype.getValue=function(e,t){return l(e)||(e=j.now(Sit)),this.getValueInReferenceFrame(e,eo.FIXED,t)};Bm.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return yh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Bm.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Bm.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Bm.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Bm.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Bm.prototype.removeSample=function(e){return this._property.removeSample(e)};Bm.prototype.removeSamples=function(e){this._property.removeSamples(e)};Bm.prototype.equals=function(e){return this===e||e instanceof Bm&&K.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var ec=Bm;var fhi=y(x(),1);var ohi=y(x(),1),Iit={HORIZONTAL:0,VERTICAL:1},sf=Object.freeze(Iit);var _it=sf.HORIZONTAL,Zit=D.WHITE,Rit=D.BLACK,Git=0,Vit=1;function d_(e){e=e??Q.EMPTY_OBJECT,this._definitionChanged=new Ce,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}Object.defineProperties(d_.prototype,{isConstant:{get:function(){return K.isConstant(this._orientation)&&K.isConstant(this._evenColor)&&K.isConstant(this._oddColor)&&K.isConstant(this._offset)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:ge("orientation"),evenColor:ge("evenColor"),oddColor:ge("oddColor"),offset:ge("offset"),repeat:ge("repeat")});d_.prototype.getType=function(e){return"Stripe"};var Lit=new j;d_.prototype.getValue=function(e,t){return l(e)||(e=j.now(Lit)),l(t)||(t={}),t.horizontal=K.getValueOrDefault(this._orientation,e,_it)===sf.HORIZONTAL,t.evenColor=K.getValueOrClonedDefault(this._evenColor,e,Zit,t.evenColor),t.oddColor=K.getValueOrClonedDefault(this._oddColor,e,Rit,t.oddColor),t.offset=K.getValueOrDefault(this._offset,e,Git),t.repeat=K.getValueOrDefault(this._repeat,e,Vit),t};d_.prototype.equals=function(e){return this===e||e instanceof d_&&K.equals(this._orientation,e._orientation)&&K.equals(this._evenColor,e._evenColor)&&K.equals(this._oddColor,e._oddColor)&&K.equals(this._offset,e._offset)&&K.equals(this._repeat,e._repeat)};var u_=d_;var Thi=y(x(),1);function ny(e){this._definitionChanged=new Ce,this._intervals=new fs,this._intervals.changedEvent.addEventListener(ny.prototype._intervalsChanged,this),this._referenceFrame=e??eo.FIXED}Object.defineProperties(ny.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}}});var Wit=new j;ny.prototype.getValue=function(e,t){return l(e)||(e=j.now(Wit)),this.getValueInReferenceFrame(e,eo.FIXED,t)};ny.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return yh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};ny.prototype.equals=function(e){return this===e||e instanceof ny&&this._intervals.equals(e._intervals,K.equals)&&this._referenceFrame===e._referenceFrame};ny.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Ug=ny;var Vhi=y(x(),1);function sE(){this._definitionChanged=new Ce,this._intervals=new fs,this._intervals.changedEvent.addEventListener(sE.prototype._intervalsChanged,this)}Object.defineProperties(sE.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Fit=new j;sE.prototype.getValue=function(e,t){l(e)||(e=j.now(Fit));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};sE.prototype.equals=function(e){return this===e||e instanceof sE&&this._intervals.equals(e._intervals,K.equals)};sE.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Dg=sE;var Khi=y(x(),1);var Nhi=y(x(),1);function m_(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new Ce,this._normalize=t??!0,this.position=e}Object.defineProperties(m_.prototype,{isConstant:{get:function(){return K.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(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 Bit=new m,Ope=new m,zpe=new j,wit=new j,i4=1/60;m_.prototype.getValue=function(e,t){return this._getValue(e,t)};m_.prototype._getValue=function(e,t,n){l(e)||(e=j.now(wit)),l(t)||(t=new m);let i=this._position;if(K.isConstant(i))return this._normalize?void 0:m.clone(m.ZERO,t);let o=i.getValue(e,Bit),r=i.getValue(j.addSeconds(e,i4,zpe),Ope);if(!l(o)||!l(r)&&(r=o,o=i.getValue(j.addSeconds(e,-i4,zpe),Ope),!l(o)))return;if(m.equals(o,r))return this._normalize?void 0:m.clone(m.ZERO,t);l(n)&&o.clone(n);let s=m.subtract(r,o,t);return this._normalize?m.normalize(s,t):m.divideByScalar(s,i4,t)};m_.prototype.equals=function(e){return this===e||e instanceof m_&&K.equals(this._position,e._position)};var vg=m_;function kw(e,t){this._velocityVectorProperty=new vg(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new Ce,this.ellipsoid=t??ie.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(kw.prototype,{isConstant:{get:function(){return 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 Hpe=new m,Yit=new m,Kpe=new $,Nit=new j;kw.prototype.getValue=function(e,t){l(e)||(e=j.now(Nit));let n=this._velocityVectorProperty._getValue(e,Yit,Hpe);if(l(n))return Tt.rotationMatrixFromPositionVelocity(Hpe,n,this._ellipsoid,Kpe),Me.fromRotationMatrix(Kpe,t)};kw.prototype.equals=function(e){return this===e||e instanceof kw&&K.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var Qw=kw;var qhi=y(x(),1);var kg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};kg.validate=function(e){return e===kg.COMPLETE||e===kg.BELOW_ELLIPSOID_HORIZON||e===kg.ABOVE_ELLIPSOID_HORIZON};kg.toString=function(e){switch(e){case kg.COMPLETE:return"COMPLETE";case kg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case kg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new Ae("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var h_=kg;function iy(){}iy.packedLength=m.packedLength;iy.unpack=m.unpack;iy.pack=m.pack;var o4;function Ow(e,t){return t[0]==="#"&&(t=o4+t),Mg.fromString(e,t)}function Jpe(e,t,n){if(l(n.reference))return Ow(t,n.reference);if(l(n.velocityReference)){let i=Ow(t,n.velocityReference);switch(e){case m:case iy:return new vg(i,e===iy);case Me:return new Qw(i)}}throw new he(`${JSON.stringify(n)} is not valid CZML.`)}function Xit(e,t){return new Th(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var ro=new m,Xl=new vw,qc=new pe,aE=new Wn,o9=new Me;function Pit(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===D.packedLength)return[D.byteToFloat(n[0]),D.byteToFloat(n[1]),D.byteToFloat(n[2]),D.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=D.byteToFloat(n[o+1]),t[o+2]=D.byteToFloat(n[o+2]),t[o+3]=D.byteToFloat(n[o+3]),t[o+4]=D.byteToFloat(n[o+4]);return t}function jpe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):Ge.createIfNeeded(n)}function Mit(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===de.packedLength)return[V.toRadians(n[0]),V.toRadians(n[1]),V.toRadians(n[2]),V.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=V.toRadians(n[o+1]),t[o+2]=V.toRadians(n[o+2]),t[o+3]=V.toRadians(n[o+3]),t[o+4]=V.toRadians(n[o+4]);return t}function Uit(e){let t=e.length;if(Xl.magnitude=1,t===2)return Xl.clock=e[0],Xl.cone=e[1],m.fromSpherical(Xl,ro),[ro.x,ro.y,ro.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],Xl.clock=e[i+1],Xl.cone=e[i+2],m.fromSpherical(Xl,ro),n[o+1]=ro.x,n[o+2]=ro.y,n[o+3]=ro.z;return n}function Dit(e){let t=e.length;if(t===3)return Xl.clock=e[0],Xl.cone=e[1],Xl.magnitude=e[2],m.fromSpherical(Xl,ro),[ro.x,ro.y,ro.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Xl.clock=e[i+1],Xl.cone=e[i+2],Xl.magnitude=e[i+3],m.fromSpherical(Xl,ro),n[i+1]=ro.x,n[i+2]=ro.y,n[i+3]=ro.z;return n}function vit(e){let t=e.length;if(t===3)return qc.longitude=e[0],qc.latitude=e[1],qc.height=e[2],ie.default.cartographicToCartesian(qc,ro),[ro.x,ro.y,ro.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],qc.longitude=e[i+1],qc.latitude=e[i+2],qc.height=e[i+3],ie.default.cartographicToCartesian(qc,ro),n[i+1]=ro.x,n[i+2]=ro.y,n[i+3]=ro.z;return n}function kit(e){let t=e.length;if(t===3)return qc.longitude=V.toRadians(e[0]),qc.latitude=V.toRadians(e[1]),qc.height=e[2],ie.default.cartographicToCartesian(qc,ro),[ro.x,ro.y,ro.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],qc.longitude=V.toRadians(e[i+1]),qc.latitude=V.toRadians(e[i+2]),qc.height=e[i+3],ie.default.cartographicToCartesian(qc,ro),n[i+1]=ro.x,n[i+2]=ro.y,n[i+3]=ro.z;return n}function r4(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return Uit(o);let r=e.spherical;if(l(r))return Dit(r);let s=e.cartographicRadians;if(l(s))return vit(s);let a=e.cartographicDegrees;if(l(a))return kit(a);throw new he(`${JSON.stringify(e)} is not a valid CZML interval.`)}function qpe(e,t){m.unpack(e,t,ro),m.normalize(ro,ro),m.pack(ro,e,t)}function Qit(e){let t=r4(e);if(t.length===3)return qpe(t,0),t;for(let n=1;n<t.length;n+=4)qpe(t,n);return t}function $pe(e,t){Me.unpack(e,t,o9),Me.normalize(o9,o9),Me.pack(o9,e,t)}function Oit(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return $pe(t,0),t;for(let n=1;n<t.length;n+=5)$pe(t,n)}return t}function eAe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?$e:e.hasOwnProperty("cartesian2")?M:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?m:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?iy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?D:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?qn:e.hasOwnProperty("colorBlendMode")?Dc:e.hasOwnProperty("cornerType")?Hi:e.hasOwnProperty("heightReference")?tt:e.hasOwnProperty("horizontalOrigin")?Bi:e.hasOwnProperty("date")?j:e.hasOwnProperty("labelStyle")?cr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?kt:e.hasOwnProperty("distanceDisplayCondition")?Mt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Me:e.hasOwnProperty("shadowMode")?Rn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?sf:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?de:e.hasOwnProperty("uri")?Hw.default:e.hasOwnProperty("verticalOrigin")?vn:Object}function zit(e,t,n){switch(e){case ln:return ln[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case $e:return t.boundingRectangle;case M:return t.cartesian2;case m:return r4(t);case iy:return Qit(t);case D:return Pit(t);case qn:return qn[t.classificationType??t];case Dc:return Dc[t.colorBlendMode??t];case Hi:return Hi[t.cornerType??t];case tt:return tt[t.heightReference??t];case Bi:return Bi[t.horizontalOrigin??t];case Image:return jpe(t,n);case j:return j.fromIso8601(t.date??t);case cr:return cr[t.labelStyle??t];case Number:return t.number??t;case kt:return t.nearFarScalar;case Mt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Me:return Oit(t);case Wm:return t.number??t;case h_:return h_[t.portionToDisplay??t];case Rn:return Rn[t.shadowMode??t.shadows??t];case String:return t.string??t;case sf:return sf[t.stripeOrientation??t];case de:return Mit(t);case Hw.default:return jpe(t,n);case vn:return vn[t.verticalOrigin??t];default:throw new he(`Unknown CzmlDataSource interval type: ${e}`)}}var Hit={HERMITE:Uw,LAGRANGE:Dw,LINEAR:iE};function r9(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:Hit[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=fu[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=fu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var tAe={iso8601:void 0};function Pr(e){if(l(e))return tAe.iso8601=e,Wn.fromIso8601(tAe)}function s4(e){let t=Ke.MAXIMUM_INTERVAL.clone();return t.data=e,t}function nAe(e){let t=new Kc;return t.intervals.addInterval(s4(e)),t}function iAe(e){let t=new qa(e.referenceFrame);return t.intervals.addInterval(s4(e)),t}function s9(e,t,n,i,o,r,s){let a=Pr(i.interval);l(o)&&(l(a)?a=Wn.intersect(a,o,aE):a=o);let c,d,u,h=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Ke.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return fAe(t[n],a)}let g=!1;if(h){if(d=zit(e,i,r),!l(d))return;c=e.packedLength??1,u=d.length??1,g=!l(i.array)&&typeof d!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==Wm;if(!g&&!p){h?t[n]=new mi(f?e.unpack(d,0):d):t[n]=Jpe(e,s,i);return}let b=t[n],C,E=i.epoch;if(l(E)&&(C=j.fromIso8601(E)),g&&!p){b instanceof Au||(t[n]=b=new Au(e)),b.addSamplesPackedArray(d,C),r9(i,b);return}let T;if(!g&&p){a=a.clone(),h?a.data=f?e.unpack(d,0):d:a.data=Jpe(e,s,i),l(b)||(t[n]=b=h?new Dg:new Kc),h&&b instanceof Dg?b.intervals.addInterval(a):b instanceof Kc?(h&&(a.data=new mi(a.data)),b.intervals.addInterval(a)):(t[n]=b=nAe(b),h&&(a.data=new mi(a.data)),b.intervals.addInterval(a));return}l(b)||(t[n]=b=new Kc),b instanceof Kc||(t[n]=b=nAe(b));let S=b.intervals;T=S.findInterval(a),(!l(T)||!(T.data instanceof Au))&&(T=a.clone(),T.data=new Au(e),S.addInterval(T)),T.data.addSamplesPackedArray(d,C),r9(i,T.data)}function fAe(e,t){if(e instanceof Au){e.removeSamples(t);return}else if(e instanceof Dg){e.intervals.removeInterval(t);return}else if(e instanceof Kc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Wn.intersect(n.get(i),t,aE);o.isEmpty||fAe(o.data,t)}n.removeInterval(t);return}}function Te(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)s9(e,t,n,i[a],o,r,s);else s9(e,t,n,i,o,r,s)}function oAe(e,t,n,i,o,r){let s=Pr(n.interval);l(i)&&(l(s)?s=Wn.intersect(s,i,aE):s=i);let a=l(n.cartesianVelocity)?1:0,c=m.packedLength*(a+1),d,u,h=!l(n.reference),p=l(s)&&!s.equals(Ke.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return pAe(e[t],s)}let g,f=!1;if(h&&(l(n.referenceFrame)&&(g=eo[n.referenceFrame]),g=g??eo.FIXED,d=r4(n),u=d.length??1,f=u>c),!f&&!p){h?e[t]=new gl(m.unpack(d),g):e[t]=Ow(r,n.reference);return}let b=e[t],C,E=n.epoch;if(l(E)&&(C=j.fromIso8601(E)),f&&!p){(!(b instanceof ec)||l(g)&&b.referenceFrame!==g)&&(e[t]=b=new ec(g,a)),b.addSamplesPackedArray(d,C),r9(n,b);return}let T;if(!f&&p){s=s.clone(),h?s.data=m.unpack(d):s.data=Ow(r,n.reference),l(b)||(h?b=new Ug(g):b=new qa(g),e[t]=b),h&&b instanceof Ug&&l(g)&&b.referenceFrame===g?b.intervals.addInterval(s):b instanceof qa?(h&&(s.data=new gl(s.data,g)),b.intervals.addInterval(s)):(e[t]=b=iAe(b),h&&(s.data=new gl(s.data,g)),b.intervals.addInterval(s));return}l(b)?b instanceof qa||(e[t]=b=iAe(b)):e[t]=b=new qa(g);let S=b.intervals;T=S.findInterval(s),(!l(T)||!(T.data instanceof ec)||l(g)&&T.data.referenceFrame!==g)&&(T=s.clone(),T.data=new ec(g,a),S.addInterval(T)),T.data.addSamplesPackedArray(d,C),r9(n,T.data)}function pAe(e,t){if(e instanceof ec){e.removeSamples(t);return}else if(e instanceof Ug){e.intervals.removeInterval(t);return}else if(e instanceof qa){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Wn.intersect(n.get(i),t,aE);o.isEmpty||pAe(o.data,t)}n.removeInterval(t);return}}function AAe(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)oAe(e,t,n[s],i,o,r);else oAe(e,t,n,i,o,r)}function rAe(e,t,n,i){l(n.references)?a9(e,t,n.references,n.interval,i,l_,Kc):(l(n.cartesian2)?n.array=M.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=M.unpackArray(n.cartesian)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function sAe(e,t,n,i,o,r){let s=Pr(n.interval);l(i)&&(l(s)?s=Wn.intersect(s,i,aE):s=i);let a=e[t],c,d;if(l(s)){a instanceof QI||(a=new QI,e[t]=a);let h=a.intervals;d=h.findInterval({start:s.start,stop:s.stop}),l(d)?c=d.data:(d=s.clone(),h.addInterval(d))}else c=a;let u;l(n.solidColor)?(c instanceof Kt||(c=new Kt),u=n.solidColor,Te(D,c,"color",u.color,void 0,void 0,r)):l(n.grid)?(c instanceof t_||(c=new t_),u=n.grid,Te(D,c,"color",u.color,void 0,o,r),Te(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),Te(M,c,"lineCount",u.lineCount,void 0,o,r),Te(M,c,"lineThickness",u.lineThickness,void 0,o,r),Te(M,c,"lineOffset",u.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Hb||(c=new Hb),u=n.image,Te(Image,c,"image",u.image,void 0,o,r),Te(M,c,"repeat",u.repeat,void 0,o,r),Te(D,c,"color",u.color,void 0,o,r),Te(Boolean,c,"transparent",u.transparent,void 0,o,r)):l(n.stripe)?(c instanceof u_||(c=new u_),u=n.stripe,Te(sf,c,"orientation",u.orientation,void 0,o,r),Te(D,c,"evenColor",u.evenColor,void 0,o,r),Te(D,c,"oddColor",u.oddColor,void 0,o,r),Te(Number,c,"offset",u.offset,void 0,o,r),Te(Number,c,"repeat",u.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof ey||(c=new ey),u=n.polylineOutline,Te(D,c,"color",u.color,void 0,o,r),Te(D,c,"outlineColor",u.outlineColor,void 0,o,r),Te(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof a_||(c=new a_),u=n.polylineGlow,Te(D,c,"color",u.color,void 0,o,r),Te(Number,c,"glowPower",u.glowPower,void 0,o,r),Te(Number,c,"taperPower",u.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof i_||(c=new i_),u=n.polylineArrow,Te(D,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof r_||(c=new r_),u=n.polylineDash,Te(D,c,"color",u.color,void 0,void 0,r),Te(D,c,"gapColor",u.gapColor,void 0,void 0,r),Te(Number,c,"dashLength",u.dashLength,void 0,o,r),Te(Number,c,"dashPattern",u.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof vI||(c=new vI),u=n.checkerboard,Te(D,c,"evenColor",u.evenColor,void 0,o,r),Te(D,c,"oddColor",u.oddColor,void 0,o,r),Te(M,c,"repeat",u.repeat,void 0,o,r)),l(d)?d.data=c:e[t]=c}function gu(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)sAe(e,t,n[s],i,o,r);else sAe(e,t,n,i,o,r)}function Kit(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function Jit(e,t,n,i){let o=t.description;l(o)&&Te(String,e,"description",o,void 0,i,n)}function jit(e,t,n,i){let o=t.position;l(o)&&AAe(e,"position",o,void 0,i,n)}function qit(e,t,n,i){let o=t.viewFrom;l(o)&&Te(m,e,"viewFrom",o,void 0,i,n)}function $it(e,t,n,i){let o=t.orientation;l(o)&&Te(Me,e,"orientation",o,void 0,i,n)}function eot(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new yl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)s9(eAe(s[a]),e.properties,r,s[a],void 0,i,n);else s9(eAe(s),e.properties,r,s,void 0,i,n)}}}function a9(e,t,n,i,o,r,s){let a=n.map(function(c){return Ow(o,c)});if(l(i)){i=Pr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(s4(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function aAe(e,t,n,i){let o=n.references;l(o)?a9(e,t,o,n.interval,i,l_,Kc):Te(Array,e,t,n,void 0,void 0,i)}function cAe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)aAe(e,t,n[o],i);else aAe(e,t,n,i)}function lAe(e,t,n,i){let o=n.references;l(o)?a9(e,t,o,n.interval,i,Pg,qa):(l(n.cartesian)?n.array=m.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=m.fromRadiansArrayHeights(n.cartographicRadians,ie.default):l(n.cartographicDegrees)&&(n.array=m.fromDegreesArrayHeights(n.cartographicDegrees,ie.default)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function Kw(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)lAe(e,t,n[o],i);else lAe(e,t,n,i)}function tot(e){return m.unpackArray(e)}function not(e){return m.fromRadiansArrayHeights(e,ie.default)}function iot(e){return m.fromDegreesArrayHeights(e,ie.default)}function dAe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return a9(a,"positions",s,n.interval,i,Pg,qa),a.positions});e[t]=new Pg(r)}else l(n.cartesian)?n.array=n.cartesian.map(tot):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(not):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(iot)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i)}function oot(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)dAe(e,t,n[o],i);else dAe(e,t,n,i)}function rot(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)rAe(e,t,n[o],i);else rAe(e,t,n,i)}function sot(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new fs),r.addInterval(Pr(o[s]));else r=new fs,r.addInterval(Pr(o));e.availability=r}function aot(e,t,n,i,o){l(t)&&Te(iy,e,"alignedAxis",t,n,i,o)}function cot(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=Pr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new wc),Te(Boolean,s,"show",o.show,r,i,n),Te(Image,s,"image",o.image,r,i,n),Te(Number,s,"scale",o.scale,r,i,n),Te(M,s,"pixelOffset",o.pixelOffset,r,i,n),Te(m,s,"eyeOffset",o.eyeOffset,r,i,n),Te(Bi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Te(vn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(D,s,"color",o.color,r,i,n),Te(Wm,s,"rotation",o.rotation,r,i,n),aot(s,o.alignedAxis,r,i,n),Te(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Te(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Te($e,s,"imageSubRegion",o.imageSubRegion,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function lot(e,t,n,i){let o=t.box;if(!l(o))return;let r=Pr(o.interval),s=e.box;l(s)||(e.box=s=new Yx),Te(Boolean,s,"show",o.show,r,i,n),Te(m,s,"dimensions",o.dimensions,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),gu(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function dot(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=Pr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new Xx),Te(Boolean,s,"show",o.show,r,i,n),Kw(s,"positions",o.positions,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(tt,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Hi,s,"cornerType",o.cornerType,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),gu(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(qn,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function uot(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=Pr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new Px),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"length",o.length,r,i,n),Te(Number,s,"topRadius",o.topRadius,r,i,n),Te(Number,s,"bottomRadius",o.bottomRadius,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),gu(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Te(Number,s,"slices",o.slices,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function mot(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new he("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new he("CZML version information invalid.  It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function hot(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=Pr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Mx),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),Te(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(tt,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Wm,s,"rotation",o.rotation,r,i,n),Te(Wm,s,"stRotation",o.stRotation,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),gu(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(qn,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function fot(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=Pr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Ux),Te(Boolean,s,"show",o.show,r,i,n),Te(m,s,"radii",o.radii,r,i,n),Te(m,s,"innerRadii",o.innerRadii,r,i,n),Te(Number,s,"minimumClock",o.minimumClock,r,i,n),Te(Number,s,"maximumClock",o.maximumClock,r,i,n),Te(Number,s,"minimumCone",o.minimumCone,r,i,n),Te(Number,s,"maximumCone",o.maximumCone,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),gu(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"stackPartitions",o.stackPartitions,r,i,n),Te(Number,s,"slicePartitions",o.slicePartitions,r,i,n),Te(Number,s,"subdivisions",o.subdivisions,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function pot(e,t,n,i){let o=t.label;if(!l(o))return;let r=Pr(o.interval),s=e.label;l(s)||(e.label=s=new xh),Te(Boolean,s,"show",o.show,r,i,n),Te(String,s,"text",o.text,r,i,n),Te(String,s,"font",o.font,r,i,n),Te(cr,s,"style",o.style,r,i,n),Te(Number,s,"scale",o.scale,r,i,n),Te(Boolean,s,"showBackground",o.showBackground,r,i,n),Te(D,s,"backgroundColor",o.backgroundColor,r,i,n),Te(M,s,"backgroundPadding",o.backgroundPadding,r,i,n),Te(M,s,"pixelOffset",o.pixelOffset,r,i,n),Te(m,s,"eyeOffset",o.eyeOffset,r,i,n),Te(Bi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Te(vn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(D,s,"fillColor",o.fillColor,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Te(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Aot(e,t,n,i){let o=t.model;if(!l(o))return;let r=Pr(o.interval),s=e.model;l(s)||(e.model=s=new FA),Te(Boolean,s,"show",o.show,r,i,n),Te(Hw.default,s,"uri",o.gltf,r,i,n),Te(Number,s,"scale",o.scale,r,i,n),Te(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),Te(Number,s,"maximumScale",o.maximumScale,r,i,n),Te(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Te(Boolean,s,"runAnimations",o.runAnimations,r,i,n),Te(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(D,s,"silhouetteColor",o.silhouetteColor,r,i,n),Te(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),Te(D,s,"color",o.color,r,i,n),Te(Dc,s,"colorBlendMode",o.colorBlendMode,r,i,n),Te(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,d=o.nodeTransformations;if(l(d))if(Array.isArray(d))for(a=0,c=d.length;a<c;++a)uAe(s,d[a],r,i,n);else uAe(s,d,r,i,n);let u=o.articulations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)mAe(s,u[a],r,i,n);else mAe(s,u,r,i,n)}function uAe(e,t,n,i,o){let r=Pr(t.interval);l(n)&&(l(r)?r=Wn.intersect(r,n,aE):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let h=t[u];if(!l(h))continue;l(s)||(e.nodeTransformations=s=new yl),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new Dx),Te(m,p,"translation",h.translation,r,i,o),Te(Me,p,"rotation",h.rotation,r,i,o),Te(m,p,"scale",h.scale,r,i,o)}}function mAe(e,t,n,i,o){let r=Pr(t.interval);l(n)&&(l(r)?r=Wn.intersect(r,n,aE):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let h=t[u];l(h)&&(l(s)||(e.articulations=s=new yl),s.hasProperty(u)||s.addProperty(u),Te(Number,s,u,h,r,i,o))}}function got(e,t,n,i){let o=t.path;if(!l(o))return;let r=Pr(o.interval),s=e.path;l(s)||(e.path=s=new BA),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"leadTime",o.leadTime,r,i,n),Te(Number,s,"trailTime",o.trailTime,r,i,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"resolution",o.resolution,r,i,n),gu(s,"material",o.material,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function bot(e,t,n,i){let o=t.point;if(!l(o))return;let r=Pr(o.interval),s=e.point;l(s)||(e.point=s=new kx),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"pixelSize",o.pixelSize,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(D,s,"color",o.color,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Te(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function zw(e){this.polygon=e,this._definitionChanged=new Ce}Object.defineProperties(zw.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});zw.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new gc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new gc(n,i)};zw.prototype.equals=function(e){return this===e||e instanceof zw&&K.equals(this.polygon._positions,e.polygon._positions)&&K.equals(this.polygon._holes,e.polygon._holes)};function yot(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=Pr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Ch),Te(Boolean,s,"show",o.show,r,i,n),Kw(s,"_positions",o.positions,n),oot(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new zw(s)),Te(Number,s,"height",o.height,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(tt,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Wm,s,"stRotation",o.stRotation,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),gu(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),Te(Boolean,s,"closeTop",o.closeTop,r,i,n),Te(Boolean,s,"closeBottom",o.closeBottom,r,i,n),Te(ln,s,"arcType",o.arcType,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(qn,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function xot(e){return e?ln.GEODESIC:ln.NONE}function Cot(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=Pr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Nc),Te(Boolean,s,"show",o.show,r,i,n),Kw(s,"positions",o.positions,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),gu(s,"material",o.material,r,i,n),gu(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),Te(ln,s,"arcType",o.arcType,r,i,n),Te(Boolean,s,"clampToGround",o.clampToGround,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(qn,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};Te(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=Xit(a.followSurface,xot)}}function Eot(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=Pr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Qx),Kw(s,"positions",o.positions,n),rot(s,"shape",o.shape,n),Te(Boolean,s,"show",o.show,r,i,n),Te(Hi,s,"cornerType",o.cornerType,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),gu(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Tot(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=Pr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Eh),Te(Boolean,s,"show",o.show,r,i,n),Te(de,s,"coordinates",o.coordinates,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(tt,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(tt,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Wm,s,"rotation",o.rotation,r,i,n),Te(Wm,s,"stRotation",o.stRotation,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),gu(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(qn,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function Sot(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=Pr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new vx),Te(Boolean,s,"show",o.show,r,i,n),Te(Hw.default,s,"uri",o.uri,r,i,n),Te(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function Iot(e,t,n,i){let o=t.wall;if(!l(o))return;let r=Pr(o.interval),s=e.wall;l(s)||(e.wall=s=new wA),Te(Boolean,s,"show",o.show,r,i,n),Kw(s,"positions",o.positions,n),cAe(s,"minimumHeights",o.minimumHeights,n),cAe(s,"maximumHeights",o.maximumHeights,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),gu(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(D,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Rn,s,"shadows",o.shadows,r,i,n),Te(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function hAe(e,t,n,i,o){let r=e.id;if(l(r)||(r=Kn()),o4=r,!l(o._version)&&r!=="document")throw new he("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")mot(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}o4=void 0}function _ot(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ke.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=j.secondsDifference(s,r),c=Math.round(a/120);return t=new rf,t.startTime=j.clone(r),t.stopTime=j.clone(s),t.clockRange=As.LOOP_STOP,t.multiplier=c,t.currentTime=j.clone(r),t.clockStep=wo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new rf,t.startTime=Ke.MINIMUM_VALUE.clone(),t.stopTime=Ke.MAXIMUM_VALUE.clone(),t.currentTime=Ke.MINIMUM_VALUE.clone(),t.clockRange=As.LOOP_STOP,t.clockStep=wo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Pr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=j.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=As[n.range]??As.LOOP_STOP),l(n.step)&&(t.clockStep=wo[n.step]??wo.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function gAe(e,t,n,i){n=n??Q.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new bt(s)),e._credit=s,typeof t=="string"||t instanceof Ge){t=Ge.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return r=Ge.createIfNeeded(r),ps.setLoading(e,!0),Promise.resolve(o).then(function(a){return Zot(e,a,r,i)}).catch(function(a){return ps.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function Zot(e,t,n,i){ps.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new bAe,o.removeAll()),Qs._processCzml(t,o,n,void 0,e);let r=_ot(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=Ng(n.getUrlComponent()),r=!0),ps.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function bAe(){this.name=void 0,this.clock=void 0}function Qs(e){this._name=e,this._changed=new Ce,this._error=new Ce,this._isLoading=!1,this._loading=new Ce,this._clock=void 0,this._documentPacket=new bAe,this._version=void 0,this._entityCollection=new Ga(this),this._entityCluster=new mu,this._credit=void 0,this._resourceCredits=[]}Qs.load=function(e,t){return new Qs().load(e,t)};Object.defineProperties(Qs.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Qs.updaters=[cot,lot,dot,uot,hot,fot,pot,Aot,Kit,Jit,got,bot,yot,Cot,Eot,eot,Tot,jit,Sot,qit,Iot,$it,sot];Qs.registerUpdater=function(e){Qs.updaters.includes(e)||Qs.updaters.push(e)};Qs.unregisterUpdater=function(e){if(Qs.updaters.includes(e)){let t=Qs.updaters.indexOf(e);Qs.updaters.splice(t,1)}};Qs.prototype.process=function(e,t){return gAe(this,e,t,!1)};Qs.prototype.load=function(e,t){return gAe(this,e,t,!0)};Qs.prototype.update=function(e){return!0};Qs.processPacketData=Te;Qs.processPositionPacketData=AAe;Qs.processMaterialPacketData=gu;Qs._processCzml=function(e,t,n,i,o){if(i=i??Qs.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)hAe(e[r],t,i,n,o);else hAe(e,t,i,n,o)};var Jw=Qs;var Dpi=y(x(),1);function Pl(){this._dataSources=[],this._dataSourceAdded=new Ce,this._dataSourceRemoved=new Ce,this._dataSourceMoved=new Ce}Object.defineProperties(Pl.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}}});Pl.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Pl.prototype.remove=function(e,t){t=t??!1;let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};Pl.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};Pl.prototype.contains=function(e){return this.indexOf(e)!==-1};Pl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Pl.prototype.get=function(e){return this._dataSources[e]};Pl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function c9(e,t){return e.indexOf(t)}function yAe(e,t,n){let i=e._dataSources,o=i.length-1;if(t=V.clamp(t,0,o),n=V.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}Pl.prototype.raise=function(e){let t=c9(this._dataSources,e);yAe(this,t,t+1)};Pl.prototype.lower=function(e){let t=c9(this._dataSources,e);yAe(this,t,t-1)};Pl.prototype.raiseToTop=function(e){let t=c9(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))};Pl.prototype.lowerToBottom=function(e){let t=c9(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Pl.prototype.isDestroyed=function(){return!1};Pl.prototype.destroy=function(){return this.removeAll(!0),fe(this)};var jw=Pl;var aRi=y(x(),1);var eAi=y(x(),1);var Kpi=y(x(),1);function tc(e){e=e??Q.EMPTY_OBJECT,this._primitives=[],this._guid=Kn(),this._primitiveAdded=new Ce,this._primitiveRemoved=new Ce,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(tc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});tc.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};tc.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};tc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};tc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};tc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function l9(e,t){return e._primitives.indexOf(t)}tc.prototype.raise=function(e){if(l(e)){let t=l9(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};tc.prototype.raiseToTop=function(e){if(l(e)){let t=l9(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};tc.prototype.lower=function(e){if(l(e)){let t=l9(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};tc.prototype.lowerToBottom=function(e){if(l(e)){let t=l9(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};tc.prototype.get=function(e){return this._primitives[e]};tc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};tc.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};tc.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};tc.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};tc.prototype.isDestroyed=function(){return!1};tc.prototype.destroy=function(){return this.removeAll(),fe(this)};var Ml=tc;function Cp(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Cp.prototype,{length:{get:function(){return this._length}}});Cp.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Ml({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};Cp.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Cp.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};Cp.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};Cp.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Cp.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Cp.prototype.isDestroyed=function(){return!1};Cp.prototype.destroy=function(){return this.removeAll(),fe(this)};var qw=Cp;var XSi=y(x(),1);var rAi=y(x(),1);function f_(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Ft}f_.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};f_.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};f_.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};f_.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};f_.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):gt.FAILED};var cE=f_;var kEi=y(x(),1);var Cgi=y(x(),1);var YAi=y(x(),1);var uAi=y(x(),1);var c4={},d9=new m,xAe=new m,CAe=new Me,EAe=new $;function p_(e,t,n,i,o,r,s,a,c,d){let u=e+t;m.multiplyByScalar(i,Math.cos(u),d9),m.multiplyByScalar(n,Math.sin(u),xAe),m.add(d9,xAe,d9);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let f=r/Math.sqrt(s*h+o*p)/a;return Me.fromAxisAngle(d9,f,CAe),$.fromQuaternion(CAe,EAe),$.multiplyByVector(EAe,c,d),m.normalize(d,d),m.multiplyByScalar(d,a,d),d}var TAe=new m,SAe=new m,a4=new m,Rot=new m;c4.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,d=n?c:0;for(let u=0;u<c;u+=3){let h=u+1,p=u+2,g=m.fromArray(e,u,TAe);i.scaleToGeodeticSurface(g,g);let f=m.clone(g,SAe),b=i.geodeticSurfaceNormal(g,Rot),C=m.multiplyByScalar(b,o,a4);m.add(g,C,g),n&&(m.multiplyByScalar(b,r,C),m.add(f,C,f),a[u+d]=f.x,a[h+d]=f.y,a[p+d]=f.z),a[u]=g.x,a[h]=g.y,a[p]=g.z}return a};var Got=new m,Vot=new m,Lot=new m;c4.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,d=o*o,u=o*i,h=m.magnitude(s),p=m.normalize(s,Got),g=m.cross(m.UNIT_Z,s,Vot);g=m.normalize(g,g);let f=m.cross(p,g,Lot),b=1+Math.ceil(V.PI_OVER_TWO/a),C=V.PI_OVER_TWO/(b-1),E=V.PI_OVER_TWO-b*C;E<0&&(b-=Math.ceil(Math.abs(E)/C));let T=2*(b*(b+2)),S=t?new Array(T*3):void 0,_=0,R=TAe,L=SAe,W=b*4*3,B=W-1,Y=0,N=n?new Array(W):void 0,A,I,Z,G,w;for(E=V.PI_OVER_TWO,R=p_(E,r,f,g,c,u,d,h,p,R),t&&(S[_++]=R.x,S[_++]=R.y,S[_++]=R.z),n&&(N[B--]=R.z,N[B--]=R.y,N[B--]=R.x),E=V.PI_OVER_TWO-C,A=1;A<b+1;++A){if(R=p_(E,r,f,g,c,u,d,h,p,R),L=p_(Math.PI-E,r,f,g,c,u,d,h,p,L),t){for(S[_++]=R.x,S[_++]=R.y,S[_++]=R.z,Z=2*A+2,I=1;I<Z-1;++I)G=I/(Z-1),w=m.lerp(R,L,G,a4),S[_++]=w.x,S[_++]=w.y,S[_++]=w.z;S[_++]=L.x,S[_++]=L.y,S[_++]=L.z}n&&(N[B--]=R.z,N[B--]=R.y,N[B--]=R.x,N[Y++]=L.x,N[Y++]=L.y,N[Y++]=L.z),E=V.PI_OVER_TWO-(A+1)*C}for(A=b;A>1;--A){if(E=V.PI_OVER_TWO-(A-1)*C,R=p_(-E,r,f,g,c,u,d,h,p,R),L=p_(E+Math.PI,r,f,g,c,u,d,h,p,L),t){for(S[_++]=R.x,S[_++]=R.y,S[_++]=R.z,Z=2*(A-1)+2,I=1;I<Z-1;++I)G=I/(Z-1),w=m.lerp(R,L,G,a4),S[_++]=w.x,S[_++]=w.y,S[_++]=w.z;S[_++]=L.x,S[_++]=L.y,S[_++]=L.z}n&&(N[B--]=R.z,N[B--]=R.y,N[B--]=R.x,N[Y++]=L.x,N[Y++]=L.y,N[Y++]=L.z)}E=V.PI_OVER_TWO,R=p_(-E,r,f,g,c,u,d,h,p,R);let X={};return t&&(S[_++]=R.x,S[_++]=R.y,S[_++]=R.z,X.positions=S,X.numPts=b),n&&(N[B--]=R.z,N[B--]=R.y,N[B--]=R.x,X.outerPositions=N),X};var Td=c4;var A_=new m,l4=new m,d4=new m,IAe=new m,da=new M,_Ae=new $,Wot=new $,u4=new Me,ZAe=new m,RAe=new m,GAe=new m,h9=new pe,VAe=new m,LAe=new M,WAe=new M;function FAe(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,d=n?e.length/3*2:e.length/3,u=t.shadowVolume,h=i.st?new Float32Array(d*2):void 0,p=i.normal?new Float32Array(d*3):void 0,g=i.tangent?new Float32Array(d*3):void 0,f=i.bitangent?new Float32Array(d*3):void 0,b=u?new Float32Array(d*3):void 0,C=0,E=ZAe,T=RAe,S=GAe,_=new vi(a),R=_.project(a.cartesianToCartographic(o,h9),VAe),L=a.scaleToGeodeticSurface(o,A_);a.geodeticSurfaceNormal(L,L);let W=_Ae,B=Wot;if(c!==0){let w=Me.fromAxisAngle(L,c,u4);W=$.fromQuaternion(w,W),w=Me.fromAxisAngle(L,-c,u4),B=$.fromQuaternion(w,B)}else W=$.clone($.IDENTITY,W),B=$.clone($.IDENTITY,B);let Y=M.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,LAe),N=M.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,WAe),A=e.length,I=n?A:0,Z=I/3*2;for(let w=0;w<A;w+=3){let X=w+1,v=w+2,U=m.fromArray(e,w,A_);if(i.st){let k=$.multiplyByVector(W,U,l4),P=_.project(a.cartesianToCartographic(k,h9),d4);m.subtract(P,R,P),da.x=(P.x+r)/(2*r),da.y=(P.y+s)/(2*s),Y.x=Math.min(da.x,Y.x),Y.y=Math.min(da.y,Y.y),N.x=Math.max(da.x,N.x),N.y=Math.max(da.y,N.y),n&&(h[C+Z]=da.x,h[C+1+Z]=da.y),h[C++]=da.x,h[C++]=da.y}(i.normal||i.tangent||i.bitangent||u)&&(E=a.geodeticSurfaceNormal(U,E),u&&(b[w+I]=-E.x,b[X+I]=-E.y,b[v+I]=-E.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(T=m.normalize(m.cross(m.UNIT_Z,E,T),T),$.multiplyByVector(B,T,T)),i.normal&&(p[w]=E.x,p[X]=E.y,p[v]=E.z,n&&(p[w+I]=-E.x,p[X+I]=-E.y,p[v+I]=-E.z)),i.tangent&&(g[w]=T.x,g[X]=T.y,g[v]=T.z,n&&(g[w+I]=-T.x,g[X+I]=-T.y,g[v+I]=-T.z)),i.bitangent&&(S=m.normalize(m.cross(E,T,S),S),f[w]=S.x,f[X]=S.y,f[v]=S.z,n&&(f[w+I]=S.x,f[X+I]=S.y,f[v+I]=S.z))))}if(i.st){A=h.length;for(let w=0;w<A;w+=2)h[w]=(h[w]-Y.x)/(N.x-Y.x),h[w+1]=(h[w+1]-Y.y)/(N.y-Y.y)}let G=new yn;if(i.position){let w=Td.raisePositionsToHeight(e,t,n);G.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:w})}if(i.st&&(G.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(G.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(G.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(G.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),u&&(G.extrudeDirection=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),n&&l(t.offsetAttribute)){let w=new Uint8Array(d);if(t.offsetAttribute===mn.TOP)w=w.fill(1,0,d/2);else{let X=t.offsetAttribute===mn.NONE?0:1;w=w.fill(X)}G.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:w})}return G}function BAe(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var lE=new m;function Fot(e){let t=e.center;lE=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,lE),e.height,lE),lE=m.add(t,lE,lE);let n=new ue(lE,e.semiMajorAxis),i=Td.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=FAe(o,e,!1),a=BAe(r);return a=Pe.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function Bot(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,d=t.stRotation,u=e.length/3*2,h=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,g=n.normal?new Float32Array(u*3):void 0,f=n.tangent?new Float32Array(u*3):void 0,b=n.bitangent?new Float32Array(u*3):void 0,C=t.shadowVolume,E=C?new Float32Array(u*3):void 0,T=0,S=ZAe,_=RAe,R=GAe,L=new vi(s),W=L.project(s.cartesianToCartographic(i,h9),VAe),B=s.scaleToGeodeticSurface(i,A_);s.geodeticSurfaceNormal(B,B);let Y=Me.fromAxisAngle(B,d,u4),N=$.fromQuaternion(Y,_Ae),A=M.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,LAe),I=M.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,WAe),Z=e.length,G=Z/3*2;for(let X=0;X<Z;X+=3){let v=X+1,U=X+2,k=m.fromArray(e,X,A_),P;if(n.st){let H=$.multiplyByVector(N,k,l4),ee=L.project(s.cartesianToCartographic(H,h9),d4);m.subtract(ee,W,ee),da.x=(ee.x+o)/(2*o),da.y=(ee.y+r)/(2*r),A.x=Math.min(da.x,A.x),A.y=Math.min(da.y,A.y),I.x=Math.max(da.x,I.x),I.y=Math.max(da.y,I.y),p[T+G]=da.x,p[T+1+G]=da.y,p[T++]=da.x,p[T++]=da.y}k=s.scaleToGeodeticSurface(k,k),P=m.clone(k,l4),S=s.geodeticSurfaceNormal(k,S),C&&(E[X+Z]=-S.x,E[v+Z]=-S.y,E[U+Z]=-S.z);let O=m.multiplyByScalar(S,a,IAe);if(k=m.add(k,O,k),O=m.multiplyByScalar(S,c,O),P=m.add(P,O,P),n.position&&(h[X+Z]=P.x,h[v+Z]=P.y,h[U+Z]=P.z,h[X]=k.x,h[v]=k.y,h[U]=k.z),n.normal||n.tangent||n.bitangent){R=m.clone(S,R);let H=m.fromArray(e,(X+3)%Z,IAe);m.subtract(H,k,H);let ee=m.subtract(P,k,d4);S=m.normalize(m.cross(ee,H,S),S),n.normal&&(g[X]=S.x,g[v]=S.y,g[U]=S.z,g[X+Z]=S.x,g[v+Z]=S.y,g[U+Z]=S.z),n.tangent&&(_=m.normalize(m.cross(R,S,_),_),f[X]=_.x,f[v]=_.y,f[U]=_.z,f[X+Z]=_.x,f[X+1+Z]=_.y,f[X+2+Z]=_.z),n.bitangent&&(b[X]=R.x,b[v]=R.y,b[U]=R.z,b[X+Z]=R.x,b[v+Z]=R.y,b[U+Z]=R.z)}}if(n.st){Z=p.length;for(let X=0;X<Z;X+=2)p[X]=(p[X]-A.x)/(I.x-A.x),p[X+1]=(p[X+1]-A.y)/(I.y-A.y)}let w=new yn;if(n.position&&(w.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(w.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(w.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(w.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(w.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),C&&(w.extrudeDirection=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E})),l(t.offsetAttribute)){let X=new Uint8Array(u);if(t.offsetAttribute===mn.TOP)X=X.fill(1,0,u/2);else{let v=t.offsetAttribute===mn.NONE?0:1;X=X.fill(v)}w.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:X})}return w}function wot(e){let t=e.length/3,n=Pe.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var u9=new ue,m9=new ue;function Yot(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,A_),e.height,A_);u9.center=m.add(t,o,u9.center),u9.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),m9.center=m.add(t,o,m9.center),m9.radius=i;let r=Td.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=ue.union(u9,m9),u=FAe(s,e,!0),h=BAe(a),p=h.length;h.length=p*2;let g=s.length/3;for(let _=0;_<p;_+=3)h[_+p]=h[_+2]+g,h[_+1+p]=h[_+1]+g,h[_+2+p]=h[_]+g;let f=Pe.createTypedArray(g*2/3,h),b=new pt({attributes:u,indices:f,primitiveType:Be.TRIANGLES}),C=Bot(c,e);h=wot(c);let E=Pe.createTypedArray(c.length*2/3,h),T=new pt({attributes:C,indices:E,primitiveType:Be.TRIANGLES}),S=Dn.combineInstances([new Bt({geometry:b}),new Bt({geometry:T})]);return{boundingSphere:d,attributes:S[0].attributes,indices:S[0].indices}}function wAe(e,t,n,i,o,r,s){let c=Td.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,d=c.length/3,u=new Array(d);for(let p=0;p<d;++p)u[p]=m.fromArray(c,p*3);let h=de.fromCartesianArray(u,r,s);return h.width>V.PI&&(h.north=h.north>0?V.PI_OVER_TWO-V.EPSILON7:h.north,h.south=h.south<0?V.EPSILON7-V.PI_OVER_TWO:h.south,h.east=V.PI,h.west=-V.PI),h}function Tp(e){e=e??Q.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ie.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??V.RADIANS_PER_DEGREE,s=e.vertexFormat??we.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ie.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=we.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Tp.packedLength=m.packedLength+ie.packedLength+we.packedLength+9;Tp.pack=function(e,t,n){return n=n??0,m.pack(e._center,t,n),n+=m.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var YAe=new m,NAe=new ie,XAe=new we,Ep={center:YAe,ellipsoid:NAe,vertexFormat:XAe,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};Tp.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,YAe);t+=m.packedLength;let o=ie.unpack(e,t,NAe);t+=ie.packedLength;let r=we.unpack(e,t,XAe);t+=we.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t++],g=e[t++]===1,f=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=we.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=f===-1?void 0:f,n):(Ep.height=u,Ep.extrudedHeight=p,Ep.granularity=h,Ep.stRotation=d,Ep.rotation=c,Ep.semiMajorAxis=s,Ep.semiMinorAxis=a,Ep.shadowVolume=g,Ep.offsetAttribute=f===-1?void 0:f,new Tp(Ep))};Tp.computeRectangle=function(e,t){e=e??Q.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ie.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??V.RADIANS_PER_DEGREE,a=e.rotation??0;return wAe(n,o,r,a,s,i,t)};Tp.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!V.equalsEpsilon(t,n,0,V.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let 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},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=Yot(o);else if(r=Fot(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new pt({attributes:r.attributes,indices:r.indices,primitiveType:Be.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Tp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Tp({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:we.POSITION_ONLY,shadowVolume:!0})};function Not(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Td.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=m.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return pt._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(Tp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=wAe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Not(this)),this._textureCoordinateRotationPoints}}});var Ul=Tp;var qAi=y(x(),1);var PAe=new m,dE=new m;function Xot(e){let t=e.center;dE=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,dE),e.height,dE),dE=m.add(t,dE,dE);let n=new ue(dE,e.semiMajorAxis),i=Td.computeEllipsePositions(e,!1,!0).outerPositions,o=new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:Td.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Pe.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var f9=new ue,p9=new ue;function Pot(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,PAe),e.height,PAe);f9.center=m.add(t,o,f9.center),f9.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),p9.center=m.add(t,o,p9.center),p9.radius=i;let r=Td.computeEllipsePositions(e,!1,!0).outerPositions,s=new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:Td.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ue.union(f9,p9),c=r.length/3;if(l(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===mn.TOP)f=f.fill(1,0,c/2);else{let b=e.offsetAttribute===mn.NONE?0:1;f=f.fill(b)}s.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let d=e.numberOfVerticalLines??16;d=V.clamp(d,0,c/2);let u=Pe.createTypedArray(c,c*2+d*2);c/=2;let h=0,p;for(p=0;p<c;++p)u[h++]=p,u[h++]=(p+1)%c,u[h++]=p+c,u[h++]=(p+1)%c+c;let g;if(d>0){let f=Math.min(d,c);g=Math.round(c/f);let b=Math.min(g*d,c);for(p=0;p<b;p+=g)u[h++]=p,u[h++]=p+c}return{boundingSphere:a,attributes:s,indices:u}}function g_(e){e=e??Q.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ie.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??V.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ie.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}g_.packedLength=m.packedLength+ie.packedLength+8;g_.pack=function(e,t,n){return n=n??0,m.pack(e._center,t,n),n+=m.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var MAe=new m,UAe=new ie,Qg={center:MAe,ellipsoid:UAe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};g_.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,MAe);t+=m.packedLength;let o=ie.unpack(e,t,UAe);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=ie.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=d,n._extrudedHeight=u,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(Qg.height=c,Qg.extrudedHeight=u,Qg.granularity=d,Qg.rotation=a,Qg.semiMajorAxis=r,Qg.semiMinorAxis=s,Qg.numberOfVerticalLines=h,Qg.offsetAttribute=p===-1?void 0:p,new g_(Qg))};g_.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!V.equalsEpsilon(t,n,0,V.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=Pot(o);else if(r=Xot(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new pt({attributes:r.attributes,indices:r.indices,primitiveType:Be.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var bu=g_;var DAe=new D,vAe=m.ZERO,kAe=new m,QAe=new de;function Mot(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 af(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new Mot(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(af.prototype=Object.create(ii.prototype),af.prototype.constructor=af);af.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,DAe)),l(o)||(o=D.WHITE),i.color=qt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,vAe,kAe))),new Bt({id:t,geometry:new Ul(this._options),attributes:i})};af.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,DAe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(i),distanceDisplayCondition:jn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,vAe,kAe))),new Bt({id:t,geometry:new bu(this._options),attributes:r})};af.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};af.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Ei.prototype._isHidden.call(this,e,t)};af.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!K.isConstant(t.rotation)||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.stRotation)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.numberOfVerticalLines)||!K.isConstant(t.zIndex)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};af.prototype._setStaticOptions=function(e,t){let n=K.getValueOrUndefined(t.height,Ke.MINIMUM_VALUE),i=K.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,tt.NONE),o=K.getValueOrUndefined(t.extrudedHeight,Ke.MINIMUM_VALUE),r=K.getValueOrDefault(t.extrudedHeightReference,Ke.MINIMUM_VALUE,tt.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ke.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ke.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ke.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=K.getValueOrUndefined(t.rotation,Ke.MINIMUM_VALUE),s.granularity=K.getValueOrUndefined(t.granularity,Ke.MINIMUM_VALUE),s.stRotation=K.getValueOrUndefined(t.stRotation,Ke.MINIMUM_VALUE),s.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,Ke.MINIMUM_VALUE),s.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,o,r),s.height=ii.getGeometryHeight(n,i),o=ii.getGeometryExtrudedHeight(o,r),o===ii.CLAMP_TO_GROUND&&(o=Zi.getMinimumMaximumHeights(Ul.computeRectangle(s,QAe)).minimumTerrainHeight),s.extrudedHeight=o};af.DynamicGeometryUpdater=b_;function b_(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(b_.prototype=Object.create(Ci.prototype),b_.prototype.constructor=b_);b_.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Ci.prototype._isHidden.call(this,e,t,n)};b_.prototype._setOptions=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,tt.NONE),s=K.getValueOrUndefined(t.extrudedHeight,n),a=K.getValueOrDefault(t.extrudedHeightReference,n,tt.NONE);l(s)&&!l(o)&&(o=0),i.center=K.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=K.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=K.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=K.getValueOrUndefined(t.rotation,n),i.granularity=K.getValueOrUndefined(t.granularity,n),i.stRotation=K.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(o,r,s,a),i.height=ii.getGeometryHeight(o,r),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Zi.getMinimumMaximumHeights(Ul.computeRectangle(i,QAe)).minimumTerrainHeight),i.extrudedHeight=s};var $w=af;var ubi=y(x(),1);var Xgi=y(x(),1);var Uot=new m,Dot=new m,vot=new m,kot=new m,Qot=new m,Oot=new m(1,1,1),OAe=Math.cos,zAe=Math.sin;function Og(e){e=e??Q.EMPTY_OBJECT;let t=e.radii??Oot,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??V.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??V.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),d=e.vertexFormat??we.DEFAULT;this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=we.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Og.packedLength=2*m.packedLength+we.packedLength+7;Og.pack=function(e,t,n){return n=n??0,m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=e._offsetAttribute??-1,t};var HAe=new m,KAe=new m,JAe=new we,oy={radii:HAe,innerRadii:KAe,vertexFormat:JAe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Og.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,HAe);t+=m.packedLength;let o=m.unpack(e,t,KAe);t+=m.packedLength;let r=we.unpack(e,t,JAe);t+=we.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._vertexFormat=we.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=d,n._stackPartitions=u,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(oy.minimumClock=s,oy.maximumClock=a,oy.minimumCone=c,oy.maximumCone=d,oy.stackPartitions=u,oy.slicePartitions=h,oy.offsetAttribute=p===-1?void 0:p,new Og(oy))};Og.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,d=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/V.TWO_PI),d=Math.round(d*Math.abs(s-r)/V.PI),c<2&&(c=2),d<2&&(d=2);let u,h,p=0,g=[r],f=[i];for(u=0;u<d;u++)g.push(r+u*(s-r)/(d-1));for(g.push(s),h=0;h<c;h++)f.push(i+h*(o-i)/(c-1));f.push(o);let b=g.length,C=f.length,E=0,T=1,S=n.x!==t.x||n.y!==t.y||n.z!==t.z,_=!1,R=!1,L=!1;S&&(T=2,r>0&&(_=!0,E+=c-1),s<Math.PI&&(R=!0,E+=c-1),(o-i)%V.TWO_PI?(L=!0,E+=(d-1)*2+1):E+=1);let W=C*b*T,B=new Float64Array(W*3),Y=new Array(W).fill(!1),N=new Array(W).fill(!1),A=c*d*T,I=6*(A+E+1-(c+d)*T),Z=Pe.createTypedArray(A,I),G=a.normal?new Float32Array(W*3):void 0,w=a.tangent?new Float32Array(W*3):void 0,X=a.bitangent?new Float32Array(W*3):void 0,v=a.st?new Float32Array(W*2):void 0,U=new Array(b),k=new Array(b);for(u=0;u<b;u++)U[u]=zAe(g[u]),k[u]=OAe(g[u]);let P=new Array(C),O=new Array(C);for(h=0;h<C;h++)O[h]=OAe(f[h]),P[h]=zAe(f[h]);for(u=0;u<b;u++)for(h=0;h<C;h++)B[p++]=t.x*U[u]*O[h],B[p++]=t.y*U[u]*P[h],B[p++]=t.z*k[u];let H=W/2;if(S)for(u=0;u<b;u++)for(h=0;h<C;h++)B[p++]=n.x*U[u]*O[h],B[p++]=n.y*U[u]*P[h],B[p++]=n.z*k[u],Y[H]=!0,u>0&&u!==b-1&&h!==0&&h!==C-1&&(N[H]=!0),H++;p=0;let ee,z;for(u=1;u<b-2;u++)for(ee=u*C,z=(u+1)*C,h=1;h<C-2;h++)Z[p++]=z+h,Z[p++]=z+h+1,Z[p++]=ee+h+1,Z[p++]=z+h,Z[p++]=ee+h+1,Z[p++]=ee+h;if(S){let De=b*C;for(u=1;u<b-2;u++)for(ee=De+u*C,z=De+(u+1)*C,h=1;h<C-2;h++)Z[p++]=z+h,Z[p++]=ee+h,Z[p++]=ee+h+1,Z[p++]=z+h,Z[p++]=ee+h+1,Z[p++]=z+h+1}let te,q;if(S){if(_)for(q=b*C,u=1;u<C-2;u++)Z[p++]=u,Z[p++]=u+1,Z[p++]=q+u+1,Z[p++]=u,Z[p++]=q+u+1,Z[p++]=q+u;if(R)for(te=b*C-C,q=b*C*T-C,u=1;u<C-2;u++)Z[p++]=te+u+1,Z[p++]=te+u,Z[p++]=q+u,Z[p++]=te+u+1,Z[p++]=q+u,Z[p++]=q+u+1}if(L){for(u=1;u<b-2;u++)q=C*b+C*u,te=C*u,Z[p++]=q,Z[p++]=te+C,Z[p++]=te,Z[p++]=q,Z[p++]=q+C,Z[p++]=te+C;for(u=1;u<b-2;u++)q=C*b+C*(u+1)-1,te=C*(u+1)-1,Z[p++]=te+C,Z[p++]=q,Z[p++]=te,Z[p++]=te+C,Z[p++]=q+C,Z[p++]=q}let me=new yn;a.position&&(me.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:B}));let ye=0,oe=0,xe=0,Ee=0,Le=W/2,Se,Fe=ie.fromCartesian3(t),Ue=ie.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<W;u++){Se=Y[u]?Ue:Fe;let De=m.fromArray(B,u*3,Uot),Je=Se.geodeticSurfaceNormal(De,Dot);if(N[u]&&m.negate(Je,Je),a.st){let St=M.negate(Je,Qot);v[ye++]=Math.atan2(St.y,St.x)/V.TWO_PI+.5,v[ye++]=Math.asin(Je.z)/Math.PI+.5}if(a.normal&&(G[oe++]=Je.x,G[oe++]=Je.y,G[oe++]=Je.z),a.tangent||a.bitangent){let St=vot,Oe=0,it;if(Y[u]&&(Oe=Le),!_&&u>=Oe&&u<Oe+C*2?it=m.UNIT_X:it=m.UNIT_Z,m.cross(it,Je,St),m.normalize(St,St),a.tangent&&(w[xe++]=St.x,w[xe++]=St.y,w[xe++]=St.z),a.bitangent){let yt=m.cross(Je,St,kot);m.normalize(yt,yt),X[Ee++]=yt.x,X[Ee++]=yt.y,X[Ee++]=yt.z}}}a.st&&(me.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:v})),a.normal&&(me.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:G})),a.tangent&&(me.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:w})),a.bitangent&&(me.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:X}))}if(l(e._offsetAttribute)){let De=B.length,Je=e._offsetAttribute===mn.NONE?0:1,St=new Uint8Array(De/3).fill(Je);me.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:St})}return new pt({attributes:me,indices:Z,primitiveType:Be.TRIANGLES,boundingSphere:ue.fromEllipsoid(Fe),offsetAttribute:e._offsetAttribute})};var m4;Og.getUnitEllipsoid=function(){return l(m4)||(m4=Og.createGeometry(new Og({radii:new m(1,1,1),vertexFormat:we.POSITION_ONLY}))),m4};var Va=Og;var zot=new Kt(D.WHITE),h4=m.ZERO,f4=new m,Hot=new m,Kot=new m,p4=new D,Jot=new m(1,1,1);function jot(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 yu(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new jot(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(yu.prototype=Object.create(Ei.prototype),yu.prototype.constructor=yu);Object.defineProperties(yu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});yu.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new Zn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=jn.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let u;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,p4)),l(u)||(u=D.WHITE),r=qt.fromColor(u),d.color=r}return l(this._options.offsetAttribute)&&(d.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,h4,f4))),new Bt({id:i,geometry:new Va(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:d})};yu.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,p4),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Zn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(r),distanceDisplayCondition:jn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,h4,f4))),new Bt({id:i,geometry:new du(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};yu.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};yu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Ei.prototype._isHidden.call(this,e,t)};yu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.radii.isConstant||!K.isConstant(t.innerRadii)||!K.isConstant(t.stackPartitions)||!K.isConstant(t.slicePartitions)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.minimumClock)||!K.isConstant(t.maximumClock)||!K.isConstant(t.minimumCone)||!K.isConstant(t.maximumCone)||!K.isConstant(t.subdivisions)};yu.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,tt.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ke.MINIMUM_VALUE,i.radii),i.innerRadii=K.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=K.getValueOrUndefined(t.minimumClock,Ke.MINIMUM_VALUE),i.maximumClock=K.getValueOrUndefined(t.maximumClock,Ke.MINIMUM_VALUE),i.minimumCone=K.getValueOrUndefined(t.minimumCone,Ke.MINIMUM_VALUE),i.maximumCone=K.getValueOrUndefined(t.maximumCone,Ke.MINIMUM_VALUE),i.stackPartitions=K.getValueOrUndefined(t.stackPartitions,Ke.MINIMUM_VALUE),i.slicePartitions=K.getValueOrUndefined(t.slicePartitions,Ke.MINIMUM_VALUE),i.subdivisions=K.getValueOrUndefined(t.subdivisions,Ke.MINIMUM_VALUE),i.offsetAttribute=n!==tt.NONE?mn.ALL:void 0};yu.prototype._onEntityPropertyChanged=YA;yu.DynamicGeometryUpdater=eY;function eY(e,t,n){Ci.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,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 m,this._material={}}l(Object.create)&&(eY.prototype=Object.create(Ci.prototype),eY.prototype.constructor=eY);eY.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!K.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=K.getValueOrUndefined(n.radii,e,Hot),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=K.getValueOrDefault(n.fill,e,!0),s=K.getValueOrDefault(n.outline,e,!1),a=K.getValueOrClonedDefault(n.outlineColor,e,D.BLACK,p4),c=yr.getValue(e,n.material??zot,this._material),d=K.getValueOrUndefined(n.innerRadii,e,Kot),u=K.getValueOrUndefined(n.minimumClock,e),h=K.getValueOrUndefined(n.maximumClock,e),p=K.getValueOrUndefined(n.minimumCone,e),g=K.getValueOrUndefined(n.maximumCone,e),f=K.getValueOrUndefined(n.stackPartitions,e),b=K.getValueOrUndefined(n.slicePartitions,e),C=K.getValueOrUndefined(n.subdivisions,e),E=K.getValueOrDefault(n.outlineWidth,e,1),T=K.getValueOrDefault(n.heightReference,e,tt.NONE),S=T!==tt.NONE?mn.ALL:void 0,_=this._scene.mode,R=_===se.SCENE3D&&T===tt.NONE,L=this._options,W=this._geometryUpdater.shadowsProperty.getValue(e),Y=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=K.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,h4,f4);if(!R||this._lastSceneMode!==_||!l(this._primitive)||L.stackPartitions!==f||L.slicePartitions!==b||l(d)&&!m.equals(L.innerRadii!==d)||L.minimumClock!==u||L.maximumClock!==h||L.minimumCone!==p||L.maximumCone!==g||L.subdivisions!==C||this._lastOutlineWidth!==E||L.offsetAttribute!==S){let I=this._primitives;I.removeAndDestroy(this._primitive),I.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=_,this._lastOutlineWidth=E,L.stackPartitions=f,L.slicePartitions=b,L.subdivisions=C,L.offsetAttribute=S,L.radii=m.clone(R?Jot:i,L.radii),l(d)?R?L.innerRadii=m.fromElements(d.x/i.x,d.y/i.y,d.z/i.z,L.innerRadii):L.innerRadii=m.clone(d,L.innerRadii):L.innerRadii=void 0,L.minimumClock=u,L.maximumClock=h,L.minimumCone=p,L.maximumCone=g;let Z=new Io({material:c,translucent:c.isTranslucent(),closed:!0});L.vertexFormat=Z.vertexFormat;let G=this._geometryUpdater.createFillGeometryInstance(e,R,this._modelMatrix);this._primitive=I.add(new Nn({geometryInstances:G,appearance:Z,asynchronous:!1,shadows:W}));let w=this._geometryUpdater.createOutlineGeometryInstance(e,R,this._modelMatrix);this._outlinePrimitive=I.add(new Nn({geometryInstances:w,appearance:new pn({flat:!0,translucent:w.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(E)}}),asynchronous:!1,shadows:W})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=D.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=Y,this._lastOffset=m.clone(N,this._lastOffset)}else if(this._primitive.ready){let I=this._primitive,Z=this._outlinePrimitive;I.show=!0,Z.show=!0,I.appearance.material=c;let G=this._attributes;l(G)||(G=I.getGeometryInstanceAttributes(t),this._attributes=G),r!==this._lastShow&&(G.show=Zn.toValue(r,G.show),this._lastShow=r);let w=this._outlineAttributes;l(w)||(w=Z.getGeometryInstanceAttributes(t),this._outlineAttributes=w),s!==this._lastOutlineShow&&(w.show=Zn.toValue(s,w.show),this._lastOutlineShow=s),D.equals(a,this._lastOutlineColor)||(w.color=qt.toValue(a,w.color),D.clone(a,this._lastOutlineColor)),Mt.equals(Y,this._lastDistanceDisplayCondition)||(G.distanceDisplayCondition=jn.toValue(Y,G.distanceDisplayCondition),w.distanceDisplayCondition=jn.toValue(Y,w.distanceDisplayCondition),Mt.clone(Y,this._lastDistanceDisplayCondition)),m.equals(N,this._lastOffset)||(G.offset=go.toValue(N,G.offset),w.offset=go.toValue(N,G.offset),m.clone(N,this._lastOffset))}R&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var tY=yu;var e0i=y(x(),1);var Tbi=y(x(),1);function y_(e){e=e??Q.EMPTY_OBJECT;let t=e.vertexFormat??we.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}y_.packedLength=we.packedLength;y_.pack=function(e,t,n){return n=n??0,we.pack(e._vertexFormat,t,n),t};var jAe=new we,qot={vertexFormat:jAe};y_.unpack=function(e,t,n){t=t??0;let i=we.unpack(e,t,jAe);return l(n)?(n._vertexFormat=we.clone(i,n._vertexFormat),n):new y_(qot)};var A9=new m(-.5,-.5,0),g9=new m(.5,.5,0);y_.createGeometry=function(e){let t=e._vertexFormat,n=new yn,i,o;if(t.position){if(o=new Float64Array(12),o[0]=A9.x,o[1]=A9.y,o[2]=0,o[3]=g9.x,o[4]=A9.y,o[5]=0,o[6]=g9.x,o[7]=g9.y,o[8]=0,o[9]=A9.x,o[10]=g9.y,o[11]=0,n.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new pt({attributes:n,indices:i,primitiveType:Be.TRIANGLES,boundingSphere:new ue(m.ZERO,Math.sqrt(2))})};var nY=y_;var Fbi=y(x(),1);function x_(){this._workerName="createPlaneOutlineGeometry"}x_.packedLength=0;x_.pack=function(e,t){return t};x_.unpack=function(e,t,n){return l(n)?n:new x_};var ry=new m(-.5,-.5,0),b9=new m(.5,.5,0);x_.createGeometry=function(){let e=new yn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=ry.x,n[1]=ry.y,n[2]=ry.z,n[3]=b9.x,n[4]=ry.y,n[5]=ry.z,n[6]=b9.x,n[7]=b9.y,n[8]=ry.z,n[9]=ry.x,n[10]=b9.y,n[11]=ry.z,e.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:n}),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 pt({attributes:e,indices:t,primitiveType:Be.LINES,boundingSphere:new ue(m.ZERO,Math.sqrt(2))})};var iY=x_;var $ot=new m,qAe=new D;function ert(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function wm(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new ert(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(wm.prototype=Object.create(Ei.prototype),wm.prototype.constructor=wm);wm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=jn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,qAe)),l(g)||(g=D.WHITE),o=qt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,d=this._options,u=t.computeModelMatrix(e),h=K.getValueOrDefault(c.plane,e,d.plane),p=K.getValueOrUndefined(c.dimensions,e,d.dimensions);return d.plane=h,d.dimensions=p,u=A4(h,p,u,u),new Bt({id:t,geometry:new nY(this._options),modelMatrix:u,attributes:i})};wm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,qAe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=K.getValueOrDefault(r.plane,e,s.plane),d=K.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=d,a=A4(c,d,a,a),new Bt({id:t,geometry:new iY,modelMatrix:a,attributes:{show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(i),distanceDisplayCondition:jn.fromDistanceDisplayCondition(o)}})};wm.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Ei.prototype._isHidden.call(this,e,t)};wm.prototype._getIsClosed=function(e){return!1};wm.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!K.isConstant(t.outlineWidth)};wm.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ke.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ke.MINIMUM_VALUE,i.dimensions)};wm.DynamicGeometryUpdater=C_;function C_(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(C_.prototype=Object.create(Ci.prototype),C_.prototype.constructor=C_);C_.prototype._isHidden=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(e.position,n,$ot);return!l(o)||!l(i.plane)||!l(i.dimensions)||Ci.prototype._isHidden.call(this,e,t,n)};C_.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=K.getValueOrDefault(t.plane,n,i.plane),i.dimensions=K.getValueOrUndefined(t.dimensions,n,i.dimensions)};var trt=new m,nrt=new m,irt=new m,ort=new m,rrt=new $,srt=new $,art=new F;function A4(e,t,n,i){let o=e.normal,r=e.distance,s=m.multiplyByScalar(o,-r,irt),a=m.clone(m.UNIT_Z,nrt);V.equalsEpsilon(Math.abs(m.dot(a,o)),1,V.EPSILON8)&&(a=m.clone(m.UNIT_Y,a));let c=m.cross(a,o,trt);a=m.cross(o,c,a),m.normalize(c,c),m.normalize(a,a);let d=rrt;$.setColumn(d,0,c,d),$.setColumn(d,1,a,d),$.setColumn(d,2,o,d);let u=m.fromElements(t.x,t.y,1,ort),h=$.multiplyByScale(d,u,srt),p=F.fromRotationTranslation(h,s,art);return F.multiplyTransformation(n,p,i)}wm.createPrimitiveMatrix=A4;var oY=wm;var Eyi=y(x(),1);var I0i=y(x(),1);var crt=new m,lrt=new $e,drt=new M,urt=new M,mrt=new m,hrt=new m,frt=new m,rY=new m,prt=new m,Art=new m,$Ae=new Me,grt=new $,brt=new $,yrt=new m;function xrt(e,t,n,i,o,r,s,a,c){let d=e.positions,u=Si.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let h=Pe.createTypedArray(d.length,u.length);h.set(u);let p=grt;if(i!==0){let A=Me.fromAxisAngle(s,i,$Ae);if(p=$.fromQuaternion(A,p),t.tangent||t.bitangent){A=Me.fromAxisAngle(s,-i,$Ae);let I=$.fromQuaternion(A,brt);a=m.normalize($.multiplyByVector(I,a,a),a),t.bitangent&&(c=m.normalize(m.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=urt;t.st&&(g.x=n.x,g.y=n.y);let f=d.length,b=f*3,C=new Float64Array(b),E=t.normal?new Float32Array(b):void 0,T=t.tangent?new Float32Array(b):void 0,S=t.bitangent?new Float32Array(b):void 0,_=t.st?new Float32Array(f*2):void 0,R=0,L=0,W=0,B=0,Y=0;for(let A=0;A<f;A++){let I=d[A];if(C[R++]=I.x,C[R++]=I.y,C[R++]=I.z,t.st)if(l(o)&&o.positions.length===f)_[Y++]=o.positions[A].x,_[Y++]=o.positions[A].y;else{let Z=$.multiplyByVector(p,I,crt),G=r(Z,drt);M.subtract(G,g,G);let w=V.clamp(G.x/n.width,0,1),X=V.clamp(G.y/n.height,0,1);_[Y++]=w,_[Y++]=X}t.normal&&(E[L++]=s.x,E[L++]=s.y,E[L++]=s.z),t.tangent&&(T[B++]=a.x,T[B++]=a.y,T[B++]=a.z),t.bitangent&&(S[W++]=c.x,S[W++]=c.y,S[W++]=c.z)}let N=new yn;return t.position&&(N.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:C})),t.normal&&(N.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E})),t.tangent&&(N.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(N.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:S})),t.st&&(N.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:_})),new pt({attributes:N,indices:h,primitiveType:Be.TRIANGLES})}function uE(e){e=e??Q.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??we.DEFAULT;this._vertexFormat=we.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=ei.computeHierarchyPackedLength(t,m)+we.packedLength+ie.packedLength+(l(n)?ei.computeHierarchyPackedLength(n,M):1)+2}uE.fromPositions=function(e){e=e??Q.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new uE(t)};uE.pack=function(e,t,n){return n=n??0,n=ei.packPolygonHierarchy(e._polygonHierarchy,t,n,m),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=ei.packPolygonHierarchy(e._textureCoordinates,t,n,M):t[n++]=-1,t[n++]=e.packedLength,t};var Crt=ie.clone(ie.UNIT_SPHERE),Ert=new we,Trt={polygonHierarchy:{}};uE.unpack=function(e,t,n){t=t??0;let i=ei.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,Crt);t+=ie.packedLength;let r=we.unpack(e,t,Ert);t+=we.packedLength;let s=e[t++],a=e[t]===-1?void 0:ei.unpackPolygonHierarchy(e,t,M);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new uE(Trt)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=we.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};uE.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=Mo(s,m.equalsEpsilon,!0),s.length<3)return;let a=mrt,c=hrt,d=frt,u=prt,h=Art;if(!Ig.computeProjectTo2DArguments(s,rY,u,h))return;if(a=m.cross(u,h,a),a=m.normalize(a,a),!m.equalsEpsilon(rY,m.ZERO,V.EPSILON6)){let Y=e._ellipsoid.geodeticSurfaceNormal(rY,yrt);m.dot(a,Y)<0&&(a=m.negate(a,a),u=m.negate(u,u))}let g=Ig.createProjectPointsTo2DFunction(rY,u,h),f=Ig.createProjectPointTo2DFunction(rY,u,h);t.tangent&&(c=m.clone(u,c)),t.bitangent&&(d=m.clone(h,d));let b=ei.polygonsFromHierarchy(n,r,g,!1),C=b.hierarchy,E=b.polygons,T=function(Y){return Y},S=r?ei.polygonsFromHierarchy(o,!0,T,!1).polygons:void 0;if(C.length===0)return;s=C[0].outerRing;let _=ue.fromPoints(s),R=ei.computeBoundingRectangle(a,f,s,i,lrt),L=[];for(let Y=0;Y<E.length;Y++){let N=new Bt({geometry:xrt(E[Y],t,R,i,r?S[Y]:void 0,f,a,c,d)});L.push(N)}let W=Dn.combineInstances(L)[0];W.attributes.position.values=new Float64Array(W.attributes.position.values),W.indices=Pe.createTypedArray(W.attributes.position.values.length/3,W.indices);let B=W.attributes;return t.position||delete B.position,new pt({attributes:B,indices:W.indices,primitiveType:W.primitiveType,boundingSphere:_})};var sY=uE;var z0i=y(x(),1);var ege=[],y9=[];function Srt(e,t,n,i,o){let s=Ss.fromPoints(t,e).projectPointsOntoPlane(t,ege);Si.computeWindingOrder2D(s)===Ns.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,h=0;if(i)for(c=new Float64Array(u*2*3),d=0;d<u;d++){let f=t[d],b=t[(d+1)%u];c[h++]=f.x,c[h++]=f.y,c[h++]=f.z,c[h++]=b.x,c[h++]=b.y,c[h++]=b.z}else{let f=0;if(o===ln.GEODESIC)for(d=0;d<u;d++)f+=ei.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===ln.RHUMB)for(d=0;d<u;d++)f+=ei.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(f*3),d=0;d<u;d++){let b;o===ln.GEODESIC?b=ei.subdivideLine(t[d],t[(d+1)%u],n,y9):o===ln.RHUMB&&(b=ei.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,y9));let C=b.length;for(let E=0;E<C;++E)c[h++]=b[E]}}u=c.length/3;let p=u*2,g=Pe.createTypedArray(u,p);for(h=0,d=0;d<u-1;d++)g[h++]=d,g[h++]=d+1;return g[h++]=u-1,g[h++]=0,new Bt({geometry:new pt({attributes:new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Be.LINES})})}function Irt(e,t,n,i,o){let s=Ss.fromPoints(t,e).projectPointsOntoPlane(t,ege);Si.computeWindingOrder2D(s)===Ns.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,h=new Array(u),p=0;if(i)for(c=new Float64Array(u*2*3*2),d=0;d<u;++d){h[d]=p/3;let C=t[d],E=t[(d+1)%u];c[p++]=C.x,c[p++]=C.y,c[p++]=C.z,c[p++]=E.x,c[p++]=E.y,c[p++]=E.z}else{let C=0;if(o===ln.GEODESIC)for(d=0;d<u;d++)C+=ei.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===ln.RHUMB)for(d=0;d<u;d++)C+=ei.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(C*3*2),d=0;d<u;++d){h[d]=p/3;let E;o===ln.GEODESIC?E=ei.subdivideLine(t[d],t[(d+1)%u],n,y9):o===ln.RHUMB&&(E=ei.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,y9));let T=E.length;for(let S=0;S<T;++S)c[p++]=E[S]}}u=c.length/6;let g=h.length,f=(u*2+g)*2,b=Pe.createTypedArray(u+g,f);for(p=0,d=0;d<u;++d)b[p++]=d,b[p++]=(d+1)%u,b[p++]=d+u,b[p++]=(d+1)%u+u;for(d=0;d<g;d++){let C=h[d];b[p++]=C,b[p++]=C+u}return new Bt({geometry:new pt({attributes:new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})}),indices:b,primitiveType:Be.LINES})})}function mE(e){let t=e.polygonHierarchy,n=e.ellipsoid??ie.default,i=e.granularity??V.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),s=e.arcType??ln.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!r){let d=Math.max(a,c);c=Math.min(a,c),a=d}this._ellipsoid=ie.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=ei.computeHierarchyPackedLength(t,m)+ie.packedLength+8}mE.pack=function(e,t,n){return n=n??0,n=ei.packPolygonHierarchy(e._polygonHierarchy,t,n,m),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var _rt=ie.clone(ie.UNIT_SPHERE),Zrt={polygonHierarchy:{}};mE.unpack=function(e,t,n){t=t??0;let i=ei.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,_rt);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,d=e[t++]===1,u=e[t++],h=e[t++],p=e[t];return l(n)||(n=new mE(Zrt)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=d,n._perPositionHeightExtrude=c,n._arcType=u,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};mE.fromPositions=function(e){e=e??Q.EMPTY_OBJECT;let t={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};return new mE(t)};mE.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=ei.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],d=V.chordLength(n,t.maximumRadius),u=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!V.equalsEpsilon(u,h,0,V.EPSILON2),g,f;if(p)for(f=0;f<s.length;f++){if(a=Irt(t,s[f],d,o,r),a.geometry=ei.scaleToGeodeticHeightExtruded(a.geometry,u,h,t,o),l(e._offsetAttribute)){let E=a.geometry.attributes.position.values.length/3,T=new Uint8Array(E);e._offsetAttribute===mn.TOP?T=T.fill(1,0,E/2):(g=e._offsetAttribute===mn.NONE?0:1,T=T.fill(g)),a.geometry.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}else for(f=0;f<s.length;f++){if(a=Srt(t,s[f],d,o,r),a.geometry.attributes.position.values=Si.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),l(e._offsetAttribute)){let E=a.geometry.attributes.position.values.length;g=e._offsetAttribute===mn.NONE?0:1;let T=new Uint8Array(E/3).fill(g);a.geometry.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}let b=Dn.combineInstances(c)[0],C=ue.fromVertices(b.attributes.position.values);return new pt({attributes:b.attributes,indices:b.indices,primitiveType:b.primitiveType,boundingSphere:C,offsetAttribute:e._offsetAttribute})};var aY=mE;var tge="Entity polygons cannot have both height and perPositionHeight.  height will be ignored",nge="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",ige=new D,oge=m.ZERO,rge=new m,sge=new de,Rrt=[],Grt=new M;function Vrt(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.textureCoordinates=void 0}function xu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new Vrt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(xu.prototype=Object.create(ii.prototype),xu.prototype.constructor=xu);xu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,ige)),l(s)||(s=D.WHITE),o.color=qt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,oge,rge)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new sY(i):r=new jA(i),new Bt({id:t,geometry:r,attributes:o})};xu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,ige),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(o),distanceDisplayCondition:jn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,oge,rge)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Zm(i):a=new aY(i),new Bt({id:t,geometry:a,attributes:s})};xu.prototype._computeCenter=function(e,t){let n=K.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=Ss.fromPoints(i,o),s=r.projectPointsOntoPlane(i,Rrt),a=s.length,c=0,d=a-1,u=new M;for(let p=0;p<a;d=p++){let g=s[p],f=s[d],b=g.x*f.y-f.x*g.y,C=M.add(g,f,Grt);C=M.multiplyByScalar(C,b,C),u=M.add(u,C,u),c+=b}let h=1/(c*3);return u=M.multiplyByScalar(u,h,u),r.projectPointOntoEllipsoid(u,t)};xu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Ei.prototype._isHidden.call(this,e,t)};xu.prototype._isOnTerrain=function(e,t){let n=ii.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Ke.MINIMUM_VALUE):!0);return n&&!o};xu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.stRotation)||!K.isConstant(t.textureCoordinates)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.perPositionHeight)||!K.isConstant(t.closeTop)||!K.isConstant(t.closeBottom)||!K.isConstant(t.zIndex)||!K.isConstant(t.arcType)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};xu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ke.MINIMUM_VALUE),r=K.getValueOrUndefined(t.height,Ke.MINIMUM_VALUE),s=K.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,tt.NONE),a=K.getValueOrUndefined(t.extrudedHeight,Ke.MINIMUM_VALUE),c=K.getValueOrDefault(t.extrudedHeightReference,Ke.MINIMUM_VALUE,tt.NONE),d=K.getValueOrDefault(t.perPositionHeight,Ke.MINIMUM_VALUE,!1);r=ii.getGeometryHeight(r,s);let u;if(d?(l(r)&&(r=void 0,At(tge)),s!==tt.NONE&&d&&(r=void 0,At(nge))):(l(a)&&!l(r)&&(r=0),u=ii.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=K.getValueOrUndefined(t.granularity,Ke.MINIMUM_VALUE),i.stRotation=K.getValueOrUndefined(t.stRotation,Ke.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=K.getValueOrDefault(t.closeTop,Ke.MINIMUM_VALUE,!0),i.closeBottom=K.getValueOrDefault(t.closeBottom,Ke.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=K.getValueOrDefault(t.arcType,Ke.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=K.getValueOrUndefined(t.textureCoordinates,Ke.MINIMUM_VALUE),a=ii.getGeometryExtrudedHeight(a,c),a===ii.CLAMP_TO_GROUND){let h=jA.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,sge);a=Zi.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=a};xu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};xu.DynamicGeometryUpdater=E_;function E_(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(E_.prototype=Object.create(Ci.prototype),E_.prototype.constructor=E_);E_.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Ci.prototype._isHidden.call(this,e,t,n)};E_.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=K.getValueOrUndefined(t.hierarchy,n);let o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,tt.NONE),s=K.getValueOrDefault(t.extrudedHeightReference,n,tt.NONE),a=K.getValueOrUndefined(t.extrudedHeight,n),c=K.getValueOrUndefined(t.perPositionHeight,n);o=ii.getGeometryHeight(o,s);let d;if(c?(l(o)&&(o=void 0,At(tge)),r!==tt.NONE&&c&&(o=void 0,At(nge))):(l(a)&&!l(o)&&(o=0),d=ii.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=K.getValueOrUndefined(t.granularity,n),i.stRotation=K.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=K.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=K.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=K.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=K.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=d,i.height=o,i.arcType=K.getValueOrDefault(t.arcType,n,ln.GEODESIC),a=ii.getGeometryExtrudedHeight(a,s),a===ii.CLAMP_TO_GROUND){let u=jA.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,sge);a=Zi.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var cY=xu;var Vxi=y(x(),1);var Oyi=y(x(),1);function Lrt(e,t,n,i){let o=new yn;i.position&&(o.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=Si.triangulate(t),d=(a-1)*r*6+c.length*2,u=Pe.createTypedArray(s,d),h,p,g,f,b,C,E=r*2,T=0;for(h=0;h<a-1;h++){for(p=0;p<r-1;p++)g=p*2+h*r*2,C=g+E,f=g+1,b=f+E,u[T++]=f,u[T++]=g,u[T++]=b,u[T++]=b,u[T++]=g,u[T++]=C;g=r*2-2+h*r*2,f=g+1,b=f+E,C=g+E,u[T++]=f,u[T++]=g,u[T++]=b,u[T++]=b,u[T++]=g,u[T++]=C}if(i.st||i.tangent||i.bitangent){let R=new Float32Array(s*2),L=1/(a-1),W=1/n.height,B=n.height/2,Y,N,A=0;for(h=0;h<a;h++){for(Y=h*L,N=W*(t[0].y+B),R[A++]=Y,R[A++]=N,p=1;p<r;p++)N=W*(t[p].y+B),R[A++]=Y,R[A++]=N,R[A++]=Y,R[A++]=N;N=W*(t[0].y+B),R[A++]=Y,R[A++]=N}for(p=0;p<r;p++)Y=0,N=W*(t[p].y+B),R[A++]=Y,R[A++]=N;for(p=0;p<r;p++)Y=(a-1)*L,N=W*(t[p].y+B),R[A++]=Y,R[A++]=N;o.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:new Float32Array(R)})}let S=s-r*2;for(h=0;h<c.length;h+=3){let R=c[h]+S,L=c[h+1]+S,W=c[h+2]+S;u[T++]=R,u[T++]=L,u[T++]=W,u[T++]=W+r,u[T++]=L+r,u[T++]=R+r}let _=new pt({attributes:o,indices:u,boundingSphere:ue.fromVertices(e),primitiveType:Be.TRIANGLES});if(i.normal&&(_=Dn.computeNormal(_)),i.tangent||i.bitangent){try{_=Dn.computeTangentAndBitangent(_)}catch{At("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(_.attributes.tangent=void 0),i.bitangent||(_.attributes.bitangent=void 0),i.st||(_.attributes.st=void 0)}return _}function dY(e){e=e??Q.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._cornerType=e.cornerType??Hi.ROUNDED,this._vertexFormat=we.clone(e.vertexFormat??we.DEFAULT),this._granularity=e.granularity??V.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*M.packedLength,this.packedLength=i+ie.packedLength+we.packedLength+2}dY.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=M.packedLength)M.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var age=ie.clone(ie.UNIT_SPHERE),cge=new we,lY={polylinePositions:void 0,shapePositions:void 0,ellipsoid:age,vertexFormat:cge,cornerType:void 0,granularity:void 0};dY.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=M.packedLength)s[i]=M.unpack(e,t);let a=ie.unpack(e,t,age);t+=ie.packedLength;let c=we.unpack(e,t,cge);t+=we.packedLength;let d=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._vertexFormat=we.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(lY.polylinePositions=r,lY.shapePositions=s,lY.cornerType=d,lY.granularity=u,new dY(lY))};var Wrt=new $e;dY.createGeometry=function(e){let t=e._positions,n=Mo(t,m.equalsEpsilon),i=e._shape;if(i=qh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;Si.computeWindingOrder2D(i)===Ns.CLOCKWISE&&i.reverse();let o=$e.fromPoints(i,Wrt),r=qh.computePositions(n,i,o,e,!0);return Lrt(r,i,o,e._vertexFormat)};var uY=dY;var hxi=y(x(),1);function Frt(e,t){let n=new yn;n.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Pe.createTypedArray(o,2*i*(s+1)),c,d,u=0;c=0;let h=c*i;for(d=0;d<i-1;d++)a[u++]=d+h,a[u++]=d+h+1;for(a[u++]=i-1+h,a[u++]=h,c=s-1,h=c*i,d=0;d<i-1;d++)a[u++]=d+h,a[u++]=d+h+1;for(a[u++]=i-1+h,a[u++]=h,c=0;c<s-1;c++){let g=i*c,f=g+i;for(d=0;d<i;d++)a[u++]=d+g,a[u++]=d+f}return new pt({attributes:n,indices:Pe.createTypedArray(o,a),boundingSphere:ue.fromVertices(e),primitiveType:Be.LINES})}function hY(e){e=e??Q.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._cornerType=e.cornerType??Hi.ROUNDED,this._granularity=e.granularity??V.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*M.packedLength,this.packedLength=i+ie.packedLength+2}hY.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=M.packedLength)M.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var lge=ie.clone(ie.UNIT_SPHERE),mY={polylinePositions:void 0,shapePositions:void 0,ellipsoid:lge,height:void 0,cornerType:void 0,granularity:void 0};hY.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=M.packedLength)s[i]=M.unpack(e,t);let a=ie.unpack(e,t,lge);t+=ie.packedLength;let c=e[t++],d=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=d,n):(mY.polylinePositions=r,mY.shapePositions=s,mY.cornerType=c,mY.granularity=d,new hY(mY))};var Brt=new $e;hY.createGeometry=function(e){let t=e._positions,n=Mo(t,m.equalsEpsilon),i=e._shape;if(i=qh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;Si.computeWindingOrder2D(i)===Ns.CLOCKWISE&&i.reverse();let o=$e.fromPoints(i,Brt),r=qh.computePositions(n,i,o,e,!1);return Frt(r,i)};var fY=hY;var dge=new D;function wrt(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function Sp(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new wrt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Sp.prototype=Object.create(Ei.prototype),Sp.prototype.constructor=Sp);Sp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=jn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,dge)),l(c)||(c=D.WHITE),o=qt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Bt({id:t,geometry:new uY(this._options),attributes:i})};Sp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,dge),o=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new fY(this._options),attributes:{show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(i),distanceDisplayCondition:jn.fromDistanceDisplayCondition(o)}})};Sp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Ei.prototype._isHidden.call(this,e,t)};Sp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!K.isConstant(t.granularity)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.cornerType)};Sp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Kt;o.vertexFormat=r?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ke.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ke.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Ke.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Ke.MINIMUM_VALUE):void 0};Sp.DynamicGeometryUpdater=T_;function T_(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(T_.prototype=Object.create(Ci.prototype),T_.prototype.constructor=T_);T_.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Ci.prototype._isHidden.call(this,e,t,n)};T_.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=K.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=K.getValueOrUndefined(t.shape,n),i.granularity=K.getValueOrUndefined(t.granularity,n),i.cornerType=K.getValueOrUndefined(t.cornerType,n)};var pY=Sp;var ZCi=y(x(),1);var nCi=y(x(),1);var g4=new m,hge=new m,fge=new m,pge=new m,Age=new de,Yrt=new M,Nrt=new ue,Xrt=new ue;function gge(e,t){let n=new pt({attributes:new yn,primitiveType:Be.TRIANGLES});return n.attributes.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function Prt(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,d=pge,u=fge,h=hge;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=m.fromArray(e,p,g4),f=c+1,b=c+2;h=n.geodeticSurfaceNormal(g,h),(t.tangent||t.bitangent)&&(m.cross(m.UNIT_Z,h,u),$.multiplyByVector(i,u,u),m.normalize(u,u),t.bitangent&&m.normalize(m.cross(h,u,d),d)),t.normal&&(r[c]=h.x,r[f]=h.y,r[b]=h.z),t.tangent&&(s[c]=u.x,s[f]=u.y,s[b]=u.z),t.bitangent&&(a[c]=d.x,a[f]=d.y,a[b]=d.z),c+=3}return gge(t,{positions:e,normals:r,tangents:s,bitangents:a})}var b4=new m,bge=new m;function Mrt(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,d=0,u=!0,h=pge,p=fge,g=hge;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let b=m.fromArray(e,f,g4),C=m.fromArray(e,(f+6)%i,b4);if(u){let E=m.fromArray(e,(f+3)%i,bge);m.subtract(C,b,C),m.subtract(E,b,E),g=m.normalize(m.cross(E,C,g),g),u=!1}m.equalsEpsilon(C,b,V.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(b,h),t.tangent&&(p=m.normalize(m.cross(h,g,p),p))),t.normal&&(o[a++]=g.x,o[a++]=g.y,o[a++]=g.z,o[a++]=g.x,o[a++]=g.y,o[a++]=g.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[d++]=h.x,s[d++]=h.y,s[d++]=h.z,s[d++]=h.x,s[d++]=h.y,s[d++]=h.z)}return gge(t,{positions:e,normals:o,tangents:r,bitangents:s})}function yge(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,d=o,u=o,h=0;s&&(c=1,u-=1,h+=1),a&&(d-=1,u-=1,h+=1),h+=r*u;let p=n.position?new Float64Array(h*3):void 0,g=n.st?new Float32Array(h*2):void 0,f=0,b=0,C=g4,E=Yrt,T=Number.MAX_VALUE,S=Number.MAX_VALUE,_=-Number.MAX_VALUE,R=-Number.MAX_VALUE;for(let I=c;I<d;++I)for(let Z=0;Z<r;++Z)aa.computePosition(t,i,n.st,I,Z,C,E),p[f++]=C.x,p[f++]=C.y,p[f++]=C.z,n.st&&(g[b++]=E.x,g[b++]=E.y,T=Math.min(T,E.x),S=Math.min(S,E.y),_=Math.max(_,E.x),R=Math.max(R,E.y));if(s&&(aa.computePosition(t,i,n.st,0,0,C,E),p[f++]=C.x,p[f++]=C.y,p[f++]=C.z,n.st&&(g[b++]=E.x,g[b++]=E.y,T=E.x,S=E.y,_=E.x,R=E.y)),a&&(aa.computePosition(t,i,n.st,o-1,0,C,E),p[f++]=C.x,p[f++]=C.y,p[f]=C.z,n.st&&(g[b++]=E.x,g[b]=E.y,T=Math.min(T,E.x),S=Math.min(S,E.y),_=Math.max(_,E.x),R=Math.max(R,E.y))),n.st&&(T<0||S<0||_>1||R>1))for(let I=0;I<g.length;I+=2)g[I]=(g[I]-T)/(_-T),g[I+1]=(g[I+1]-S)/(R-S);let L=Prt(p,n,i,t.tangentRotationMatrix),W=6*(r-1)*(u-1);s&&(W+=3*(r-1)),a&&(W+=3*(r-1));let B=Pe.createTypedArray(h,W),Y=0,N=0,A;for(A=0;A<u-1;++A){for(let I=0;I<r-1;++I){let Z=Y,G=Z+r,w=G+1,X=Z+1;B[N++]=Z,B[N++]=G,B[N++]=X,B[N++]=X,B[N++]=G,B[N++]=w,++Y}++Y}if(s||a){let I=h-1,Z=h-1;s&&a&&(I=h-2);let G,w;if(Y=0,s)for(A=0;A<r-1;A++)G=Y,w=G+1,B[N++]=I,B[N++]=G,B[N++]=w,++Y;if(a)for(Y=(u-1)*r,A=0;A<r-1;A++)G=Y,w=G+1,B[N++]=G,B[N++]=Z,B[N++]=w,++Y}return L.indices=B,n.st&&(L.attributes.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:g})),L}function S_(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function I_(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var y4=new we;function Urt(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,d=t.width,u;if(n){let Oe=we.clone(o,y4);Oe.normal=!0,e._vertexFormat=Oe}let h=yge(e,t);n&&(e._vertexFormat=o);let p=Si.scaleToGeodeticHeight(h.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,f=g*2,b=new Float64Array(f);b.set(p);let C=Si.scaleToGeodeticHeight(h.attributes.position.values,r,a);b.set(C,g),h.attributes.position.values=b;let E=o.normal?new Float32Array(f):void 0,T=o.tangent?new Float32Array(f):void 0,S=o.bitangent?new Float32Array(f):void 0,_=o.st?new Float32Array(f/3*2):void 0,R,L;if(o.normal){for(L=h.attributes.normal.values,E.set(L),u=0;u<g;u++)L[u]=-L[u];E.set(L,g),h.attributes.normal.values=E}if(n){L=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let Oe=new Float32Array(f);for(u=0;u<g;u++)L[u]=-L[u];Oe.set(L,g),h.attributes.extrudeDirection=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:Oe})}let W,B=l(i);if(B){let Oe=g/3*2,it=new Uint8Array(Oe);i===mn.TOP?it=it.fill(1,0,Oe/2):(W=i===mn.NONE?0:1,it=it.fill(W)),h.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:it})}if(o.tangent){let Oe=h.attributes.tangent.values;for(T.set(Oe),u=0;u<g;u++)Oe[u]=-Oe[u];T.set(Oe,g),h.attributes.tangent.values=T}if(o.bitangent){let Oe=h.attributes.bitangent.values;S.set(Oe),S.set(Oe,g),h.attributes.bitangent.values=S}o.st&&(R=h.attributes.st.values,_.set(R),_.set(R,g/3*2),h.attributes.st.values=_);let Y=h.indices,N=Y.length,A=g/3,I=Pe.createTypedArray(f/3,N*2);for(I.set(Y),u=0;u<N;u+=3)I[u+N]=Y[u+2]+A,I[u+1+N]=Y[u+1]+A,I[u+2+N]=Y[u]+A;h.indices=I;let Z=t.northCap,G=t.southCap,w=c,X=2,v=0,U=4,k=4;Z&&(X-=1,w-=1,v+=1,U-=2,k-=1),G&&(X-=1,w-=1,v+=1,U-=2,k-=1),v+=X*d+2*w-U;let P=(v+k)*2,O=new Float64Array(P*3),H=n?new Float32Array(P*3):void 0,ee=B?new Uint8Array(P):void 0,z=o.st?new Float32Array(P*2):void 0,te=i===mn.TOP;B&&!te&&(W=i===mn.ALL?1:0,ee=ee.fill(W));let q=0,me=0,ye=0,oe=0,xe=d*w,Ee;for(u=0;u<xe;u+=d)Ee=u*3,O=S_(O,q,Ee,p,C),q+=6,o.st&&(z=I_(z,me,u*2,R),me+=4),n&&(ye+=3,H[ye++]=L[Ee],H[ye++]=L[Ee+1],H[ye++]=L[Ee+2]),te&&(ee[oe++]=1,oe+=1);if(G){let Oe=Z?xe+1:xe;for(Ee=Oe*3,u=0;u<2;u++)O=S_(O,q,Ee,p,C),q+=6,o.st&&(z=I_(z,me,Oe*2,R),me+=4),n&&(ye+=3,H[ye++]=L[Ee],H[ye++]=L[Ee+1],H[ye++]=L[Ee+2]),te&&(ee[oe++]=1,oe+=1)}else for(u=xe-d;u<xe;u++)Ee=u*3,O=S_(O,q,Ee,p,C),q+=6,o.st&&(z=I_(z,me,u*2,R),me+=4),n&&(ye+=3,H[ye++]=L[Ee],H[ye++]=L[Ee+1],H[ye++]=L[Ee+2]),te&&(ee[oe++]=1,oe+=1);for(u=xe-1;u>0;u-=d)Ee=u*3,O=S_(O,q,Ee,p,C),q+=6,o.st&&(z=I_(z,me,u*2,R),me+=4),n&&(ye+=3,H[ye++]=L[Ee],H[ye++]=L[Ee+1],H[ye++]=L[Ee+2]),te&&(ee[oe++]=1,oe+=1);if(Z){let Oe=xe;for(Ee=Oe*3,u=0;u<2;u++)O=S_(O,q,Ee,p,C),q+=6,o.st&&(z=I_(z,me,Oe*2,R),me+=4),n&&(ye+=3,H[ye++]=L[Ee],H[ye++]=L[Ee+1],H[ye++]=L[Ee+2]),te&&(ee[oe++]=1,oe+=1)}else for(u=d-1;u>=0;u--)Ee=u*3,O=S_(O,q,Ee,p,C),q+=6,o.st&&(z=I_(z,me,u*2,R),me+=4),n&&(ye+=3,H[ye++]=L[Ee],H[ye++]=L[Ee+1],H[ye++]=L[Ee+2]),te&&(ee[oe++]=1,oe+=1);let Le=Mrt(O,o,a);o.st&&(Le.attributes.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:z})),n&&(Le.attributes.extrudeDirection=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:H})),B&&(Le.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:ee}));let Se=Pe.createTypedArray(P,v*6),Fe,Ue,De,Je;g=O.length/3;let St=0;for(u=0;u<g-1;u+=2){Fe=u,Je=(Fe+2)%g;let Oe=m.fromArray(O,Fe*3,b4),it=m.fromArray(O,Je*3,bge);m.equalsEpsilon(Oe,it,V.EPSILON10)||(Ue=(Fe+1)%g,De=(Ue+2)%g,Se[St++]=Fe,Se[St++]=Ue,Se[St++]=Je,Se[St++]=Je,Se[St++]=Ue,Se[St++]=De)}return Le.indices=Se,Le=Dn.combineInstances([new Bt({geometry:h}),new Bt({geometry:Le})]),Le[0]}var Drt=[new m,new m,new m,new m],xge=new pe,vrt=new pe;function x4(e,t,n,i,o){if(n===0)return de.clone(e,o);let r=aa.computeOptions(e,t,n,0,Age,xge),s=r.height,a=r.width,c=Drt;return aa.computePosition(r,i,!1,0,0,c[0]),aa.computePosition(r,i,!1,0,a-1,c[1]),aa.computePosition(r,i,!1,s-1,0,c[2]),aa.computePosition(r,i,!1,s-1,a-1,c[3]),de.fromCartesianArray(c,i,o)}function Ip(e){e=e??Q.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=de.clone(t),this._granularity=e.granularity??V.RADIANS_PER_DEGREE,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=we.clone(e.vertexFormat??we.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Ip.packedLength=de.packedLength+ie.packedLength+we.packedLength+7;Ip.pack=function(e,t,n){return n=n??0,de.pack(e._rectangle,t,n),n+=de.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var Cge=new de,Ege=ie.clone(ie.UNIT_SPHERE),sy={rectangle:Cge,ellipsoid:Ege,vertexFormat:y4,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Ip.unpack=function(e,t,n){t=t??0;let i=de.unpack(e,t,Cge);t+=de.packedLength;let o=ie.unpack(e,t,Ege);t+=ie.packedLength;let r=we.unpack(e,t,y4);t+=we.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++]===1,p=e[t];return l(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=we.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=d,n._extrudedHeight=u,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(sy.granularity=s,sy.height=a,sy.rotation=c,sy.stRotation=d,sy.extrudedHeight=u,sy.shadowVolume=h,sy.offsetAttribute=p===-1?void 0:p,new Ip(sy))};Ip.computeRectangle=function(e,t){e=e??Q.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??V.RADIANS_PER_DEGREE,o=e.ellipsoid??ie.default,r=e.rotation??0;return x4(n,i,r,o,t)};var krt=new $,uge=new Me,Qrt=new pe;Ip.createGeometry=function(e){if(V.equalsEpsilon(e._rectangle.north,e._rectangle.south,V.EPSILON10)||V.equalsEpsilon(e._rectangle.east,e._rectangle.west,V.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=aa.computeOptions(t,e._granularity,i,o,Age,xge,vrt),a=krt;if(o!==0||i!==0){let g=de.center(t,Qrt),f=n.geodeticSurfaceNormalCartographic(g,b4);Me.fromAxisAngle(f,-o,uge),$.fromQuaternion(uge,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,d=e._extrudedHeight,u=!V.equalsEpsilon(c,d,0,V.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let h,p;if(t=e._rectangle,u){h=Urt(e,s);let g=ue.fromRectangle3D(t,n,c,Xrt),f=ue.fromRectangle3D(t,n,d,Nrt);p=ue.union(g,f)}else{if(h=yge(e,s),h.attributes.position.values=Si.scaleToGeodeticHeight(h.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=h.attributes.position.values.length,f=e._offsetAttribute===mn.NONE?0:1,b=new Uint8Array(g/3).fill(f);h.attributes.applyOffset=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}p=ue.fromRectangle3D(t,n,c)}return r.position||delete h.attributes.position,new pt({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Ip.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Ip({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:we.POSITION_ONLY,shadowVolume:!0})};var mge=new de,Ort=[new M,new M,new M],zrt=new ki,Hrt=new pe;function Krt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=de.clone(e._rectangle,mge),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=x4(t,n,o,i,mge),s=Ort;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=ki.fromRotation(e._stRotation,zrt),d=de.center(a,Hrt);for(let f=0;f<3;++f){let b=s[f];b.x-=d.longitude,b.y-=d.latitude,ki.multiplyByVector(c,b,b),b.x+=d.longitude,b.y+=d.latitude,b.x=(b.x-a.west)/a.width,b.y=(b.y-a.south)/a.height}let u=s[0],h=s[1],p=s[2],g=new Array(6);return M.pack(u,g),M.pack(h,g,2),M.pack(p,g,4),g}Object.defineProperties(Ip.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=x4(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Krt(this)),this._textureCoordinateRotationPoints}}});var hE=Ip;var Tge=new D,Sge=m.ZERO,Ige=new m,_ge=new de,Jrt=new de,jrt=new pe;function qrt(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 cf(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new qrt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(cf.prototype=Object.create(ii.prototype),cf.prototype.constructor=cf);cf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Tge)),l(o)||(o=D.WHITE),i.color=qt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Sge,Ige))),new Bt({id:t,geometry:new hE(this._options),attributes:i})};cf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,Tge),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(i),distanceDisplayCondition:jn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Sge,Ige))),new Bt({id:t,geometry:new DC(this._options),attributes:r})};cf.prototype._computeCenter=function(e,t){let n=K.getValueOrUndefined(this._entity.rectangle.coordinates,e,Jrt);if(!l(n))return;let i=de.center(n,jrt);return pe.toCartesian(i,ie.default,t)};cf.prototype._isHidden=function(e,t){return!l(t.coordinates)||Ei.prototype._isHidden.call(this,e,t)};cf.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.stRotation)||!K.isConstant(t.rotation)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.zIndex)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};cf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=K.getValueOrUndefined(t.height,Ke.MINIMUM_VALUE),o=K.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,tt.NONE),r=K.getValueOrUndefined(t.extrudedHeight,Ke.MINIMUM_VALUE),s=K.getValueOrDefault(t.extrudedHeightReference,Ke.MINIMUM_VALUE,tt.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ke.MINIMUM_VALUE,a.rectangle),a.granularity=K.getValueOrUndefined(t.granularity,Ke.MINIMUM_VALUE),a.stRotation=K.getValueOrUndefined(t.stRotation,Ke.MINIMUM_VALUE),a.rotation=K.getValueOrUndefined(t.rotation,Ke.MINIMUM_VALUE),a.offsetAttribute=ii.computeGeometryOffsetAttribute(i,o,r,s),a.height=ii.getGeometryHeight(i,o),r=ii.getGeometryExtrudedHeight(r,s),r===ii.CLAMP_TO_GROUND&&(r=Zi.getMinimumMaximumHeights(hE.computeRectangle(a,_ge)).minimumTerrainHeight),a.extrudedHeight=r};cf.DynamicGeometryUpdater=__;function __(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(__.prototype=Object.create(Ci.prototype),__.prototype.constructor=__);__.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ci.prototype._isHidden.call(this,e,t,n)};__.prototype._setOptions=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,tt.NONE),s=K.getValueOrUndefined(t.extrudedHeight,n),a=K.getValueOrDefault(t.extrudedHeightReference,n,tt.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=K.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=K.getValueOrUndefined(t.granularity,n),i.stRotation=K.getValueOrUndefined(t.stRotation,n),i.rotation=K.getValueOrUndefined(t.rotation,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(o,r,s,a),i.height=ii.getGeometryHeight(o,r),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Zi.getMinimumMaximumHeights(hE.computeRectangle(i,_ge)).minimumTerrainHeight),i.extrudedHeight=s};var AY=cf;var GEi=y(x(),1);var jCi=y(x(),1);var wCi=y(x(),1);var Zge={};function $rt(e,t){return V.equalsEpsilon(e.latitude,t.latitude,V.EPSILON10)&&V.equalsEpsilon(e.longitude,t.longitude,V.EPSILON10)}var est=new pe,tst=new pe;function nst(e,t,n,i){t=Mo(t,m.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),d=new Array(o),u=t[0];a[0]=u;let h=e.cartesianToCartographic(u,est);s&&(h.height=n[0]),c[0]=h.height,r?d[0]=i[0]:d[0]=0;let p=c[0],g=d[0],f=p===g,b=1;for(let C=1;C<o;++C){let E=t[C],T=e.cartesianToCartographic(E,tst);s&&(T.height=n[C]),f=f&&T.height===0,$rt(h,T)?h.height<T.height&&(c[b-1]=T.height):(a[b]=E,c[b]=T.height,r?d[b]=i[C]:d[b]=0,f=f&&c[b]===d[b],pe.clone(T,h),++b)}if(!(f||b<2))return a.length=b,c.length=b,d.length=b,{positions:a,topHeights:c,bottomHeights:d}}var ist=new Array(2),ost=new Array(2),rst={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Zge.computePositions=function(e,t,n,i,o,r){let s=nst(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,d,u,h=V.chordLength(o,e.maximumRadius),p=rst;if(p.minDistance=h,p.ellipsoid=e,r){let g=0,f;for(f=0;f<a-1;f++)g+=zi.numberOfPoints(t[f],t[f+1],h)+1;d=new Float64Array(g*3),u=new Float64Array(g*3);let b=ist,C=ost;p.positions=b,p.height=C;let E=0;for(f=0;f<a-1;f++){b[0]=t[f],b[1]=t[f+1],C[0]=n[f],C[1]=n[f+1];let T=zi.generateArc(p);d.set(T,E),C[0]=i[f],C[1]=i[f+1],u.set(zi.generateArc(p),E),E+=T.length}}else p.positions=t,p.height=n,d=new Float64Array(zi.generateArc(p)),p.height=i,u=new Float64Array(zi.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:c}};var fE=Zge;var C4=new m,x9=new m,sst=new m,Rge=new m,ast=new m,cst=new m,lst=new m;function pE(e){e=e??Q.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??we.DEFAULT,r=e.granularity??V.RADIANS_PER_DEGREE,s=e.ellipsoid??ie.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=we.clone(o),this._granularity=r,this._ellipsoid=ie.clone(s),this._workerName="createWallGeometry";let a=1+t.length*m.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ie.packedLength+we.packedLength+1}pE.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n]=e._granularity,t};var Gge=ie.clone(ie.UNIT_SPHERE),Vge=new we,gY={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Gge,vertexFormat:Vge,granularity:void 0};pE.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ie.unpack(e,t,Gge);t+=ie.packedLength;let d=we.unpack(e,t,Vge);t+=we.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ie.clone(c,n._ellipsoid),n._vertexFormat=we.clone(d,n._vertexFormat),n._granularity=u,n):(gY.positions=r,gY.minimumHeights=s,gY.maximumHeights=a,gY.granularity=u,new pE(gY))};pE.fromConstantHeights=function(e){e=e??Q.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new pE(c)};pE.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=fE.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,d=a.topPositions,u=a.numCorners,h=d.length,p=h*2,g=o.position?new Float64Array(p):void 0,f=o.normal?new Float32Array(p):void 0,b=o.tangent?new Float32Array(p):void 0,C=o.bitangent?new Float32Array(p):void 0,E=o.st?new Float32Array(p/3*2):void 0,T=0,S=0,_=0,R=0,L=0,W=lst,B=cst,Y=ast,N=!0;h/=3;let A,I=0,Z=1/(h-u-1);for(A=0;A<h;++A){let U=A*3,k=m.fromArray(d,U,C4),P=m.fromArray(c,U,x9);if(o.position&&(g[T++]=P.x,g[T++]=P.y,g[T++]=P.z,g[T++]=k.x,g[T++]=k.y,g[T++]=k.z),o.st&&(E[L++]=I,E[L++]=0,E[L++]=I,E[L++]=1),o.normal||o.tangent||o.bitangent){let O=m.clone(m.ZERO,Rge),H=m.subtract(k,s.geodeticSurfaceNormal(k,x9),x9);if(A+1<h&&(O=m.fromArray(d,U+3,Rge)),N){let ee=m.subtract(O,k,sst),z=m.subtract(H,k,C4);W=m.normalize(m.cross(z,ee,W),W),N=!1}m.equalsEpsilon(k,O,V.EPSILON10)?N=!0:(I+=Z,o.tangent&&(B=m.normalize(m.subtract(O,k,B),B)),o.bitangent&&(Y=m.normalize(m.cross(W,B,Y),Y))),o.normal&&(f[S++]=W.x,f[S++]=W.y,f[S++]=W.z,f[S++]=W.x,f[S++]=W.y,f[S++]=W.z),o.tangent&&(b[R++]=B.x,b[R++]=B.y,b[R++]=B.z,b[R++]=B.x,b[R++]=B.y,b[R++]=B.z),o.bitangent&&(C[_++]=Y.x,C[_++]=Y.y,C[_++]=Y.z,C[_++]=Y.x,C[_++]=Y.y,C[_++]=Y.z)}}let G=new yn;o.position&&(G.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(G.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(G.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),o.bitangent&&(G.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:C})),o.st&&(G.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:E}));let w=p/3;p-=6*(u+1);let X=Pe.createTypedArray(w,p),v=0;for(A=0;A<w-2;A+=2){let U=A,k=A+2,P=m.fromArray(g,U*3,C4),O=m.fromArray(g,k*3,x9);if(m.equalsEpsilon(P,O,V.EPSILON10))continue;let H=A+1,ee=A+3;X[v++]=H,X[v++]=U,X[v++]=ee,X[v++]=ee,X[v++]=U,X[v++]=k}return new pt({attributes:G,indices:X,primitiveType:Be.TRIANGLES,boundingSphere:new ue.fromVertices(g)})};var bY=pE;var mEi=y(x(),1);var Lge=new m,Wge=new m;function AE(e){e=e??Q.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??V.RADIANS_PER_DEGREE,r=e.ellipsoid??ie.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ie.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*m.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ie.packedLength+1}AE.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n]=e._granularity,t};var Fge=ie.clone(ie.UNIT_SPHERE),yY={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Fge,granularity:void 0};AE.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ie.unpack(e,t,Fge);t+=ie.packedLength;let d=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ie.clone(c,n._ellipsoid),n._granularity=d,n):(yY.positions=r,yY.minimumHeights=s,yY.maximumHeights=a,yY.granularity=d,new AE(yY))};AE.fromConstantHeights=function(e){e=e??Q.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new AE(c)};AE.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=fE.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,d=c.length,u=d*2,h=new Float64Array(u),p=0;d/=3;let g;for(g=0;g<d;++g){let T=g*3,S=m.fromArray(c,T,Lge),_=m.fromArray(a,T,Wge);h[p++]=_.x,h[p++]=_.y,h[p++]=_.z,h[p++]=S.x,h[p++]=S.y,h[p++]=S.z}let f=new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:h})}),b=u/3;u=2*b-4+b;let C=Pe.createTypedArray(b,u),E=0;for(g=0;g<b-2;g+=2){let T=g,S=g+2,_=m.fromArray(h,T*3,Lge),R=m.fromArray(h,S*3,Wge);if(m.equalsEpsilon(_,R,V.EPSILON10))continue;let L=g+1,W=g+3;C[E++]=L,C[E++]=T,C[E++]=L,C[E++]=W,C[E++]=T,C[E++]=S}return C[E++]=b-2,C[E++]=b-1,new pt({attributes:f,indices:C,primitiveType:Be.LINES,boundingSphere:new ue.fromVertices(h)})};var xY=AE;var Bge=new D;function dst(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function lf(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new dst(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(lf.prototype=Object.create(Ei.prototype),lf.prototype.constructor=lf);lf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=jn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Bge)),l(c)||(c=D.WHITE),o=qt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Bt({id:t,geometry:new bY(this._options),attributes:i})};lf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,Bge),o=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new xY(this._options),attributes:{show:new Zn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:qt.fromColor(i),distanceDisplayCondition:jn.fromDistanceDisplayCondition(o)}})};lf.prototype._isHidden=function(e,t){return!l(t.positions)||Ei.prototype._isHidden.call(this,e,t)};lf.prototype._getIsClosed=function(e){return!1};lf.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!K.isConstant(t.minimumHeights)||!K.isConstant(t.maximumHeights)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.granularity)};lf.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Kt,s=this._options;s.vertexFormat=r?pn.VERTEX_FORMAT:Io.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ke.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Ke.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Ke.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(Ke.MINIMUM_VALUE):void 0};lf.DynamicGeometryUpdater=Z_;function Z_(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(Z_.prototype=Object.create(Ci.prototype),Z_.prototype.constructor=Z_);Z_.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ci.prototype._isHidden.call(this,e,t,n)};Z_.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=K.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=K.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=K.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=K.getValueOrUndefined(t.granularity,n)};var CY=lf;var gE=[DL,Mw,Lw,$w,tY,oY,cY,pY,AY,CY];function bE(e,t){this.entity=e,this.scene=t;let n=new Array(gE.length),i=new Ce,o=new Xr;for(let r=0;r<n.length;r++){let s=new gE[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(bE.prototype._onEntityPropertyChanged,this)}bE.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};bE.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};bE.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),fe(this)};bE.registerUpdater=function(e){gE.includes(e)||gE.push(e)};bE.unregisterUpdater=function(e){if(gE.includes(e)){let t=gE.indexOf(e);gE.splice(t,1)}};var yE=bE;var sTi=y(x(),1);var wge=new D,ust=new Mt,mst=new Mt,hst=m.ZERO,fst=new m;function df(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.updaters=new Ft,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.subscriptions=new Ft,this.showsUpdated=new Ft,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(df.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}df.prototype.onMaterialChanged=function(){this.invalidated=!0};df.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};df.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!K.isConstant(e.distanceDisplayConditionProperty)||!K.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};df.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};df.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Nn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),h=this.attributes.get(u.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!d.fillMaterialProperty.isConstant||c){let C=d.fillMaterialProperty.color,E=K.getValueOrDefault(C,e,D.WHITE,wge);D.equals(h._lastColor,E)||(h._lastColor=D.clone(E,h._lastColor),h.color=qt.toValue(E,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=d))}if(l(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof Kt&&(!d.depthFailMaterialProperty.isConstant||c)){let C=d.depthFailMaterialProperty.color,E=K.getValueOrDefault(C,e,D.WHITE,wge);D.equals(h._lastDepthFailColor,E)||(h._lastDepthFailColor=D.clone(E,h._lastDepthFailColor),h.depthFailColor=qt.toValue(E,h.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Zn.toValue(p,h.show));let f=d.distanceDisplayConditionProperty;if(!K.isConstant(f)){let C=K.getValueOrDefault(f,e,mst,ust);Mt.equals(C,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(C,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=jn.toValue(C,h.distanceDisplayCondition))}let b=d.terrainOffsetProperty;if(!K.isConstant(b)){let C=K.getValueOrDefault(b,e,hst,fst);m.equals(C,h._lastOffset)||(h._lastOffset=m.clone(C,h._lastOffset),h.offset=go.toValue(C,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};df.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Zn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};df.prototype.contains=function(e){return this.updaters.contains(e.id)};df.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return gt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?gt.FAILED:(i.boundingSphere.clone(t),gt.DONE)};df.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function R_(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}R_.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new df(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Yge(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}R_.prototype.remove=function(e){Yge(this._solidItems,e)||Yge(this._translucentItems,e)};function Nge(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let d=a[r];s.remove(d),e.add(n,d),i=!0}}return i}function C9(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let d=0;d<c;d++)e.add(n,a[d]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}R_.prototype.update=function(e){let t=C9(this,this._solidItems,e,!0);t=C9(this,this._translucentItems,e,t)&&t;let n=Nge(this,this._solidItems,e),i=Nge(this,this._translucentItems,e);return(n||i)&&(t=C9(this,this._solidItems,e,t)&&t,t=C9(this,this._translucentItems,e,t)&&t),t};function Xge(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return gt.FAILED}R_.prototype.getBoundingSphere=function(e,t){let n=Xge(this._solidItems,e,t);return n===gt.FAILED?Xge(this._translucentItems,e,t):n};function Pge(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}R_.prototype.removeAllPrimitives=function(){Pge(this._solidItems),Pge(this._translucentItems)};var Ym=R_;var ETi=y(x(),1);var pst=new Mt,Ast=new Mt,gst=m.ZERO,bst=new m;function uf(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new Ft,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(uf.prototype.onMaterialChanged,this),this.subscriptions=new Ft,this.showsUpdated=new Ft}uf.prototype.onMaterialChanged=function(){this.invalidated=!0};uf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};uf.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!K.isConstant(t.distanceDisplayConditionProperty)||!K.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};uf.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var yst=new D;uf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=yr.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Nn({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=yr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),h=this.attributes.get(u.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Kt&&!c.depthFailMaterialProperty.isConstant){let C=c.depthFailMaterialProperty.color,E=K.getValueOrDefault(C,e,D.WHITE,yst);D.equals(h._lastDepthFailColor,E)||(h._lastDepthFailColor=D.clone(E,h._lastDepthFailColor),h.depthFailColor=qt.toValue(E,h.depthFailColor))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Zn.toValue(p,h.show));let f=c.distanceDisplayConditionProperty;if(!K.isConstant(f)){let C=K.getValueOrDefault(f,e,Ast,pst);Mt.equals(C,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(C,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=jn.toValue(C,h.distanceDisplayCondition))}let b=c.terrainOffsetProperty;if(!K.isConstant(b)){let C=K.getValueOrDefault(b,e,gst,bst);m.equals(C,h._lastOffset)||(h._lastOffset=m.clone(C,h._lastOffset),h.offset=go.toValue(C,h.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};uf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Zn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};uf.prototype.contains=function(e){return this.updaters.contains(e.id)};uf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return gt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?gt.FAILED:(i.boundingSphere.clone(t),gt.DONE)};uf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function G_(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}G_.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new uf(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};G_.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};G_.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};G_.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return gt.FAILED};G_.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Nm=G_;var vTi=y(x(),1);var VTi=y(x(),1);var ZTi=y(x(),1);var STi=y(x(),1);function E9(e,t,n=0,i=e.length-1,o=xst){for(;i>n;){if(i-n>600){let c=i-n+1,d=t-n+1,u=Math.log(c),h=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*h*(c-h)/c)*(d-c/2<0?-1:1),g=Math.max(n,Math.floor(t-d*h/c+p)),f=Math.min(i,Math.floor(t+(c-d)*h/c+p));E9(e,t,g,f,o)}let r=e[t],s=n,a=i;for(EY(e,n,t),o(e[i],r)>0&&EY(e,n,i);s<a;){for(EY(e,s,a),s++,a--;o(e[s],r)<0;)s++;for(;o(e[a],r)>0;)a--}o(e[n],r)===0?EY(e,n,a):(a++,EY(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function EY(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function xst(e,t){return e<t?-1:e>t?1:0}var IY=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!S9(t,n))return i;let o=this.toBBox,r=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?o(a):a;S9(t,c)&&(n.leaf?i.push(a):T4(t,c)?this._all(a,i):r.push(a))}n=r.pop()}return i}collides(t){let n=this.data;if(!S9(t,n))return!1;let i=[];for(;n;){for(let o=0;o<n.children.length;o++){let r=n.children[o],s=n.leaf?this.toBBox(r):r;if(S9(t,s)){if(n.leaf||T4(t,s))return!0;i.push(r)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=L_([]),this}remove(t,n){if(!t)return this;let i=this.data,o=this.toBBox(t),r=[],s=[],a,c,d;for(;i||r.length;){if(i||(i=r.pop(),c=r[r.length-1],a=s.pop(),d=!0),i.leaf){let u=Cst(t,i.children,n);if(u!==-1)return i.children.splice(u,1),r.push(i),this._condense(r),this}!d&&!i.leaf&&T4(i,o)?(r.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],d=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,o){let r=i-n+1,s=this._maxEntries,a;if(r<=s)return a=L_(t.slice(n,i+1)),V_(a,this.toBBox),a;o||(o=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,o-1))),a=L_([]),a.leaf=!1,a.height=o;let c=Math.ceil(r/s),d=c*Math.ceil(Math.sqrt(s));Mge(t,n,i,d,this.compareMinX);for(let u=n;u<=i;u+=d){let h=Math.min(u+d-1,i);Mge(t,u,h,c,this.compareMinY);for(let p=u;p<=h;p+=c){let g=Math.min(p+c-1,h);a.children.push(this._build(t,p,g,o-1))}}return V_(a,this.toBBox),a}_chooseSubtree(t,n,i,o){for(;o.push(n),!(n.leaf||o.length-1===i);){let r=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let d=n.children[c],u=E4(d),h=Sst(t,d)-u;h<s?(s=h,r=u<r?u:r,a=d):h===s&&u<r&&(r=u,a=d)}n=a||n.children[0]}return n}_insert(t,n,i){let o=i?t:this.toBBox(t),r=[],s=this._chooseSubtree(o,this.data,n,r);for(s.children.push(t),SY(s,o);n>=0&&r[n].children.length>this._maxEntries;)this._split(r,n),n--;this._adjustParentBBoxes(o,r,n)}_split(t,n){let i=t[n],o=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,o);let s=this._chooseSplitIndex(i,r,o),a=L_(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,V_(i,this.toBBox),V_(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=L_([t,n]),this.data.height=t.height+1,this.data.leaf=!1,V_(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let o,r=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=TY(t,0,a,this.toBBox),d=TY(t,a,i,this.toBBox),u=Ist(c,d),h=E4(c)+E4(d);u<r?(r=u,o=a,s=h<s?h:s):u===r&&h<s&&(s=h,o=a)}return o||i-n}_chooseSplitAxis(t,n,i){let o=t.leaf?this.compareMinX:Est,r=t.leaf?this.compareMinY:Tst,s=this._allDistMargin(t,n,i,o),a=this._allDistMargin(t,n,i,r);s<a&&t.children.sort(o)}_allDistMargin(t,n,i,o){t.children.sort(o);let r=this.toBBox,s=TY(t,0,n,r),a=TY(t,i-n,i,r),c=T9(s)+T9(a);for(let d=n;d<i-n;d++){let u=t.children[d];SY(s,t.leaf?r(u):u),c+=T9(s)}for(let d=i-n-1;d>=n;d--){let u=t.children[d];SY(a,t.leaf?r(u):u),c+=T9(a)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)SY(n[o],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():V_(t[n],this.toBBox)}};function Cst(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function V_(e,t){TY(e,0,e.children.length,t,e)}function TY(e,t,n,i,o){o||(o=L_(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(let r=t;r<n;r++){let s=e.children[r];SY(o,e.leaf?i(s):s)}return o}function SY(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 Est(e,t){return e.minX-t.minX}function Tst(e,t){return e.minY-t.minY}function E4(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function T9(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Sst(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 Ist(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),o=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,o-n)*Math.max(0,r-i)}function T4(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function S9(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function L_(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Mge(e,t,n,i,o){let r=[t,n];for(;r.length;){if(n=r.pop(),t=r.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;E9(e,s,t,n,o),r.push(t,s,s,n)}}function I9(){this._tree=new IY}function xE(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}xE.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};I9.prototype.insert=function(e,t){let n=xE.fromRectangleAndId(e,t,new xE);this._tree.insert(n)};function _st(e,t){return e.id===t.id}var Zst=new xE;I9.prototype.remove=function(e,t){let n=xE.fromRectangleAndId(e,t,Zst);this._tree.remove(n,_st)};var Rst=new xE;I9.prototype.collides=function(e){let t=xE.fromRectangleAndId("",e,Rst);return this._tree.collides(t)};var CE=I9;var Gst=new D,Vst=new Mt,Lst=new Mt;function zg(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.updaters=new Ft,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.subscriptions=new Ft,this.showsUpdated=new Ft,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new CE}zg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};zg.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!K.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};zg.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};zg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new pl({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),h=this.attributes.get(u.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!d.fillMaterialProperty.isConstant||c){let b=d.fillMaterialProperty.color,C=K.getValueOrDefault(b,e,D.WHITE,Gst);D.equals(h._lastColor,C)||(h._lastColor=D.clone(C,h._lastColor),h.color=qt.toValue(C,h.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Zn.toValue(p,h.show));let f=d.distanceDisplayConditionProperty;if(!K.isConstant(f)){let b=K.getValueOrDefault(f,e,Lst,Vst);Mt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=jn.toValue(b,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};zg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Zn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};zg.prototype.contains=function(e){return this.updaters.contains(e.id)};zg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return gt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),gt.DONE):gt.FAILED};zg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function W_(e,t){this._batches=[],this._primitives=e,this._classificationType=t}W_.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=K.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new zg(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};W_.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};W_.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let d=0;d<c;d++){n=a[d],s.remove(n);let u=this.add(e,n);s.isDirty=!0,u.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};W_.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return gt.FAILED};W_.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var F_=W_;var iSi=y(x(),1);var Wst=new Mt,Fst=new Mt;function _p(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Ft,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.material=void 0,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.subscriptions=new Ft,this.showsUpdated=new Ft,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new CE}_p.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};_p.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};_p.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!K.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};_p.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};_p.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=yr.getValue(e,this.materialProperty,this.material),n=new pl({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=yr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),h=this.attributes.get(u.id.id);l(h)||(h=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h));let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Zn.toValue(p,h.show));let f=c.distanceDisplayConditionProperty;if(!K.isConstant(f)){let b=K.getValueOrDefault(f,e,Fst,Wst);Mt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=jn.toValue(b,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};_p.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Zn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};_p.prototype.contains=function(e){return this.updaters.contains(e.id)};_p.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return gt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?gt.FAILED:(i.boundingSphere.clone(t),gt.DONE)};_p.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function B_(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}B_.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Hd.shouldUseSphericalCoordinates(o.geometry.rectangle),s=K.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let d=n[c];if(d.isMaterial(t)&&d.usingSphericalTextureCoordinates===r&&d.zIndex===s&&!d.overlapping(o.geometry.rectangle)){d.add(e,t,o);return}}let a=new _p(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};B_.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};B_.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];r.updaters.length===0&&(n.splice(t,1),r.destroy())}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};B_.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return gt.FAILED};B_.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var _Y=B_;var bSi=y(x(),1);var Bst=new D,wst=new Mt,Yst=new Mt,Nst=m.ZERO,Xst=new m;function Hg(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.updaters=new Ft,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.itemsToRemove=[],this.subscriptions=new Ft,this.showsUpdated=new Ft}Hg.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!K.isConstant(e.distanceDisplayConditionProperty)||!K.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Hg.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Hg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Nn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new pn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),h=this.attributes.get(u.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!d.outlineColorProperty.isConstant||c){let C=d.outlineColorProperty,E=K.getValueOrDefault(C,e,D.WHITE,Bst);D.equals(h._lastColor,E)||(h._lastColor=D.clone(E,h._lastColor),h.color=qt.toValue(E,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=d))}let p=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e)),g=h.show[0]===1;p!==g&&(h.show=Zn.toValue(p,h.show));let f=d.distanceDisplayConditionProperty;if(!K.isConstant(f)){let C=K.getValueOrDefault(f,e,Yst,wst);Mt.equals(C,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(C,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=jn.toValue(C,h.distanceDisplayCondition))}let b=d.terrainOffsetProperty;if(!K.isConstant(b)){let C=K.getValueOrDefault(b,e,Nst,Xst);m.equals(C,h._lastOffset)||(h._lastOffset=m.clone(C,h._lastOffset),h.offset=go.toValue(C,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Hg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Zn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Hg.prototype.contains=function(e){return this.updaters.contains(e.id)};Hg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return gt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?gt.FAILED:(i.boundingSphere.clone(t),gt.DONE)};Hg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function w_(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Ft,this._translucentBatches=new Ft}w_.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new Hg(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new Hg(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};w_.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};w_.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,d,u=!0,h=!1;do{for(h=!1,n=0;n<s;n++){o=r[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(h=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(h=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}}while(h);return u};w_.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return gt.FAILED};w_.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var Y_=w_;var Pst=[];function Sd(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Ft,this._removedObjects=new Ft,this._changedObjects=new Ft;let o=Rn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=xr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new Y_(n,e,s,!1),this._outlineBatches[o+s]=new Y_(n,e,s,!0),this._closedColorBatches[s]=new Ym(n,pn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Ym(n,pn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Nm(n,Io,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Nm(n,Io,void 0,!0,s,!1),this._openColorBatches[s]=new Ym(n,pn,void 0,!1,s,!0),this._openColorBatches[o+s]=new Ym(n,pn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Nm(n,Io,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Nm(n,Io,void 0,!1,s,!1);let a=qn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new _Y(i,s,Io)),c[s]=new F_(i,s);else for(s=0;s<a;++s)c[s]=new F_(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new cE(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Ft,this._updaterSets=new Ft,this._entityCollection=t,t.collectionChanged.addEventListener(Sd.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Pst)}Sd.registerUpdater=function(e){yE.registerUpdater(e)};Sd.unregisterUpdater=function(e){yE.unregisterUpdater(e)};Sd.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u,h=this;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaterSets.get(d),u.entity===c?u.forEach(function(b){h._removeUpdater(b),h._insertUpdaterIntoBatch(e,b)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new yE(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(b){h._insertUpdaterIntoBatch(e,b)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Sd._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,f=g.length;for(a=0;a<f;a++)p=g[a].update(e)&&p;return p};var Mst=[],Ust=new ue;Sd.prototype.getBoundingSphere=function(e,t){let n=Mst,i=Ust,o=0,r=gt.DONE,s=this._batches,a=s.length,c=e.id,d=this._updaterSets.get(c).updaters;for(let u=0;u<d.length;u++){let h=d[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(h,i),r===gt.PENDING)return gt.PENDING;r===gt.DONE&&(n[o]=ue.clone(i,n[o]),o++)}}return o===0?gt.FAILED:(n.length=o,ue.fromBoundingSpheres(n,t),gt.DONE)};Sd.prototype.isDestroyed=function(){return!1};Sd.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Sd.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),fe(this)};Sd.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Sd.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Rn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Kt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Sd._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Sd.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var ZY=Sd;var eIi=y(x(),1);var Dst=1,vst="30px sans-serif",kst=cr.FILL,Qst=D.WHITE,Ost=D.BLACK,zst=1,Hst=!1,Kst=new D(.165,.165,.165,.8),Jst=new M(7,5),jst=M.ZERO,qst=m.ZERO,$st=tt.NONE,eat=Bi.CENTER,tat=vn.CENTER,nat=new m,iat=new D,oat=new D,rat=new D,sat=new M,aat=new m,cat=new M,lat=new kt,dat=new kt,uat=new kt,mat=new Mt;function Uge(e){this.entity=e,this.label=void 0,this.index=void 0}function ay(e,t){t.collectionChanged.addEventListener(ay.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ft,this._onCollectionChanged(t,t.values,[],[])}ay.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,d=r.label,u=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),h;if(u&&(h=K.getValueOrUndefined(s._position,e,nat),c=K.getValueOrUndefined(a._text,e),u=l(h)&&l(c)),!u){S4(r,s,n);continue}K.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=K.getValueOrDefault(a._heightReference,e,$st);l(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=m.equals(d.position,h)&&d.heightReference===g),d.show=!0,d.position=h,d.text=c,d.scale=K.getValueOrDefault(a._scale,e,Dst),d.font=K.getValueOrDefault(a._font,e,vst),d.style=K.getValueOrDefault(a._style,e,kst),d.fillColor=K.getValueOrDefault(a._fillColor,e,Qst,iat),d.outlineColor=K.getValueOrDefault(a._outlineColor,e,Ost,oat),d.outlineWidth=K.getValueOrDefault(a._outlineWidth,e,zst),d.showBackground=K.getValueOrDefault(a._showBackground,e,Hst),d.backgroundColor=K.getValueOrDefault(a._backgroundColor,e,Kst,rat),d.backgroundPadding=K.getValueOrDefault(a._backgroundPadding,e,Jst,sat),d.pixelOffset=K.getValueOrDefault(a._pixelOffset,e,jst,cat),d.eyeOffset=K.getValueOrDefault(a._eyeOffset,e,qst,aat),d.heightReference=g,d.horizontalOrigin=K.getValueOrDefault(a._horizontalOrigin,e,eat),d.verticalOrigin=K.getValueOrDefault(a._verticalOrigin,e,tat),d.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,lat),d.pixelOffsetScaleByDistance=K.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,dat),d.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,uat),d.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,mat),d.disableDepthTestDistance=K.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};ay.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return gt.FAILED;let i=n.label;return t.center=m.clone(i._clampedPosition??i.position,t.center),t.radius=0,gt.DONE};ay.prototype.isDestroyed=function(){return!1};ay.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ay.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return fe(this)};ay.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new Uge(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Uge(r)):(S4(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],S4(s.get(r.id),r,a),s.remove(r.id)};function S4(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var RY=ay;var xIi=y(x(),1);var hat=1,fat=!0,pat=0,Aat=!0,gat=!0,bat=Rn.ENABLED,yat=tt.NONE,xat=D.RED,Cat=0,Eat=D.WHITE,Tat=Dc.HIGHLIGHT,Sat=.5,Iat=new M(1,1),Dge={maximumPositionEpsilon:Number.POSITIVE_INFINITY},_at=new F,Zat=new F,vge=new D,kge=new Array(4),Rat=new m;function cy(e,t){t.collectionChanged.addEventListener(cy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Ft,this._onCollectionChanged(t,t.values,[],[])}async function Gat(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await Dh.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}cy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),h;if(u&&(h=s.computeModelMatrix(e,_at),c=Ge.createIfNeeded(K.getValueOrUndefined(a._uri,e)),u=l(h)&&l(c)),!u){l(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if(!l(d)||c.url!==d.url){l(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...Dge}},n[s.id]=d;let f=K.getValueOrDefault(a._incrementallyLoadTextures,e,Aat),b=K.getValueOrDefault(a._environmentMapOptions,e,Dge,d.environmentMapOptionsScratch);Gat(this,s,c,f,b)}let p=d.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=K.getValueOrDefault(a._scale,e,hat),p.enableVerticalExaggeration=K.getValueOrDefault(a._enableVerticalExaggeration,e,fat),p.minimumPixelSize=K.getValueOrDefault(a._minimumPixelSize,e,pat),p.maximumScale=K.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(h,p.modelMatrix),p.shadows=K.getValueOrDefault(a._shadows,e,bat),p.heightReference=K.getValueOrDefault(a._heightReference,e,yat),p.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=K.getValueOrDefault(a._silhouetteColor,e,xat,vge),p.silhouetteSize=K.getValueOrDefault(a._silhouetteSize,e,Cat),p.color=K.getValueOrDefault(a._color,e,Eat,vge),p.colorBlendMode=K.getValueOrDefault(a._colorBlendMode,e,Tat),p.colorBlendAmount=K.getValueOrDefault(a._colorBlendAmount,e,Sat),p.clippingPlanes=K.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=K.getValueOrDefault(a._clampAnimations,e,gat),p.imageBasedLighting.imageBasedLightingFactor=K.getValueOrDefault(a._imageBasedLightingFactor,e,Iat);let g=K.getValueOrUndefined(a._lightColor,e);if(l(g)&&(D.pack(g,kge,0),g=m.unpack(kge,0,Rat)),p.lightColor=g,p.customShader=K.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let f=K.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==f&&(f?p.activeAnimations.addAll({loop:hd.REPEAT}):p.activeAnimations.removeAll(),d.animationsRunning=f);let b=K.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(b)){let T=Object.keys(b);for(let S=0,_=T.length;S<_;++S){let R=T[S],L=b[R];if(!l(L))continue;let W=p.getNode(R);if(!l(W))continue;let B=F.fromTranslationRotationScale(L,Zat);W.matrix=F.multiply(W.originalMatrix,B,B)}}let C=!1,E=K.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(E)){let T=Object.keys(E);for(let S=0,_=T.length;S<_;++S){let R=T[S],L=E[R];l(L)&&(C=!0,p.setArticulationStage(R,L))}}C&&p.applyArticulations()}}return!0};cy.prototype.isDestroyed=function(){return!1};cy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(cy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)I4(this,e[i],t,n);return fe(this)};var _9=new m,Vat=new pe;cy.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return gt.FAILED;if(n.loadFailed)return gt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return gt.PENDING;if(!i.ready||!n.modelUpdated)return gt.PENDING;let o=this._scene,r=o.ellipsoid??ie.default;if(i.heightReference!==tt.NONE){let a=i.modelMatrix;_9.x=a[12],_9.y=a[13],_9.z=a[14];let c=r.cartesianToCartographic(_9,Vat),d=o.getHeight(c,i.heightReference);return l(d)&&(em(i.heightReference)?c.height=d:c.height+=d),ue.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),gt.DONE}return ue.clone(i.boundingSphere,t),gt.DONE};cy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(Lat(r,a),s.set(r.id,r)):(I4(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],I4(this,r,a,c),s.remove(r.id)};function I4(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Lat(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var GY=cy;var jIi=y(x(),1);var RIi=y(x(),1);function ly(e){this._definitionChanged=new Ce,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(ly.prototype,{isConstant:{get:function(){return K.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:eo.FIXED}}});var Wat=new j;ly.prototype.getValue=function(e,t){return l(e)||(e=j.now(Wat)),this.getValueInReferenceFrame(e,eo.FIXED,t)};ly.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};ly.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ie.default.scaleToGeodeticSurface(n,n):void 0};ly.prototype.equals=function(e){return this===e||e instanceof ly&&this._value===e._value};ly.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Zp=ly;var Fat=60,Bat=1,Oge=new Wn,_4=new Wn,Z4=new Wn;function Qge(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function wat(e,t,n,i,o,r,s,a,c){let d=a,u;u=e.getValueInReferenceFrame(t,r,c[d]),l(u)&&(c[d++]=u);let h=!l(o)||j.lessThanOrEquals(o,t)||j.greaterThanOrEquals(o,n),p=0,g=i.length,f=i[p],b=n,C=!1,E,T,S;for(;p<g;){if(!h&&j.greaterThanOrEquals(f,o)&&(u=e.getValueInReferenceFrame(o,r,c[d]),l(u)&&(c[d++]=u),h=!0),j.greaterThan(f,t)&&j.lessThan(f,b)&&!f.equals(o)&&(u=e.getValueInReferenceFrame(f,r,c[d]),l(u)&&(c[d++]=u)),p<g-1){if(s>0&&!C){let _=i[p+1],R=j.secondsDifference(_,f);C=R>s,C&&(E=Math.ceil(R/s),T=0,S=R/Math.max(E,2),E=Math.max(E-1,1))}if(C&&T<E){f=j.addSeconds(f,S,new j),T++;continue}}C=!1,p++,f=i[p]}return u=e.getValueInReferenceFrame(n,r,c[d]),l(u)&&(c[d++]=u),d}function Yat(e,t,n,i,o,r,s,a){let c,d=0,u=s,h=t,p=!l(i)||j.lessThanOrEquals(i,t)||j.greaterThanOrEquals(i,n);for(;j.lessThan(h,n);)!p&&j.greaterThanOrEquals(h,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(h,o,a[u]),l(c)&&(a[u]=c,u++),d++,h=j.addSeconds(t,r*d,new j);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function Nat(e,t,n,i,o,r,s,a){let c,d=0,u=s,h=t,p=Math.max(r,60),g=!l(i)||j.lessThanOrEquals(i,t)||j.greaterThanOrEquals(i,n);for(;j.lessThan(h,n);)!g&&j.greaterThanOrEquals(h,i)&&(g=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(h,o,a[u]),l(c)&&(a[u]=c,u++),d++,h=j.addSeconds(t,p*d,new j);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function Xat(e,t,n,i,o,r,s,a){Z4.start=t,Z4.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let h=d.get(u);if(!Wn.intersect(h,Z4,Oge).isEmpty){let p=h.start;h.isStartIncluded||(h.isStopIncluded?p=h.stop:p=j.addSeconds(h.start,j.secondsDifference(h.stop,h.start)/2,new j));let g=e.getValueInReferenceFrame(p,o,a[c]);l(g)&&(a[c]=g,c++)}}return c}function Pat(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Mat(e,t,n,i,o,r,s,a){_4.start=t,_4.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let h=d.get(u);if(!Wn.intersect(h,_4,Oge).isEmpty){let p=h.start,g=h.stop,f=t;j.greaterThan(p,f)&&(f=p);let b=n;j.lessThan(g,b)&&(b=g),c=zge(h.data,f,b,i,o,r,c,a)}}return c}function zge(e,t,n,i,o,r,s,a){for(;e instanceof Mg;)e=e.resolvedProperty;if(e instanceof ec){let c=e._property._times;s=wat(e,t,n,c,i,o,r,s,a)}else e instanceof vL?s=Yat(e,t,n,i,o,r,s,a):e instanceof qa?s=Mat(e,t,n,i,o,r,s,a):e instanceof Ug?s=Xat(e,t,n,i,o,r,s,a):e instanceof gl||e instanceof Zp&&K.isConstant(e)?s=Pat(e,t,n,i,o,r,s,a):s=Nat(e,t,n,i,o,r,s,a);return s}function Hge(e,t,n,i,o,r,s){l(s)||(s=[]);let a=zge(e,t,n,i,o,r,0,s);return s.length=a,s}var Uat=new $;function VY(e,t){this._unusedIndexes=[],this._polylineCollection=new Oh,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}VY.prototype.update=function(e){if(this._referenceFrame===eo.INERTIAL){let t=Tt.computeIcrfToCentralBodyFixedMatrix(e,Uat);F.fromRotationTranslation(t,m.ZERO,this._polylineCollection.modelMatrix)}};VY.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,d=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(d){let h=K.getValueOrUndefined(i._leadTime,e),p=K.getValueOrUndefined(i._trailTime,e),g=n._availability,f=l(g),b=l(h),C=l(p);if(d=f||b&&C,d){if(C&&(r=j.addSeconds(e,-p,new j)),b&&(s=j.addSeconds(e,h,new j)),f){let E=g.start,T=g.stop;(!C||j.greaterThan(E,r))&&(r=E),(!b||j.lessThan(T,s))&&(s=T)}d=j.lessThan(r,s)}}if(!d){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let h=this._unusedIndexes;if(h.length>0){let g=h.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=K.getValueOrDefault(i._resolution,e,Fat);c.show=!0,c.positions=Hge(o,r,s,e,this._referenceFrame,u,c.positions.slice()),c.material=yr.getValue(e,i._material,c.material),c.width=K.getValueOrDefault(i._width,e,Bat),c.distanceDisplayCondition=K.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};VY.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};VY.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),fe(this)};function dy(e,t){t.collectionChanged.addEventListener(dy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Ft,this._onCollectionChanged(t,t.values,[],[])}dy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,d=eo.FIXED;this._scene.mode===se.SCENE3D&&(d=a.referenceFrame);let u=this._updaters[d];if(c===u&&l(u)){u.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(u)||(u=new VY(this._scene,d),u.update(e),this._updaters[d]=u),r.updater=u,l(u)&&u.updateObject(e,r)}return!0};dy.prototype.isDestroyed=function(){return!1};dy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(dy.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return fe(this)};dy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Qge(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Qge(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};dy._subSample=Hge;var LY=dy;var u_i=y(x(),1);var Kge=D.WHITE,Jge=D.BLACK,jge=0,qge=1,$ge=0,ebe=Br.NONE,tbe=new D,Dat=new m,nbe=new D,ibe=new kt,obe=new kt,rbe=new Mt;function sbe(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 uy(e,t){t.collectionChanged.addEventListener(uy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ft,this._onCollectionChanged(t,t.values,[],[])}uy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,d=r.billboard,u=K.getValueOrDefault(a._heightReference,e,tt.NONE),h=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),p;if(h&&(p=K.getValueOrUndefined(s._position,e,Dat),h=l(p)),!h){WY(r,s,n);continue}K.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,f=!1;if(u!==tt.NONE&&!l(d)?(l(c)&&(WY(r,s,n),c=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,g=!0,f=m.equals(d.position,p)&&d.heightReference===u):u===tt.NONE&&!l(c)&&(l(d)&&(WY(r,s,n),d=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,ibe),c.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,obe),c.color=K.getValueOrDefault(a._color,e,Kge,tbe),c.outlineColor=K.getValueOrDefault(a._outlineColor,e,Jge,nbe),c.outlineWidth=K.getValueOrDefault(a._outlineWidth,e,jge),c.pixelSize=K.getValueOrDefault(a._pixelSize,e,qge),c.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,rbe),c.disableDepthTestDistance=K.getValueOrDefault(a._disableDepthTestDistance,e,$ge),c.splitDirection=K.getValueOrDefault(a._splitDirection,e,ebe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,ibe),d.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,obe),d.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,rbe),d.disableDepthTestDistance=K.getValueOrDefault(a._disableDepthTestDistance,e,$ge),d.splitDirection=K.getValueOrDefault(a._splitDirection,e,ebe),d.heightReference=u;let b=K.getValueOrDefault(a._color,e,Kge,tbe),C=K.getValueOrDefault(a._outlineColor,e,Jge,nbe),E=Math.round(K.getValueOrDefault(a._outlineWidth,e,jge)),T=Math.max(1,Math.round(K.getValueOrDefault(a._pixelSize,e,qge)));if(E>0?(d.scale=1,g=g||E!==r.outlineWidth||T!==r.pixelSize||!D.equals(b,r.color)||!D.equals(C,r.outlineColor)):(d.scale=T/50,T=50,g=g||E!==r.outlineWidth||!D.equals(b,r.color)||!D.equals(C,r.outlineColor)),g){r.color=D.clone(b,r.color),r.outlineColor=D.clone(C,r.outlineColor),r.pixelSize=T,r.outlineWidth=E;let S=b.alpha,_=b.toCssColorString(),R=C.toCssColorString(),L=JSON.stringify([_,T,R,E]);d.setImage(L,BC(S,_,R,E,T))}f&&d._updateClamping()}}return!0};uy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return gt.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return gt.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,gt.DONE};uy.prototype.isDestroyed=function(){return!1};uy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(uy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return fe(this)};uy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new sbe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new sbe(r)):(WY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],WY(s.get(r.id),r,a),s.remove(r.id)};function WY(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var FY=uy;var MZi=y(x(),1);var aZi=y(x(),1);var L_i=y(x(),1);var ube=[];function vat(e,t,n,i,o){let r=ube;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,h=i.red,p=i.green,g=i.blue,f=i.alpha;if(D.equals(n,i)){for(s=0;s<o;s++)r[s]=D.clone(n);return r}let b=(h-a)/o,C=(p-c)/o,E=(g-d)/o,T=(f-u)/o;for(s=0;s<o;s++)r[s]=new D(a+s*b,c+s*C,d+s*E,u+s*T);return r}function BY(e){e=e??Q.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=we.clone(e.vertexFormat??we.DEFAULT),this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??V.RADIANS_PER_DEGREE,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._workerName="createPolylineGeometry";let r=1+t.length*m.packedLength;r+=l(n)?1+n.length*D.packedLength:1,this.packedLength=r+ie.packedLength+we.packedLength+4}BY.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var mbe=ie.clone(ie.UNIT_SPHERE),hbe=new we,EE={positions:void 0,colors:void 0,ellipsoid:mbe,vertexFormat:hbe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};BY.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=ie.unpack(e,t,mbe);t+=ie.packedLength;let c=we.unpack(e,t,hbe);t+=we.packedLength;let d=e[t++],u=e[t++]===1,h=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._vertexFormat=we.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=h,n._granularity=p,n):(EE.positions=r,EE.colors=s,EE.width=d,EE.colorsPerVertex=u,EE.arcType=h,EE.granularity=p,new BY(EE))};var abe=new m,cbe=new m,lbe=new m,dbe=new m;BY.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,d,u,h=[],p=Mo(e._positions,m.equalsEpsilon,!1,h);if(l(i)&&h.length>0){let w=0,X=h[0];i=i.filter(function(v,U){let k=!1;return o?k=U===X||U===0&&X===1:k=U+1===X,k?(w++,X=h[w],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===ln.GEODESIC||r===ln.RHUMB){let w,X;r===ln.GEODESIC?(w=V.chordLength(s,a.maximumRadius),X=zi.numberOfPoints):(w=s,X=zi.numberOfPointsRhumbLine);let v=zi.extractHeights(p,a);if(l(i)){let U=1;for(c=0;c<g-1;++c)U+=X(p[c],p[c+1],w);let k=new Array(U),P=0;for(c=0;c<g-1;++c){let O=p[c],H=p[c+1],ee=i[c],z=X(O,H,w);if(o&&c<U){let te=i[c+1],q=vat(O,H,ee,te,z),me=q.length;for(d=0;d<me;++d)k[P++]=q[d]}else for(d=0;d<z;++d)k[P++]=D.clone(ee)}k[P]=D.clone(i[i.length-1]),i=k,ube.length=0}r===ln.GEODESIC?p=zi.generateCartesianArc({positions:p,minDistance:w,ellipsoid:a,height:v}):p=zi.generateCartesianRhumbArc({positions:p,granularity:w,ellipsoid:a,height:v})}g=p.length;let f=g*4-4,b=new Float64Array(f*3),C=new Float64Array(f*3),E=new Float64Array(f*3),T=new Float32Array(f*2),S=n.st?new Float32Array(f*2):void 0,_=l(i)?new Uint8Array(f*4):void 0,R=0,L=0,W=0,B=0,Y;for(d=0;d<g;++d){d===0?(Y=abe,m.subtract(p[0],p[1],Y),m.add(p[0],Y,Y)):Y=p[d-1],m.clone(Y,lbe),m.clone(p[d],cbe),d===g-1?(Y=abe,m.subtract(p[g-1],p[g-2],Y),m.add(p[g-1],Y,Y)):Y=p[d+1],m.clone(Y,dbe);let w,X;l(_)&&(d!==0&&!o?w=i[d-1]:w=i[d],d!==g-1&&(X=i[d]));let v=d===0?2:0,U=d===g-1?2:4;for(u=v;u<U;++u){m.pack(cbe,b,R),m.pack(lbe,C,R),m.pack(dbe,E,R),R+=3;let k=u-2<0?-1:1;if(T[L++]=2*(u%2)-1,T[L++]=k*t,n.st&&(S[W++]=d/(g-1),S[W++]=Math.max(T[L-2],0)),l(_)){let P=u<2?w:X;_[B++]=D.floatToByte(P.red),_[B++]=D.floatToByte(P.green),_[B++]=D.floatToByte(P.blue),_[B++]=D.floatToByte(P.alpha)}}}let N=new yn;N.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:b}),N.prevPosition=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:C}),N.nextPosition=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:E}),N.expandAndWidth=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:T}),n.st&&(N.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:S})),l(_)&&(N.color=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,values:_,normalize:!0}));let A=Pe.createTypedArray(f,g*6-6),I=0,Z=0,G=g-1;for(d=0;d<G;++d)A[Z++]=I,A[Z++]=I+2,A[Z++]=I+1,A[Z++]=I+1,A[Z++]=I+2,A[Z++]=I+3,I+=4;return new pt({attributes:N,indices:A,primitiveType:Be.TRIANGLES,boundingSphere:ue.fromPoints(p),geometryType:zu.POLYLINES})};var Kg=BY;var kat=new mi(0),Z9={},fbe=new D,Qat=new Kt(D.WHITE),Oat=new mi(!0),zat=new mi(Rn.DISABLED),Hat=new mi(new Mt),Kat=new mi(qn.BOTH);function Jat(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function jat(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function mf(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(mf.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new Ce,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 Jat,this._groundGeometryOptions=new jat,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=xr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(mf.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||!l(this._entity.availability)&&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}}});mf.prototype.isOutlineVisible=function(e){return!1};mf.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};mf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Zn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=jn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Kt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,fbe)),l(a)||(a=D.WHITE),s.color=qt.fromColor(a)),this.clampToGround?new Bt({id:t,geometry:new Wx(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Kt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,fbe)),l(a)||(a=D.WHITE),s.depthFailColor=qt.fromColor(a)),new Bt({id:t,geometry:new Kg(this._geometryOptions),attributes:s}))};mf.prototype.createOutlineGeometryInstance=function(e){};mf.prototype.isDestroyed=function(){return!1};mf.prototype.destroy=function(){this._entitySubscription(),fe(this)};mf.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(Ke.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=o.material??Qat,d=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??Oat,this._shadowsProperty=o.shadows??zat,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??Hat,this._classificationTypeProperty=o.classificationType??Kat,this._fillEnabled=!0,this._zIndex=a??kat;let u=o.width,h=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!K.isConstant(u)||!K.isConstant(h)||!K.isConstant(g)||!K.isConstant(p)||!K.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,b=r.getValue(Ke.MINIMUM_VALUE,f.positions);if(!l(b)||b.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let C;d&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Kt)?C=Is.VERTEX_FORMAT:C=Qa.VERTEX_FORMAT,f.vertexFormat=C,f.positions=b,f.width=l(u)?u.getValue(Ke.MINIMUM_VALUE):void 0,f.arcType=l(h)?h.getValue(Ke.MINIMUM_VALUE):void 0,f.granularity=l(g)?g.getValue(Ke.MINIMUM_VALUE):void 0;let E=this._groundGeometryOptions;E.positions=b,E.width=f.width,E.arcType=f.arcType,E.granularity=f.granularity,this._clampToGround=l(p)?p.getValue(Ke.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&At("Entity polylines must have clampToGround: true when using zIndex.  zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};mf.prototype.createDynamicUpdater=function(e,t){return new wY(e,t,this)};var N_={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function wY(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function pbe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=Z9[n];!l(i)||i.isDestroyed()?(i=new Oh,Z9[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}wY.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=K.getValueOrUndefined(o,e,this._positions);t._clampToGround=K.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=K.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=K.getValueOrDefault(i._arcType,e,ln.GEODESIC),t._groundGeometryOptions.granularity=K.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!K.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof Kt)p=new Is;else{let g=yr.getValue(e,h,this._material);p=new Qa({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new bh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),K.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=pbe(this);if(!n.isShowing||!n.isAvailable(e)||!K.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=ln.GEODESIC;c=K.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe,u=t._scene.ellipsoid;c!==ln.NONE&&l(d)&&(N_.ellipsoid=u,N_.positions=r,N_.granularity=K.getValueOrUndefined(i._granularity,e),N_.height=zi.extractHeights(r,u),c===ln.GEODESIC?r=zi.generateCartesianArc(N_):r=zi.generateCartesianRhumbArc(N_)),a.show=!0,a.positions=r.slice(),a.material=yr.getValue(e,t.fillMaterialProperty,a.material),a.width=K.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=K.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};wY.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ue.clone(n.boundingSphere,e),gt.DONE}return l(t)&&!t.ready?gt.PENDING:gt.DONE}else{let t=pbe(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),gt.DONE}return gt.FAILED};wY.prototype.isDestroyed=function(){return!1};wY.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Z9[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Z9[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),fe(this)};var YY=mf;var TZi=y(x(),1);var qat=new D,$at=new Mt,ect=new Mt;function hf(e,t,n,i,o){let r;n instanceof Kt?r=Is:r=Qa,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Ft,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.material=void 0,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(hf.prototype.onMaterialChanged,this),this.subscriptions=new Ft,this.showsUpdated=new Ft,this.zIndex=i,this._asynchronous=o}hf.prototype.onMaterialChanged=function(){this.invalidated=!0};hf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};hf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!K.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};hf.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};hf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new bh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Qa&&(this.material=yr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Qa&&(this.material=yr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),h=this.attributes.get(u.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!c.fillMaterialProperty.isConstant){let b=c.fillMaterialProperty.color,C=K.getValueOrDefault(b,e,D.WHITE,qat);D.equals(h._lastColor,C)||(h._lastColor=D.clone(C,h._lastColor),h.color=qt.toValue(C,h.color))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Zn.toValue(p,h.show));let f=c.distanceDisplayConditionProperty;if(!K.isConstant(f)){let b=K.getValueOrDefault(f,e,ect,$at);Mt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=jn.toValue(b,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};hf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Zn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};hf.prototype.contains=function(e){return this.updaters.contains(e.id)};hf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return gt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?gt.FAILED:(i.boundingSphere.clone(t),gt.DONE)};hf.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function X_(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}X_.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=K.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new hf(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};X_.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};X_.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};X_.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return gt.FAILED};X_.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var NY=X_;var tct=[];function Abe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function gbe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Kt?1:2);let r;l(i)&&(r=i+o*Rn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Rp(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Ft,this._removedObjects=new Ft,this._changedObjects=new Ft;let o,r=Rn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new Ym(n,Is,void 0,!1,o),this._materialBatches[o]=new Nm(n,Qa,void 0,!1,o),this._colorBatches[o+r]=new Ym(n,Is,Is,!1,o),this._materialBatches[o+r]=new Nm(n,Qa,Is,!1,o),this._colorBatches[o+r*2]=new Ym(n,Is,Qa,!1,o),this._materialBatches[o+r*2]=new Nm(n,Qa,Qa,!1,o);this._dynamicBatch=new cE(n,i);let s=qn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new NY(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Ft,this._updaters=new Ft,this._entityCollection=t,t.collectionChanged.addEventListener(Rp.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,tct)}Rp.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaters.get(d),u.entity===c?(Abe(this,u),gbe(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaters.get(d),Abe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new YY(c,this._scene),this._updaters.set(d,u),gbe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(Rp._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)h=p[a].update(e)&&h;return h};var nct=[],ict=new ue;Rp.prototype.getBoundingSphere=function(e,t){let n=nct,i=ict,o=0,r=gt.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(c,i),r===gt.PENDING)return gt.PENDING;r===gt.DONE&&(n[o]=ue.clone(i,n[o]),o++)}return o===0?gt.FAILED:(n.length=o,ue.fromBoundingSpheres(n,t),gt.DONE)};Rp.prototype.isDestroyed=function(){return!1};Rp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Rp.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),fe(this)};Rp._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Rp.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var XY=Rp;function Id(e){pl.initializeTerrainHeights(),bh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Xr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=e.visualizersCallback??Id.defaultVisualizersCallback;let i=!1,o=new Ml,r=new Ml;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;d<u;d++)this._onDataSourceAdded(n,n.get(d));let s=new Nw;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let d=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),c=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var P_=[];Id.registerVisualizer=function(e){P_.includes(e)||P_.push(e)};Id.unregisterVisualizer=function(e){if(P_.includes(e)){let t=P_.indexOf(e);P_.splice(t,1)}};Id.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new V1(t,i),new ZY(e,i,n._primitives,n._groundPrimitives),new RY(t,i),new GY(e,i),new Ew(e,i),new FY(t,i),new LY(e,i),new XY(e,i,n._primitives,n._groundPrimitives),...P_.map(o=>new o(e,i))]};Object.defineProperties(Id.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}}});Id.prototype.isDestroyed=function(){return!1};Id.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),fe(this)};Id.prototype.update=function(e){if(!Zi.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};Id.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var oct=[],rct=new ue;Id.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return gt.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let g=p.get(i);if(g.entities.contains(e)){r=g;break}}}if(!l(r))return gt.FAILED;let s=oct,a=rct,c=0,d=gt.DONE,u=r._visualizers,h=u.length;for(i=0;i<h;i++){let p=u[i];if(l(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===gt.PENDING)return gt.PENDING;d===gt.DONE&&(s[c]=ue.clone(a,s[c]),c++)}}return c===0?gt.FAILED:(s.length=c,ue.fromBoundingSpheres(s,n),gt.DONE)};Id.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Ml),s=o.add(new qw);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Id.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let d=0;d<c;d++)a[d].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Id.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var PY=Id;var IRi=y(x(),1);var dRi=y(x(),1);function R4(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}R4.clone=function(e,t){if(l(e))return l(t)||(t=new R4),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Xm=R4;var bbe=new $,ybe=new $,xbe=new $,sct=new F,R9=new m,Cbe=new m,G4=new m,V4=new m,Ebe=new m,Tbe=new m,act=new Me,cct=new m,lct=new $,M_=new j,dct=1.25;function uct(e,t,n,i,o,r,s,a,c,d){let u=e.scene.mode,h=o.getValue(c,e._lastCartesian);if(l(h)){let p=!1,g=!1,f,b,C;if(u===se.SCENE3D){j.addSeconds(c,.001,M_);let W=o.getValue(M_,R9);if(l(W)||(j.addSeconds(c,-.001,M_),W=o.getValue(M_,R9),g=!0),l(W)){let B=Tt.computeFixedToIcrfMatrix(c,bbe),Y=Tt.computeFixedToIcrfMatrix(M_,ybe),N;!l(B)||!l(Y)?(N=Tt.computeTemeToPseudoFixedMatrix(c,xbe),B=$.transpose(N,bbe),Y=Tt.computeTemeToPseudoFixedMatrix(M_,ybe),$.transpose(Y,Y)):N=$.transpose(B,xbe);let A=$.multiplyByVector(B,h,Ebe),I=$.multiplyByVector(Y,W,Tbe);m.subtract(A,I,V4);let Z=m.magnitude(V4)*1e3,G=V.GRAVITATIONALPARAMETER,w=-G/(Z*Z-2*G/m.magnitude(A));w<0||w>dct*d.maximumRadius?(f=Cbe,m.normalize(h,f),m.negate(f,f),C=m.clone(m.UNIT_Z,G4),b=m.cross(C,f,R9),m.magnitude(b)>V.EPSILON7&&(m.normalize(f,f),m.normalize(b,b),C=m.cross(f,b,G4),m.normalize(C,C),p=!0)):m.equalsEpsilon(h,W,V.EPSILON7)||(C=Cbe,m.normalize(A,C),m.normalize(I,I),b=m.cross(C,I,G4),g&&(b=m.multiplyByScalar(b,-1,b)),m.equalsEpsilon(b,m.ZERO,V.EPSILON7)||(f=m.cross(b,C,R9),$.multiplyByVector(N,f,f),$.multiplyByVector(N,b,b),$.multiplyByVector(N,C,C),m.normalize(f,f),m.normalize(b,b),m.normalize(C,C),p=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let E,T,S;i&&(E=m.clone(t.position,V4),T=m.clone(t.direction,Ebe),S=m.clone(t.up,Tbe));let _=sct,R;l(s)&&(R=s.getValue(c,act));let L=r.getValue(c,cct);if(a===ZA.INERTIAL&&l(R))F.fromTranslationQuaternionRotationScale(h,R,m.ONE,_);else if(a===ZA.VELOCITY&&l(L)){let W=Tt.rotationMatrixFromPositionVelocity(h,L,d,lct);F.fromRotationTranslation(W,h,_)}else a===ZA.ENU||!p?Tt.eastNorthUpToFixedFrame(h,d,_):(_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=0,_[4]=b.x,_[5]=b.y,_[6]=b.z,_[7]=0,_[8]=C.x,_[9]=C.y,_[10]=C.z,_[11]=0,_[12]=h.x,_[13]=h.y,_[14]=h.z,_[15]=0);t._setTransform(_),i&&(m.clone(E,t.position),m.clone(T,t.direction),m.clone(S,t.up),m.cross(T,S,t.right))}if(n){let p=u===se.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function MY(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ie.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._velocityProperty=new vg(e.position,!0),this._offset3D=new m}Object.defineProperties(MY,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});MY.defaultOffset3D=new m(-14e3,3500,3500);var G9=new Xm,mct=new m;MY.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===se.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,d=r.orientation,u=r!==this._lastEntity,h=o!==this._mode,p=n.camera,g=u||h,f=!0;if(u){let b=r.viewFrom,C=l(b);if(!C&&l(t)){G9.pitch=-V.PI_OVER_FOUR,G9.range=0;let E=a.getValue(e,mct);if(l(E)){let T=2-1/Math.max(1,m.magnitude(E)/i.maximumRadius);G9.pitch*=T}p.viewBoundingSphere(t,G9),this.boundingSphere=t,g=!1,f=!1}else(!C||!l(b.getValue(e,this._offset3D)))&&m.clone(MY._defaultOffset3D,this._offset3D)}else!h&&this._mode!==se.SCENE2D&&m.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,uct(this,p,g,f,a,c,d,s,e,i)};var UY=MY;var iVi=y(x(),1);var WRi=y(x(),1);function vY(){this._cache={}}vY.prototype.fromColor=function(e,t){return V9(void 0,void 0,e,t,this._cache)};vY.prototype.fromUrl=function(e,t,n){return V9(e,void 0,t,n,this._cache)};vY.prototype.fromMakiIconId=function(e,t,n){return V9(en(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};vY.prototype.fromText=function(e,t,n){return V9(void 0,e,t,n,this._cache)};var hct=new D;function fct(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,hct).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 Sbe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=D.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=D.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var DY=new Array(4);function V9(e,t,n,i,o){DY[0]=e,DY[1]=t,DY[2]=n,DY[3]=i;let r=JSON.stringify(DY),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(fct(c,n,i),l(e)){let u=Ge.createIfNeeded(e).fetchImage().then(function(h){return Sbe(c,h,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=YC(t,{font:`bold ${i}px sans-serif`});Sbe(c,d,i)}return o[r]=a,a}var Jg=vY;var EGi=y(x());var MRi=y(x());var NRi=y(x());var BRi=y(x());function L4(e){return e}function L9(e){if(e==null)return L4;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var d=2,u=a.length,h=new Array(u);for(h[0]=(t+=a[0])*i+r,h[1]=(n+=a[1])*o+s;d<u;)h[d]=a[d],++d;return h}}var ORi=y(x());var DRi=y(x());function Ibe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function W4(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return _be(e,n)})}:_be(e,t)}function _be(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=F4(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function F4(e,t){var n=L9(e.transform),i=e.arcs;function o(u,h){h.length&&h.pop();for(var p=i[u<0?~u:u],g=0,f=p.length;g<f;++g)h.push(n(p[g],g));u<0&&Ibe(h,f)}function r(u){return n(u)}function s(u){for(var h=[],p=0,g=u.length;p<g;++p)o(u[p],h);return h.length<2&&h.push(h[0]),h}function a(u){for(var h=s(u);h.length<4;)h.push(h[0]);return h}function c(u){return u.map(a)}function d(u){var h=u.type,p;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(d)};case"Point":p=r(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(r);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=c(u.arcs);break;case"MultiPolygon":p=u.arcs.map(c);break;default:return null}return{type:h,coordinates:p}}return d(t)}var qRi=y(x());var HRi=y(x());var nGi=y(x());var cGi=y(x());var oGi=y(x());var pGi=y(x());var uGi=y(x());function W9(e){return m.fromDegrees(e[0],e[1],e[2])}var B4={"urn:ogc:def:crs:OGC:1.3:CRS84":W9,"EPSG:4326":W9,"urn:ogc:def:crs:EPSG::4326":W9},Zbe={},Rbe={},w4=48,Y4,N4=D.ROYALBLUE,X4=D.YELLOW,P4=2,M4=D.fromBytes(255,255,0,100),U4=!1,yct={small:24,medium:48,large:64},xct=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Gbe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||xct.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Gbe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function Cct(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function Ect(e,t){return new Th(Cct(Gbe,e,t),!0)}function F9(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Kn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let h=u.toLowerCase();if(d>1&&h==="title"){d=1,s=u;break}else d>2&&h==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new mi(c):n(r,s))}return o}function D4(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Vbe={Feature:Wbe,FeatureCollection:Tct,GeometryCollection:Fbe,LineString:Xbe,MultiLineString:Pbe,MultiPoint:Ybe,MultiPolygon:Dbe,Point:wbe,Polygon:Ube,Topology:vbe},Lbe={GeometryCollection:Fbe,LineString:Xbe,MultiLineString:Pbe,MultiPoint:Ybe,MultiPolygon:Dbe,Point:wbe,Polygon:Ube,Topology:vbe};function Wbe(e,t,n,i,o){if(t.geometry===null){F9(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new he("feature.geometry is required.");let r=t.geometry.type,s=Lbe[r];if(!l(s))throw new he(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Tct(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)Wbe(e,r[s],void 0,i,o)}function Fbe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],d=c.type,u=Lbe[d];if(!l(u))throw new he(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function Bbe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=D.fromCssColorString(g)),a=yct[c["marker-size"]]??a;let f=c["marker-symbol"];l(f)&&(r=f)}let d;l(r)?r.length===1?d=e._pinBuilder.fromText(r.toUpperCase(),s,a):d=e._pinBuilder.fromMakiIconId(r,s,a):d=e._pinBuilder.fromColor(s,a);let u=new wc;u.verticalOrigin=new mi(vn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=tt.CLAMP_TO_GROUND);let h=F9(t,e._entityCollection,o.describe);h.billboard=u,h.position=new gl(n(i));let p=Promise.resolve(d).then(function(g){u.image=new mi(g)}).catch(function(){u.image=new mi(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function wbe(e,t,n,i,o){Bbe(e,t,i,n.coordinates,o)}function Ybe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Bbe(e,t,i,r[s],o)}function Nbe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let u=a["stroke-width"];l(u)&&(s=new mi(u));let h,p=a.stroke;l(p)&&(h=D.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(h)||(h=r.color.getValue().clone()),h.alpha=g),l(h)&&(r=new Kt(h))}let c=F9(t,e._entityCollection,o.describe),d=new Nc;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new mi(D4(i,n)),d.arcType=ln.RHUMB}function Xbe(e,t,n,i,o){Nbe(e,t,i,n.coordinates,o)}function Pbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Nbe(e,t,i,r[s],o)}function Mbe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new mi(g));let f,b=c.stroke;l(b)&&(f=D.fromCssColorString(b));let C=c["stroke-opacity"];l(C)&&C!==1&&(l(f)||(f=r.getValue().clone()),f.alpha=C),l(f)&&(r=new mi(f));let E,T=c.fill,S=s.color.getValue();l(T)&&(E=D.fromCssColorString(T),E.alpha=S.alpha),C=c["fill-opacity"],l(C)&&C!==S.alpha&&(l(E)||(E=S.clone()),E.alpha=C),l(E)&&(s=new Kt(E))}let d=new Ch;d.outline=new mi(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=ln.RHUMB;let u=[];for(let g=1,f=i.length;g<f;g++)u.push(new gc(D4(i[g],n)));let h=i[0];d.hierarchy=new mi(new gc(D4(h,n),u)),h[0].length>2?d.perPositionHeight=new mi(!0):o.clampToGround||(d.height=0);let p=F9(t,e._entityCollection,o.describe);p.polygon=d}function Ube(e,t,n,i,o){Mbe(e,t,i,n.coordinates,o)}function Dbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Mbe(e,t,i,r[s],o)}function vbe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=W4(n,n.objects[r]),a=Vbe[s.type];a(e,s,s,i,o)}}function my(e){this._name=e,this._changed=new Ce,this._error=new Ce,this._isLoading=!1,this._loading=new Ce,this._entityCollection=new Ga(this),this._promises=[],this._pinBuilder=new Jg,this._entityCluster=new mu,this._credit=void 0,this._resourceCredits=[]}my.load=function(e,t){return new my().load(e,t)};Object.defineProperties(my,{markerSize:{get:function(){return w4},set:function(e){w4=e}},markerSymbol:{get:function(){return Y4},set:function(e){Y4=e}},markerColor:{get:function(){return N4},set:function(e){N4=e}},stroke:{get:function(){return X4},set:function(e){X4=e}},strokeWidth:{get:function(){return P4},set:function(e){P4=e}},fill:{get:function(){return M4},set:function(e){M4=e}},clampToGround:{get:function(){return U4},set:function(e){U4=e}},crsNames:{get:function(){return B4}},crsLinkHrefs:{get:function(){return Zbe}},crsLinkTypes:{get:function(){return Rbe}}});Object.defineProperties(my.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});my.prototype.load=function(e,t){return kbe(this,e,t,!0)};my.prototype.process=function(e,t){return kbe(this,e,t,!1)};function kbe(e,t,n,i){ps.setLoading(e,!0),n=n??Q.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new bt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Ge){t=Ge.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return n={describe:n.describe??Ect,markerSize:n.markerSize??w4,markerSymbol:n.markerSymbol??Y4,markerColor:n.markerColor??N4,strokeWidthProperty:new mi(n.strokeWidth??P4),strokeMaterialProperty:new Kt(n.stroke??X4),fillMaterialProperty:new Kt(n.fill??M4),clampToGround:n.clampToGround??U4},Promise.resolve(r).then(function(a){return Sct(e,a,n,s,i)}).catch(function(a){throw ps.setLoading(e,!1),e._error.raiseEvent(e,a),a})}my.prototype.update=function(e){return!0};function Sct(e,t,n,i,o){let r;l(i)&&(r=Ng(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Vbe[t.type];if(!l(s))throw new he(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?W9:null;if(l(a)){if(!l(a.properties))throw new he("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(c=B4[d.name],!l(c))throw new he(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=Zbe[d.href];if(l(u)||(u=Rbe[d.type]),!l(u))throw new he(`Unable to resolve crs link: ${JSON.stringify(d)}`);c=u(d)}else if(a.type==="EPSG"){if(c=B4[`EPSG:${d.code}`],!l(c))throw new he(`Unknown crs EPSG code: ${d.code}`)}else throw new he(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(d){return o&&e._entityCollection.removeAll(),d!==null&&s(e,t,t,d,n),Promise.all(e._promises).then(function(){return e._promises.length=0,ps.setLoading(e,!1),e})})}var hy=my;var HLi=y(x(),1);var cLi=y(x());var O1i=y(x());var rVi=y(x(),1),v4=function(e,t){return v4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},v4(e,t)};function Gp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");v4(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Os=function(){return Os=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Os.apply(this,arguments)};function Qbe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function Obe(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var aVi=y(x()),zbe="4.1.5";var lVi=y(x()),Hbe=Object.prototype.hasOwnProperty;function Cu(e){return typeof e=="boolean"}function Kbe(e,t,n){var i;return e.length>t&&(n==null?(n="&hellip;",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function fy(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function ff(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var IVi=y(x());var mVi=y(x());var B9=/\s+/,w9=(function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(B9):[],o=t.split(B9),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(B9):[],o=t.split(B9),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)Hbe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();var fVi=y(x());function jbe(e,t,n){var i,o;if(n==null?(n="&hellip;",o=3,i=8):(o=n.length,i=n.length),e.length<=t)return e;var r=t-o,s=Ict(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=Jbe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=Jbe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=r)return s.host.length===t?(s.host.substr(0,t-o)+n).substr(0,r+i):k4(c,r,n).substr(0,r+i);var d="";if(s.path&&(d+="/"+s.path),s.query&&(d+="?"+s.query),d)if((c+d).length>=r){if((c+d).length==t)return(c+d).substr(0,t);var u=r-c.length;return(c+k4(d,u,n)).substr(0,r+i)}else c+=d;if(s.fragment){var h="#"+s.fragment;if((c+h).length>=r){if((c+h).length==t)return(c+h).substr(0,t);var p=r-c.length;return(c+k4(h,p,n)).substr(0,r+i)}else c+=h}if(s.scheme&&s.host){var g=s.scheme+"://";if((c+g).length<r)return(g+c).substr(0,t)}if(c.length<=t)return c;var f="";return r>0&&(f=c.substr(-1*Math.floor(r/2))),(c.substr(0,Math.ceil(r/2))+n+f).substr(0,r+i)}function Ict(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function Jbe(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}function k4(e,t,n){var i=t/2,o=Math.ceil(i),r=-1*Math.floor(i),s="";return r<0&&(s=e.substr(r)),e.substr(0,o)+n+s}var AVi=y(x());function qbe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="&hellip;",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var yVi=y(x());function $be(e,t,n){return Kbe(e,t,n)}var e0e=(function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new w9({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,o=n.location;return o==="smart"?jbe(t,i):o==="middle"?qbe(t,i):$be(t,i)},e})();var V1i=y(x());var MVi=y(x());var ZVi=y(x()),Vp=(function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e})();var wVi=y(x());var GVi=y(x());function t0e(e){return e>=0&&e<=31||e==127}function jg(e){return e>=65&&e<=90||e>=97&&e<=122}function zs(e){return e>=48&&e<=57}function Y9(e){return e==34||e==39}function py(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function pf(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function n0e(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function i0e(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function N9(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function o0e(e){return e<91?e==40:e==91||e==123}function Q4(e){return e<93?e==41:e==93||e==125}var LVi=y(x()),r0e=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|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|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|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--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--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|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|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|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--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|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--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|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|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|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|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|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|walter|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|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|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|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|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|dvag|erni|fage|fail|fans|farm|fast|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|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|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|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|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|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|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|gay|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|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|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|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|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|ss|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|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var O4=/https?:\/\//i,s0e=new RegExp("^"+O4.source,"i"),_ct=/^(javascript|vbscript):/i,Zct=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,Rct=/^(?:\/\/)?([^/#?:]+)/,U_=jg;function z4(e){return jg(e)||zs(e)||e===43||e===45||e===46}var qg=pf;function X9(e){return e===95||qg(e)}function H4(e){return pf(e)||i0e(e)||N9(e)}function P9(e){return e===47||e===63||e===35}function K4(e){return r0e.test(e.toLowerCase())}function a0e(e){if(_ct.test(e))return!1;var t=e.match(Zct);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function c0e(e){var t=e.match(Rct);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!K4(o)}var Gct=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,Vct=/[:/?#]/;function l0e(e){var t=e.split(Vct,1)[0];return Gct.test(t)}var Lct=/^(https?:\/\/)?(?:www\.)?/i,Wct=/^\/\//,d0e=(function(e){Gp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=wct(n)),this.stripPrefix.scheme&&(n=Fct(n)),this.stripPrefix.www&&(n=Bct(n)),this.stripTrailingSlash&&(n=Yct(n)),this.decodePercentEncoding&&(n=Nct(n)),n},t})(Vp);function Fct(e){return e.replace(s0e,"")}function Bct(e){return e.includes("www.")?e.replace(Lct,"$1"):e}function wct(e){return e.replace(Wct,"")}function Yct(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function Nct(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?"&quot;":n==="%26"?"&amp;":n==="%27"?"&#39;":n==="%3C"||n==="%3c"?"&lt;":"&gt;"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var kVi=y(x());var u0e=/^mailto:/i,J4=pf;function M9(e){return J4(e)||n0e(e)}function m0e(e){var t=e.split(".").pop();return K4(t)}var HVi=y(x());var h0e=(function(e){Gp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return 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})(Vp);var jVi=y(x());function j4(e){return e===95||pf(e)}function f0e(e){return e.length<=140}var p0e=["twitter","facebook","instagram","tiktok","youtube"];var n1i=y(x());var A0e=(function(e){Gp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return 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 n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:ff(n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(Vp);var r1i=y(x());var Xct={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function q4(e){return e===45||e===46||e===95||jg(e)||zs(e)}function g0e(e,t){var n=Xct[t];return n.test(e)}var b0e=["twitter","instagram","soundcloud","tiktok","youtube"];var d1i=y(x());var y0e=(function(e){Gp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return 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":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:ff(this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(Vp);var m1i=y(x()),Pct=/[-. ()]/,Mct=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\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)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,Uct=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,Dct=new RegExp("^".concat(Mct.source,"|").concat(Uct.source,"$"));function $4(e){return e===45||e===46||e===32}function U9(e){return e===44||e===59}function x0e(e){var t=e.charAt(0)==="+"||Pct.test(e);return t&&Dct.test(e)}var A1i=y(x());var C0e=(function(e){Gp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return 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})(Vp);var vct=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),T0e(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),T0e(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function S0e(e,t){for(var n=new vct(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)D9(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var s=n.stateMachines[r];switch(s.state){case 11:Kct(n,s,o);break;case 12:Jct(n,s,o);break;case 0:kct(n,s,o);break;case 1:Qct(n,s,o);break;case 2:Oct(n,s,o);break;case 3:zct(n,s,o);break;case 4:Hct(n,s,i,o);break;case 5:jct(n,s,o);break;case 6:qct(n,s,i,o);break;case 7:$ct(n,s,i,o);break;case 13:elt(n,s,o);break;case 14:tlt(n,s,o);break;case 8:nlt(n,s,o);break;case 9:ilt(n,s,o);break;case 10:olt(n,s,o);break;case 15:rlt(n,s,i,o);break;case 16:slt(n,s,i,o);break;case 17:alt(n,s,i,o);break;case 18:clt(n,s,i,o);break;case 19:llt(n,s,i,o);break;case 20:dlt(n,s,o);break;case 21:ult(n,s,o);break;case 22:TE(n,s,o);break;case 23:mlt(n,s,o);break;case 24:hlt(n,s,o);break;case 25:flt(n,s,o);break;case 26:plt(n,s,o);break;case 27:Alt(n,s,o);break;case 28:glt(n,s,o);break;case 29:blt(n,s,o);break;case 30:ylt(n,s,o);break;case 31:xlt(n,s,o);break;case 32:Elt(n,s,i,o);break;case 33:Tlt(n,s,o);break;case 34:Slt(n,s,o);break;case 35:Ilt(n,s,o);break;case 36:_lt(n,s,i,o);break;case 37:Clt(n,s,i,o);break;case 38:Zlt(n,s,i,o);break;case 39:Rlt(n,s,i,o);break;case 40:Glt(n,s,o);break;case 41:Vlt(n,s,o);break;default:ff(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&U_(o)){var a=n.text.charCodeAt(n.charIdx-1);U_(a)||n.addMachine(v9(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(d){return gs(n,d)});return n.matches}function D9(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(wlt(i,28));else if(n===64)e.addMachine(Ylt(i,30));else if(n===47)e.addMachine(t8(i,11));else if(n===43)e.addMachine(e8(i,37));else if(n===40)e.addMachine(e8(i,32));else{if(zs(n)&&(e.addMachine(e8(i,38)),e.addMachine(Flt(i,13))),J4(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(Blt(i,o))}U_(n)&&e.addMachine(v9(i,0)),pf(n)&&e.addMachine(t8(i,5))}}function kct(e,t,n){n===58?t.state=2:n===45?t.state=1:z4(n)||e.removeMachine(t)}function Qct(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(t8(i,11))):z4(n)?t.state=0:e.removeMachine(t))}function Oct(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):qg(n)?(t.state=5,U_(n)&&e.addMachine(v9(i,0))):e.removeMachine(t)}function zct(e,t,n){n===47?t.state=4:H4(n)?(t.state=10,t.acceptStateReached=!0):gs(e,t)}function Hct(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):qg(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function Kct(e,t,n){n===47?t.state=12:e.removeMachine(t)}function Jct(e,t,n){qg(n)?t.state=5:e.removeMachine(t)}function jct(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:P9(n)?t.state=10:X9(n)||gs(e,t)}function qct(e,t,n,i){i===45||(i===46?gs(e,t):qg(i)?t.state=5:gs(e,t))}function $ct(e,t,n,i){i===46?gs(e,t):qg(i)?(t.state=5,t.acceptStateReached=!0):gs(e,t)}function elt(e,t,n){n===46?t.state=14:n===58?t.state=8:zs(n)||(P9(n)?t.state=10:pf(n)?e.removeMachine(t):gs(e,t))}function tlt(e,t,n){zs(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):gs(e,t)}function nlt(e,t,n){zs(n)?t.state=9:gs(e,t)}function ilt(e,t,n){zs(n)||(P9(n)?t.state=10:gs(e,t))}function olt(e,t,n){H4(n)||gs(e,t)}function rlt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:TE(e,t,i)}function slt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:TE(e,t,i)}function alt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:TE(e,t,i)}function clt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:TE(e,t,i)}function llt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:TE(e,t,i)}function dlt(e,t,n){n===58?t.state=21:TE(e,t,n)}function ult(e,t,n){M9(n)?t.state=22:e.removeMachine(t)}function TE(e,t,n){n===46?t.state=23:n===64?t.state=24:M9(n)?t.state=22:e.removeMachine(t)}function mlt(e,t,n){n===46||n===64?e.removeMachine(t):M9(n)?t.state=22:e.removeMachine(t)}function hlt(e,t,n){qg(n)?t.state=25:e.removeMachine(t)}function flt(e,t,n){n===46?t.state=27:n===45?t.state=26:X9(n)||gs(e,t)}function plt(e,t,n){n===45||n===46?gs(e,t):X9(n)?t.state=25:gs(e,t)}function Alt(e,t,n){n===46||n===45?gs(e,t):qg(n)?(t.state=25,t.acceptStateReached=!0):gs(e,t)}function glt(e,t,n){j4(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function blt(e,t,n){j4(n)||gs(e,t)}function ylt(e,t,n){q4(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function xlt(e,t,n){q4(n)||(pf(n)?e.removeMachine(t):gs(e,t))}function Clt(e,t,n,i){zs(i)?t.state=38:(e.removeMachine(t),D9(e,n,i))}function Elt(e,t,n,i){zs(i)?t.state=33:e.removeMachine(t),D9(e,n,i)}function Tlt(e,t,n){zs(n)?t.state=34:e.removeMachine(t)}function Slt(e,t,n){zs(n)?t.state=35:e.removeMachine(t)}function Ilt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function _lt(e,t,n,i){zs(i)?t.state=38:$4(i)?t.state=39:e.removeMachine(t)}function Zlt(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,U9(i)?t.state=40:i===35?t.state=41:zs(i)||(i===40?t.state=32:$4(i)?t.state=39:(gs(e,t),U_(i)&&e.addMachine(v9(o,0))))}function Rlt(e,t,n,i){zs(i)?t.state=38:i===40?t.state=32:(gs(e,t),D9(e,n,i))}function Glt(e,t,n){U9(n)||(n===35?t.state=41:zs(n)?t.state=38:gs(e,t))}function Vlt(e,t,n){U9(n)?t.state=40:zs(n)?e.removeMachine(t):gs(e,t)}function gs(e,t){var n=e.matches,i=e.text,o=e.charIdx,r=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,d=e.hashtagServiceName,u=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var h=t.startIdx,p=i.slice(t.startIdx,o);switch(p=Wlt(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var f=O4.exec(p);if(f&&(h=h+f.index,p=p.slice(f.index)),!a0e(p))return;break}case 1:{if(!c0e(p))return;break}case 2:{if(!l0e(p))return;break}default:ff(t)}n.push(new d0e({tagBuilder:r,matchedText:p,offset:h,urlMatchType:Llt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{m0e(p)&&n.push(new h0e({tagBuilder:r,matchedText:p,offset:h,email:p.replace(u0e,"")}));break}case 2:{f0e(p)&&n.push(new A0e({tagBuilder:r,matchedText:p,offset:h,serviceName:d,hashtag:p.slice(1)}));break}case 3:{g0e(p,u)&&n.push(new y0e({tagBuilder:r,matchedText:p,offset:h,serviceName:u,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),x0e(p)){var b=p.replace(/[^0-9,;#]/g,"");n.push(new C0e({tagBuilder:r,matchedText:p,offset:h,number:b,plusSign:p.charAt(0)==="+"}))}break}default:ff(t)}}}function Llt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:ff(e)}}var E0e={")":"(","}":"{","]":"["};function Wlt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);o0e(o)?t[i]++:Q4(o)&&t[E0e[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if(Q4(o)){var s=E0e[i];if(t[s]<0)t[s]++,r--;else break}else if(N9(o))r--;else break}return e.slice(0,r+1)}function v9(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function t8(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function Flt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function Blt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function wlt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function Ylt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function e8(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function T0e(e){return e.type===0&&e.matchType===0}var w1i=y(x());var Lp=(function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e})(),i8=new Lp,Nlt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=i8,this.html=t,this.callbacks=n}return e})();function I0e(e,t){for(var n=new Nlt(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:Xlt(n,o);break;case 1:Plt(n,o,r);break;case 2:Ult(n,o,r);break;case 3:Mlt(n,o,r);break;case 4:Dlt(n,o,r);break;case 5:vlt(n,o,r);break;case 6:klt(n,o,r);break;case 7:Qlt(n,o,r);break;case 8:Olt(n,o);break;case 9:zlt(n,o);break;case 10:Hlt(n,o,r);break;case 11:Klt(n,o,r);break;case 12:Jlt(n,o);break;case 13:jlt(n);break;case 14:qlt(n,o);break;case 15:$lt(n,o);break;case 16:edt(n,o);break;case 17:tdt(n,o);break;case 18:ndt(n,o);break;case 19:idt(n,o);break;case 20:odt(n,o);break;default:ff(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&rdt(n)}function Xlt(e,t){t==="<"&&Wp(e)}function Plt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new Lp(Os(Os({},e.currentTag),{isClosing:!0}))):t==="<"?Wp(e):jg(n)?(e.state=3,e.currentTag=new Lp(Os(Os({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=i8)}function Mlt(e,t,n){py(n)?(e.currentTag=new Lp(Os(Os({},e.currentTag),{name:n8(e)})),e.state=4):t==="<"?Wp(e):t==="/"?(e.currentTag=new Lp(Os(Os({},e.currentTag),{name:n8(e)})),e.state=12):t===">"?(e.currentTag=new Lp(Os(Os({},e.currentTag),{name:n8(e)})),Fp(e)):!jg(n)&&!zs(n)&&t!==":"&&Pm(e)}function Ult(e,t,n){t===">"?Pm(e):jg(n)?e.state=3:Pm(e)}function Dlt(e,t,n){py(n)||(t==="/"?e.state=12:t===">"?Fp(e):t==="<"?Wp(e):t==="="||Y9(n)||t0e(n)?Pm(e):e.state=5)}function vlt(e,t,n){py(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?Fp(e):t==="<"?Wp(e):Y9(n)&&Pm(e)}function klt(e,t,n){py(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?Fp(e):t==="<"?Wp(e):Y9(n)?Pm(e):e.state=5)}function Qlt(e,t,n){py(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Pm(e):t==="<"?Wp(e):e.state=10)}function Olt(e,t){t==='"'&&(e.state=11)}function zlt(e,t){t==="'"&&(e.state=11)}function Hlt(e,t,n){py(n)?e.state=4:t===">"?Fp(e):t==="<"&&Wp(e)}function Klt(e,t,n){py(n)?e.state=4:t==="/"?e.state=12:t===">"?Fp(e):t==="<"?Wp(e):(e.state=4,sdt(e))}function Jlt(e,t){t===">"?(e.currentTag=new Lp(Os(Os({},e.currentTag),{isClosing:!0})),Fp(e)):Pm(e)}function jlt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new Lp(Os(Os({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new Lp(Os(Os({},e.currentTag),{type:"doctype"})),e.state=20):Pm(e)}function qlt(e,t){t==="-"?e.state=15:t===">"?Pm(e):e.state=16}function $lt(e,t){t==="-"?e.state=18:t===">"?Pm(e):e.state=16}function edt(e,t){t==="-"&&(e.state=17)}function tdt(e,t){t==="-"?e.state=18:e.state=16}function ndt(e,t){t===">"?Fp(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function idt(e,t){t==="-"?e.state=17:t===">"?Fp(e):e.state=16}function odt(e,t){t===">"?Fp(e):t==="<"&&Wp(e)}function Pm(e){e.state=0,e.currentTag=i8}function Wp(e){e.state=1,e.currentTag=new Lp({idx:e.charIdx})}function Fp(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),Pm(e),e.currentDataIdx=e.charIdx+1}function rdt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function n8(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function sdt(e){e.charIdx--}var adt=(function(){function e(t){t===void 0&&(t={}),this.version=e.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.sanitizeHtml=!1,this.tagBuilder=null,this.urls=cdt(t.urls),this.email=Cu(t.email)?t.email:this.email,this.phone=Cu(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Cu(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=ldt(t.stripPrefix),this.stripTrailingSlash=Cu(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Cu(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&b0e.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&p0e.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=ddt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return I0e(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,d=s.split(c),u=a;d.forEach(function(h,p){if(p%2===0){var g=n.parseText(h,u);r.push.apply(r,Obe([],Qbe(g),!1))}u+=h.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(){},onDoctype:function(){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(udt);for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===o){var s=t[n+1].getMatchedText().length>r?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||fy(t,function(n){return n.getType()==="hashtag"}),this.email||fy(t,function(n){return n.getType()==="email"}),this.phone||fy(t,function(n){return n.getType()==="phone"}),this.mention||fy(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||fy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||fy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||fy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=S0e(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var n=this.parse(t),i=new Array(n.length*2+1),o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof w9)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e0e({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=zbe,e})(),_0e=adt;function cdt(e){return e==null&&(e=!0),Cu(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Cu(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Cu(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Cu(e.ipV4Matches)?e.ipV4Matches:!0}}function ldt(e){return e==null&&(e=!0),Cu(e)?{scheme:e,www:e}:{scheme:Cu(e.scheme)?e.scheme:!0,www:Cu(e.www)?e.www:!0}}function ddt(e){return typeof e=="number"?{length:e,location:"end"}:Os({length:Number.POSITIVE_INFINITY,location:"end"},e)}function udt(e,t){return e.getOffset()-t.getOffset()}var K1i=y(x());var z1i=y(x());var oLi=y(x());var k9=_0e;var w0e;typeof DOMParser<"u"&&(w0e=new DOMParser);var mdt=new k9({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),Q9=32,Z0e=2414016,R0e=1,G0e=16093e3,V0e=.1,hdt=[null,void 0,"http://www.topografix.com/GPX/1/1"],jo={gpx:hdt};function fdt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function o8(e,t){let n=OY(e,"id");return n=l(n)?n:Kn(),t.getOrCreateEntity(n)}function r8(e){let t=L0e(e,"lon"),n=L0e(e,"lat"),i=kY(e,"ele",jo.gpx);return m.fromDegrees(t,n,i)}function L0e(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function OY(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ay(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function s8(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function kY(e,t,n){let i=Ay(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function _d(e,t,n){let i=Ay(e,t,n);if(l(i))return i.textContent.trim()}function Y0e(e){let t=new wc;return t.width=Q9,t.height=Q9,t.scaleByDistance=new kt(Z0e,R0e,G0e,V0e),t.pixelOffsetScaleByDistance=new kt(Z0e,R0e,G0e,V0e),t.verticalOrigin=new mi(vn.BOTTOM),t.image=e,t}function pdt(){let e=new xh;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new M(17,0),e.horizontalOrigin=Bi.LEFT,e.font="16px sans-serif",e.style=cr.FILL_AND_OUTLINE,e}function N0e(e){let t=new Nc;return t.width=4,t.material=new ey,t.material.color=l(e)?e:D.RED,t.material.outlineWidth=2,t.material.outlineColor=D.BLACK,t}var W0e={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},QY;typeof document<"u"&&(QY=document.createElement("div"));function a8(e,t){let n,i="",o=Object.keys(W0e),r=o.length;for(n=0;n<r;n++){let u=o[n],h=W0e[u];h.value=_d(e,h.tag,jo.gpx)??"",l(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!l(i)||i==="")return;i=mdt.link(i),QY.innerHTML=i;let s=QY.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=D.WHITE,c=D.BLACK,d='<div class="cesium-infoBox-description-lighter" style="';return d+="overflow:auto;",d+="word-wrap:break-word;",d+=`background-color:${a.toCssColorString()};`,d+=`color:${c.toCssColorString()};`,d+='">',d+=`${QY.innerHTML}</div>`,QY.innerHTML="",d}function X0e(e,t,n,i){let o=r8(t),r=o8(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",D.RED,Q9);r.billboard=Y0e(s);let a=_d(t,"name",jo.gpx);r.name=a,r.label=pdt(),r.label.text=a,r.description=a8(t,r),i.clampToGround&&(r.billboard.heightReference=tt.CLAMP_TO_GROUND,r.label.heightReference=tt.CLAMP_TO_GROUND)}function Adt(e,t,n,i){let o=o8(t,n);o.description=a8(t,o);let r=s8(t,"rtept",jo.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)X0e(e,r[a],n,i),s[a]=r8(r[a]);o.polyline=N0e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function gdt(e,t,n,i){let o=o8(t,n);o.description=a8(t,o);let r=s8(t,"trkseg",jo.gpx),s=[],a=[],c,d=!0,u=new ec;for(let h=0;h<r.length;h++)c=bdt(r[h]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",D.RED,Q9);o.billboard=Y0e(h),o.position=u,i.clampToGround&&(o.billboard.heightReference=tt.CLAMP_TO_GROUND),o.availability=new fs,o.availability.addInterval(new Wn({start:a[0],stop:a[a.length-1]}))}o.polyline=N0e(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function bdt(e){let t={positions:[],times:[]},n=s8(e,"trkpt",jo.gpx),i;for(let o=0;o<n.length;o++){let r=r8(n[o]);t.positions.push(r),i=_d(n[o],"time",jo.gpx),l(i)&&t.times.push(j.fromIso8601(i))}return t}function ydt(e){let t=Ay(e,"metadata",jo.gpx);if(l(t)){let n={name:_d(t,"name",jo.gpx),desc:_d(t,"desc",jo.gpx),author:xdt(t),copyright:Edt(t),link:P0e(t),time:_d(t,"time",jo.gpx),keywords:_d(t,"keywords",jo.gpx),bounds:Tdt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function xdt(e){let t=Ay(e,"author",jo.gpx);if(l(t)){let n={name:_d(t,"name",jo.gpx),email:Cdt(t),link:P0e(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Cdt(e){let t=Ay(e,"email",jo.gpx);if(l(t)){let n=_d(t,"id",jo.gpx),i=_d(t,"domain",jo.gpx);return`${n}@${i}`}}function P0e(e){let t=Ay(e,"link",jo.gpx);if(l(t)){let n={href:OY(t,"href"),text:_d(t,"text",jo.gpx),mimeType:_d(t,"type",jo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function Edt(e){let t=Ay(e,"copyright",jo.gpx);if(l(t)){let n={author:OY(t,"author"),year:_d(t,"year",jo.gpx),license:_d(t,"license",jo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function Tdt(e){let t=Ay(e,"bounds",jo.gpx);if(l(t)){let n={minLat:kY(t,"minlat",jo.gpx),maxLat:kY(t,"maxlat",jo.gpx),minLon:kY(t,"minlon",jo.gpx),maxLon:kY(t,"maxlon",jo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var F0e={wpt:X0e,rte:Adt,trk:gdt};function Sdt(e,t,n,i){let o=Object.keys(F0e),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=F0e[a],d=t.childNodes,u=d.length;for(let h=0;h<u;h++){let p=d[h];p.localName===a&&jo.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function B0e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=OY(o,"version"),s=OY(o,"creator"),a,c=ydt(o);l(c)&&(a=c.name),o.localName==="gpx"?Sdt(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),h=u.start,p=u.stop,g=j.equals(h,Ke.MINIMUM_VALUE),f=j.equals(p,Ke.MAXIMUM_VALUE);if(!g||!f){let C;g&&(C=new Date,C.setHours(0,0,0,0),h=j.fromDate(C)),f&&(C=new Date,C.setHours(24,0,0,0),p=j.fromDate(C)),d=new rf,d.startTime=h,d.stopTime=p,d.currentTime=j.clone(h),d.clockRange=As.LOOP_STOP,d.clockStep=wo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(j.secondsDifference(p,h)/60,1),31556900))}let b=!1;return e._name!==a&&(e._name=a,b=!0),e._creator!==s&&(e._creator=s,b=!0),Idt(e._metadata,c)&&(e._metadata=c,b=!0),e._version!==r&&(e._version=r,b=!0),d!==e._clock&&(b=!0,e._clock=d),b&&e._changed.raiseEvent(e),ps.setLoading(e,!1),e}function Idt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function _dt(e,t,n,i){i=i??Q.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof Ge){n=Ge.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?fdt(r).then(function(s){let a,c;try{a=w0e.parseFromString(s,"application/xml")}catch(d){c=d.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let d=l(c)?c:a.documentElement.firstChild.nodeValue;throw d||(d=a.body.innerText),new he(d)}return B0e(e,a,i)}):B0e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function D_(){this._changed=new Ce,this._error=new Ce,this._loading=new Ce,this._clock=void 0,this._entityCollection=new Ga(this),this._entityCluster=new mu,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Jg}D_.load=function(e,t){return new D_().load(e,t)};Object.defineProperties(D_.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});D_.prototype.update=function(e){return!0};D_.prototype.load=function(e,t){if(!l(e))throw new Ae("data is required.");t=t??Q.EMPTY_OBJECT,ps.setLoading(this,!0);let n=this._name,i=this;return _dt(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=j.equals(s,Ke.MINIMUM_VALUE),d=j.equals(a,Ke.MAXIMUM_VALUE);if(!c||!d){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=j.fromDate(h)),d&&(h=new Date,h.setHours(24,0,0,0),a=j.fromDate(h)),o=new rf,o.startTime=s,o.stopTime=a,o.currentTime=j.clone(s),o.clockRange=As.LOOP_STOP,o.clockStep=wo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(j.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),ps.setLoading(i,!1),i}).catch(function(o){return ps.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var zY=D_;var JLi=y(x(),1);function Zdt(e,t){this.position=e,this.headingPitchRoll=t}var HY=Zdt;var dwi=y(x(),1);var FN=y(Md(),1);var yBi=y(x(),1);var HFi=y(x(),1);var tWi=y(x(),1);var qLi=y(x(),1);var c8=new Date(2107,11,31),l8=new Date(1980,0,1),$t=void 0,Eu="undefined",Mm="function",M0e="object";var Rdt=64,U0e=2;try{typeof navigator!=Eu&&navigator.hardwareConcurrency&&(U0e=navigator.hardwareConcurrency)}catch{}var Gdt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:U0e,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=Eu&&CompressionStream,DecompressionStream:typeof DecompressionStream!=Eu&&DecompressionStream},D0e=Object.assign({},Gdt);function KY(){return D0e}function O9(e){return Math.max(e.chunkSize,Rdt)}function Bp(e){let{baseURI:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,CompressionStream:a,DecompressionStream:c,CompressionStreamZlib:d,DecompressionStreamZlib:u,workerURI:h,wasmURI:p}=e;Um("baseURI",t),Um("wasmURI",p),Um("workerURI",h),Um("chunkSize",n),Um("maxWorkers",i),Um("terminateWorkerTimeout",o),Um("useCompressionStream",r),Um("useWebWorkers",s),Um("CompressionStream",a),Um("DecompressionStream",c),Um("CompressionStreamZlib",d),Um("DecompressionStreamZlib",u)}function Um(e,t){t!==$t&&(D0e[e]=t)}var CFi=y(x(),1);var bFi=y(x(),1);var HWi=y(x(),1);var PWi=y(x(),1);var wWi=y(x(),1);var sWi=y(x(),1);var iWi=y(x(),1),v0e=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;v0e[e]=t}var $g=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^v0e[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var JY=class extends TransformStream{constructor(){let t,n=new $g;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};var IWi=y(x(),1);var lWi=y(x(),1);function v_(e){if(typeof TextEncoder==Eu){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var uWi=y(x(),1),Dl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Dl.getPartial(n);return i===32?e.concat(t):Dl._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+Dl.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=Dl.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=Dl.getPartial(o);return i.push(Dl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},jY={bytes:{fromBits(e){let n=Dl.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)(r&3)===0&&(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(Dl.partial(8*(n&3),i)),t}}},k0e={};k0e.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=jY.utf8String.toBits(e));let n=t._buffer=Dl.concat(t._buffer,e),i=t._length,o=t._length=i+Dl.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=Dl.concat(t,[Dl.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+c+i[d]+t._key[Math.floor(d/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var d8={};d8.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[u]=h,i[h]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,g=o[h]*257^h*16843008;for(let f=0;f<4;f++)e[f][u]=g=g<<24^g>>>8,t[f][h]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],d=r[3],u=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],f=e[t?1:3]^n[3],b=4,C,E,T;for(let S=0;S<i;S++)C=s[h>>>24]^a[p>>16&255]^c[g>>8&255]^d[f&255]^n[b],E=s[p>>>24]^a[g>>16&255]^c[f>>8&255]^d[h&255]^n[b+1],T=s[g>>>24]^a[f>>16&255]^c[h>>8&255]^d[p&255]^n[b+2],f=s[f>>>24]^a[h>>16&255]^c[p>>8&255]^d[g&255]^n[b+3],b+=4,h=C,p=E,g=T;for(let S=0;S<4;S++)o[t?3&-S:S]=u[h>>>24]<<24^u[p>>16&255]<<16^u[g>>8&255]<<8^u[f&255]^n[b++],C=h,h=p,p=g,g=f,f=C;return o}};var Q0e={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},u8={};u8.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=Dl.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return Dl.clamp(t,o)}};var gy={importKey(e){return new gy.hmacSha1(jY.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),h=new DataView(u),p=0,g=Dl;for(t=jY.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(g.concat(t,[d])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)h.setInt32(p,r[a]),p+=4}return u.slice(0,i/8)}};gy.hmacSha1=class{constructor(e){let t=this,n=t._hash=k0e.sha1,i=[[],[]];t._baseHash=[new n,new n];let o=t._baseHash[0].blockSize/32;e.length>o&&(e=new n().update(e).finalize());for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var yWi=y(x(),1);var Vdt=typeof crypto!=Eu&&typeof crypto.getRandomValues==Mm,eb="Invalid password",by="Invalid signature",tb="zipjs-abort-check-password";function z9(e){return Vdt?crypto.getRandomValues(e):Q0e.getRandomValues(e)}var k_=16,Ldt="raw",H0e={name:"PBKDF2"},Wdt={name:"HMAC"},Fdt="SHA-1",Bdt=Object.assign({hash:Wdt},H0e),m8=Object.assign({iterations:1e3,hash:{name:Fdt}},H0e),wdt=["deriveBits"],$Y=[8,12,16],qY=[16,24,32],yy=10,Ydt=[0,0,0,0],J9=typeof crypto!=Eu,nN=J9&&crypto.subtle,K0e=J9&&typeof nN!=Eu,wp=jY.bytes,Ndt=d8.aes,Xdt=u8.ctrGladman,Pdt=gy.hmacSha1,O0e=J9&&K0e&&typeof nN.importKey==Mm,z0e=J9&&K0e&&typeof nN.deriveBits==Mm,H9=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:q0e(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:h,ready:p}=c;d?(await Mdt(c,u,d,Dm(s,0,$Y[u]+2)),s=Dm(s,$Y[u]+2),r?a.error(new Error(tb)):h()):await p;let g=new Uint8Array(s.length-yy-(s.length-yy)%k_);a.enqueue(J0e(c,s,g,0,yy,!0))},async flush(s){let{signed:a,ctr:c,hmac:d,pending:u,ready:h}=this;if(d&&c){await h;let p=Dm(u,0,u.length-yy),g=Dm(u,u.length-yy),f=new Uint8Array;if(p.length){let b=tN(wp,p);d.update(b);let C=c.update(b);f=eN(wp,C)}if(a){let b=Dm(eN(wp,d.digest()),0,yy);for(let C=0;C<yy;C++)if(b[C]!=g[C])throw new Error(by)}s.enqueue(f)}}})}},K9=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:q0e(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:d,resolveReady:u,ready:h}=a,p=new Uint8Array;c?(p=await Udt(a,d,c),u()):await h;let g=new Uint8Array(p.length+r.length-r.length%k_);g.set(p,0),s.enqueue(J0e(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:d}=this;if(a&&s){await d;let u=new Uint8Array;if(c.length){let h=s.update(tN(wp,c));a.update(h),u=eN(wp,h)}o.signature=eN(wp,a.digest()).slice(0,yy),r.enqueue(h8(u,o.signature))}}}),o=this}};function J0e(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,d=t.length-o;c.length&&(t=h8(c,t),n=kdt(n,d-d%k_));let u;for(u=0;u<=d-k_;u+=k_){let h=tN(wp,Dm(t,u,u+k_));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(eN(wp,p),u+i)}return e.pending=Dm(t,u),n}async function Mdt(e,t,n,i){let o=await j0e(e,t,n,Dm(i,0,$Y[t])),r=Dm(i,$Y[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(eb)}async function Udt(e,t,n){let i=z9(new Uint8Array($Y[t])),o=await j0e(e,t,n,i);return h8(i,o)}async function j0e(e,t,n,i){e.password=null;let o=await Ddt(Ldt,n,Bdt,!1,wdt),r=await vdt(Object.assign({salt:i},m8),o,8*(qY[t]*2+2)),s=new Uint8Array(r),a=tN(wp,Dm(s,0,qY[t])),c=tN(wp,Dm(s,qY[t],qY[t]*2)),d=Dm(s,qY[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new Xdt(new Ndt(a),Array.from(Ydt)),hmac:new Pdt(c)}),d}async function Ddt(e,t,n,i,o){if(O0e)try{return await nN.importKey(e,t,n,i,o)}catch{return O0e=!1,gy.importKey(t)}else return gy.importKey(t)}async function vdt(e,t,n){if(z0e)try{return await nN.deriveBits(e,t,n)}catch{return z0e=!1,gy.pbkdf2(t,e.salt,m8.iterations,n)}else return gy.pbkdf2(t,e.salt,m8.iterations,n)}function q0e(e,t){return t===$t?v_(e):t}function h8(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function kdt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Dm(e,t,n){return e.subarray(t,n)}function eN(e,t){return e.fromBits(t)}function tN(e,t){return e.toBits(t)}var GWi=y(x(),1);var iN=12,j9=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),nye(this,t)},transform(o,r){let s=this;if(s.password){let a=$0e(s,o.subarray(0,iN));if(s.password=null,a.at(-1)!=s.passwordVerification)throw new Error(eb);o=o.subarray(iN)}i?r.error(new Error(tb)):r.enqueue($0e(s,o))}})}},q9=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),nye(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=z9(new Uint8Array(iN));c[iN-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(eye(r,c),0),a=iN}else s=new Uint8Array(i.length),a=0;s.set(eye(r,i),a),o.enqueue(s)}})}};function $0e(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=iye(e)^t[i],f8(e,n[i]);return n}function eye(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=iye(e)^t[i],f8(e,t[i]);return n}function nye(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new $g(n[0]),crcKey2:new $g(n[2])});for(let i=0;i<t.length;i++)f8(e,t.charCodeAt(i))}function f8(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=tye(Math.imul(tye(i+oye(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function iye(e){let t=e.keys[2]|2;return oye(Math.imul(t,t^1)>>>8)}function oye(e){return e&255}function tye(e){return e&4294967295}var Q_="Invalid uncompressed size",Qdt="deflate-raw",Odt="deflate64-raw",$9=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamZlib:i,CompressionStream:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:d,level:u}=t,h=this,p,g,f=super.readable;(!s||c)&&d&&(p=new JY,f=Yp(f,p)),r&&(f=sye(f,a,{level:u,chunkSize:n},o,i,o)),s&&(c?f=Yp(f,new q9(t)):(g=new K9(t),f=Yp(f,g))),rye(h,f,()=>{let b;s&&!c&&(b=g.signature),(!s||c)&&d&&(b=new DataView(p.value.buffer).getUint32(0)),h.signature=b})}},eQ=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamZlib:i,DecompressionStream:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:d,useCompressionStream:u,deflate64:h}=t,p,g,f=super.readable;s&&(r?f=Yp(f,new j9(t)):(g=new H9(t),f=Yp(f,g))),d&&(f=sye(f,u,{chunkSize:n,deflate64:h},o,i,o)),(!s||r)&&a&&(p=new JY,f=Yp(f,p)),rye(this,f,()=>{if((!s||r)&&a){let b=new DataView(p.value.buffer);if(c!=b.getUint32(0,!1))throw new Error(by)}})}};function rye(e,t,n){t=Yp(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function sye(e,t,n,i,o,r){let s=t&&i?i:o||r,a=n.deflate64?Odt:Qdt;try{e=Yp(e,new s(a,n))}catch(c){if(t)if(o)e=Yp(e,new o(a,n));else if(r)e=Yp(e,new r(a,n));else throw c;else throw c}return e}function Yp(e,t){return e.pipeThrough(t)}var aye="message",cye="start",lye="pull",p8="data",dye="ack",A8="close",iQ="deflate",oQ="inflate";var tQ=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(iQ)?r=$9:o.startsWith(oQ)&&(r=eQ),i.outputSize=0;let s=0,a=new r(t,n),c=super.readable,d=new TransformStream({transform(h,p){h&&h.length&&(s+=h.length,p.enqueue(h))},flush(){Object.assign(i,{inputSize:s})}}),u=new TransformStream({transform(h,p){if(h&&h.length&&(p.enqueue(h),i.outputSize+=h.length,t.outputSize!==$t&&i.outputSize>t.outputSize))throw new Error(Q_)},flush(){let{signature:h}=a;Object.assign(i,{signature:h,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(d).pipeThrough(a).pipeThrough(u)}})}},nQ=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var vWi=y(x(),1);var rQ,mye=()=>{};function hye({initModule:e}){mye=e}var O_=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:d},u){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new nQ(r.chunkSize)).pipeThrough(new b8(s),{signal:h}),writable:i,options:Object.assign({},o),workerURI:d,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:f}=t;g?(f?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,u(t)}}),rQ===$t&&(rQ=typeof Worker!=Eu),(a&&rQ?zdt:fye)(t,r)}},b8=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await g8(t,i)},async transform(s,a){r+=s.length,n&&await g8(n,r,i),a.enqueue(s)},async flush(){o&&await g8(o,r)}})}};async function g8(e,...t){try{await e(...t)}catch{}}function fye(e,t){return{run:()=>Hdt(e,t)}}function zdt(e,t){let{baseURI:n,chunkSize:i}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Mm&&(o=o());let r;try{r=jdt(e.workerURI,n,e)}catch{return rQ=!1,fye(e,t)}Object.assign(e,{worker:r,interface:{run:()=>Kdt(e,{chunkSize:i,wasmURI:o,baseURI:n})}})}return e.interface}async function Hdt({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(!e.useCompressionStream)try{await mye(o)}catch{e.useCompressionStream=!0}r=new tQ(e,o),await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}catch(s){throw r&&(s.outputSize=r.outputSize),s}finally{i()}}async function Kdt(e,t){let n,i,o=new Promise((h,p)=>{n=h,i=p});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s}=e,{writable:a,closed:c}=Jdt(e.writable),d=sQ({type:cye,options:s,config:t,readable:r,writable:a},e);d||Object.assign(e,{reader:r.getReader(),writer:a.getWriter()});let u=await o;return d||await a.getWriter().close(),await c,u}function Jdt(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var uye=!0;function jdt(e,t,n){let i={type:"module"},o,r;if(typeof e==Mm&&(e=e()),e.startsWith("data:")||e.startsWith("blob:"))try{r=new Worker(e)}catch{r=new Worker(e,i)}else{try{o=new URL(e,t)}catch{o=e}r=new Worker(o,i)}return r.addEventListener(aye,s=>qdt(s,n)),r}function sQ(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(e.value=r,c.push(e.value.buffer)),o&&uye?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{uye=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function qdt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:h}=t;try{if(s){let{message:g,stack:f,code:b,name:C,outputSize:E}=s,T=new Error(g);Object.assign(T,{stack:f,code:b,name:C,outputSize:E}),p(T)}else{if(n==lye){let{value:g,done:f}=await a.read();sQ({type:p8,value:g,done:f,messageId:o},t)}n==p8&&(await c.ready,await c.write(new Uint8Array(i)),sQ({type:dye,messageId:o},t)),n==A8&&p(null,r)}}catch(g){sQ({type:A8,messageId:o},t),p(g)}function p(g,f){g?u(g):d(f),c&&c.releaseLock(),h()}}var SE=[],y8=[];var pye=0;async function aQ(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,compressed:a,signed:c,encrypted:d}=n,{workerURI:u,maxWorkers:h}=i;t.transferStreams=o||o===$t;let p=!a&&!c&&!d&&!t.transferStreams;return t.useWebWorkers=!p&&(r||r===$t&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&u?u:$t,n.useCompressionStream=s||s===$t&&i.useCompressionStream,(await g()).run();async function g(){let b=SE.find(C=>!C.busy);if(b)return Aye(b),new O_(b,e,t,f);if(SE.length<h){let C={indexWorker:pye};return pye++,SE.push(C),new O_(C,e,t,f)}else return new Promise(C=>y8.push({resolve:C,stream:e,workerOptions:t}))}function f(b){if(y8.length){let[{resolve:C,stream:E,workerOptions:T}]=y8.splice(0,1);C(new O_(b,E,T,f))}else b.worker?(Aye(b),$dt(b,t)):SE=SE.filter(C=>C!=b)}}function $dt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{SE=SE.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function Aye(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var $Wi=y(x(),1);var eut="Writer iterator completed too soon",tut="Writer not initialized",nut="text/plain";var iut="Content-Type";var out=64*1024,jWi=256*1024,x8="writable",z_=class{constructor(){this.size=0}init(){this.initialized=!0}},oN=class extends z_{get readable(){let t=this,{chunkSize:n=out}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this,d=s===$t?n:Math.min(n,s-c),u=await nc(t,r+c,d,a);o.enqueue(u),c+n>s||s===$t&&!u.length&&d?o.close():this.chunkOffset+=n}});return i}},cQ=class extends z_{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(tut);return t.writeUint8Array(i)}});Object.defineProperty(t,x8,{get(){return n}})}writeUint8Array(){}};var rN=class extends cQ{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length&&(o.length>2?n.data+=btoa(o):n.pending+=o)}getData(){return this.data+btoa(this.pending)}},Np=class extends oN{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},H_=class extends z_{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([iut,t]),Object.defineProperty(n,x8,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},sN=class extends Np{constructor(t){super(new Blob([t],{type:nut}))}},aN=class extends H_{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var lQ=class extends oN{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;r[a]&&c>=r[a].size;)c-=r[a].size,a++;let d=r[a];if(d){let u=d.size;if(c+n<=u)s=await nc(d,c,n);else{let h=u-c;s=new Uint8Array(n);let p=await nc(d,c,h);s.set(p,0);let g=await o.readUint8Array(t+h,n-h,i);s.set(g,h),p.length+g.length<n&&(s=s.subarray(0,p.length+g.length))}}else s=new Uint8Array;return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},cN=class extends z_{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(u){let{availableSize:h}=i;if(s)u.length>=h?(await c(u.subarray(0,h)),await d(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(u.subarray(h))):await c(u);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(eut);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Pp(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,x8,{get(){return a}});async function c(u){let h=u.length;h&&(await s.ready,await s.write(u),o.size+=h,i.size+=h,i.availableSize-=h)}async function d(){await s.close()}}},IE=class{constructor(t){return Array.isArray(t)&&(t=new lQ(t)),t instanceof ReadableStream&&(t={readable:t}),t}},K_=class{constructor(t){return t.writable===$t&&typeof t.next==Mm&&(t=new cN(t)),t instanceof WritableStream&&(t={writable:t}),t.size===$t&&(t.size=0),t instanceof cN||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}};async function Pp(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function nc(e,t,n,i){return e.readUint8Array(t,n,i)}var oFi=y(x(),1);var tFi=y(x(),1),gye="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),rut=gye.length==256;function bye(e){if(rut){let t="";for(let n=0;n<e.length;n++)t+=gye[e[n]];return t}else return new TextDecoder().decode(e)}function lN(e,t){return t&&t.trim().toLowerCase()=="cp437"?bye(e):new TextDecoder(t).decode(e)}var sFi=y(x(),1),C8="filename",E8="rawFilename",dN="comment",T8="rawComment",uN="uncompressedSize",S8="compressedSize",I8="offset",_8="diskNumberStart",J_="lastModDate",dQ="rawLastModDate",mN="lastAccessDate",yye="rawLastAccessDate",hN="creationDate",Z8="rawCreationDate",R8="internalFileAttributes",G8="externalFileAttributes",V8="msdosAttributesRaw",L8="msdosAttributes",W8="msDosCompatible",uQ="zip64",F8="encrypted",B8="version",w8="versionMadeBy",Y8="zipCrypto",fN="directory",N8="executable",X8="compressionMethod",P8="signature",M8="extraField",sut="extraFieldInfoZip",aut="extraFieldUnix";var U8="unixMode",D8="setuid",v8="setgid",k8="sticky",cut="bitFlag",lut="filenameUTF8",dut="commentUTF8",uut="rawExtraField",mut="extraFieldZip64",hut="extraFieldUnicodePath",fut="extraFieldUnicodeComment",put="extraFieldAES",Aut="extraFieldNTFS",gut="extraFieldExtendedTimestamp",but=[C8,E8,uN,S8,J_,dQ,dN,T8,mN,hN,Z8,I8,_8,R8,G8,V8,L8,W8,uQ,F8,B8,w8,Y8,fN,N8,X8,P8,M8,aut,sut,"uid","gid",U8,D8,v8,k8,cut,lut,dut,uut,mut,hut,fut,put,Aut,gut],xy=class{constructor(t){but.forEach(n=>this[n]=t[n])}};var cFi=y(x(),1),xye="filenameEncoding",Cye="commentEncoding",Eye="decodeText",Tye="extractPrependedData",Sye="extractAppendedData",mQ="password",hQ="rawPassword",fQ="passThrough",pQ="signal",Iye="checkPasswordOnly",_ye="checkOverlappingEntryOnly",Zye="checkOverlappingEntry",Rye="checkSignature",AQ="useWebWorkers",gQ="useCompressionStream",Gye="transferStreams",bQ="preventClose",Vye="encryptionStrength",Lye="extendedTimestamp",Wye="keepOrder",Fye="level",Bye="bufferedWrite",wye="dataDescriptorSignature",Yye="useUnicodeFileNames",Nye="dataDescriptor",Q8="supportZip64SplitFile",Xye="encodeText",O8="offset",z8="usdz",Pye="unixExtraFieldType";var yQ="File format is not recognized",Oye="End of central directory not found",zye="End of Zip64 central directory locator not found",Hye="Central directory header not found",Kye="Local file header not found",Jye="Zip64 extra field not found",jye="File contains encrypted entry",qye="Encryption method not supported",K8="Compression method not supported",J8="Split zip file",$ye="Overlapping entry found",Uye="utf-8",Eut="UTF8",Dye="cp437",Tut=[[uN,4294967295],[S8,4294967295],[I8,4294967295],[_8,65535]],Sut={65535:{getValue:Mr,bytes:4},4294967295:{getValue:$_,bytes:8}},_E=class{constructor(t,n={}){Object.assign(this,{reader:new IE(t),options:n,config:KY(),readRanges:[]})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Pp(i),(i.size===$t||!i.readUint8Array)&&(i=new Np(await new Response(i.readable).blob()),await Pp(i)),i.size<22)throw new Error(yQ);i.chunkSize=O9(o);let r=await Vut(i,101010256,i.size,22,65535*16);if(!r){let N=await nc(i,0,4),A=Ur(N);throw Mr(A)==134695760?new Error(J8):new Error(Oye)}let s=Ur(r),a=Mr(s,12),c=Mr(s,16),d=r.offset,u=ic(s,20),h=d+22+u,p=ic(s,4),g=i.lastDiskNumber||0,f=ic(s,6),b=ic(s,8),C=0,E=0;if(c==4294967295||a==4294967295||b==65535||f==65535){let N=await nc(i,r.offset-20,20),A=Ur(N);if(Mr(A,0)==117853008){c=$_(A,8);let I=await nc(i,c,56,-1),Z=Ur(I),G=r.offset-20-56;if(Mr(Z,0)!=101075792&&c!=G){let w=c;c=G,c>w&&(C=c-w),I=await nc(i,c,56,-1),Z=Ur(I)}if(Mr(Z,0)!=101075792)throw new Error(zye);p==65535&&(p=Mr(Z,16)),f==65535&&(f=Mr(Z,20)),b==65535&&(b=$_(Z,32)),a==4294967295&&(a=$_(Z,40)),c-=a}}if(c>=i.size&&(C=i.size-c-a-22,c=i.size-a-22),g!=p)throw new Error(J8);if(c<0)throw new Error(yQ);let T=0,S=await nc(i,c,a,f),_=Ur(S);if(a){let N=r.offset-a;if(Mr(_,T)!=33639248&&c!=N){let A=c;c=N,c>A&&(C+=c-A),S=await nc(i,c,a,f),_=Ur(S)}}let R=r.offset-c-(i.lastDiskOffset||0);if(a!=R&&R>=0&&(a=R,S=await nc(i,c,a,f),_=Ur(S)),c<0||c>=i.size)throw new Error(yQ);let L=Ec(n,t,xye),W=Ec(n,t,Cye);for(let N=0;N<b;N++){let A=new j8(i,o,n.options);if(Mr(_,T)!=33639248)throw new Error(Hye);exe(A,_,T+6);let I=!!A.bitFlag.languageEncodingFlag,Z=T+46,G=Z+A.filenameLength,w=G+A.extraFieldLength,X=ic(_,T+4),v=X>>8==0,U=X>>8==3,k=S.subarray(Z,G),P=ic(_,T+32),O=w+P,H=S.subarray(w,O),ee=I,z=I,te=Mr(_,T+38),q=te&255,me={readOnly:!!(q&1),hidden:!!(q&2),system:!!(q&4),directory:!!(q&16),archive:!!(q&32)},ye=Mr(_,T+42)+C,oe=Ec(n,t,Eye)||lN,xe=ee?Uye:L||Dye,Ee=z?Uye:W||Dye,Le=oe(k,xe);Le===$t&&(Le=lN(k,xe));let Se=oe(H,Ee);Se===$t&&(Se=lN(H,Ee)),Object.assign(A,{versionMadeBy:X,msDosCompatible:v,compressedSize:0,uncompressedSize:0,commentLength:P,offset:ye,diskNumberStart:ic(_,T+34),internalFileAttributes:ic(_,T+36),externalFileAttributes:te,msdosAttributesRaw:q,msdosAttributes:me,rawFilename:k,filenameUTF8:ee,commentUTF8:z,rawExtraField:S.subarray(G,w),rawComment:H,filename:Le,comment:Se}),E=Math.max(ye,E),txe(A,A,_,T+6);let Fe=A.externalFileAttributes>>16&65535;A.unixMode===$t&&(Fe&16877)!=0&&(A.unixMode=Fe);let Ue=!!(A.unixMode&2048),De=!!(A.unixMode&1024),Je=!!(A.unixMode&512),St=A.unixMode!==$t?(A.unixMode&73)!=0:U&&(Fe&73)!=0,Oe=A.unixMode!==$t&&(A.unixMode&61440)==16384,it=(Fe&61440)==16384;Object.assign(A,{setuid:Ue,setgid:De,sticky:Je,unixExternalUpper:Fe,internalFileAttribute:A.internalFileAttributes,externalFileAttribute:A.externalFileAttributes,executable:St,directory:Oe||it||v&&me.directory||Le.endsWith("/")&&!A.uncompressedSize,zipCrypto:A.encrypted&&!A.extraFieldAES});let yt=new xy(A);yt.getData=(Mn,sn)=>A.getData(Mn,yt,n.readRanges,sn),yt.arrayBuffer=async Mn=>{let sn=new TransformStream,[ut]=await Promise.all([new Response(sn.readable).arrayBuffer(),A.getData(sn,yt,n.readRanges,Mn)]);return ut},T=O;let{onprogress:Ot}=t;if(Ot)try{await Ot(N+1,b,new xy(A))}catch{}yield yt}let B=Ec(n,t,Tye),Y=Ec(n,t,Sye);return B&&(n.prependedData=E>0?await nc(i,0,E):new Uint8Array),n.comment=u?await nc(i,d+22,u):new Uint8Array,Y&&(n.appendedData=h<i.size?await nc(i,h,i.size-h):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var j8=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i,o={}){let r=this,{reader:s,offset:a,diskNumberStart:c,extraFieldAES:d,extraFieldZip64:u,compressionMethod:h,config:p,bitFlag:g,signature:f,rawLastModDate:b,uncompressedSize:C,compressedSize:E}=r,{dataDescriptor:T}=g,S=n.localDirectory={},_=await nc(s,a,30,c),R=Ur(_),L=Ec(r,o,mQ),W=Ec(r,o,hQ),B=Ec(r,o,fQ);if(L=L&&L.length&&L,W=W&&W.length&&W,d&&d.originalCompressionMethod!=99)throw new Error(K8);if(h!=0&&h!=8&&h!=9&&!B)throw new Error(K8);if(Mr(R,0)!=67324752)throw new Error(Kye);exe(S,R,4);let{extraFieldLength:Y,filenameLength:N,lastAccessDate:A,creationDate:I}=S;S.rawExtraField=Y?await nc(s,a+30+N,Y,c):new Uint8Array,txe(r,S,R,4,!0),Object.assign(n,{lastAccessDate:A,creationDate:I});let Z=r.encrypted&&S.encrypted&&!B,G=Z&&!d;if(B||(n.zipCrypto=G),Z){if(!G&&d.strength===$t)throw new Error(qye);if(!L&&!W)throw new Error(jye)}let w=a+30+N+Y,X=E,v=s.readable;Object.assign(v,{diskNumberStart:c,offset:w,size:X});let U=Ec(r,o,pQ),k=Ec(r,o,Iye),P=Ec(r,o,Zye),O=Ec(r,o,_ye);O&&(P=!0);let{onstart:H,onprogress:ee,onend:z}=o,te=h==9,q=Ec(r,o,gQ);te&&(q=!1);let me={options:{codecType:oQ,password:L,rawPassword:W,zipCrypto:G,encryptionStrength:d&&d.strength,signed:Ec(r,o,Rye)&&!B,passwordVerification:G&&(T?b>>>8&255:f>>>24&255),outputSize:B?E:C,signature:f,compressed:h!=0&&!B,encrypted:r.encrypted&&!B,useWebWorkers:Ec(r,o,AQ),useCompressionStream:q,transferStreams:Ec(r,o,Gye),deflate64:te,checkPasswordOnly:k},config:p,streamOptions:{signal:U,size:X,onstart:H,onprogress:ee,onend:z}};P&&await Gut({reader:s,fileEntry:n,offset:a,diskNumberStart:c,signature:f,compressedSize:E,uncompressedSize:C,dataOffset:w,dataDescriptor:T||S.bitFlag.dataDescriptor,extraFieldZip64:u||S.extraFieldZip64,readRanges:i});let ye;try{if(!O){k&&(t=new WritableStream),t=new K_(t),await Pp(t,B?E:C),{writable:ye}=t;let{outputSize:oe}=await aQ({readable:v,writable:ye},me);if(t.size+=oe,oe!=(B?E:C))throw new Error(Q_)}}catch(oe){if(oe.outputSize!==$t&&(t.size+=oe.outputSize),!k||oe.message!=tb)throw oe}finally{!Ec(r,o,bQ)&&ye&&!ye.locked&&await ye.getWriter().close()}return k||O?$t:t.getData?t.getData():ye}};function exe(e,t,n){let i=e.rawBitFlag=ic(t,n+2),o=(i&1)==1,r=Mr(t,n+6);Object.assign(e,{encrypted:o,version:ic(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Lut(r),filenameLength:ic(t,n+22),extraFieldLength:ic(t,n+24)})}function txe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=Ur(new Uint8Array(r)),c=0;try{for(;c<r.length;){let T=ic(a,c),S=ic(a,c+2);s.set(T,{type:T,data:r.slice(c+4,c+4+S)}),c+=4+S}}catch{}let d=ic(n,i+4);Object.assign(t,{signature:Mr(n,i+10),compressedSize:Mr(n,i+14),uncompressedSize:Mr(n,i+18)});let u=s.get(1);u&&(Iut(u,t),t.extraFieldZip64=u);let h=s.get(28789);h&&(vye(h,C8,E8,t,e),t.extraFieldUnicodePath=h);let p=s.get(25461);p&&(vye(p,dN,T8,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(_ut(g,t,d),t.extraFieldAES=g):t.compressionMethod=d;let f=s.get(10);f&&(Zut(f,t),t.extraFieldNTFS=f);let b=s.get(30805);if(b)kye(b,t,!1),t.extraFieldUnix=b;else{let T=s.get(30837);T&&(kye(T,t,!0),t.extraFieldInfoZip=T)}let C=s.get(21589);C&&(Rut(C,t,o),t.extraFieldExtendedTimestamp=C);let E=s.get(6534);E&&(t.extraFieldUSDZ=E)}function Iut(e,t){t.zip64=!0;let n=Ur(e.data),i=Tut.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let c=Sut[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(Jye)}}function vye(e,t,n,i,o){let r=Ur(e.data),s=new $g;s.append(o[n]);let a=Ur(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Mr(r,1);Object.assign(e,{version:Ey(r,0),[t]:lN(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==Mr(a,0)}),e.valid&&(i[t]=e[t],i[t+Eut]=!0)}function _ut(e,t,n){let i=Ur(e.data),o=Ey(i,4);Object.assign(e,{vendorVersion:Ey(i,0),vendorId:Ey(i,2),strength:o,originalCompressionMethod:n,compressionMethod:ic(i,5)}),t.compressionMethod=e.compressionMethod}function Zut(e,t){let n=Ur(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=ic(n,i),s=ic(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=Ur(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let d=H8(s),u=H8(a),h=H8(c),p={lastModDate:d,lastAccessDate:u,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function kye(e,t,n){try{let i=Ur(new Uint8Array(e.data)),o=0,r=Ey(i,o++),s=Ey(i,o++),a=e.data.subarray(o,o+s);o+=s;let c=Qye(a),d=Ey(i,o++),u=e.data.subarray(o,o+d);o+=d;let h=Qye(u),p=$t;if(!n&&o+2<=e.data.length){let g=e.data;p=new DataView(g.buffer,g.byteOffset+o,2).getUint16(0,!0)}Object.assign(e,{version:r,uid:c,gid:h,unixMode:p}),c!==$t&&(t.uid=c),h!==$t&&(t.gid=h),p!==$t&&(t.unixMode=p)}catch{}}function Qye(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function Rut(e,t,n){let i=Ur(e.data),o=Ey(i,0),r=[],s=[];n?((o&1)==1&&(r.push(J_),s.push(dQ)),(o&2)==2&&(r.push(mN),s.push(yye)),(o&4)==4&&(r.push(hN),s.push(Z8))):e.data.length>=5&&(r.push(J_),s.push(dQ));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=Mr(i,a);t[c]=e[c]=new Date(u*1e3);let h=s[d];e[h]=u}a+=4})}async function Gut({reader:e,fileEntry:t,offset:n,diskNumberStart:i,signature:o,compressedSize:r,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:d,readRanges:u}){let h=0;if(i)for(let f=0;f<i;f++){let b=e.readers[f];h+=b.size}let p=0;if(c&&(d?p=20:p=12),p){let f=await nc(e,a+r,p+4,i);if(Mr(Ur(f),0)==134695760){let C=Mr(Ur(f),4),E,T;d?(E=$_(Ur(f),8),T=$_(Ur(f),16)):(E=Mr(Ur(f),8),T=Mr(Ur(f),12)),(t.encrypted&&!t.zipCrypto||C==o)&&E==r&&T==s&&(p+=4)}}let g={start:h+n,end:h+a+r+p,fileEntry:t};for(let f of u)if(f.fileEntry!=t&&g.start>=f.start&&g.start<f.end){let b=new Error($ye);throw b.overlappingEntry=f.fileEntry,b}u.push(g)}async function Vut(e,t,n,i,o){let r=new Uint8Array(4),s=Ur(r);Wut(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(d){let u=n-d,h=await nc(e,u,d);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:u+p,buffer:h.slice(p,p+i).buffer}}}function Ec(e,t,n){return t[n]===$t?e.options[n]:t[n]}function Lut(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function H8(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function Ey(e,t){return e.getUint8(t)}function ic(e,t){return e.getUint16(t,!0)}function Mr(e,t){return e.getUint32(t,!0)}function $_(e,t){return Number(e.getBigUint64(t,!0))}function Wut(e,t,n){e.setUint32(t,n,!0)}function Ur(e){return new DataView(e.buffer)}var wFi=y(x(),1);var WFi=y(x(),1);var lxe="File already exists",dxe="Zip file comment exceeds 64KB",uxe="File entry comment exceeds 64KB",mxe="File entry name exceeds 64KB",p7="Version exceeds 65535",hxe="The strength must equal 1, 2, or 3",fxe="Extra field type exceeds 65535",pxe="Extra field data exceeds 64KB",BQ="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Axe="Undefined uncompressed size",gxe="Zip file not empty",Mut="Invalid uid (must be integer 0..2^32-1)",Uut="Invalid gid (must be integer 0..2^32-1)",Dut="Invalid UNIX mode (must be integer 0..65535)",vut="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",kut="Invalid msdosAttributesRaw (must be integer 0..255)",Qut="Invalid msdosAttributes (must be an object with boolean flags)",oxe=new Uint8Array([7,0,2,0,65,69,3,0,0]),bxe="infozip",yxe="unix",h7=0,rxe=[],SN=class{constructor(t,n={}){t=new K_(t);let i=t.availableSize!==$t&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==$t&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:KY(),files:new Map,filenames:new Set,offset:n[O8]===$t?t.size||t.writable.size||0:n[O8],pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async prependZip(t){if(this.filenames.size)throw new Error(gxe);t=new IE(t);let n=new _E(t.readable),i=await n.getEntries();await n.close(),await t.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=t.size,this.filenames=new Set(i.map(o=>o.filename)),this.files=new Map(i.map(o=>{let{version:r,compressionMethod:s,lastModDate:a,lastAccessDate:c,creationDate:d,rawFilename:u,bitFlag:h,encrypted:p,uncompressedSize:g,compressedSize:f,diskOffset:b,diskNumber:C,zip64:E}=o,{rawExtraFieldZip64:T,rawExtraFieldAES:S,rawExtraFieldExtendedTimestamp:_,rawExtraFieldNTFS:R,rawExtraFieldUnix:L,rawExtraField:W}=o,{level:B,languageEncodingFlag:Y,dataDescriptor:N}=h;T=T||new Uint8Array,S=S||new Uint8Array,_=_||new Uint8Array,R=R||new Uint8Array,L=o.rawExtraFieldUnix||new Uint8Array,W=W||new Uint8Array;let A=Gi(T,S,_,R,L,W),I=E&&g>4294967295,Z=E&&f>4294967295,{headerArray:G,headerView:w}=xxe({version:r,bitFlag:Cxe(B,Y,N,p,s),compressionMethod:s,uncompressedSize:g,compressedSize:f,lastModDate:a,rawFilename:u,zip64CompressedSize:Z,zip64UncompressedSize:I,extraFieldLength:A});return Object.assign(o,{zip64UncompressedSize:I,zip64CompressedSize:Z,zip64Offset:E&&this.offset-b>4294967295,zip64DiskNumberStart:E&&C>65535,rawExtraFieldZip64:T,rawExtraFieldAES:S,rawExtraFieldExtendedTimestamp:_,rawExtraFieldNTFS:R,rawExtraFieldUnix:L,rawExtraField:W,extendedTimestamp:_.length>0||R.length>0,extraFieldExtendedTimestampFlag:1+(c?2:0)+(d?4:0),headerArray:G,headerView:w}),[o.filename,o]}))}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;h7<s.maxWorkers?h7++:await new Promise(c=>rxe.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(lxe);return o.filenames.add(t),a=Out(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=rxe.shift();c?c():h7--}}remove(t){let{filenames:n,files:i}=this;if(typeof t=="string"&&(t=i.get(t)),t&&t.filename!==$t){let{filename:o}=t;if(n.has(o)&&i.has(o))return n.delete(o),i.delete(o),!0}return!1}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await tmt(i,t,n),Ii(i,n,bQ)||await s.getWriter().close(),r.getData?r.getData():s}};async function Out(e,t,n,i){t=t.trim();let o=Ii(e,i,W8),r=Ii(e,i,w8,o?20:768),s=Ii(e,i,N8),a=Ii(e,i,"uid"),c=Ii(e,i,"gid"),d=Ii(e,i,U8),u=Ii(e,i,Pye),h=Ii(e,i,D8),p=Ii(e,i,v8),g=Ii(e,i,k8);if(a!==$t&&(a<0||a>4294967295))throw new Error(Mut);if(c!==$t&&(c<0||c>4294967295))throw new Error(Uut);if(d!==$t&&(d<0||d>65535))throw new Error(Dut);if(u!==$t&&u!==bxe&&u!==yxe)throw new Error(vut);let f=Ii(e,i,V8),b=Ii(e,i,L8),C=a!==$t||c!==$t||d!==$t||u,E=f!==$t||b!==$t;if(C?(o=!1,r=r&65535|768):E&&(o=!0,r=r&255),f!==$t&&(f<0||f>255))throw new Error(kut);if(b&&typeof b!==M0e)throw new Error(Qut);if(r>65535)throw new Error(p7);let T=Ii(e,i,G8,0);!i[fN]&&t.endsWith("/")&&(i[fN]=!0);let S=Ii(e,i,fN);S?(t.endsWith("/")||(t+="/"),T===0&&(T=16,o||(T|=16877<<16))):!o&&T===0&&(s?T=493<<16:T=420<<16);let _;o||(_=T>>16&65535,d=d===$t?_:d&65535,h?d|=2048:h=!!(d&2048),p?d|=1024:p=!!(d&1024),g?d|=512:g=!!(d&512),S&&(d|=16384),T=(d&65535)<<16|T&255),{msdosAttributesRaw:f,msdosAttributes:b}=jut(f,b),E&&(T=T&4294967295|f&255);let R=Ii(e,i,Xye,v_),L=R(t);if(L===$t&&(L=v_(t)),Gi(L)>65535)throw new Error(mxe);let W=i[dN]||"",B=R(W);if(B===$t&&(B=v_(W)),Gi(B)>65535)throw new Error(uxe);let Y=Ii(e,i,B8,20);if(Y>65535)throw new Error(p7);let N=Ii(e,i,J_,new Date),A=Ii(e,i,mN),I=Ii(e,i,hN),Z=Ii(e,i,R8,0),G=Ii(e,i,fQ),w,X;G||(w=Ii(e,i,mQ),X=Ii(e,i,hQ));let v=Ii(e,i,Vye,3),U=Ii(e,i,Y8),k=Ii(e,i,Lye,!0),P=Ii(e,i,Wye,!0),O=Ii(e,i,AQ),H=Ii(e,i,Bye),ee=Ii(e,i,wye,!1),z=Ii(e,i,pQ),te=Ii(e,i,Yye,!0),q=Ii(e,i,X8),me=Ii(e,i,Fye),ye=Ii(e,i,gQ),oe=Ii(e,i,Nye);H&&oe===$t&&(oe=!1),(oe===$t||U)&&(oe=!0),me!==$t&&me!=6&&(ye=!1),!ye&&e.config.CompressionStream===$t&&e.config.CompressionStreamZlib===$t&&(me=0);let xe=Ii(e,i,uQ);if(!U&&(w!==$t||X!==$t)&&!(v>=1&&v<=3))throw new Error(hxe);let Ee=new Uint8Array,Le=i[M8];if(Le){let ao=0,po=0;Le.forEach(ri=>ao+=4+Gi(ri)),Ee=new Uint8Array(ao),Le.forEach((ri,co)=>{if(co>65535)throw new Error(fxe);if(Gi(ri)>65535)throw new Error(pxe);_r(Ee,new Uint16Array([co]),po),_r(Ee,new Uint16Array([Gi(ri)]),po+2),_r(Ee,ri,po+4),po+=4+Gi(ri)})}let Se=0,Fe=0,Ue=0;if(G&&(Ue=i[uN],Ue===$t))throw new Error(Axe);let De=xe===!0;n&&(n=new IE(n),await Pp(n),G?(i.uncompressedSize=Ue,Se=cxe(Ue)):n.size===$t?(oe=!0,(xe||xe===$t)&&(xe=!0,Ue=Se=4294967296)):(i.uncompressedSize=Ue=n.size,Se=cxe(Ue)));let{diskOffset:Je,diskNumber:St,maxSize:Oe}=e.writer,it=De||Ue>4294967295,yt=De||Se>4294967295,Ot=De||e.offset+e.pendingEntriesSize-Je>4294967295,sn=Ii(e,i,Q8,!0)&&De||St+Math.ceil(e.pendingEntriesSize/Oe)>65535;if(Ot||it||yt||sn){if(xe===!1||!P)throw new Error(BQ);xe=!0}xe=xe||!1;let ut=Ii(e,i,F8);i=Object.assign({},i,{rawFilename:L,rawComment:B,version:Y,versionMadeBy:r,lastModDate:N,lastAccessDate:A,creationDate:I,rawExtraField:Ee,zip64:xe,zip64UncompressedSize:it,zip64CompressedSize:yt,zip64Offset:Ot,zip64DiskNumberStart:sn,password:w,rawPassword:X,level:me,useWebWorkers:O,encryptionStrength:v,extendedTimestamp:k,zipCrypto:U,bufferedWrite:H,keepOrder:P,useUnicodeFileNames:te,dataDescriptor:oe,dataDescriptorSignature:ee,signal:z,msDosCompatible:o,internalFileAttribute:Z,internalFileAttributes:Z,externalFileAttribute:T,externalFileAttributes:T,useCompressionStream:ye,passThrough:G,encrypted:!!(w&&Gi(w)||X&&Gi(X))||G&&ut,signature:i[P8],compressionMethod:q,uncompressedSize:Ue,offset:e.offset-Je,diskNumberStart:St,uid:a,gid:c,setuid:h,setgid:p,sticky:g,unixMode:d,msdosAttributesRaw:f,msdosAttributes:b,unixExternalUpper:_});let Nt=Kut(i),In=qut(i),lt=Gi(Nt.localHeaderArray,In.dataDescriptorArray);Fe=lt+Se,e.options[z8]&&(Fe+=Fe+64),e.pendingEntriesSize+=Fe;let fi;try{fi=await zut(e,t,n,{headerInfo:Nt,dataDescriptorInfo:In,metadataSize:lt},i)}finally{e.pendingEntriesSize-=Fe}return Object.assign(fi,{name:t,comment:W,extraField:Le}),new xy(fi)}async function zut(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:d}=o,{headerInfo:u}=i,h=e.options[z8],p=Array.from(r.values()).pop(),g={},f,b,C,E,T,S,_;r.set(t,g);try{let B;a&&(B=p&&p.lock,R()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!h?(S=new TransformStream,S.size=0,f=!0,e.bufferedWrites++,await Pp(s)):(S=s,await L()),await Pp(S);let{writable:Y,diskOffset:N}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let w=new Uint8Array(4),X=Hs(w);so(X,0,134695760),await nb(s,w),e.offset+=4}h&&Jut(i,e.offset-N);let{localHeaderView:A,localHeaderArray:I}=u;f||(await B,await W(Y));let{diskNumber:Z}=s;T=!0,g.diskNumberStart=Z,f?_=new Response(S.readable).blob():await nb(S,I),g=await Hut(n,S,g,i,e.config,o);let{zip64:G}=g;if(T=!1,r.set(t,g),g.filename=t,f){let[w]=await Promise.all([_,S.writable.getWriter().close(),B]);await L(),E=!0,g.diskNumberStart=s.diskNumber,g.offset=e.offset-s.diskOffset,G&&axe(g),emt(g,A,o),await W(Y),await nb(s,I),await w.stream().pipeTo(Y,{preventClose:!0,preventAbort:!0,signal:d}),s.size+=S.size,E=!1}else g.offset=e.offset-N,G&&axe(g);if(g.offset>4294967295&&!G)throw new Error(BQ);return e.offset+=g.size,g}catch(B){if(f&&E||!f&&T){if(e.hasCorruptedEntries=!0,B)try{B.corruptedEntry=!0}catch{}f?e.offset+=S.size:e.offset=S.size}throw r.delete(t),B}finally{f&&e.bufferedWrites--,C&&C(),b&&b()}function R(){g.lock=new Promise(B=>C=B)}async function L(){e.writerLocked=!0;let{lockWriter:B}=e;e.lockWriter=new Promise(Y=>b=()=>{e.writerLocked=!1,Y()}),await B}async function W(B){Gi(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await nb(B,new Uint8Array))}}async function Hut(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{headerArray:u,headerView:h,lastModDate:p,rawLastModDate:g,encrypted:f,compressed:b,version:C,compressionMethod:E,rawExtraFieldZip64:T,localExtraFieldZip64Length:S,rawExtraFieldExtendedTimestamp:_,extraFieldExtendedTimestampFlag:R,rawExtraFieldNTFS:L,rawExtraFieldUnix:W,rawExtraFieldAES:B}=a,{dataDescriptorArray:Y}=c,{rawFilename:N,lastAccessDate:A,creationDate:I,password:Z,rawPassword:G,level:w,zip64:X,zip64UncompressedSize:v,zip64CompressedSize:U,zip64Offset:k,zip64DiskNumberStart:P,zipCrypto:O,dataDescriptor:H,directory:ee,executable:z,versionMadeBy:te,rawComment:q,rawExtraField:me,useWebWorkers:ye,onstart:oe,onprogress:xe,onend:Ee,signal:Le,encryptionStrength:Se,extendedTimestamp:Fe,msDosCompatible:Ue,internalFileAttributes:De,externalFileAttributes:Je,uid:St,gid:Oe,unixMode:it,setuid:yt,setgid:Ot,sticky:Mn,unixExternalUpper:sn,msdosAttributesRaw:ut,msdosAttributes:Nt,useCompressionStream:In,passThrough:lt}=s,fi={lock:i,versionMadeBy:te,zip64:X,directory:!!ee,executable:!!z,filenameUTF8:!0,rawFilename:N,commentUTF8:!0,rawComment:q,rawExtraFieldZip64:T,localExtraFieldZip64Length:S,rawExtraFieldExtendedTimestamp:_,rawExtraFieldNTFS:L,rawExtraFieldUnix:W,rawExtraFieldAES:B,rawExtraField:me,extendedTimestamp:Fe,msDosCompatible:Ue,internalFileAttributes:De,externalFileAttributes:Je,diskNumberStart:n,uid:St,gid:Oe,unixMode:it,setuid:yt,setgid:Ot,sticky:Mn,unixExternalUpper:sn,msdosAttributesRaw:ut,msdosAttributes:Nt},{signature:ao,uncompressedSize:po}=s,ri=0;lt||(po=0);let{writable:co}=t;if(e){e.chunkSize=O9(r);let lo=e.readable,Di=e.size,Wi={options:{codecType:iQ,level:w,rawPassword:G,password:Z,encryptionStrength:Se,zipCrypto:f&&O,passwordVerification:f&&O&&g>>8&255,signed:!lt,compressed:b&&!lt,encrypted:f&&!lt,useWebWorkers:ye,useCompressionStream:In,transferStreams:!1},config:r,streamOptions:{signal:Le,size:Di,onstart:oe,onprogress:xe,onend:Ee}};try{let Qn=await aQ({readable:lo,writable:co},Wi);ri=Qn.outputSize,t.size+=ri,lt||(po=Qn.inputSize,ao=Qn.signature)}catch(Qn){throw Qn.outputSize!==$t&&(t.size+=Qn.outputSize),Qn}}return $ut({signature:ao,compressedSize:ri,uncompressedSize:po,headerInfo:a,dataDescriptorInfo:c},s),H&&await nb(t,Y),Object.assign(fi,{uncompressedSize:po,compressedSize:ri,lastModDate:p,rawLastModDate:g,creationDate:I,lastAccessDate:A,encrypted:f,zipCrypto:O,size:d+ri,compressionMethod:E,version:C,headerArray:u,headerView:h,signature:ao,extraFieldExtendedTimestampFlag:R,zip64UncompressedSize:v,zip64CompressedSize:U,zip64Offset:k,zip64DiskNumberStart:P}),fi}function Kut(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:d,directory:u,rawExtraField:h,encryptionStrength:p,extendedTimestamp:g,passThrough:f,encrypted:b,zip64UncompressedSize:C,zip64CompressedSize:E,zip64Offset:T,zip64DiskNumberStart:S,uncompressedSize:_,offset:R,diskNumberStart:L}=e,{version:W,compressionMethod:B}=e,Y=!u&&(r>0||r===$t&&B!==0),N,A,I=f||!Y,Z=s&&(e.bufferedWrite||!C&&!E||I);if(s){let me=4,ye=4;C&&(me+=8,ye+=8),E&&(me+=8,ye+=8),T&&(me+=8),S&&(me+=4),N=new Uint8Array(me);let oe=Hs(N);A=new Uint8Array(ye);let xe=Hs(A);if(Ki(oe,0,1),Ki(oe,2,Gi(N)-4),Ki(xe,0,1),Ki(xe,2,Gi(A)-4),Z){let Ee=Hs(N),Le=Hs(A),Se=4,Fe=4;C&&(Ks(Ee,Se,BigInt(_)),Se+=8,Ks(Le,Fe,BigInt(_)),Fe+=8),E&&I&&(Ks(Ee,Se,BigInt(_)),Se+=8,Ks(Le,Fe,BigInt(_)),Fe+=8),T&&(Ks(Ee,Se,BigInt(R)),Se+=8),S&&(so(Ee,Se,L),Se+=4),Fe==4&&(A=new Uint8Array)}}else N=new Uint8Array,A=new Uint8Array;let G;if(b&&!a){G=new Uint8Array(Gi(oxe)+2);let me=Hs(G);Ki(me,0,39169),_r(G,oxe,2),eZ(me,8,p)}else G=new Uint8Array;let w,X,v;if(g){X=new Uint8Array(9+(i?4:0)+(o?4:0));let me=Hs(X);Ki(me,0,21589),Ki(me,2,Gi(X)-4),v=1+(i?2:0)+(o?4:0),eZ(me,4,v);let ye=5;so(me,ye,Math.floor(n.getTime()/1e3)),ye+=4,i&&(so(me,ye,Math.floor(i.getTime()/1e3)),ye+=4),o&&so(me,ye,Math.floor(o.getTime()/1e3));try{w=new Uint8Array(36);let oe=Hs(w),xe=f7(n);Ki(oe,0,10),Ki(oe,2,32),Ki(oe,8,1),Ki(oe,10,24),Ks(oe,12,xe),Ks(oe,20,f7(i)||xe),Ks(oe,28,f7(o)||xe)}catch{w=new Uint8Array}}else w=X=new Uint8Array;let U;try{let{uid:me,gid:ye,unixMode:oe,setuid:xe,setgid:Ee,sticky:Le,unixExtraFieldType:Se}=e;if(Se&&(me!==$t||ye!==$t||oe!==$t)){let Fe=sxe(me),Ue=sxe(ye),De=new Uint8Array;if(Se==yxe&&oe!==$t){let it=oe&65535;xe&&(it|=2048),Ee&&(it|=1024),Le&&(it|=512),De=new Uint8Array(2),new DataView(De.buffer).setUint16(0,it,!0)}let Je=3+Fe.length+Ue.length+De.length;U=new Uint8Array(4+Je);let St=Hs(U);Ki(St,0,Se==bxe?30837:30805),Ki(St,2,Je),eZ(St,4,1),eZ(St,5,Fe.length);let Oe=6;_r(U,Fe,Oe),Oe+=Fe.length,eZ(St,Oe,Ue.length),Oe++,_r(U,Ue,Oe),Oe+=Ue.length,_r(U,De,Oe)}else U=new Uint8Array}catch{U=new Uint8Array}B===$t&&(B=Y?8:0),s&&(W=W>45?W:45),b&&!a&&(W=W>51?W:51,G[9]=B,B=99);let k=Z?Gi(A):0,P=k+Gi(G,X,w,U,h),{headerArray:O,headerView:H,rawLastModDate:ee}=xxe({version:W,bitFlag:Cxe(r,c,d,b,B),compressionMethod:B,uncompressedSize:_,lastModDate:n<l8?l8:n>c8?c8:n,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:C,extraFieldLength:P}),z=30,te=new Uint8Array(z+Gi(t)+P),q=Hs(te);return so(q,0,67324752),_r(te,O,4),_r(te,t,z),z+=Gi(t),Z&&_r(te,A,z),z+=k,_r(te,G,z),z+=Gi(G),_r(te,X,z),z+=Gi(X),_r(te,w,z),z+=Gi(w),_r(te,U,z),z+=Gi(U),_r(te,h,z),d&&(so(q,18,0),so(q,22,0)),{localHeaderArray:te,localHeaderView:q,headerArray:O,headerView:H,lastModDate:n,rawLastModDate:ee,encrypted:b,compressed:Y,version:W,compressionMethod:B,extraFieldExtendedTimestampFlag:v,rawExtraFieldZip64:N,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:X,rawExtraFieldNTFS:w,rawExtraFieldUnix:U,rawExtraFieldAES:G,extraFieldLength:P}}function Jut(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Hs(i),s=64-(t+Gi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Hs(a);Ki(c,0,6534),Ki(c,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array(Gi(d)+s),_r(i,d),_r(i,a,Gi(d)),r=Hs(i),Ki(r,28,o+s),e.metadataSize+=s}function sxe(e){if(e===$t)return new Uint8Array;{let t=new Uint8Array(4);Hs(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}}function jut(e,t){if(e!==$t)e=e&255;else if(t!==$t){let{readOnly:n,hidden:i,system:o,directory:r,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),o&&(a|=4),r&&(a|=16),s&&(a|=32),e=a&255}return t===$t&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function qut({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=new Uint8Array,o,r=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),o=Hs(i),n&&(r=4,so(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function $ut({signature:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:o},{zip64:r,zipCrypto:s,dataDescriptor:a}){let{headerView:c,encrypted:d}=i,{dataDescriptorView:u,dataDescriptorOffset:h}=o;(!d||s)&&e!==$t&&(so(c,10,e),a&&so(u,h,e)),r?a&&(Ks(u,h+4,BigInt(t)),Ks(u,h+12,BigInt(n))):(so(c,14,t),so(c,18,n),a&&(so(u,h+4,t),so(u,h+8,n)))}function emt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,signature:o,compressedSize:r,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},d,{dataDescriptor:u}){if(u||(t||so(d,14,o),c||so(d,18,r),a||so(d,22,s)),n&&i){let h=30+Gi(e)+4;a&&(Ks(d,h,BigInt(s)),h+=8),c&&(Ks(d,h,BigInt(r)),h+=8)}}function axe({compressedSize:e,uncompressedSize:t,offset:n,diskNumberStart:i,zip64UncompressedSize:o,zip64CompressedSize:r,zip64Offset:s,zip64DiskNumberStart:a,rawExtraFieldZip64:c}){let d=Hs(c),u=4;o&&(Ks(d,u,BigInt(t)),u+=8),r&&(Ks(d,u,BigInt(e)),u+=8),s&&(Ks(d,u,BigInt(n)),u+=8),a&&so(d,u,i)}async function tmt(e,t,n){let{files:i,writer:o}=e,{diskOffset:r}=o,{diskNumber:s}=o,a=0,c=0,d=e.offset-r,u=i.size;for(let[,_]of i){let{rawFilename:R,rawExtraFieldZip64:L,rawExtraFieldAES:W,rawComment:B,rawExtraFieldNTFS:Y,rawExtraFieldUnix:N,rawExtraField:A,extendedTimestamp:I,extraFieldExtendedTimestampFlag:Z,lastModDate:G}=_,w;if(I){w=new Uint8Array(9);let X=Hs(w);Ki(X,0,21589),Ki(X,2,5),eZ(X,4,Z),so(X,5,Math.floor(G.getTime()/1e3))}else w=new Uint8Array;_.rawExtraFieldExtendedTimestamp=w,c+=46+Gi(R,B,L,W,Y,N,w,A)}let h=new Uint8Array(c),p=Hs(h);await Pp(o);let g=0;for(let[_,R]of Array.from(i.values()).entries()){let{offset:L,rawFilename:W,rawExtraFieldZip64:B,rawExtraFieldAES:Y,rawExtraFieldExtendedTimestamp:N,rawExtraFieldNTFS:A,rawExtraFieldUnix:I,rawExtraField:Z,rawComment:G,versionMadeBy:w,headerArray:X,headerView:v,zip64:U,zip64UncompressedSize:k,zip64CompressedSize:P,zip64DiskNumberStart:O,zip64Offset:H,internalFileAttributes:ee,externalFileAttributes:z,diskNumberStart:te,uncompressedSize:q,compressedSize:me}=R,ye=Gi(B,Y,N,A,I,Z);so(p,a,33639248),Ki(p,a+4,w),k||so(v,18,q),P||so(v,14,me),_r(h,X,a+6);let oe=a+30;if(Ki(p,oe,ye),oe+=2,Ki(p,oe,Gi(G)),oe+=2,Ki(p,oe,U&&O?65535:te),oe+=2,Ki(p,oe,ee),oe+=2,z&&so(p,oe,z),oe+=4,so(p,oe,U&&H?4294967295:L),oe+=4,_r(h,W,oe),oe+=Gi(W),_r(h,B,oe),oe+=Gi(B),_r(h,Y,oe),oe+=Gi(Y),_r(h,N,oe),oe+=Gi(N),_r(h,A,oe),oe+=Gi(A),_r(h,I,oe),oe+=Gi(I),_r(h,Z,oe),oe+=Gi(Z),_r(h,G,oe),oe+=Gi(G),a-g>o.availableSize&&(o.availableSize=0,await nb(o,h.slice(g,a)),g=a),a=oe,n.onprogress)try{await n.onprogress(_+1,i.size,new xy(R))}catch{}}await nb(o,g?h.slice(g):h);let f=o.diskNumber,{availableSize:b}=o;b<22&&f++;let C=Ii(e,n,uQ);if(d>4294967295||c>4294967295||u>65535||f>65535){if(C===!1)throw new Error(BQ);C=!0}let E=new Uint8Array(C?98:22),T=Hs(E);a=0,C&&(so(T,0,101075792),Ks(T,4,BigInt(44)),Ki(T,12,45),Ki(T,14,45),so(T,16,f),so(T,20,s),Ks(T,24,BigInt(u)),Ks(T,32,BigInt(u)),Ks(T,40,BigInt(c)),Ks(T,48,BigInt(d)),so(T,56,117853008),Ks(T,64,BigInt(d)+BigInt(c)),so(T,72,f+1),Ii(e,n,Q8,!0)&&(f=65535,s=65535),u=65535,d=4294967295,c=4294967295,a+=76),so(T,a,101010256),Ki(T,a+4,f),Ki(T,a+6,s),Ki(T,a+8,u),Ki(T,a+10,u),so(T,a+12,c),so(T,a+16,d);let S=Gi(t);if(S)if(S<=65535)Ki(T,a+20,S);else throw new Error(dxe);await nb(o,E),S&&await nb(o,t)}async function nb(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=Gi(t),await i.write(t)}finally{i.releaseLock()}}function f7(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Ii(e,t,n,i){let o=t[n]===$t?e.options[n]:t[n];return o===$t?i:o}function cxe(e){return e+5*(Math.floor(e/16383)+1)}function eZ(e,t,n){e.setUint8(t,n)}function Ki(e,t,n){e.setUint16(t,n,!0)}function so(e,t,n){e.setUint32(t,n,!0)}function Ks(e,t,n){e.setBigUint64(t,n,!0)}function _r(e,t,n){e.set(t,n)}function Hs(e){return new DataView(e.buffer)}function Gi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function xxe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawFilename:s,zip64CompressedSize:a,zip64UncompressedSize:c,extraFieldLength:d}){let u=new Uint8Array(26),h=Hs(u);Ki(h,0,e),Ki(h,2,t),Ki(h,4,n);let p=new Uint32Array(1),g=Hs(p);Ki(g,0,(r.getHours()<<6|r.getMinutes())<<5|r.getSeconds()/2),Ki(g,2,(r.getFullYear()-1980<<4|r.getMonth()+1)<<5|r.getDate());let f=p[0];return so(h,6,f),(a||o!==$t)&&so(h,14,a?4294967295:o),(c||i!==$t)&&so(h,18,c?4294967295:i),Ki(h,22,Gi(s)),Ki(h,24,d),{headerArray:u,headerView:h,rawLastModDate:f}}function Cxe(e,t,n,i,o){let r=0;return t&&(r=r|2048),n&&(r=r|8),(o==8||o==9)&&(e>=0&&e<=3&&(r=r|6),e>3&&e<=5&&(r=r|4),e==9&&(r=r|2)),i&&(r=r|1),r}var XFi=y(x(),1);var nmt={};try{Bp({baseURI:nmt.url})}catch{}var gBi=y(x(),1);var tBi=y(x(),1),Tu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Exe(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(n=>{n=(s=>{let a=(s=(s+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,c=[];for(let d=0;a>d;d+=4){let u=Tu.indexOf(s[d])<<18|Tu.indexOf(s[d+1])<<12|(63&Tu.indexOf(s[d+2]))<<6|63&Tu.indexOf(s[d+3]);c.push(u>>16&255),s[d+2]!=="="&&c.push(u>>8&255),s[d+3]!=="="&&c.push(255&u)}return new Uint8Array(c)})(n);let i=new Uint8Array(1024),o=0;for(let s=0;s<n.length;){let a=n[s++];if(128&a){let c=3+(127&a),d=n[s++]<<8|n[s++],u=o-d;r(o+c);for(let h=0;c>h;h++)i[o++]=i[u+h]}else{let c=a;r(o+c);for(let d=0;c>d&&s<n.length;d++)i[o++]=n[s++]}}return(s=>{let a="",c=s.length,d=0;for(;c>d+2;d+=3){let h=s[d]<<16|s[d+1]<<8|s[d+2];a+=Tu[h>>18&63]+Tu[h>>12&63]+Tu[h>>6&63]+Tu[63&h]}let u=c-d;if(u===1){let h=s[d]<<16;a+=Tu[h>>18&63]+Tu[h>>12&63]+"=="}else if(u===2){let h=s[d]<<16|s[d+1]<<8;a+=Tu[h>>18&63]+Tu[h>>12&63]+Tu[h>>6&63]+"="}return a})(new Uint8Array(i.buffer.slice(0,o)));function r(s){if(i.length<s){let a=2*i.length;for(;s>a;)a*=2;let c=new Uint8Array(a);c.set(i.subarray(0,o)),i=c}}})("[encoded data, 39356 characters]")),t)})}var sBi=y(x(),1);var iBi=y(x(),1),Fs,tZ,Su,IN;function A7(e){if(Fs=e,{malloc:tZ,free:Su,memory:IN}=Fs,typeof tZ!="function"||typeof Su!="function"||!IN)throw Fs=tZ=Su=IN=null,new Error("Invalid WASM module")}function Txe(e,t,n={}){let i=typeof n.level=="number"?n.level:-1,o=typeof n.outBuffer=="number"?n.outBuffer:64*1024,r=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){let s;if(this.out=tZ(o),this.in=tZ(r),this.inBufferSize=r,this._scratch=new Uint8Array(o),e?(this._process=Fs.deflate_process,this._last_consumed=Fs.deflate_last_consumed,this._end=Fs.deflate_end,this.streamHandle=Fs.deflate_new(),t==="gzip"?s=Fs.deflate_init_gzip(this.streamHandle,i):t==="deflate-raw"?s=Fs.deflate_init_raw(this.streamHandle,i):s=Fs.deflate_init(this.streamHandle,i)):t==="deflate64-raw"?(this._process=Fs.inflate9_process,this._last_consumed=Fs.inflate9_last_consumed,this._end=Fs.inflate9_end,this.streamHandle=Fs.inflate9_new(),s=Fs.inflate9_init_raw(this.streamHandle)):(this._process=Fs.inflate_process,this._last_consumed=Fs.inflate_last_consumed,this._end=Fs.inflate_end,this.streamHandle=Fs.inflate_new(),t==="deflate-raw"?s=Fs.inflate_init_raw(this.streamHandle):t==="gzip"?s=Fs.inflate_init_gzip(this.streamHandle):s=Fs.inflate_init(this.streamHandle)),s!==0)throw new Error("init failed:"+s)},transform(s,a){try{let c=s,d=new Uint8Array(IN.buffer),u=this._process,h=this._last_consumed,p=this.out,g=this._scratch,f=0;for(;f<c.length;){let b=Math.min(c.length-f,32768);(!this.in||this.inBufferSize<b)&&(this.in&&Su&&Su(this.in),this.in=tZ(b),this.inBufferSize=b),d.set(c.subarray(f,f+b),this.in);let C=u(this.streamHandle,this.in,b,p,o,0),E=C&16777215;if(E&&(g.set(d.subarray(p,p+E),0),a.enqueue(g.slice(0,E))),!e){let S=C>>24&255,_=S&128?S-256:S;if(_<0)throw new Error("process error:"+_)}let T=h(this.streamHandle);if(T===0)break;f+=T}}catch(c){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Su&&Su(this.in),this.out&&Su&&Su(this.out),a.error(c)}},flush(s){try{let a=new Uint8Array(IN.buffer),c=this._process,d=this.out,u=this._scratch;for(;;){let h=c(this.streamHandle,0,0,d,o,4),p=h&16777215,g=h>>24&255;if(!e){let f=g&128?g-256:g;if(f<0)throw new Error("process error:"+f)}if(p&&(u.set(a.subarray(d,d+p),0),s.enqueue(u.slice(0,p))),g===1||p===0)break}}catch(a){s.error(a)}finally{if(this._end&&this.streamHandle){let a=this._end(this.streamHandle);a!==0&&s.error(new Error("end error:"+a))}this.in&&Su&&Su(this.in),this.out&&Su&&Su(this.out)}}})}var _N=class{constructor(t="deflate",n){return Txe(!0,t,n)}},ZN=class{constructor(t="deflate",n){return Txe(!1,t,n)}};var Sxe=!1;async function Ixe(e,{baseURI:t}){if(!Sxe){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(r){if(e.startsWith("data:application/wasm;base64,"))n=imt(e);else throw r}let o=await WebAssembly.instantiate(n);A7(o.instance.exports),Sxe=!0}}function imt(e){let t=e.split(",")[1],n=atob(t),i=n.length,o=new Uint8Array(i);for(let r=0;r<i;++r)o[r]=n.charCodeAt(r);return o.buffer}var g7;Exe(Bp);hye({initModule:e=>{if(!g7){let{wasmURI:t}=e;typeof t==Mm&&(t=t()),g7=Ixe(t,e)}return g7}});Bp({CompressionStreamZlib:_N,DecompressionStreamZlib:ZN});var TBi=y(x(),1);function omt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Xn=omt;var IBi=y(x(),1);function rmt(e,t){this.position=e,this.headingPitchRange=t}var RN=rmt;var GBi=y(x(),1);function wQ(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new Ce,this.tourEnd=new Ce,this.entryStart=new Ce,this.entryEnd=new Ce,this._activeEntries=[]}wQ.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};wQ.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;Zxe.call(this,e,t,function(i){n.playlistIndex=0,i||_xe(n._activeEntries),n.tourEnd.raiseEvent(i)})};wQ.prototype.stop=function(){_xe(this._activeEntries)};function _xe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Zxe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=smt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function smt(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,Zxe.call(this,e,t,n)}}var GN=wQ;var OBi=y(x(),1);var MBi=y(x(),1);var NBi=y(x(),1),Ji=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({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:Object.freeze({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:Object.freeze({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:Object.freeze({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:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({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:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Ji.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Ji.Bounce.In(e*2)*.5:Ji.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),VN=function(){return performance.now()},amt=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=VN()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),nZ={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=nZ.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=nZ.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=nZ.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=nZ.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}})(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},Rxe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),b7=new amt,Gxe=(function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ji.Linear.None,this._interpolationFunction=nZ.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Rxe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=b7,b7.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=VN()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),d=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var h=i[s];if(h.length===0)continue;for(var p=[a],g=0,f=h.length;g<f;g+=1){var b=this._handleRelativeValue(a,h[g]);if(isNaN(b)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(b)}u&&(i[s]=p)}if((d==="object"||c)&&a&&!u){n[s]=c?[]:{};var C=a;for(var E in C)n[s][E]=C[E];o[s]=c?[]:{};var h=i[s];if(!this._isDynamic){var T={};for(var E in h)T[E]=h[E];i[s]=h=T}this._setupProperties(C,n[s],h,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=VN()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=VN()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Ji.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=nZ.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=VN()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,d=function(){if(i._duration===0||s>c)return 1;var b=Math.trunc(s/a),C=s-b*a,E=Math.min(C/i._duration,1);return E===0&&s===i._duration?1:E},u=d(),h=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,f=this._chainedTweens.length;g<f;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),d=Array.isArray(a),u=!c&&d;u?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e})();var VBi=Rxe.nextId,Mp=b7,LBi=Mp.getAll.bind(Mp),WBi=Mp.removeAll.bind(Mp),FBi=Mp.add.bind(Mp),BBi=Mp.remove.bind(Mp),wBi=Mp.update.bind(Mp);var cmt={LINEAR_NONE:Ji.Linear.None,QUADRATIC_IN:Ji.Quadratic.In,QUADRATIC_OUT:Ji.Quadratic.Out,QUADRATIC_IN_OUT:Ji.Quadratic.InOut,CUBIC_IN:Ji.Cubic.In,CUBIC_OUT:Ji.Cubic.Out,CUBIC_IN_OUT:Ji.Cubic.InOut,QUARTIC_IN:Ji.Quartic.In,QUARTIC_OUT:Ji.Quartic.Out,QUARTIC_IN_OUT:Ji.Quartic.InOut,QUINTIC_IN:Ji.Quintic.In,QUINTIC_OUT:Ji.Quintic.Out,QUINTIC_IN_OUT:Ji.Quintic.InOut,SINUSOIDAL_IN:Ji.Sinusoidal.In,SINUSOIDAL_OUT:Ji.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Ji.Sinusoidal.InOut,EXPONENTIAL_IN:Ji.Exponential.In,EXPONENTIAL_OUT:Ji.Exponential.Out,EXPONENTIAL_IN_OUT:Ji.Exponential.InOut,CIRCULAR_IN:Ji.Circular.In,CIRCULAR_OUT:Ji.Circular.Out,CIRCULAR_IN_OUT:Ji.Circular.InOut,ELASTIC_IN:Ji.Elastic.In,ELASTIC_OUT:Ji.Elastic.Out,ELASTIC_IN_OUT:Ji.Elastic.InOut,BACK_IN:Ji.Back.In,BACK_OUT:Ji.Back.Out,BACK_IN_OUT:Ji.Back.InOut,BOUNCE_IN:Ji.Bounce.In,BOUNCE_OUT:Ji.Bounce.Out,BOUNCE_IN_OUT:Ji.Bounce.InOut},bs=Object.freeze(cmt);function YQ(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}YQ.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ue(this.view.position);t.flyToBoundingSphere(o,i)}};YQ.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};YQ.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=bs.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Rt(t,e)),t};var LN=YQ;var KBi=y(x(),1);function y7(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}y7.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};y7.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var WN=y7;var Pxe={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){let t=e.toLowerCase();return t=hA(t),Pxe[t]}},_7;typeof DOMParser<"u"&&(_7=new DOMParser);var lmt=new k9({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Ty=32,Vxe=2414016,Lxe=1,Wxe=16093e3,Fxe=.1,Bxe=[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"],wxe=["http://www.google.com/kml/ext/2.2"],dmt=["http://www.w3.org/2005/Atom"],Ne={kml:Bxe,gx:wxe,atom:dmt,kmlgx:Bxe.concat(wxe)},Z7={Document:Kxe,Folder:Gmt,Placemark:Vmt,NetworkLink:Pmt,GroundOverlay:Ymt,PhotoOverlay:qxe,ScreenOverlay:wmt,Tour:Wmt};function Up(e){this._dataSource=e,this._deferred=ed(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Up.prototype,{dataSource:{get:function(){return this._dataSource}}});Up.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Up.prototype.addPromise=function(e){this._promises.push(e)};Up.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Up.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Zu._getTimestamp()),this._process(e)};Up.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Zu._getTimestamp(),e._process(!0)},0)};Up.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};Up.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Up.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=Z7[i.localName];if(l(o)&&(Ne.kml.indexOf(i.namespaceURI)!==-1||Ne.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Zu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function umt(e){let t=e.slice(0,Math.min(4,e.size)),n=ed(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function mmt(e){let t=ed(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function Mxe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function Uxe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}async function hmt(e,t){let n=await e.getData(new aN);n=Mxe(n),n=Uxe(n),t.kml=_7.parseFromString(n,"application/xml")}async function x7(e,t){let n=Pxe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new rN(n));t[e.filename]=i}function Iu(e,t,n,i){let o=i.keys,r=new FN.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],d=c.getAttribute(n);if(l(d)){let h=new FN.default(d).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let g=o[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function _u(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=R7(a,i);l(c)&&s.setAttribute(n,c.url)}}function Dxe(e,t,n){let i=ua(e,"id");i=l(i)&&i.length!==0?i:Kn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Kn(),l(n)&&(i=n+i)),o=t.add(new xr({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new vmt),o}function BN(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function MQ(e,t){if(!l(e))return m.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return m.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,m.fromDegrees(i,o,r,t)}function NQ(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=MQ(n[s],t);return o}function Sy(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function ua(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function ji(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Yxe(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function gf(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function bi(e,t,n){let i=ji(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Pn(e,t,n){let i=ji(e,t,n);if(l(i))return i.textContent.trim()}function bf(e,t,n){let i=ji(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function R7(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new Ge({url:o});else{let r=new FN.default(t.getUrlComponent()),s=new FN.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Ge({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Zd={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function S7(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(Zd.maximumRed=r,Zd.red=void 0):(Zd.maximumRed=void 0,Zd.red=0),o>0?(Zd.maximumGreen=o,Zd.green=void 0):(Zd.maximumGreen=void 0,Zd.green=0),i>0?(Zd.maximumBlue=i,Zd.blue=void 0):(Zd.maximumBlue=void 0,Zd.blue=0),Zd.alpha=n,D.fromRandom(Zd)):new D(r,o,i,n)}function GE(e,t,n){let i=Pn(e,t,n);if(l(i))return S7(i,Pn(e,"colorMode",n)==="random")}function fmt(e){let t=ji(e,"TimeStamp",Ne.kmlgx),n=Pn(t,"when",Ne.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=j.fromIso8601(n),o=new fs;return o.addInterval(new Wn({start:i,stop:Ke.MAXIMUM_VALUE})),o}function pmt(e){let t=ji(e,"TimeSpan",Ne.kmlgx);if(!l(t))return;let n,i=ji(t,"begin",Ne.kmlgx),o=l(i)?j.fromIso8601(i.textContent):void 0,r=ji(t,"end",Ne.kmlgx),s=l(r)?j.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(j.lessThan(s,o)){let a=o;o=s,s=a}n=new fs,n.addInterval(new Wn({start:o,stop:s}))}else l(o)?(n=new fs,n.addInterval(new Wn({start:o,stop:Ke.MAXIMUM_VALUE}))):l(s)&&(n=new fs,n.addInterval(new Wn({start:Ke.MINIMUM_VALUE,stop:s})));return n}function vxe(){let e=new wc;return e.width=Ty,e.height=Ty,e.scaleByDistance=new kt(Vxe,Lxe,Wxe,Fxe),e.pixelOffsetScaleByDistance=new kt(Vxe,Lxe,Wxe,Fxe),e}function G7(){let e=new Ch;return e.outline=!0,e.outlineColor=D.WHITE,e}function kxe(){let e=new xh;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new M(17,0),e.horizontalOrigin=Bi.LEFT,e.font="16px sans-serif",e.style=cr.FILL_AND_OUTLINE,e}function V7(e,t,n,i,o){let r=Pn(e,"href",Ne.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=bi(e,"x",Ne.gx)??0,d=bi(e,"y",Ne.gx)??0;c=Math.min(c/32,7),d=7-Math.min(d/32,7);let u=8*d+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=R7(r,n,i);if(o){let a=Pn(e,"refreshMode",Ne.kml),c=Pn(e,"viewRefreshMode",Ne.kml);a==="onInterval"||a==="onExpire"?At(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&At(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=Pn(e,"viewBoundScale",Ne.kml)??1,u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=Pn(e,"viewFormat",Ne.kml)??u,p=Pn(e,"httpQuery",Ne.kml);l(h)&&s.setQueryParameters(Ud(PQ(h))),l(p)&&s.setQueryParameters(Ud(PQ(p)));let g=t._ellipsoid;return W7(s,t.camera,t.canvas,d,t._lastCameraView.bbox,g),s}return s}function Amt(e,t,n,i,o){let r=bi(t,"scale",Ne.kml),s=bi(t,"heading",Ne.kml),a=GE(t,"color",Ne.kml),c=ji(t,"Icon",Ne.kml),d=V7(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=bi(c,"x",Ne.gx),h=bi(c,"y",Ne.gx),p=bi(c,"w",Ne.gx),g=bi(c,"h",Ne.gx),f=ji(t,"hotSpot",Ne.kml),b=Sy(f,"x"),C=Sy(f,"y"),E=ua(f,"xunits"),T=ua(f,"yunits"),S=n.billboard;l(S)||(S=vxe(),n.billboard=S),S.image=d,S.scale=r,S.color=a,(l(u)||l(h)||l(p)||l(g))&&(S.imageSubRegion=new $e(u,h,p,g)),l(s)&&s!==0&&(S.rotation=V.toRadians(-s),S.alignedAxis=m.UNIT_Z),r=r??1;let _,R;l(b)&&(E==="pixels"?_=-b*r:E==="insetPixels"?_=(b-Ty)*r:E==="fraction"&&(_=-b*Ty*r),_+=Ty*.5*r),l(C)&&(T==="pixels"?R=C*r:T==="insetPixels"?R=(-C+Ty)*r:T==="fraction"&&(R=C*Ty*r),R-=Ty*.5*r),(l(_)||l(R))&&(S.pixelOffset=new M(_,R))}function XQ(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")Amt(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=kxe(),n.label=c),c.scale=bi(a,"scale",Ne.kml)??c.scale,c.fillColor=GE(a,"color",Ne.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Nc,n.polyline=c),c.width=bi(a,"width",Ne.kml),c.material=GE(a,"color",Ne.kml),l(GE(a,"outerColor",Ne.gx))&&At("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(bi(a,"outerWidth",Ne.gx))&&At("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(bi(a,"physicalWidth",Ne.gx))&&At("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(bf(a,"labelVisibility",Ne.gx))&&At("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=G7(),n.polygon=c),c.material=GE(a,"color",Ne.kml)??c.material,c.fill=bf(a,"fill",Ne.kml)??c.fill,c.outline=bf(a,"outline",Ne.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=S7(Pn(a,"bgColor",Ne.kml))??D.WHITE,d=S7(Pn(a,"textColor",Ne.kml))??D.BLACK,u=Pn(a,"text",Ne.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:d,text:u}}else if(a.localName==="ListStyle"){let c=Pn(a,"listItemType",Ne.kml);(c==="radioFolder"||c==="checkOffOnly")&&At(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function gmt(e,t,n,i,o){let r=new xr,s,a=-1,c=t.childNodes,d=c.length;for(let h=0;h<d;h++){let p=c[h];(p.localName==="Style"||p.localName==="StyleMap")&&(a=h)}if(a!==-1){let h=c[a];if(h.localName==="Style")XQ(e,h,r,i,o);else{let p=gf(h,"Pair",Ne.kml);for(let g=0;g<p.length;g++){let f=p[g],b=Pn(f,"key",Ne.kml);if(b==="normal"){let C=Pn(f,"styleUrl",Ne.kml);if(l(C))s=n.getById(C),l(s)||(s=n.getById(`#${C}`)),l(s)&&r.merge(s);else{let E=ji(f,"Style",Ne.kml);XQ(e,E,r,i,o)}}else At(`kml-styleMap-${b}`,`KML - Unsupported StyleMap key: ${b}`)}}}let u=Pn(t,"styleUrl",Ne.kml);if(l(u)){let h=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),g=p[0];h=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(h),l(s)||(s=n.getById(`#${h}`)),l(s)&&r.merge(s)}return r}function bmt(e,t,n){return t.fetchXML().then(function(i){return Qxe(e,i,n,t,!0)})}function Qxe(e,t,n,i,o,r){let s,a,c,d,u=Yxe(t,"Style",Ne.kml);if(l(u)){let b=u.length;for(s=0;s<b;s++)d=u[s],a=ua(d,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new xr({id:a}),n.add(c),XQ(e,d,c,i,r)))}let h=Yxe(t,"StyleMap",Ne.kml);if(l(h)){let b=h.length;for(s=0;s<b;s++){let C=h[s];if(a=ua(C,"id"),l(a)){let E=gf(C,"Pair",Ne.kml);for(let T=0;T<E.length;T++){let S=E[T],_=Pn(S,"key",Ne.kml);if(_==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let R=Pn(S,"styleUrl",Ne.kml);if(l(R)){R[0]!=="#"&&(R=`#${R}`),o&&l(i)&&(R=i.getUrlComponent()+R);let L=n.getById(R);l(L)&&c.merge(L)}else d=ji(S,"Style",Ne.kml),XQ(e,d,c,i,r)}}else At(`kml-styleMap-${_}`,`KML - Unsupported StyleMap key: ${_}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),f=g.length;for(s=0;s<f;s++){let b=g[s].textContent;if(b[0]!=="#"){let C=b.split("#");if(C.length===2){let E=C[0],T=i.getDerivedResource({url:E});p.push(bmt(e,T,n))}}}return p}function L7(e,t,n){let i=new Mg(e,t.id,["position"]),o=new Zp(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Nc,t.polyline.positions=new Pg([i,o])}function Oxe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?tt.CLAMP_TO_GROUND:e==="relativeToGround"?tt.RELATIVE_TO_GROUND:e==="absolute"?tt.NONE:t==="clampToSeaFloor"?(At("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),tt.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(At("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),tt.RELATIVE_TO_GROUND):(l(e)?At("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):At("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),tt.CLAMP_TO_GROUND)}function ymt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&At("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new Zp(e))}function xmt(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&At("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function UQ(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():kxe(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():vxe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(D.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new M(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function zxe(e,t){let n=e.path;l(n)||(n=new BA,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function Cmt(e,t,n,i,o){let r=Pn(n,"coordinates",Ne.kml),s=Pn(n,"altitudeMode",Ne.kml),a=Pn(n,"altitudeMode",Ne.gx),c=bf(n,"extrude",Ne.kml),d=e._ellipsoid,u=MQ(r,d);return i.position=u,UQ(e,i,o,Oxe(s,a)),c&&BN(s,a)&&L7(t,i,o),!0}function Nxe(e,t,n,i,o){let r=ji(n,"coordinates",Ne.kml),s=Pn(n,"altitudeMode",Ne.kml),a=Pn(n,"altitudeMode",Ne.gx),c=bf(n,"extrude",Ne.kml),d=bf(n,"tessellate",Ne.kml),u=BN(s,a),h=bi(n,"drawOrder",Ne.gx),p=e._ellipsoid,g=NQ(r,p),f=o.polyline;if(u&&c){let b=new wA;i.wall=b,b.positions=g;let C=o.polygon;l(C)&&(b.fill=C.fill,b.material=C.material),b.outline=!0,l(f)?(b.outlineColor=l(f.material)?f.material.color:D.WHITE,b.outlineWidth=f.width):l(C)&&(b.outlineColor=l(C.material)?C.material.color:D.WHITE)}else if(e._clampToGround&&!u&&d){let b=new Nc;b.clampToGround=!0,i.polyline=b,b.positions=g,l(f)?(b.material=l(f.material)?f.material.color.getValue(Ke.MINIMUM_VALUE):D.WHITE,b.width=f.width??1):(b.material=D.WHITE,b.width=1),b.zIndex=h}else l(h)&&At("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&At("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=l(f)?f.clone():new Nc,i.polyline=f,f.positions=xmt(g,s,a,p),(!d||u)&&(f.arcType=ln.NONE);return!0}function Emt(e,t,n,i,o){let r=ji(n,"outerBoundaryIs",Ne.kml),s=ji(r,"LinearRing",Ne.kml),a=ji(s,"coordinates",Ne.kml),c=e._ellipsoid,d=NQ(a,c),u=bf(n,"extrude",Ne.kml),h=Pn(n,"altitudeMode",Ne.kml),p=Pn(n,"altitudeMode",Ne.gx),g=BN(h,p),f=l(o.polygon)?o.polygon.clone():G7(),b=o.polyline;if(l(b)&&(f.outlineColor=l(b.material)?b.material.color:D.WHITE,f.outlineWidth=b.width),i.polygon=f,g?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),l(d)){let C=new gc(d),E=gf(n,"innerBoundaryIs",Ne.kml);for(let T=0;T<E.length;T++){s=gf(E[T],"LinearRing",Ne.kml);for(let S=0;S<s.length;S++)a=ji(s[S],"coordinates",Ne.kml),d=NQ(a,c),l(d)&&C.holes.push(new gc(d))}f.hierarchy=C}return!0}function Tmt(e,t,n,i,o){let r=Pn(n,"altitudeMode",Ne.kml),s=Pn(n,"altitudeMode",Ne.gx),a=gf(n,"coord",Ne.gx),c=gf(n,"angles",Ne.gx),d=gf(n,"when",Ne.kml),u=bf(n,"extrude",Ne.kml),h=BN(r,s),p=e._ellipsoid;c.length>0&&At("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,d.length),f=[],b=[];for(let E=0;E<g;E++){let T=MQ(a[E].textContent,p);f.push(T),b.push(j.fromIso8601(d[E].textContent))}let C=new ec;return C.addSamples(b,f),i.position=C,UQ(e,i,o,Oxe(r,s)),zxe(i,o),i.availability=new fs,d.length>0&&i.availability.addInterval(new Wn({start:b[0],stop:b[b.length-1]})),h&&u&&L7(t,i,o),!0}function Xxe(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],h=new ec;h.addSamples(e,t),n.intervals.addInterval(new Wn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:ymt(h,s,a)})),i.addInterval(new Wn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Wn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function Smt(e,t,n,i,o){let r=bf(n,"interpolate",Ne.gx),s=gf(n,"Track",Ne.gx),a,c,d,u=!1,h=new Dg,p=new fs,g=new qa,f=e._ellipsoid;for(let b=0,C=s.length;b<C;b++){let E=s[b],T=gf(E,"when",Ne.kml),S=gf(E,"coord",Ne.gx),_=Pn(E,"altitudeMode",Ne.kml),R=Pn(E,"altitudeMode",Ne.gx),L=BN(_,R),W=bf(E,"extrude",Ne.kml),B=Math.min(S.length,T.length),Y=[];a=[];for(let N=0;N<B;N++){let A=MQ(S[N].textContent,f);Y.push(A),a.push(j.fromIso8601(T[N].textContent))}r&&(l(c)&&Xxe([c,a[0]],[d,Y[0]],g,p,h,!1,"absolute",void 0,!1),c=a[B-1],d=Y[Y.length-1]),Xxe(a,Y,g,p,h,L&&W,_,R,!0),u=u||L&&W}return i.availability=p,i.position=g,UQ(e,i,o),zxe(i,o),u&&(L7(t,i,o),i.polyline.show=h),!0}var Hxe={Point:Cmt,LineString:Nxe,LinearRing:Nxe,Polygon:Emt,Track:Tmt,MultiTrack:Smt,MultiGeometry:Imt,Model:_mt};function Imt(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,d=s.length;c<d;c++){let u=s.item(c),h=Hxe[u.localName];if(l(h)){let p=Dxe(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,u,p,o)&&(a=!0)}}return a}function _mt(e,t,n,i,o){return At("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Zmt(e,t){let n=ji(e,"ExtendedData",Ne.kml);if(!l(n))return;l(ji(n,"SchemaData",Ne.kml))&&At("kml-schemaData","KML - SchemaData is unsupported"),l(ua(n,"xmlns:prefix"))&&At("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=gf(n,"Data",Ne.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=ua(a,"name");l(c)&&(i[c]={displayName:Pn(a,"displayName",Ne.kml),value:Pn(a,"value",Ne.kml)})}}t.kml.extendedData=i}var Yo;typeof document<"u"&&(Yo=document.createElement("div"));function Rmt(e,t,n,i,o){let r,s,a,c=t.kml,d=c.extendedData,u=Pn(e,"description",Ne.kml),h=t.balloonStyle??n.balloonStyle,p=D.WHITE,g=D.BLACK,f=u;l(h)&&(p=h.bgColor??D.WHITE,g=h.textColor??D.BLACK,f=h.text??u);let b;if(l(f)){if(f=f.replace("$[name]",t.name??""),f=f.replace("$[description]",u??""),f=f.replace("$[address]",c.address??""),f=f.replace("$[Snippet]",c.snippet??""),f=f.replace("$[id]",t.id),f=f.replace("$[geDirections]",""),l(d)){let T=f.match(/\$\[.+?\]/g);if(T!==null)for(r=0;r<T.length;r++){let S=T[r],_=S.substr(2,S.length-3),R=/\/displayName$/.test(_);_=_.replace(/\/displayName$/,""),b=d[_],l(b)&&(b=R?b.displayName:b.value),l(b)&&(f=f.replace(S,b??""))}}}else if(l(d)&&(a=Object.keys(d),a.length>0)){for(f='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],b=d[s],f+=`<tr><th>${b.displayName??s}</th><td>${b.value??""}</td></tr>`;f+="</tbody></table>"}if(!l(f))return;f=lmt.link(f),Yo.innerHTML=f;let C=Yo.querySelectorAll("a");for(r=0;r<C.length;r++)C[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Iu(Yo,"a","href",i),Iu(Yo,"link","href",i),Iu(Yo,"area","href",i),Iu(Yo,"img","src",i),Iu(Yo,"iframe","src",i),Iu(Yo,"video","src",i),Iu(Yo,"audio","src",i),Iu(Yo,"source","src",i),Iu(Yo,"track","src",i),Iu(Yo,"input","src",i),Iu(Yo,"embed","src",i),Iu(Yo,"script","src",i),Iu(Yo,"video","poster",i)),_u(Yo,"a","href",o),_u(Yo,"link","href",o),_u(Yo,"area","href",o),_u(Yo,"img","src",o),_u(Yo,"iframe","src",o),_u(Yo,"video","src",o),_u(Yo,"audio","src",o),_u(Yo,"source","src",o),_u(Yo,"track","src",o),_u(Yo,"input","src",o),_u(Yo,"embed","src",o),_u(Yo,"script","src",o),_u(Yo,"video","poster",o);let E='<div class="cesium-infoBox-description-lighter" style="';E+="overflow:auto;",E+="word-wrap:break-word;",E+=`background-color:${p.toCssColorString()};`,E+=`color:${g.toCssColorString()};`,E+='">',E+=`${Yo.innerHTML}</div>`,Yo.innerHTML="",t.description=E}function DQ(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=Dxe(t,i,n.context),c=a.kml,d=gmt(e,t,n.styleCollection,r,s),u=Pn(t,"name",Ne.kml);a.name=u,a.parent=o;let h=pmt(t);l(h)||(h=fmt(t)),a.availability=h,B7(a);function p(S){return S?S.show&&p(S.parent):!0}let g=bf(t,"visibility",Ne.kml);a.show=p(o)&&(g??!0);let f=ji(t,"author",Ne.atom),b=c.author;b.name=Pn(f,"name",Ne.atom),b.uri=Pn(f,"uri",Ne.atom),b.email=Pn(f,"email",Ne.atom);let C=ji(t,"link",Ne.atom),E=c.link;E.href=ua(C,"href"),E.hreflang=ua(C,"hreflang"),E.rel=ua(C,"rel"),E.type=ua(C,"type"),E.title=ua(C,"title"),E.length=ua(C,"length"),c.address=Pn(t,"address",Ne.kml),c.phoneNumber=Pn(t,"phoneNumber",Ne.kml),c.snippet=Pn(t,"Snippet",Ne.kml),Zmt(t,a),Rmt(t,a,d,s,r);let T=e._ellipsoid;return jxe(t,a,T),Jxe(t,a,T),l(ji(t,"Region",Ne.kml))&&At("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function Kxe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Gmt(e,t,n,i){let o=DQ(e,t,n),r=Qe(n);r.parentEntity=o.entity,Kxe(e,t,r,i)}function Vmt(e,t,n,i){let o=DQ(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let d=0,u=c.length;d<u&&!a;d++){let h=c.item(d),p=Hxe[h.localName];l(p)&&(p(e,n.entityCollection,h,r,s,r.id),a=!0)}a||(r.merge(s),UQ(e,r,s))}var Lmt={FlyTo:Bmt,Wait:Fmt,SoundCue:C7,AnimatedUpdate:C7,TourControl:C7};function Wmt(e,t,n,i){let o=Pn(t,"name",Ne.kml),r=ua(t,"id"),s=new GN(o,r),a=ji(t,"Playlist",Ne.gx);if(a){let c=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let h=d[u];if(h.localName){let p=Lmt[h.localName];p?p(s,h,c):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(s)}function C7(e,t){At(`KML Tour unsupported node ${t.localName}`)}function Fmt(e,t){let n=bi(t,"duration",Ne.gx);e.addPlaylistEntry(new WN(n))}function Bmt(e,t,n){let i=bi(t,"duration",Ne.gx),o=Pn(t,"flyToMode",Ne.gx),r={kml:{}};jxe(t,r,n),Jxe(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new LN(i,o,s);e.addPlaylistEntry(a)}function Jxe(e,t,n){let i=ji(e,"Camera",Ne.kml);if(l(i)){let o=bi(i,"longitude",Ne.kml)??0,r=bi(i,"latitude",Ne.kml)??0,s=bi(i,"altitude",Ne.kml)??0,a=bi(i,"heading",Ne.kml)??0,c=bi(i,"tilt",Ne.kml)??0,d=bi(i,"roll",Ne.kml)??0,u=m.fromDegrees(o,r,s,n),h=uc.fromDegrees(a,c-90,d);t.kml.camera=new HY(u,h)}}function jxe(e,t,n){let i=ji(e,"LookAt",Ne.kml);if(l(i)){let o=bi(i,"longitude",Ne.kml)??0,r=bi(i,"latitude",Ne.kml)??0,s=bi(i,"altitude",Ne.kml)??0,a=bi(i,"heading",Ne.kml),c=bi(i,"tilt",Ne.kml),d=bi(i,"range",Ne.kml)??0;c=V.toRadians(c??0),a=V.toRadians(a??0);let u=new Xm(a,c-V.PI_OVER_TWO,d),h=m.fromDegrees(o,r,s,n);t.kml.lookAt=new RN(h,u)}}function wmt(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=ji(t,"Icon",Ne.kml),c=V7(a,e,r,s,!1);if(!l(c))return;let d=document.createElement("img");e._screenOverlays.push(d),d.src=c.url,d.onload=function(){let u=["position: absolute"],h=ji(t,"screenXY",Ne.kml),p=ji(t,"overlayXY",Ne.kml),g=ji(t,"size",Ne.kml),f,b,C,E,T,S;l(g)&&(f=Sy(g,"x"),b=Sy(g,"y"),C=ua(g,"xunits"),E=ua(g,"yunits"),l(f)&&f!==-1&&f!==0&&(C==="fraction"?T=`width: ${Math.floor(f*100)}%`:C==="pixels"&&(T=`width: ${f}px`),u.push(T)),l(b)&&b!==-1&&b!==0&&(E==="fraction"?S=`height: ${Math.floor(b*100)}%`:E==="pixels"&&(S=`height: ${b}px`),u.push(S))),d.style=u.join(";");let _=0,R=d.height;l(p)&&(f=Sy(p,"x"),b=Sy(p,"y"),C=ua(p,"xunits"),E=ua(p,"yunits"),l(f)&&(C==="fraction"?_=f*d.width:(C==="pixels"||C==="insetPixels")&&(_=f)),l(b)&&(E==="fraction"?R=b*d.height:(E==="pixels"||E==="insetPixels")&&(R=b))),l(h)&&(f=Sy(h,"x"),b=Sy(h,"y"),C=ua(h,"xunits"),E=ua(h,"yunits"),l(f)&&(C==="fraction"?T=`left: calc(${Math.floor(f*100)}% - ${_}px)`:C==="pixels"?T=`left: ${f-_}px`:C==="insetPixels"&&(T=`right: ${f-_}px`),u.push(T)),l(b)&&(E==="fraction"?S=`bottom: calc(${Math.floor(b*100)}% - ${R}px)`:E==="pixels"?S=`bottom: ${b-R}px`:E==="insetPixels"&&(S=`top: ${b-R}px`),u.push(S))),d.style=u.join(";")},o.appendChild(d)}function Ymt(e,t,n,i){let r=DQ(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=NQ(ji(t,"LatLonQuad",Ne.gx),c),u=bi(t,"drawOrder",Ne.kml);if(l(d))s=G7(),s.hierarchy=new gc(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new Eh,s.zIndex=u,r.rectangle=s;let f=ji(t,"LatLonBox",Ne.kml);if(l(f)){let b=bi(f,"west",Ne.kml),C=bi(f,"south",Ne.kml),E=bi(f,"east",Ne.kml),T=bi(f,"north",Ne.kml);l(b)&&(b=V.negativePiToPi(V.toRadians(b))),l(C)&&(C=V.clampToLatitudeRange(V.toRadians(C))),l(E)&&(E=V.negativePiToPi(V.toRadians(E))),l(T)&&(T=V.clampToLatitudeRange(V.toRadians(T))),s.coordinates=new de(b,C,E,T);let S=bi(f,"rotation",Ne.kml);if(l(S)){let _=V.toRadians(S);s.rotation=_,s.stRotation=_}}}let h=ji(t,"Icon",Ne.kml),p=V7(h,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&At("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=bi(h,"x",Ne.gx),b=bi(h,"y",Ne.gx),C=bi(h,"w",Ne.gx),E=bi(h,"h",Ne.gx);(l(f)||l(b)||l(C)||l(E))&&At("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=GE(t,"color",Ne.kml),s.material.transparent=!0}else s.material=GE(t,"color",Ne.kml);let g=Pn(t,"altitudeMode",Ne.kml);l(g)?g==="absolute"?(s.height=bi(t,"altitude",Ne.kml),s.zIndex=void 0):g!=="clampToGround"&&At("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Pn(t,"altitudeMode",Ne.gx),g==="relativeToSeaFloor"?(At("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=bi(t,"altitude",Ne.kml),s.zIndex=void 0):g==="clampToSeaFloor"?At("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&At("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function qxe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),At(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var Iy={INTERVAL:0,EXPIRE:1,STOP:2};function PQ(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Nmt=new de,iZ=new pe,E7=new M,Xmt=new m;function W7(e,t,n,i,o,r){function s(d){return d<-V.PI_OVER_TWO?-V.PI_OVER_TWO:d>V.PI_OVER_TWO?V.PI_OVER_TWO:d}function a(d){return d>V.PI?d-V.TWO_PI:d<-V.PI?d+V.TWO_PI:d}let c=ix(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==se.MORPHING){let d,u;if(o=o??Nmt,l(n)&&(E7.x=n.clientWidth*.5,E7.y=n.clientHeight*.5,d=t.pickEllipsoid(E7,r,Xmt)),l(d)?u=r.cartesianToCartographic(d,iZ):(u=de.center(o,iZ),d=r.cartographicToCartesian(u)),l(i)&&!V.equalsEpsilon(i,1,V.EPSILON9)){let E=o.width*i*.5,T=o.height*i*.5;o=new de(a(u.longitude-E),s(u.latitude-T),a(u.longitude+E),s(u.latitude+T))}c=c.replace("[bboxWest]",V.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",V.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",V.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",V.toDegrees(o.north).toString());let h=V.toDegrees(u.longitude).toString(),p=V.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",V.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",V.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,iZ),c=c.replace("[cameraLon]",V.toDegrees(iZ.longitude).toString()),c=c.replace("[cameraLat]",V.toDegrees(iZ.latitude).toString()),c=c.replace("[cameraAlt]",V.toDegrees(iZ.height).toString());let g=t.frustum,f=g.aspectRatio,b="",C="";if(l(f)){let E=V.toDegrees(g.fov);f>1?(b=E,C=E/f):(C=E,b=E*f)}c=c.replace("[horizFov]",b.toString()),c=c.replace("[vertFov]",C.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Ud(c))}function Pmt(e,t,n,i){let r=DQ(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=ji(t,"Link",Ne.kml);if(l(c)||(c=ji(t,"Url",Ne.kml)),l(c)){let d=Pn(c,"href",Ne.kml),u,h;if(l(d)){let p=d;if(d=R7(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Pn(c,"viewRefreshMode",Ne.kml),u==="onRegion"){At("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=Pn(c,"viewBoundScale",Ne.kml)??1;let C=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",E=Pn(c,"viewFormat",Ne.kml)??C,T=Pn(c,"httpQuery",Ne.kml);l(E)&&d.setQueryParameters(Ud(PQ(E))),l(T)&&d.setQueryParameters(Ud(PQ(T)));let S=e._ellipsoid;W7(d,e.camera,e.canvas,h,e._lastCameraView.bbox,S)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new Ga,b=F7(e,f,d,g).then(function(C){let E=e._entityCollection,T=f.values;E.suspendEvents();for(let R=0;R<T.length;R++){let L=T[R];l(L.parent)||(L.parent=r,B7(L)),E.add(L)}E.resumeEvents();let S=Pn(c,"refreshMode",Ne.kml),_=bi(c,"refreshInterval",Ne.kml)??0;if(S==="onInterval"&&_>0||S==="onExpire"||u==="onStop"){let R=ji(C,"NetworkLinkControl",Ne.kml),L=l(R),W=j.now(),B={id:Kn(),href:d,cookie:{},lastUpdated:W,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:W},Y=0;if(L&&(B.cookie=Ud(Pn(R,"cookie",Ne.kml)??""),Y=bi(R,"minRefreshPeriod",Ne.kml)??0),S==="onInterval")L&&(_=Math.max(Y,_)),B.refreshMode=Iy.INTERVAL,B.time=_;else if(S==="onExpire"){let N;if(L&&(N=Pn(R,"expires",Ne.kml)),l(N))try{let A=j.fromIso8601(N),I=j.secondsDifference(A,W);I>0&&I<Y&&j.addSeconds(W,Y,A),B.refreshMode=Iy.EXPIRE,B.time=A}catch{At("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else At("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(B.refreshMode=Iy.STOP,B.time=bi(c,"viewRefreshTime",Ne.kml)??0):At("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(B.refreshMode)&&e._networkLinks.set(B.id,B)}}).catch(function(C){At(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,C)});i.addPromise(b)}}}function Mmt(e,t,n,i){let o=Z7[t.localName];return l(o)?o(e,t,n,i):qxe(e,t,n,i)}function I7(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:ji(a,"Document",Ne.kml),d=Pn(c,"name",Ne.kml);l(d)||(d=Ng(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new Zu._DeferredLoading(e),h=new Ga(e);return Promise.all(Qxe(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let f=p.childNodes;for(let b=0;b<f.length;b++){let C=f[b];if(l(Z7[C.localName])){p=C;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Mmt(e,p,g,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}async function Umt(e,t,n,i,o){let r=en("ThirdParty/Workers/zip-web-worker.js"),s=en("ThirdParty/zip-module.wasm");Bp({workerURI:r,wasmURI:s});let a=new _E(new Np(n)),c=await a.getEntries(),d=[],u={},h;for(let p=0;p<c.length;p++){let g=c[p];g.directory||(/\.kml$/i.test(g.filename)&&(!l(h)||!/\//i.test(g.filename))?(l(h)&&d.push(x7(h,u)),h=g):d.push(x7(g,u)))}if(l(h)&&d.push(hmt(h,u)),await Promise.all(d),a.close(),!l(u.kml))throw new he("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),I7(e,t,u.kml,i,u,o)}function F7(e,t,n,i){i=i??Q.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Ge){n=Ge.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let d=e._resourceCredits,u=n.credits;if(l(u)){let h=u.length;for(let p=0;p<h;p++)d.push(u[p])}}else o=o??Ge.DEFAULT.clone();return o=Ge.createIfNeeded(o),l(a)&&(a=Xn(a)),Promise.resolve(c).then(function(d){return d instanceof Blob?umt(d).then(function(u){return u?Umt(e,t,d,o,a):mmt(d).then(function(h){h=Mxe(h),h=Uxe(h);let p,g;try{p=_7.parseFromString(h,"application/xml")}catch(f){g=f.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let f=l(g)?g:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new he(f)}return I7(e,t,p,o,r,a,s)})}):I7(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}function Zu(e){e=e??Q.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new Ce,this._error=new Ce,this._loading=new Ce,this._refresh=new Ce,this._unsupportedNode=new Ce,this._clock=void 0,this._entityCollection=new Ga(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Jg,this._networkLinks=new Ft,this._entityCluster=new mu,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?m.clone(t.positionWC):void 0,direction:l(t)?m.clone(t.directionWC):void 0,up:l(t)?m.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():de.clone(de.MAX_VALUE)},this._ellipsoid=e.ellipsoid??ie.default;let i=e.credit;typeof i=="string"&&(i=new bt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Zu.load=function(e,t){return t=t??Q.EMPTY_OBJECT,new Zu(t).load(e,t)};Object.defineProperties(Zu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Zu.prototype.load=function(e,t){t=t??Q.EMPTY_OBJECT,ps.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return F7(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=j.equals(s,Ke.MINIMUM_VALUE),d=j.equals(a,Ke.MAXIMUM_VALUE);if(!c||!d){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=j.fromDate(h)),d&&(h=new Date,h.setHours(24,0,0,0),a=j.fromDate(h)),o=new rf,o.startTime=s,o.stopTime=a,o.currentTime=j.clone(s),o.clockRange=As.LOOP_STOP,o.clockStep=wo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(j.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),ps.setLoading(i,!1),i}).catch(function(o){return ps.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Zu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function B7(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function Dmt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=ji(r,"NetworkLinkControl",Ne.kml),c=l(a),d=0;if(c){if(l(ji(a,"Update",Ne.kml))){At("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Ud(Pn(a,"cookie",Ne.kml)??""),d=bi(a,"minRefreshPeriod",Ne.kml)??0}let u=j.now(),h=t.refreshMode;if(h===Iy.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(h===Iy.EXPIRE){let W;if(l(a)&&(W=Pn(a,"expires",Ne.kml)),l(W))try{let B=j.fromIso8601(W),Y=j.secondsDifference(B,u);Y>0&&Y<d&&j.addSeconds(u,d,B),t.time=B}catch{At("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else At("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,f=n.values;function b(W){g.remove(W);let B=W._children,Y=B.length;for(let N=0;N<Y;++N)b(B[N])}g.suspendEvents();let C=g.values.slice(),E;for(E=0;E<C.length;++E){let W=C[E];W.parent===p&&(W.parent=void 0,b(W))}for(g.resumeEvents(),g.suspendEvents(),E=0;E<f.length;E++){let W=f[E];l(W.parent)||(W.parent=p,B7(W)),g.add(W)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let T=g.computeAvailability(),S=T.start,_=T.stop,R=j.equals(S,Ke.MINIMUM_VALUE),L=j.equals(_,Ke.MAXIMUM_VALUE);if(!R||!L){let W=e._clock;(W.startTime!==S||W.stopTime!==_)&&(W.startTime=S,W.stopTime=_,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var T7=new Ft;Zu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=j.now(),i=this;T7.removeAll();function o(u){let h=u._children,p=h.length;for(let g=0;g<p;++g){let f=h[g];T7.set(f.id,f),o(f)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,V.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,V.EPSILON7)&&a.upWC.equalsEpsilon(s.up,V.EPSILON7))&&(s.position=m.clone(a.positionWC),s.direction=m.clone(a.directionWC),s.up=m.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new Ft,d=!1;return t.values.forEach(function(u){let h=u.entity;if(!T7.contains(h.id)){if(!u.updating){let p=!1;if(u.refreshMode===Iy.INTERVAL?j.secondsDifference(n,u.lastUpdated)>u.time&&(p=!0):u.refreshMode===Iy.EXPIRE?j.greaterThan(n,u.time)&&(p=!0):u.refreshMode===Iy.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&j.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(h),u.updating=!0;let g=new Ga,f=u.href.clone();f.setQueryParameters(u.cookie);let b=i._ellipsoid??ie.default;W7(f,i.camera,i.canvas,u.viewBoundScale,s.bbox,b),F7(i,g,f,{context:h.id}).then(Dmt(i,u,g,c,f)).catch(function(C){let E=`NetworkLink ${u.href} refresh failed: ${C}`;console.log(E),i._error.raiseEvent(i,E)}),d=!0}}c.set(u.id,u)}}),d&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function vmt(){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}Zu._DeferredLoading=Up;Zu._getTimestamp=Ni;var VE=Zu;var hwi=y(x(),1);function wN(){Ae.throwInstantiationError()}wN.prototype.update=Ae.throwInstantiationError;wN.prototype.getBoundingSphere=Ae.throwInstantiationError;wN.prototype.isDestroyed=Ae.throwInstantiationError;wN.prototype.destroy=Ae.throwInstantiationError;var w7=wN;var kwi=y(x(),1);var Y7=32,kmt="http://www.opengis.net/kml/2.2",xf="http://www.google.com/kml/ext/2.2",Qmt="http://www.w3.org/2000/xmlns/";function vQ(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Omt=/^data:image\/([^,;]+)/;vQ.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ge){if(e=Ge.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Omt);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function zmt(e,t){return function(n){e._files[t]=n}}vQ.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new he("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(zmt(this,r))}return o};Object.defineProperties(vQ.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function kQ(e){this._time=e}kQ.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};kQ.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return WE(n)};kQ.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function N7(){this._ids={},this._styles={},this._count=0}N7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};N7.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function tCe(){this._ids={}}tCe.prototype.get=function(e){if(!l(e))return this.get(Kn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function X7(e){e=e??Q.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=X7._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Qmt,"xmlns:gx",xf);let a=r.createElement("Document");s.appendChild(a),iCe(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?Hmt(u,c.files):{kml:u,externalFiles:c.files}})}async function Hmt(e,t){let n=en("ThirdParty/Workers/zip-web-worker.js"),i=en("ThirdParty/zip-module.wasm");Bp({workerURI:n,wasmURI:i});let o=new H_("application/vnd.google-earth.kmz"),r=new SN(o);await r.add("doc.kml",new sN(e));let s=Object.keys(t);return await nCe(r,s,t,0),await r.close(),{kmz:await o.getData()}}async function nCe(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new Np(n[o])),nCe(e,t,n,i+1)}X7._createState=function(e){let t=e.entities,n=new N7,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Ke.MINIMUM_VALUE?r.stop===Ke.MAXIMUM_VALUE?r=new Wn:j.addSeconds(r.stop,-10*s,r.start):r.stop===Ke.MAXIMUM_VALUE&&j.addSeconds(r.start,10*s,r.stop);let a=new vQ(e.modelCallback);return{kmlDoc:document.implementation.createDocument(kmt,"kml"),ellipsoid:e.ellipsoid??ie.default,idManager:new tCe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new kQ(o),sampleDuration:s,defaultAvailability:new fs([r])}};function iCe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let h=0;h<a;++h){let p=n[h];c=[],d=[],u=[],Kmt(e,p,d,u),Jmt(e,p.polyline,d,u),eCe(e,p.rectangle,d,u,c),eCe(e,p.polygon,d,u,c),eht(e,p,p.model,d,u);let g,f=p.availability;l(f)&&(g=i.createElement("TimeSpan"),j.equals(f.start,Ke.MINIMUM_VALUE)||g.appendChild(Cn(i,"begin",j.toIso8601(f.start))),j.equals(f.stop,Ke.MAXIMUM_VALUE)||g.appendChild(Cn(i,"end",j.toIso8601(f.stop))));for(let E=0;E<c.length;++E){let T=c[E];T.setAttribute("id",s.get(p.id)),T.appendChild(Cn(i,"name",p.name)),T.appendChild(Cn(i,"visibility",p.show)),T.appendChild(Cn(i,"description",p.description)),l(g)&&T.appendChild(g),t.appendChild(T)}let b=d.length;if(b>0){let E=i.createElement("Placemark");E.setAttribute("id",s.get(p.id));let T=p.name,S=p.label;if(l(S)){let R=i.createElement("LabelStyle"),L=r.get(S.text);T=l(L)&&L.length>0?L:T;let W=r.getColor(S.fillColor);l(W)&&(R.appendChild(Cn(i,"color",W)),R.appendChild(Cn(i,"colorMode","normal")));let B=r.get(S.scale);l(B)&&R.appendChild(Cn(i,"scale",B)),u.push(R)}E.appendChild(Cn(i,"name",T)),E.appendChild(Cn(i,"visibility",p.show)),E.appendChild(Cn(i,"description",p.description)),l(g)&&E.appendChild(g),t.appendChild(E);let _=u.length;if(_>0){let R=i.createElement("Style");for(let L=0;L<_;++L)R.appendChild(u[L]);E.appendChild(Cn(i,"styleUrl",o.get(R)))}if(d.length===1)E.appendChild(d[0]);else if(d.length>1){let R=i.createElement("MultiGeometry");for(let L=0;L<b;++L)R.appendChild(d[L]);E.appendChild(R)}}let C=p._children;if(C.length>0){let E=i.createElement("Folder");E.setAttribute("id",s.get(p.id)),E.appendChild(Cn(i,"name",p.name)),E.appendChild(Cn(i,"visibility",p.show)),E.appendChild(Cn(i,"description",p.description)),t.appendChild(E),iCe(e,E,C)}}}var Rd=new m,vl=new pe,yf=new j;function Kmt(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){oCe(e,t,a,n,i);return}s.get(c,void 0,Rd);let d=Cn(o,"coordinates",LE(Rd,r)),u=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(FE(e,a.heightReference)),u.appendChild(h),u.appendChild(d),n.push(u);let p=a instanceof wc?sCe(e,a):rCe(e,a);i.push(p)}function oCe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof qa?(c=d.intervals,u=!1):c=t.availability??e.defaultAvailability;let h=n instanceof FA,p,g,f,b=[];for(p=0;p<c.length;++p){let E=c.get(p),T=u?d:E.data,S=r.createElement("altitudeMode");T instanceof Zp?(T=T._value,S.appendChild(FE(e,tt.CLAMP_TO_GROUND))):l(n)?S.appendChild(FE(e,n.heightReference)):S.appendChild(FE(e,tt.NONE));let _=[],R=[];if(T.isConstant){a.get(T,void 0,Rd);let W=Cn(r,"coordinates",LE(Rd,s));_.push(j.toIso8601(E.start)),R.push(W),_.push(j.toIso8601(E.stop)),R.push(W)}else if(T instanceof ec)for(f=T._property._times,g=0;g<f.length;++g)_.push(j.toIso8601(f[g])),T.getValueInReferenceFrame(f[g],eo.FIXED,Rd),R.push(LE(Rd,s));else if(T instanceof Au){f=T._times;let W=T._values;for(g=0;g<f.length;++g)_.push(j.toIso8601(f[g])),m.fromArray(W,g*3,Rd),R.push(LE(Rd,s))}else{let W=e.sampleDuration;E.start.clone(yf),E.isStartIncluded||j.addSeconds(yf,W,yf);let B=E.stop;for(;j.lessThan(yf,B);)T.getValue(yf,Rd),_.push(j.toIso8601(yf)),R.push(LE(Rd,s)),j.addSeconds(yf,W,yf);E.isStopIncluded&&j.equals(yf,B)&&(T.getValue(yf,Rd),_.push(j.toIso8601(yf)),R.push(LE(Rd,s)))}let L=r.createElementNS(xf,"Track");L.appendChild(S);for(let W=0;W<_.length;++W){let B=Cn(r,"when",_[W]),Y=Cn(r,"coord",R[W],xf);L.appendChild(B),L.appendChild(Y)}h&&L.appendChild(aCe(e,n)),b.push(L)}if(b.length===1)i.push(b[0]);else if(b.length>1){let E=r.createElementNS(xf,"MultiTrack");for(p=0;p<b.length;++p)E.appendChild(b[p]);i.push(E)}if(l(n)&&!h){let E=n instanceof wc?sCe(e,n):rCe(e,n);o.push(E)}let C=t.path;if(l(C)){let E=a.get(C.width),T=C.material;if(l(T)||l(E)){let S=r.createElement("LineStyle");l(E)&&S.appendChild(Cn(r,"width",E)),P7(e,T,S),o.push(S)}}}function rCe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(Cn(n,"color",r)),o.appendChild(Cn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(Cn(n,"scale",s/Y7)),o}function sCe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(Cn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(Cn(n,"x",g.x,xf)),p.appendChild(Cn(n,"y",g.y,xf)),p.appendChild(Cn(n,"w",g.width,xf)),p.appendChild(Cn(n,"h",g.height,xf))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(Cn(n,"color",a)),r.appendChild(Cn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(Cn(n,"scale",c));let d=i.get(t.pixelOffset);if(l(d)){c=c??1,M.divideByScalar(d,c,d);let p=i.get(t.width,Y7),g=i.get(t.height,Y7),f=i.get(t.horizontalOrigin,Bi.CENTER);f===Bi.CENTER?d.x-=p*.5:f===Bi.RIGHT&&(d.x-=p);let b=i.get(t.verticalOrigin,vn.CENTER);b===vn.TOP?d.y+=g:b===vn.CENTER&&(d.y+=g*.5);let C=n.createElement("hotSpot");C.setAttribute("x",-d.x),C.setAttribute("y",d.y),C.setAttribute("xunits","pixels"),C.setAttribute("yunits","pixels"),r.appendChild(C)}let u=i.get(t.rotation),h=i.get(t.alignedAxis);return l(u)&&m.equals(m.UNIT_Z,h)&&(u=V.toDegrees(-u),u===0&&(u=360),r.appendChild(Cn(n,"heading",u))),r}function Jmt(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),d=s.get(t.clampToGround,!1),u;d?(a.appendChild(Cn(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),c.appendChild(u),a.appendChild(c);let h=t.positions,p=s.get(h),g=Cn(o,"coordinates",LE(p,r));a.appendChild(g);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(Cn(o,"drawOrder",f,xf)),n.push(a);let b=o.createElement("LineStyle"),C=s.get(t.width);l(C)&&b.appendChild(Cn(o,"width",C)),P7(e,t.material,b),i.push(b)}function jmt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],d=[de.northeast,de.southeast,de.southwest,de.northwest];for(let g=0;g<4;++g)d[g](a,vl),c.push(`${V.toDegrees(vl.longitude)},${V.toDegrees(vl.latitude)},${r}`);let u=Cn(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),h.appendChild(p),[h]}function $xe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)pe.fromCartesian(t[u],r,vl),s.push(`${V.toDegrees(vl.longitude)},${V.toDegrees(vl.latitude)},${i?vl.height:n}`);let c=Cn(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function qmt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,d=o.get(c),u=Array.isArray(d)?d:d.positions,h=i.createElement("outerBoundaryIs");h.appendChild($xe(e,u,r,s)),a.push(h);let p=d.holes;if(l(p)){let g=p.length;for(let f=0;f<g;++f){let b=i.createElement("innerBoundaryIs");b.appendChild($xe(e,p[f].positions,r,s)),a.push(b)}}return a}function eCe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Eh;if(a&&s.getMaterialType(t.material)==="Image"){$mt(e,t,o);return}let c=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&c.appendChild(Cn(r,"extrude",!0));let u=a?jmt(e,t,d):qmt(e,t,d),h=u.length;for(let C=0;C<h;++C)c.appendChild(u[C]);let p=r.createElement("altitudeMode");p.appendChild(FE(e,t.heightReference)),c.appendChild(p),n.push(c);let g=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&g.appendChild(Cn(r,"fill",f)),P7(e,t.material,g);let b=s.get(t.outline,!1);if(b){g.appendChild(Cn(r,"outline",b));let C=r.createElement("LineStyle"),E=s.get(t.outlineWidth,1);C.appendChild(Cn(r,"width",E));let T=s.getColor(t.outlineColor,D.BLACK);C.appendChild(Cn(r,"color",T)),C.appendChild(Cn(r,"colorMode","normal")),i.push(C)}i.push(g)}function $mt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(FE(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(Cn(i,"altitude",c));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(Cn(i,"north",V.toDegrees(d.north))),u.appendChild(Cn(i,"south",V.toDegrees(d.south))),u.appendChild(Cn(i,"east",V.toDegrees(d.east))),u.appendChild(Cn(i,"west",V.toDegrees(d.west))),s.appendChild(u);let h=o.get(t.material),p=r.texture(h.image),g=i.createElement("Icon");g.appendChild(Cn(i,"href",p)),s.appendChild(g);let f=h.color;l(f)&&s.appendChild(Cn(i,"color",WE(h.color))),n.push(s)}function aCe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let d=n.createElement("scale");d.appendChild(Cn(n,"x",s)),d.appendChild(Cn(n,"y",s)),d.appendChild(Cn(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(Cn(n,"href",c)),r.appendChild(a),r}function eht(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){oCe(e,t,n,i,o);return}let d=aCe(e,n),u=r.createElement("altitudeMode");u.appendChild(FE(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,Rd),pe.fromCartesian(Rd,s,vl);let h=r.createElement("Location");h.appendChild(Cn(r,"longitude",V.toDegrees(vl.longitude))),h.appendChild(Cn(r,"latitude",V.toDegrees(vl.latitude))),h.appendChild(Cn(r,"altitude",vl.height)),d.appendChild(h),i.push(d)}function P7(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,d;switch(a){case"Image":s=WE(D.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=WE(r.color);break;case"PolylineOutline":s=WE(r.color),c=WE(r.outlineColor),d=r.outlineWidth,n.appendChild(Cn(i,"outerColor",c,xf)),n.appendChild(Cn(i,"outerWidth",d,xf));break;case"Stripe":s=WE(r.oddColor);break}l(s)&&(n.appendChild(Cn(i,"color",s)),n.appendChild(Cn(i,"colorMode","normal")))}function FE(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,tt.NONE),r;switch(o){case tt.NONE:r=n.createTextNode("absolute");break;case tt.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case tt.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function LE(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)pe.fromCartesian(e[o],t,vl),i.push(`${V.toDegrees(vl.longitude)},${V.toDegrees(vl.latitude)},${vl.height}`);return i.join(" ")}function Cn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function WE(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var M7=X7;var PNi=y(x(),1);var Owi=y(x(),1),tht={NONE:0,LERC:1},vm=Object.freeze(tht);var mNi=y(x(),1);var CYi=y(x(),1);var rYi=y(x(),1);var Hwi=y(x(),1),nht={NONE:0,BITS12:1},La=Object.freeze(nht);var YN=new m,iht=new m,km=new M,oht=new F,rht=new F,sht=Math.pow(2,12);function Tc(e,t,n,i,o,r,s,a,c,d){let u=La.NONE,h,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,f=t.maximum,b=m.subtract(f,g,iht),C=i-n;Math.max(m.maximumComponent(b),C)<sht-1?u=La.BITS12:u=La.NONE;let T=F.fromScale(b,oht);T=F.setTranslation(T,g,T);let S=F.fromScale(m.fromElements(1/b.x,1/b.y,1/b.z,YN),rht);S=F.multiplyByTranslation(S,m.negate(g,YN),S),p=F.clone(o,new F);let _=F.getTranslation(o,YN);_=m.subtract(_,e,YN),p=F.setTranslation(p,_,p),p=F.multiply(p,T,p),h=F.inverseTransformation(o,new F),h=F.multiply(S,h,h),o=F.multiply(o,T,new F)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=m.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=d??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Tc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,d=i.y;if(this.quantization===La.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,YN),n.x=V.clamp(n.x,0,1),n.y=V.clamp(n.y,0,1),n.z=V.clamp(n.z,0,1);let u=this.maximumHeight-this.minimumHeight,h=V.clamp((o-this.minimumHeight)/u,0,1);M.fromElements(n.x,n.y,km);let p=_n.compressTextureCoordinates(km);M.fromElements(n.z,h,km);let g=_n.compressTextureCoordinates(km);M.fromElements(c,d,km);let f=_n.compressTextureCoordinates(km);if(e[t++]=p,e[t++]=g,e[t++]=f,this.hasWebMercatorT){M.fromElements(s,0,km);let b=_n.compressTextureCoordinates(km);e[t++]=b}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=o,e[t++]=c,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=_n.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var aht=new m,cCe=new m;Tc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let u=0;u<i;u++){let h=s*i+u,p=s*r+u;t[p]=e[h]}let a=this.decodePosition(t,s,aht),c=n.geodeticSurfaceNormal(a,cCe),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};Tc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};Tc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new m),t*=this.stride,this.quantization===La.BITS12){let i=_n.decompressTextureCoordinates(e[t],km);n.x=i.x,n.y=i.y;let o=_n.decompressTextureCoordinates(e[t+1],km);return n.z=o.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],m.add(n,this.center,n)};Tc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,cCe),a=this.decodeHeight(e,t),c=Eo.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Tc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new M),t*=this.stride,this.quantization===La.BITS12?_n.decompressTextureCoordinates(e[t+2],n):M.fromElements(e[t+4],e[t+5],n)};Tc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===La.BITS12?_n.decompressTextureCoordinates(e[t+1],km).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Tc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===La.BITS12?_n.decompressTextureCoordinates(e[t+3],km).x:e[t+6]};Tc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return M.fromElements(o,r,n)};Tc.prototype.decodeNormal=function(e,t,n){let i=t=t*this.stride+this._offsetVertexNormal;return _n.octDecodeFloat(e[i],n)};Tc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};Tc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===La.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var QQ={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},OQ={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Tc.prototype.getAttributes=function(e){let t=J.FLOAT,n=J.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===La.NONE){s(QQ.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(QQ.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(QQ.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(OQ.compressed0,a?4:3),c&&s(OQ.compressed1,1),this.hasGeodeticSurfaceNormals&&s(OQ.geodeticSurfaceNormal,3)}return r};Tc.prototype.getAttributeLocations=function(){return this.quantization===La.NONE?QQ:OQ};Tc.clone=function(e,t){if(l(e))return l(t)||(t=new Tc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=m.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var ur=Tc;var Dp={};Dp.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var U7=new m,cht=new F,lht=new m,dht=new m;Dp.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=V.PI_OVER_TWO,a=V.toRadians,c=e.heightmap,d=e.width,u=e.height,h=e.skirtHeight,p=h>0,g=e.isGeographic??!0,f=e.ellipsoid??ie.default,b=1/f.maximumRadius,C=de.clone(e.nativeRectangle),E=de.clone(e.rectangle),T,S,_,R;l(E)?(T=E.west,S=E.south,_=E.east,R=E.north):g?(T=a(C.west),S=a(C.south),_=a(C.east),R=a(C.north)):(T=C.west*b,S=s-2*o(r(-C.south*b)),_=C.east*b,R=s-2*o(r(-C.north*b)));let L=e.relativeToCenter,W=l(L);L=W?L:m.ZERO;let B=e.includeWebMercatorT??!1,Y=e.exaggeration??1,N=e.exaggerationRelativeHeight??0,I=Y!==1,Z=e.structure??Dp.DEFAULT_STRUCTURE,G=Z.heightScale??Dp.DEFAULT_STRUCTURE.heightScale,w=Z.heightOffset??Dp.DEFAULT_STRUCTURE.heightOffset,X=Z.elementsPerHeight??Dp.DEFAULT_STRUCTURE.elementsPerHeight,v=Z.stride??Dp.DEFAULT_STRUCTURE.stride,U=Z.elementMultiplier??Dp.DEFAULT_STRUCTURE.elementMultiplier,k=Z.isBigEndian??Dp.DEFAULT_STRUCTURE.isBigEndian,P=de.computeWidth(C),O=de.computeHeight(C),H=P/(d-1),ee=O/(u-1);g||(P*=b,O*=b);let z=f.radiiSquared,te=z.x,q=z.y,me=z.z,ye=65536,oe=-65536,xe=Tt.eastNorthUpToFixedFrame(L,f),Ee=F.inverseTransformation(xe,cht),Le,Se;B&&(Le=hi.geodeticLatitudeToMercatorAngle(S),Se=1/(hi.geodeticLatitudeToMercatorAngle(R)-Le));let Fe=lht;Fe.x=Number.POSITIVE_INFINITY,Fe.y=Number.POSITIVE_INFINITY,Fe.z=Number.POSITIVE_INFINITY;let Ue=dht;Ue.x=Number.NEGATIVE_INFINITY,Ue.y=Number.NEGATIVE_INFINITY,Ue.z=Number.NEGATIVE_INFINITY;let De=Number.POSITIVE_INFINITY,Je=d*u,St=h>0?d*2+u*2:0,Oe=Je+St,it=new Array(Oe),yt=new Array(Oe),Ot=new Array(Oe),Mn=B?new Array(Oe):[],sn=I?new Array(Oe):[],ut=0,Nt=u,In=0,lt=d;p&&(--ut,++Nt,--In,++lt);let fi=1e-5;for(let Qn=ut;Qn<Nt;++Qn){let uo=Qn;uo<0&&(uo=0),uo>=u&&(uo=u-1);let vo=C.north-ee*uo;g?vo=a(vo):vo=s-2*o(r(-vo*b));let hr=(vo-S)/(R-S);hr=V.clamp(hr,0,1);let Vr=Qn===ut,qs=Qn===Nt-1;h>0&&(Vr?vo+=fi*O:qs&&(vo-=fi*O));let xs=t(vo),Na=n(vo),Ao=me*Na,Vn;B&&(Vn=(hi.geodeticLatitudeToMercatorAngle(vo)-Le)*Se);for(let Qo=In;Qo<lt;++Qo){let Oo=Qo;Oo<0&&(Oo=0),Oo>=d&&(Oo=d-1);let $s=uo*(d*v)+Oo*v,Fi;if(X===1)Fi=c[$s];else{Fi=0;let Bo;if(k)for(Bo=0;Bo<X;++Bo)Fi=Fi*U+c[$s+Bo];else for(Bo=X-1;Bo>=0;--Bo)Fi=Fi*U+c[$s+Bo]}Fi=Fi*G+w,oe=Math.max(oe,Fi),ye=Math.min(ye,Fi);let Wo=C.west+H*Oo;g?Wo=a(Wo):Wo=Wo*b;let dc=(Wo-T)/(_-T);dc=V.clamp(dc,0,1);let ea=uo*d+Oo;if(h>0){let Bo=Qo===In,ql=Qo===lt-1,An=Vr||qs||Bo||ql;if((Vr||qs)&&(Bo||ql))continue;An&&(Fi-=h,Bo?(ea=Je+(u-uo-1),Wo-=fi*P):qs?ea=Je+u+(d-Oo-1):ql?(ea=Je+u+d+uo,Wo+=fi*P):Vr&&(ea=Je+u+d+u+Oo))}let Lr=xs*t(Wo),Wr=xs*n(Wo),rh=te*Lr,ws=q*Wr,Yf=1/i(rh*Lr+ws*Wr+Ao*Na),Fo=rh*Yf,Jl=ws*Yf,jl=Ao*Yf,pa=new m;pa.x=Fo+Lr*Fi,pa.y=Jl+Wr*Fi,pa.z=jl+Na*Fi,F.multiplyByPoint(Ee,pa,U7),m.minimumByComponent(U7,Fe,Fe),m.maximumByComponent(U7,Ue,Ue),De=Math.min(De,Fi),it[ea]=pa,Ot[ea]=new M(dc,hr),yt[ea]=Fi,B&&(Mn[ea]=Vn),I&&(sn[ea]=f.geodeticSurfaceNormal(pa))}}let ao=ue.fromPoints(it),po;l(E)&&(po=tn.fromRectangle(E,ye,oe,f));let ri;W&&(ri=new tf(f).computeHorizonCullingPointPossiblyUnderEllipsoid(L,it,ye));let co=new Od(Fe,Ue,L),lo=new ur(L,co,De,oe,xe,!1,B,I,Y,N),Di=new Float32Array(Oe*lo.stride),Wi=0;for(let Qn=0;Qn<Oe;++Qn)Wi=lo.encode(Di,Wi,it[Qn],Ot[Qn],yt[Qn],void 0,Mn[Qn],sn[Qn]);return{vertices:Di,maximumHeight:oe,minimumHeight:ye,encoding:lo,boundingSphere3D:ao,orientedBoundingBox:po,occludeePointInScaledSpace:ri}};var oZ=Dp;var SYi=y(x(),1);function _y(){Ae.throwInstantiationError()}Object.defineProperties(_y.prototype,{credits:{get:Ae.throwInstantiationError},waterMask:{get:Ae.throwInstantiationError}});_y.prototype.interpolateHeight=Ae.throwInstantiationError;_y.prototype.isChildAvailable=Ae.throwInstantiationError;_y.prototype.createMesh=Ae.throwInstantiationError;_y.prototype.upsample=Ae.throwInstantiationError;_y.prototype.wasCreatedByUpsampling=Ae.throwInstantiationError;_y.maximumAsynchronousTasks=5;var Gd=_y;var KYi=y(x(),1);var NYi=y(x(),1);var uht=3;function k7(e,t,n){this._vertices=e,this._indices=t,this._encoding=n,this._inverseTransform=new F,this._needsRebuild=!0,this._rootNode=new v7}var mht=new Jn("incrementallyBuildTerrainPicker");Object.defineProperties(k7.prototype,{needsRebuild:{get:function(){return this._needsRebuild},set:function(e){this._needsRebuild=e}}});function v7(){this.x=0,this.y=0,this.level=0,this.aabb=lCe(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}v7.prototype.addChild=function(e){let t=new v7;t.x=this.x*2+(e&1),t.y=this.y*2+(e>>1&1),t.level=this.level+1,t.aabb=lCe(t.x,t.y,t.level),this.children[e]=t};var hht=new xn,zQ=[new m,new m,new m];k7.prototype.rayIntersect=function(e,t,n,i,o){this._needsRebuild&&fht(this,t);let r=this._inverseTransform,s=hht;s.origin=F.multiplyByPoint(r,e.origin,s.origin),s.direction=F.multiplyByPointAsVector(r,e.direction,s.direction);let a=[];return dCe(this._rootNode,s,a),yht(this,a,e,n,i,o)};function fht(e,t){F.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let o=0;o<n;++o)i[o]=o;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var pht=new m,Aht=new m;function lCe(e,t,n){let i=1/Math.pow(2,n),o=m.fromElements(e*i-.5,t*i-.5,-.5,pht),r=m.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,Aht);return Od.fromCorners(o,r)}function ght(e,t,n,i,o){m.pack(n[0],e,9*o),m.pack(n[1],e,9*o+3),m.pack(n[2],e,9*o+6),t[o]=i}var bht=new Or;function dCe(e,t,n){let i=di.rayAxisAlignedBoundingBox(t,e.aabb,bht);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Or(i.start,i.stop)});return}for(let r=0;r<e.children.length;r++)dCe(e.children[r],t,n)}function yht(e,t,n,i,o,r){let s=t.sort(function(c,d){return c.interval.start-d.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let d=s[c],u=xht(e,n,d.node,i,o,r);if(a=Math.min(u,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return xn.getPoint(n,a)}function xht(e,t,n,i,o,r){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,d=e._vertices,u=n.intersectingTriangles.length,p=!(n.level>=uht)&&!n.buildingChildren,g,f;p&&(g=new Float64Array(u*9),f=new Uint32Array(u));for(let b=0;b<u;b++){let C=n.intersectingTriangles[b],E=D7(a,o,r,t,d,c[3*C],zQ[0]),T=D7(a,o,r,t,d,c[3*C+1],zQ[1]),S=D7(a,o,r,t,d,c[3*C+2],zQ[2]),_=di.rayTriangleParametric(t,E,T,S,i);l(_)&&_<s&&_>=0&&(s=_),p&&ght(g,f,zQ,C,b)}if(p){for(let b=0;b<4;b++)n.addChild(b);Eht(e._inverseTransform,n,f,g)}return s}var Cht=new pe;function D7(e,t,n,i,o,r,s){let a=e.getExaggeratedPosition(o,r,s);if(t===se.SCENE3D)return a;let d=n.ellipsoid.cartesianToCartographic(a,Cht);a=n.project(d,s),a=m.fromElements(a.z,a.x,a.y,s);let u=V.TWO_PI*n.ellipsoid.maximumRadius,h=Math.round((i.origin.y-a.y)/u);return a.y+=h*u,a}async function Eht(e,t,n,i){t.buildingChildren=!0;let o=new Float64Array(16);F.pack(e,o,0);let r=new Float64Array(24);for(let u=0;u<4;u++)m.pack(t.children[u].aabb.minimum,r,u*6),m.pack(t.children[u].aabb.maximum,r,u*6+3);let s={aabbs:r,inverseTransform:o,triangleIndices:n,trianglePositions:i},a=[r.buffer,o.buffer,n.buffer,i.buffer],c=mht.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((u,h)=>{l(t.children[h])&&(t.children[h].intersectingTriangles=new Uint32Array(u))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var NN=k7;function XN(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,b,C){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=d,this.orientedBoundingBox=h,this.encoding=p,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=f,this.eastIndicesNorthToSouth=b,this.northIndicesWestToEast=C,this._transform=new F,this._lastPickSceneMode=void 0,this._terrainPicker=new NN(t,n,p)}XN.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===se.SCENE3D?Tht(this,this._transform):Vht(this,t,this._transform))};function Tht(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,o=Eo.getHeight(e.minimumHeight,n,i),r=Eo.getHeight(e.maximumHeight,n,i),s=tn.fromRectangle(e.rectangle,o,r,ie.default,e.orientedBoundingBox);return tn.computeTransformation(s,t)}var Sht=new m,Iht=new m,_ht=new pe,Zht=new pe,Rht=new m,Ght=new m;function Vht(e,t,n){let i=e.encoding.exaggeration,o=e.encoding.exaggerationRelativeHeight,r=Eo.getHeight(e.minimumHeight,i,o),s=Eo.getHeight(e.maximumHeight,i,o),a=t.project(pe.fromRadians(e.rectangle.west,e.rectangle.south,0,_ht),Sht),c=t.project(pe.fromRadians(e.rectangle.east,e.rectangle.north,0,Zht),Iht),d=s-r,u=m.fromElements(c.x-a.x,c.y-a.y,d>0?d:1,Rht),h=m.fromElements(a.x+u.x*.5,a.y+u.y*.5,r+u.z*.5,Ght);return F.fromTranslation(h,n),F.setScale(n,u,n),F.multiply(Tt.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}XN.prototype.pick=function(e,t,n,i){let o=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,o};XN.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};XN.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var oc=XN;function ib(e){e=e??Q.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??vm.NONE;let t=oZ.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===vm.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(ib.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var uCe="createVerticesFromHeightmap",Lht=new Jn(uCe),Wht=new Jn(uCe,Gd.maximumAsynchronousTasks);ib.prototype.createMesh=function(e){e=e??Q.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),h=c.cartographicToCartesian(de.center(u)),p=this._structure,f=Do.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let C=(a?Wht:Lht).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:h,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof vi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(C))return;let E=this;return Promise.resolve(C).then(function(T){let S;E._skirtHeight>0?S=Do.getRegularGridAndSkirtIndicesAndEdgeIndices(T.gridWidth,T.gridHeight):S=Do.getRegularGridIndicesAndEdgeIndices(T.gridWidth,T.gridHeight);let _=T.gridWidth*T.gridHeight;return E._mesh=new oc(h,new Float32Array(T.vertices),S.indices,S.indexCountWithoutSkirts,_,T.minimumHeight,T.maximumHeight,u,ue.clone(T.boundingSphere3D),m.clone(T.occludeePointInScaledSpace),T.numberOfAttributes,tn.clone(T.orientedBoundingBox),ur.clone(T.encoding),S.westIndicesSouthToNorth,S.southIndicesEastToWest,S.eastIndicesNorthToSouth,S.northIndicesWestToEast),E._buffer=void 0,E._mesh})};ib.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(de.center(d)),h=this._structure,g=Do.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let f=oZ.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof vi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let b;this._skirtHeight>0?b=Do.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):b=Do.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let C=f.gridWidth*f.gridHeight;return this._mesh=new oc(u,f.vertices,b.indices,b.indexCountWithoutSkirts,C,f.minimumHeight,f.maximumHeight,d,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,b.westIndicesSouthToNorth,b.southIndicesEastToWest,b.eastIndicesNorthToSouth,b.northIndicesWestToEast),this._mesh};ib.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,h=r.heightScale,p=l(this._mesh),g=this._encoding===vm.LERC;if(!p&&g)return;let b;if(p){let C=this._mesh.vertices,E=this._mesh.encoding;b=mCe(C,E,u,h,e,i,o,t,n)}else b=Fht(this._buffer,a,c,s,d,e,i,o,t,n),b=b*h+u;return b};ib.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,d=this._height,u=this._structure,h=u.stride,p=new this._bufferType(c*d*h),g=a.vertices,f=a.encoding,b=e.tileXYToRectangle(t,n,i),C=e.tileXYToRectangle(o,r,s),E=u.heightOffset,T=u.heightScale,S=u.elementsPerHeight,_=u.elementMultiplier,R=u.isBigEndian,L=Math.pow(_,S-1);for(let W=0;W<d;++W){let B=V.lerp(C.north,C.south,W/(d-1));for(let Y=0;Y<c;++Y){let N=V.lerp(C.west,C.east,Y/(c-1)),A=mCe(g,f,E,T,b,c,d,N,B);A=A<u.lowestEncodedHeight?u.lowestEncodedHeight:A,A=A>u.highestEncodedHeight?u.highestEncodedHeight:A,Bht(p,S,_,L,h,R,W*c+Y,A)}}return Promise.resolve(new ib({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};ib.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};ib.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function Fht(e,t,n,i,o,r,s,a,c,d){let u=(c-r.west)*(s-1)/(r.east-r.west),h=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,g=p+1;g>=s&&(g=s-1,p=s-2);let f=h|0,b=f+1;b>=a&&(b=a-1,f=a-2);let C=u-p,E=h-f;f=a-1-f,b=a-1-b;let T=HQ(e,t,n,i,o,f*s+p),S=HQ(e,t,n,i,o,f*s+g),_=HQ(e,t,n,i,o,b*s+p),R=HQ(e,t,n,i,o,b*s+g);return hCe(C,E,T,S,_,R)}function mCe(e,t,n,i,o,r,s,a,c){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),h=d|0,p=h+1;p>=r&&(p=r-1,h=r-2);let g=u|0,f=g+1;f>=s&&(f=s-1,g=s-2);let b=d-h,C=u-g;g=s-1-g,f=s-1-f;let E=(t.decodeHeight(e,g*r+h)-n)/i,T=(t.decodeHeight(e,g*r+p)-n)/i,S=(t.decodeHeight(e,f*r+h)-n)/i,_=(t.decodeHeight(e,f*r+p)-n)/i;return hCe(b,C,E,T,S,_)}function hCe(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function HQ(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function Bht(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Sc=ib;var bNi=y(x(),1);function aZ(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var BE=new de;function wht(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}aZ.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)wht(e,g,p,s)||s.push(new rZ(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,BE);let a=BE.west,c=BE.north;r.tileXYToRectangle(i,o,e,BE);let d=BE.east,u=BE.south,h=new Mht(e,a,u,d,c);for(let p=0;p<s.length;++p){let g=s[p];Q7(g.extent,h)&&Uht(this._maximumLevel,g,h)}};aZ.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(sZ(i.extent,e)){t=i;break}}return l(t)?PN(void 0,t,e):-1};var Yht=[],Nht=[],Xht=new de,Pht=new de;aZ.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Yht;t.length=0,e.east<e.west?(t.push(de.fromRadians(-Math.PI,e.south,e.east,e.north,Xht)),t.push(de.fromRadians(e.west,e.south,Math.PI,e.north,Pht))):t.push(e);let n=Nht;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)MN(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var fCe=new pe;aZ.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,BE);return de.center(i,fCe),this.computeMaximumLevelAtPosition(fCe)>=e};aZ.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function rZ(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(rZ.prototype,{nw:{get:function(){return this._nw||(this._nw=new rZ(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new rZ(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new rZ(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new rZ(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Mht(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function Q7(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function Uht(e,t,n){for(;t.level<e;)if(KQ(t.nw.extent,n))t=t.nw;else if(KQ(t.ne.extent,n))t=t.ne;else if(KQ(t.sw.extent,n))t=t.sw;else if(KQ(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=bo(t.rectangles,n.level,Dht);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Dht(e,t){return e.level-t}function KQ(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function sZ(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function PN(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&sZ(t._nw.extent,n),s=t._ne&&sZ(t._ne.extent,n),a=t._sw&&sZ(t._sw.extent,n),c=t._se&&sZ(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,PN(t,t._nw,n))),s&&(i=Math.max(i,PN(t,t._ne,n))),a&&(i=Math.max(i,PN(t,t._sw,n))),c&&(i=Math.max(i,PN(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];sZ(a,n)&&(i=a.level)}t=t.parent}return i}function MN(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||Q7(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=vht(e[s.level],s)}MN(e,t._nw,n),MN(e,t._ne,n),MN(e,t._sw,n),MN(e,t._se,n)}function vht(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];Q7(o,t)?(o.west<t.west&&n.push(new de(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new de(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new de(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new de(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Cf=aZ;var kht=15;function pCe(e){this.ellipsoid=e.ellipsoid??ie.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}pCe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function Qht(e,t){let n=t.copyrightText;l(n)&&(e.credit=new bt(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=de.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Qi(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new M(r.xmin,r.ymin),s.rectangleNortheastInMeters=new M(r.xmax,r.ymax),e.tilingScheme=new Vs(s)}else throw new he("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new he("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?vm.LERC:vm.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Cf(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Cf(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Do.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Oht(e,t,n){try{let i=await t.fetchJson();Qht(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Ko.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function Zy(e){e=e??Q.EMPTY_OBJECT,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._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new Ce}Object.defineProperties(Zy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});Zy.fromUrl=async function(e,t){t=t??Q.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ge.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new pCe(t);await Oht(o,i);let r=new Zy(t);return o.build(r),r._resource=n,r};Zy.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(O7(this,n+1,e*2,t*2))){let h=ACe(this,n+1,e*2,t*2);s=h.promise,a=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(h){return new Sc({buffer:h[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):kht,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(h){if(l(a)&&a.state===pi.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=pi.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function O7(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}Zy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Zy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=O7(this,n,e,t);if(l(i))return i;ACe(this,n,e,t)};Zy.prototype.loadTileDataAvailability=function(e,t,n){};function zht(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},d=new M(e.x+1,e.y+1),u=!1,h=!1;for(;!(u&&h);){let p=d.x,g=h?d.y+1:d.y;if(!u){for(let f=e.y;f<g;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new M(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!h){let f=d.y*t;for(let b=e.x;b<=p;++b)if(i[f+b]!==s){h=!0;break}h?(a.push(new M(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,h=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function Hht(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new M(0,0)];for(;a.length>0;){let c=a.pop(),d=zht(c,n,i,o);if(d.value===1){let h=d.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function ACe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let d=new pr({throttle:!1,throttleByServer:!0,type:Ys.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(h)?(h=h.then(function(p){let g=Hht(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let b=0;b<g.length;++b){let C=g[b];f.addAvailableTileRange(t,C.startX,C.startY,C.endX,C.endY)}return O7(e,t,n,i)}),c[a]={promise:h,request:d},h=h.finally(function(p){return delete c[a],p}),{promise:h,request:d}):{}}var z7=Zy;var ONi=y(x(),1);var gCe="https://dev.virtualearth.net/REST/v1/Locations";function H7(e){e=e??Q.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Ge({url:gCe,queryParameters:n}),this._credit=new bt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(H7.prototype,{url:{get:function(){return gCe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});H7.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],d=r[3];return{displayName:o.name,destination:de.fromDegrees(a,s,d,c)}})})};var K7=H7;var KNi=y(x(),1);function J7(){}Object.defineProperties(J7.prototype,{credit:{get:function(){}}});J7.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:m.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var j7=J7;var oXi=y(x(),1);var Kht=new ce,bCe=new m,cZ=new m;function Jht(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new m);let d=(a-i)*o;return m.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new m);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Kht;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,h,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,h=m.subtract(t[2],c,bCe),m.multiplyByScalar(h,.5,h),p=F.multiplyByVector(Z0.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],h=e.lastTangent,u=m.subtract(d,t[r-1],bCe),m.multiplyByScalar(u,.5,u),p=F.multiplyByVector(Z0.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],h=t[r+2],p=F.multiplyByVector(Ry.catmullRomCoefficientMatrix,a,a)),o=m.multiplyByScalar(c,p.x,o),m.multiplyByScalar(d,p.y,cZ),m.add(o,cZ,o),m.multiplyByScalar(u,p.z,cZ),m.add(o,cZ,o),m.multiplyByScalar(h,p.w,cZ),m.add(o,cZ,o)}}var jht=new m,qht=new m;function Ry(e){e=e??Q.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=jht,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=qht,m.multiplyByScalar(t[r-1],2,o),m.subtract(t[r],o,o),m.add(o,t[r-2],o),m.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(o),this._evaluateFunction=Jht(this),this._lastTimeIndex=0}Object.defineProperties(Ry.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}}});Ry.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Ry.prototype.findTimeInterval=To.prototype.findTimeInterval;Ry.prototype.wrapTime=To.prototype.wrapTime;Ry.prototype.clampTime=To.prototype.clampTime;Ry.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var q7=Ry;var JXi=y(x(),1);var RXi=y(x(),1);var $7={},$ht={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},eft=new pe,tft=new m,nft=new F,ift=new F,oft=new F,rft=new m,sft=new m,aft=new m,cft=new m,lft=new pe,dft=new M,UN=new m,uft=new M,mft=new m,hft=new m,JQ=function(e,t){return e-t};$7.createMesh=async function(e){e=e??Q.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:o,gltf:r,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,u=t!==1,h=ue.clone(e.boundingSphere,new ue),p=tn.clone(e.orientedBoundingBox,new tn),g=m.clone(e.horizonOcclusionPoint,new m),f=ie.clone(e.ellipsoid,new ie),b=de.clone(e.rectangle,new de);await(r.extensionsRequired!==void 0&&r.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?o0.ready:Promise.resolve(void 0));let T=b.west,S=b.south,_=b.north,R=b.width,L=b.height,W=de.center(b,eft);W.height=.5*(s+a);let B=pe.toCartesian(W,f,tft),Y=Tt.eastNorthUpToFixedFrame(B,f,nft),N=F.inverseTransformation(Y,ift),A=F.unpack(r.nodes[0].matrix,0,oft);A=F.multiply(to.Y_UP_TO_Z_UP,A,A);let I=Oft(r,i,$ht),Z=Do.getSkirtVertexCount(I.edgeIndicesWest,I.edgeIndicesSouth,I.edgeIndicesEast,I.edgeIndicesNorth),G=I.positions,w=I.normals,X=I.indices,v=G.length/3,U=v+Z,k=X.length,P=Do.getSkirtIndexCountWithFilledCorners(Z),O=U<=65535?Uint16Array:Uint32Array,H=new O(k+P);H.set(X);let ee=new O(I.edgeIndicesWest),z=new O(I.edgeIndicesSouth),te=new O(I.edgeIndicesEast),q=new O(I.edgeIndicesNorth),me=new O(ee).sort(),ye=new O(z).sort(),oe=new O(te).sort(),xe=new O(q).sort(),Ee=hi.geodeticLatitudeToMercatorAngle(S),Se=1/(hi.geodeticLatitudeToMercatorAngle(_)-Ee),Fe=m.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,rft),Ue=m.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,sft),De=new ur(h.center,void 0,void 0,void 0,void 0,i,o,u,t,n),Je=De.stride,St=new Float32Array(U*Je),Oe=0;for(let yt=0;yt<v;yt++){let Ot=m.unpack(G,yt*3,aft),Mn=F.multiplyByPoint(A,Ot,cft),sn=pe.fromCartesian(Mn,f,lft),{longitude:ut,latitude:Nt,height:In}=sn,lt=(ut-T)/R,fi=(Nt-S)/L;lt=V.clamp(lt,0,1),fi=V.clamp(fi,0,1),bo(me,yt,JQ)>=0?lt=0:bo(oe,yt,JQ)>=0&&(lt=1),bo(ye,yt,JQ)>=0?fi=0:bo(xe,yt,JQ)>=0&&(fi=1);let ao=M.fromElements(lt,fi,dft),po;if(i){let Di=m.unpack(w,yt*3,UN);Di=F.multiplyByPointAsVector(A,Di,UN),Di=m.normalize(Di,UN),po=_n.octEncode(Di,uft)}let ri;o&&(ri=(hi.geodeticLatitudeToMercatorAngle(Nt)-Ee)*Se);let co;u&&(co=f.geodeticSurfaceNormal(Mn,mft)),Oe=De.encode(St,Oe,Mn,ao,In,po,ri,co);let lo=F.multiplyByPoint(N,Mn,hft);Fe=m.minimumByComponent(lo,Fe,Fe),Ue=m.maximumByComponent(lo,Ue,Ue)}let it=new oc(m.clone(De.center,new m),St,H,k,v,s,a,b,ue.clone(h,new ue),m.clone(g,new m),Je,tn.clone(p,new tn),De,ee,z,te,q);return ICe(it,b,f,Fe,Ue,Y,N,c),Promise.resolve(it)};var fft=new M,pft=new M,Aft=new Array(6),gft=new M,bft=new M,yft=new M,xft=new m,Cft=new m,Eft=new m,Tft=new pe,Sft=new m,Ift=new pe,_ft=new pe,yCe=new m,Zft=new m,Rft=new m,Gft=new m,Vft=new m,Lft=new m,Wft=new m,Fft=new m,Bft=new F,wft=new F,xCe=new M,Yft=new M,Nft=new m,Xft=new ue,Pft=new tn,Mft=new Od,CCe=new m,ECe=new M,Uft=new M,TCe=new m,Dft=new m;function vft(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let g=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(g.buffer,g.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let s=e.buffers[r.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,d=c===4?Uint8Array:Uint16Array,u=new d(o*4);o0.decodeVertexBuffer(new Uint8Array(u.buffer),o,c,a);let h=(1<<u.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(o*3);for(let g=0;g<o;g++)p[g*3+0]=u[g*4+0]/h,p[g*3+1]=u[g*4+1]/h,p[g*3+2]=u[g*4+2]/h;return p}function kft(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let h=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(h.buffer,h.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let s=e.buffers[r.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,d=new Int8Array(o*c);o0.decodeVertexBuffer(new Uint8Array(d.buffer),o,c,a);let u=new Float32Array(o*3);for(let h=0;h<o;h++){let p=Math.max(d[h*4+0]/127,-1),g=Math.max(d[h*4+1]/127,-1),f=1-(Math.abs(p)+Math.abs(g));if(f<0){let C=p,E=g;p=(1-Math.abs(E))*V.signNotZero(C),g=(1-Math.abs(C))*V.signNotZero(E)}let b=UN;b.x=p,b.y=g,b.z=f,b=m.normalize(b,UN),u[h*3+0]=b.x,u[h*3+1]=b.y,u[h*3+2]=b.z}return u}function Qft(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],o=n.count,r=n.componentType===J.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let u=e.buffers[i.buffer].extras._pipeline.source;return new r(u.buffer,u.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),d=new r(o);return o0.decodeIndexBuffer(new Uint8Array(d.buffer),o,s.byteStride,c),d}function jQ(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],o=e.bufferViews[i.bufferView],r=i.count,s=i.componentType===J.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[o.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(o.byteOffset??0)+(i.byteOffset??0),r)}let c=e.buffers[a.buffer].extras._pipeline.source,d=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),u=new s(r),h=a.byteStride;return o0.decodeIndexSequence(new Uint8Array(u.buffer),r,h,d),u}function Oft(e,t,n){return n.positions=vft(e),n.normals=t?kft(e):void 0,n.indices=Qft(e),n.edgeIndicesWest=jQ(e,"left"),n.edgeIndicesSouth=jQ(e,"bottom"),n.edgeIndicesEast=jQ(e,"right"),n.edgeIndicesNorth=jQ(e,"top"),n}$7.upsampleMesh=function(e){e=e??Q.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:o,skirtHeight:r}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,d=e.parentVertices,u=ur.clone(e.parentEncoding,new ur),h=u.hasVertexNormals,p=u.hasWebMercatorT,g=u.exaggeration,f=u.exaggerationRelativeHeight,C=g!==1,E=de.clone(e.rectangle,new de),T=ie.clone(e.ellipsoid),S=[],_=[],R=[],L=[],W=[],B=[],Y=[],N=[];rpt(t,n,s,a,c,d,u,L,W,B,Y,N,S,R,_);let A=de.center(E,Tft);A.height=.5*(i+o);let I=pe.toCartesian(A,T,Sft),Z=S.length,G=new ur(I,void 0,void 0,void 0,void 0,h,p,C,g,f),w=G.stride,X=Do.getSkirtVertexCount(W,B,Y,N),v=Z+X,U=L.length,k=Do.getSkirtIndexCountWithFilledCorners(X),P=U+k,O=v<=65535?Uint16Array:Uint32Array,H=new O(P);H.set(L);let ee=new O(W),z=new O(B),te=new O(Y),q=new O(N),me=new Float32Array(v*w),ye=0,oe=Tt.eastNorthUpToFixedFrame(I,T,Bft),xe=F.inverseTransformation(oe,wft),Ee=E.west,Le=E.east,Se=E.south,Fe=E.north,Ue=hi.geodeticLatitudeToMercatorAngle(Se),Je=1/(hi.geodeticLatitudeToMercatorAngle(Fe)-Ue),St=Number.POSITIVE_INFINITY,Oe=Number.NEGATIVE_INFINITY,it=m.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Wft),yt=m.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Fft);for(let In=0;In<Z;In++){let lt=S[In],fi=a[lt*3+0],ao=a[lt*3+1],po=a[lt*3+2],ri=Yft;ri.x=_[In*2+0],ri.y=_[In*2+1];let co=ri.x,lo=ri.y,Di=R[In*2+0],Wi=R[In*2+1],Qn=1-Di-Wi,uo=u.decodeHeight(d,fi),vo=u.decodeHeight(d,ao),hr=u.decodeHeight(d,po),Vr=uo*Di+vo*Wi+hr*Qn;St=Math.min(Vr,St),Oe=Math.max(Vr,Oe);let qs=V.lerp(Ee,Le,co),xs=V.lerp(Se,Fe,lo),Na=pe.fromRadians(qs,xs,Vr,_ft),Ao=pe.toCartesian(Na,T,Zft),Vn=F.multiplyByPoint(xe,Ao,Gft);it=m.minimumByComponent(Vn,it,it),yt=m.maximumByComponent(Vn,yt,yt);let Qo;if(h){let Fi=u.decodeNormal(d,fi,xft),Wo=u.decodeNormal(d,ao,Cft),dc=u.decodeNormal(d,po,Eft),ea=m.fromElements(Fi.x*Di+Wo.x*Wi+dc.x*Qn,Fi.y*Di+Wo.y*Wi+dc.y*Qn,Fi.z*Di+Wo.z*Wi+dc.z*Qn,CCe);ea=m.normalize(ea,CCe),Qo=_n.octEncode(ea,Uft)}let Oo;p&&(Oo=(hi.geodeticLatitudeToMercatorAngle(xs)-Ue)*Je);let $s;C&&($s=T.geodeticSurfaceNormal(Ao,Dft)),ye=G.encode(me,ye,Ao,ri,Vr,Qo,Oo,$s)}let Ot=tn.fromRectangle(E,St,Oe,T,Pft),Mn=ue.fromVertices(me,G.center,w,Xft),ut=new tf(T).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(G.center,me,w,G.center,St,Nft),Nt=new oc(m.clone(G.center,new m),me,H,U,Z,St,Oe,E,ue.clone(Mn),m.clone(ut),w,tn.clone(Ot),G,ee,z,te,q);return ICe(Nt,E,T,it,yt,oe,xe,r),Nt};function ICe(e,t,n,i,o,r,s,a){let{encoding:c}=e,d=c.stride,u=e.vertices,{hasVertexNormals:h,hasWebMercatorT:p,exaggeration:g,exaggerationRelativeHeight:f}=c,C=g!==1,E=e.vertexCountWithoutSkirts,T=E*d,S=u.length/d,_=S-E,R=e.indices,L=e.indexCountWithoutSkirts,W=e.westIndicesSouthToNorth,B=e.southIndicesEastToWest,Y=e.eastIndicesNorthToSouth,N=e.northIndicesWestToEast;Do.addSkirtIndicesWithFilledCorners(W,B,Y,N,E,R,L);let A=0,I=A+W.length,Z=I+B.length,G=Z+Y.length,w=[W,B,Y,N],X=[A,I,Z,G],v=[-1,0,1,0],U=[0,-1,0,1],k=m.clone(i,Vft),P=m.clone(o,Lft),O=e.maximumHeight,H=e.minimumHeight-a;for(let te=0;te<_;te++){let q=0;for(q=0;q<3&&!(te<X[q+1]);q++);let me=w[q][te-X[q]],ye=c.decodeTextureCoordinates(u,me,xCe),oe=1e-4,xe=ye.x+v[q]*oe,Ee=ye.y+U[q]*oe,Le=V.lerp(t.west,t.east,xe),Se=V.clamp(V.lerp(t.south,t.north,Ee),-V.PI_OVER_TWO,+V.PI_OVER_TWO),Ue=c.decodeHeight(u,me)-a,De=pe.fromRadians(Le,Se,Ue,Ift),Je=pe.toCartesian(De,n,yCe),St;h&&(St=c.getOctEncodedNormal(u,me,ECe));let Oe;p&&(Oe=c.decodeWebMercatorT(u,me));let it;C&&(it=n.geodeticSurfaceNormal(Je,TCe)),T=c.encode(u,T,Je,ye,Ue,St,Oe,it);let yt=F.multiplyByPoint(s,Je,Rft);m.minimumByComponent(yt,k,k),m.maximumByComponent(yt,P,P)}let ee=Od.fromCorners(k,P,Mft),z=new ur(c.center,ee,H,O,r,c.hasVertexNormals,c.hasWebMercatorT,C,g,f);if(c.quantization!==z.quantization){let te=z,q=te.stride,me=new Float32Array(S*q),ye=0;for(let oe=0;oe<S;oe++)ye=te.encode(me,ye,c.decodePosition(u,oe,yCe),c.decodeTextureCoordinates(u,oe,xCe),c.decodeHeight(u,oe),c.hasVertexNormals?c.getOctEncodedNormal(u,oe,ECe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(u,oe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(u,oe,TCe):void 0);e.vertices=me,e.stride=q,e.encoding=te}return e}var e6=0,zft=1,t6=2,n6=3,Hft=4,Kft=new m,Jft=[new m,new m,new m,new m,new m,new m],jft=[new M,new M,new M,new M,new M,new M],qft=[new m,new m,new m,new m,new m,new m],$ft=[new M,new M,new M,new M,new M,new M];function SCe(e,t,n,i){switch(n){case e6:return V.sign(i.x-e.x);case t6:return V.sign(t.x-i.x);case n6:return V.sign(i.y-e.y);default:return V.sign(t.y-i.y)}}function ept(e,t,n,i,o,r){let s,a,c;switch(n){case e6:s=(e.x-i.x)/(o.x-i.x),a=e.x,c=i.y+(o.y-i.y)*s;break;case t6:s=(t.x-i.x)/(o.x-i.x),a=t.x,c=i.y+(o.y-i.y)*s;break;case n6:s=(e.y-i.y)/(o.y-i.y),a=i.x+(o.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(o.y-i.y),a=i.x+(o.x-i.x)*s,c=t.y;break}return m.fromElements(a,c,s,r)}var tpt={length:0,coordinates:[new M,new M,new M,new M,new M,new M],barycentricCoordinates:[new m,new m,new m,new m,new m,new m]};function npt(e,t,n,i,o,r,s,a){let c=0,d=jft,u=Jft,h=3,p=$ft;M.clone(o,p[0]),M.clone(r,p[1]),M.clone(s,p[2]);let g=qft;m.fromElements(1,0,0,g[0]),m.fromElements(0,1,0,g[1]),m.fromElements(0,0,1,g[2]);for(let f=0;f<t;f++){let b=(e+f)%Hft,C=d,E=u;d=p,u=g,c=h,p=C,g=E,h=0;let T=c-1,S=d[T],_=u[T],R=SCe(n,i,b,S);for(let L=0;L<c;L++){let W=d[L],B=u[L],Y=SCe(n,i,b,W);if(R*Y===-1){let N=ept(n,i,b,S,W,Kft),{x:A,y:I,z:Z}=N,G=1-Z,w=_.x*G+B.x*Z,X=_.y*G+B.y*Z,v=_.z*G+B.z*Z;M.fromElements(A,I,p[h]),m.fromElements(w,X,v,g[h]),h++}Y>=0&&(M.clone(W,p[h]),m.clone(B,g[h]),h++),T=L,S=W,_=B,R=Y}if(h===0)break}a.length=h;for(let f=0;f<h;f++)M.clone(p[f],a.coordinates[f]),m.clone(g[f],a.barycentricCoordinates[f]);return a}function ipt(e,t,n,i,o,r,s,a){return npt(e?t?n6:e6:t?t6:zft,2,n,i,o,r,s,a)}var opt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function rpt(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f){let b={},C=e?.5:0,E=e?1:.5,T=t?.5:0,S=t?1:.5,_=fft;_.x=C,_.y=T;let R=pft;R.x=E,R.y=S;let L=0;for(let W=0;W<n;W+=3){let B=i[W+0],Y=i[W+1],N=i[W+2],A=s.decodeTextureCoordinates(r,B,gft),I=s.decodeTextureCoordinates(r,Y,bft),Z=s.decodeTextureCoordinates(r,N,yft),G=ipt(e,t,_,R,A,I,Z,tpt),w=G.length;if(w<3)continue;let X=Aft;for(let P=0;P<w;P++){let O=G.barycentricCoordinates[P],H=O.x,ee=O.y,z=O.z,te=Math.ceil(H)|Math.ceil(ee)<<1|Math.ceil(z)<<2,q=opt[te],me,ye=!1;if(q.length===1){let oe=q[0],Ee=i[W+oe];me=b[Ee],me===void 0&&(ye=!0,me=L++,b[Ee]=me)}else if(q.length===2){let oe=q[0],xe=q[1],Ee=i[W+oe],Le=i[W+xe],Se=G.barycentricCoordinates[(P+w-1)%w],Fe=Math.ceil(Se.x)|Math.ceil(Se.y)<<1|Math.ceil(Se.z)<<2,Ue=te===Fe,De=Math.min(Ee,Le),Je=Math.max(Ee,Le),St=o+2*(De*o+Je),Oe=St+0,it=St+1,yt=b[Oe],Ot=b[it],Mn=!Ue==(yt===void 0||Ot===void 0);if(me=Mn?yt:Ot,me===void 0){ye=!0,me=L++;let sn=Mn?Oe:it;b[sn]=me}}else ye=!0,me=L++;if(X[P]=me,ye){let oe=W/3;p.push(oe);let xe=G.coordinates[P],Ee=(xe.x-C)/(E-C),Le=(xe.y-T)/(S-T);f.push(Ee,Le),g.push(H,ee),Ee===0?c.push(me):Ee===1&&u.push(me),Le===0?d.push(me):Le===1&&h.push(me)}}let v=X[0],U=X[1],k=X[2];a.push(v,U,k);for(let P=3;P<w;P++)U=k,k=X[P],a.push(v,U,k)}c.sort(function(W,B){return f[W*2+1]-f[B*2+1]}),d.sort(function(W,B){return f[B*2+0]-f[W*2+0]}),u.sort(function(W,B){return f[B*2+1]-f[W*2+1]}),h.sort(function(W,B){return f[W*2+0]-f[B*2+0]})}var lZ=$7;var FXi=y(x(),1);var qQ={};qQ.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let d=s+a+c,u,h,p,g,f,b;return d===1?s?(u=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),b=(e-o)/(i-o),r.push(0),r.push(1),b!==1&&(r.push(-1),r.push(2),r.push(1),r.push(b)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(g=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(b=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(b),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};qQ.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,h=r-a,p=i-a,g=1/(h*d+u*p),f=t-a,b=e-s,C=(h*b+u*f)*g,E=(-p*b+d*f)*g,T=1-C-E;return l(c)?(c.x=C,c.y=E,c.z=T,c):new m(C,E,T)};qQ.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=d/h,g=u/h;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new M),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Ef=qQ;function rb(e){e=e??Q.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ue.clone(e.boundingSphere,new ue),this._orientedBoundingBox=tn.clone(e.orientedBoundingBox,new tn),this._horizonOcclusionPoint=m.clone(e.horizonOcclusionPoint,new m),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(rb.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});rb.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:ZCe(i,e,t,n)};rb.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};var _Ce="createVerticesFromCesium3DTilesTerrain",spt=new Jn(_Ce),apt=new Jn(_Ce,Gd.maximumAsynchronousTasks);rb.prototype.createMesh=function(e){e=e??Q.EMPTY_OBJECT;let n=e.throttle??!0?apt:spt,i=e.tilingScheme,o=i.ellipsoid,r=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(r,s,a,new de),d=this._gltf,u=n.scheduleTask({ellipsoid:o,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:d,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(u))return;let h=this;return Promise.resolve(u).then(function(p){let g=p,f=ur.clone(g.encoding,new ur),b=new Float32Array(g.verticesBuffer),C=b.length/f.stride,E=g.vertexCountWithoutSkirts,T=C<=65535?Uint16Array:Uint32Array,S=new T(g.indicesBuffer),_=new T(g.westIndicesBuffer),R=new T(g.eastIndicesBuffer),L=new T(g.southIndicesBuffer),W=new T(g.northIndicesBuffer),B=g.indexCountWithoutSkirts,Y=h._minimumHeight,N=h._maximumHeight,A=m.clone(f.center,new m),I=ue.clone(h._boundingSphere,new ue),Z=m.clone(h._horizonOcclusionPoint,new m),G=tn.clone(h._orientedBoundingBox,new tn),w=new oc(A,b,S,B,E,Y,N,c,I,Z,f.stride,G,f,_,L,R,W);return h._mesh=w,Promise.resolve(w)})};rb.prototype._createMeshSync=function(e){e=e??Q.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,o=e.y,r=e.level,s=t.tileXYToRectangle(i,o,r,new de),a=lZ.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(d){return c._mesh=d,Promise.resolve(d)})};rb.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:$Q(!1,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};rb.prototype._upsampleSync=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:$Q(!0,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};rb.prototype.wasCreatedByUpsampling=function(){return!1};function ob(e){e=e??Q.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}ob.prototype.createMesh=function(e){return e=e??Q.EMPTY_OBJECT,Promise.resolve(this._mesh)};ob.prototype.upsample=function(e,t,n,i,o,r,s){return $Q(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};ob.prototype._upsampleSync=function(e,t,n,i,o,r,s){return $Q(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};ob.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return ZCe(i,e,t,n)};ob.prototype.wasCreatedByUpsampling=function(){return!0};ob.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(ob.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var cpt=new Jn("upsampleVerticesFromCesium3DTilesTerrain",Gd.maximumAsynchronousTasks);function $Q(e,t,n,i,o,r,s,a,c,d,u){if(u-a>1)throw new Ae("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,g=r*2!==c,f=s*2===d,b=o.tileXYToRectangle(c,d,u,new de),C=o.ellipsoid,E={isEastChild:g,isNorthChild:f,rectangle:b,ellipsoid:C,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let S=lZ.upsampleMesh(E),_=new ob({terrainMesh:S,skirtHeight:p,credits:i});return Promise.resolve(_)}let T=cpt.scheduleTask(E);if(T!==void 0)return T.then(function(S){let _=ur.clone(S.encoding,new ur),R=_.stride,L=new Float32Array(S.verticesBuffer),W=L.length/R,B=S.vertexCountWithoutSkirts,Y=W<=65535?Uint16Array:Uint32Array,N=new Y(S.indicesBuffer),A=new Y(S.westIndicesBuffer),I=new Y(S.eastIndicesBuffer),Z=new Y(S.southIndicesBuffer),G=new Y(S.northIndicesBuffer),w=S.indexCountWithoutSkirts,X=S.minimumHeight,v=S.maximumHeight,U=m.clone(_.center,new m),k=ue.clone(S.boundingSphere,new ue),P=m.clone(S.horizonOcclusionPoint,new m),O=tn.clone(S.orientedBoundingBox,new tn),H=new oc(U,L,N,w,B,X,v,b,k,P,R,O,_,A,Z,I,G),ee=new ob({terrainMesh:H,skirtHeight:p,credits:i});return Promise.resolve(ee)})}var lpt=new M,dpt=new M,upt=new M,mpt=new m;function ZCe(e,t,n,i){let o=V.clamp((n-t.west)/t.width,0,1),r=V.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let d=0;d<e.indexCountWithoutSkirts;d+=3){let u=c[d],h=c[d+1],p=c[d+2],g=a.decodeTextureCoordinates(s,u,lpt),f=a.decodeTextureCoordinates(s,h,dpt),b=a.decodeTextureCoordinates(s,p,upt),C=Math.min(g.x,f.x,b.x),E=Math.max(g.x,f.x,b.x),T=Math.min(g.y,f.y,b.y),S=Math.max(g.y,f.y,b.y);if(o>=C&&o<=E&&r>=T&&r<=S){let _=Ef.computeBarycentricCoordinates(o,r,g.x,g.y,f.x,f.y,b.x,b.y,mpt);if(_.x>=0&&_.y>=0&&_.z>=0){let R=a.decodeHeight(s,u),L=a.decodeHeight(s,h),W=a.decodeHeight(s,p);return _.x*R+_.y*L+_.z*W}}}return 0}var DN=rb;var RPi=y(x(),1);var ePi=y(x(),1);function Tf(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Tf.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Tf.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Tf({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Tf.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Tf.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)RCe(this,t)};Tf.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,RCe(this,i),t};Tf.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],GCe(this,0)),this._array[e-1]=void 0,t};Tf.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=i6(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&GCe(this,n)}return this._array[e-1]=void 0,t};Tf.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Tf.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[i6(this,1,2)?1:2]};function e5(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function vN(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function i6(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function RCe(e,t){if(t===0)return;let n=Math.floor(V.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=vN(e,t,i);for(o!==n&&(e5(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(vN(e,t,r)!==o)break;e5(e,t,r),t=r}}function GCe(e,t){let n=e._length,i=Math.floor(V.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){vN(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let d=0;d<c;d++){let u=a+d;vN(e,u,r)===i&&(r=u)}}if(vN(e,r,t)===i&&(e5(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);i6(e,r,a)===i&&e5(e,r,a)}t=r}}var sb=Tf;function vp(e){e=e??Q.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new bt(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new Ce,this._ellipsoid=e.ellipsoid??ie.WGS84,this._tilingScheme=new Qi({ellipsoid:this._ellipsoid}),this._subtreeCache=new wE({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}vp.fromUrl=async function(e,t){t=t??Q.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ge.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(u){throw new he("Could not load tileset JSON",u)}let o=new vp(t);o._tileCredits=n.credits,o._resource=n;let r=i.root.children,s=r[0],a=r[1],c=i.schema,d=Zl.fromJson(c);return o._tileset0=new bp(n,s,d),o._tileset1=new bp(n,a,d),o};vp.fromIonAssetId=async function(e,t){let n=await os.fromAssetId(e);return vp.fromUrl(n,t)};var hpt=new Array(3);vp.prototype.requestTileGeometry=async function(e,t,n,i){let o=LCe(n,e),r=o===0?this._tileset0:this._tileset1,s=WCe(r,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,d=c.find(o,a),u=this._requestWaterMask,h=this,p;if(d===void 0){let T=r.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=r.baseResource.getDerivedResource({url:T.url}).fetchArrayBuffer().then(async function(_){if(d=c.find(o,a),d===void 0){let R=new Uint8Array(_);d=await KA.fromSubtreeJson(h._resource,void 0,R,r,a),c.addSubtree(o,d)}return d})}else p=Promise.resolve(d);let g=r.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),f=r.baseResource.getDerivedResource({url:g.url}),b=f.fetchArrayBuffer();if(b===void 0)return;let C=b.then(T=>cC(new Uint8Array(T))),E=hpt;E[0]=p,E[1]=C,E[2]=u?C.then(T=>fpt(T,f)):void 0;try{let T=await Promise.all(E),S=T[0],_=T[1],R=T[2],L=S.getTileMetadataView(s),W=L.getPropertyBySemantic(um.TILE_MINIMUM_HEIGHT),B=L.getPropertyBySemantic(um.TILE_MAXIMUM_HEIGHT),Y=L.getPropertyBySemantic(um.TILE_BOUNDING_SPHERE),N=ue.unpack(Y,0,new ue),A=L.getPropertyBySemantic(um.TILE_HORIZON_OCCLUSION_POINT),Z=h._tilingScheme.tileXYToRectangle(e,t,n,new de),G=h._ellipsoid,w=tn.fromRectangle(Z,W,B,G,new tn),X=h.getLevelMaximumGeometricError(n)*5,v=t5(r,S,s,0,0),U=t5(r,S,s,1,0),k=t5(r,S,s,0,1),P=t5(r,S,s,1,1),O=(v?1:0)|(U?2:0)|(k?4:0)|(P?8:0),H=new DN({gltf:_,minimumHeight:W,maximumHeight:B,boundingSphere:N,orientedBoundingBox:w,horizonOcclusionPoint:A,skirtHeight:X,requestVertexNormals:h._requestVertexNormals,childTileMask:O,credits:h._tileCredits,waterMask:R});return Promise.resolve(H)}catch(T){console.log(`Could not load subtree: ${o} ${a.level} ${a.x} ${a.y}: ${T}`),console.log(`Could not load tile: ${o} ${s.level} ${s.x} ${s.y}: ${T}`);return}};vp.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,o=LCe(n,e),r=o===0?this._tileset0:this._tileset1,s=WCe(r,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(o,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let d=a.getParentSubtreeCoordinates(),u=i.find(o,d);if(u!==void 0)return u.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function LCe(e,t){let n=1<<e;return t/n|0}function WCe(e,t,n,i){let o=1<<t,r=t,s=n%o,a=o-i-1,{subdivisionScheme:c,subtreeLevels:d}=e;return new yp({subdivisionScheme:c,subtreeLevels:d,level:r,x:s,y:a})}async function fpt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new f0({schema:n.schema});await i.load();let o=i.schema,r,s;if(l(o.classes)){for(let g in o.classes)if(o.classes.hasOwnProperty(g)&&(r=o.classes[g],s=r.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(g=>g.class===r.id);if(!l(a))throw new Ae(`Expected a propertyTexture with a class ${r.id}`);let c=a.properties[s.id],d=e.textures[c.index],u=e.images[d.source]?.bufferView,h=Li.getBufferViewLoader({gltf:e,bufferViewId:u,gltfResource:t,baseResource:t});return await h.load(),await OA({uint8Array:new Uint8Array(h.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function t5(e,t,n,i,o){let r=n.isBottomOfSubtree(),a=o6(e,1,i,o),c=n.getDescendantCoordinates(a);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function o6(e,t,n,i){let{subdivisionScheme:o,subtreeLevels:r}=e;return new yp({subdivisionScheme:o,subtreeLevels:r,level:t,x:n,y:i})}vp.prototype.loadTileDataAvailability=function(e,t,n){};vp.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Do.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(vp.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function ppt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function wE(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new sb({comparator:wE.comparator}),this._provider=e.provider}wE.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};wE.prototype.addSubtree=function(e,t){let n=new ppt(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let o=i.getParentSubtreeCoordinates(),r=this.find(e,o)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};wE.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:o,x:r,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],d=c.rootId,u=c.subtree.implicitCoordinates;if(d===e&&u.level===o&&u.x===r&&u.y===s)return c.subtree}};wE.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,o=t<0?0:1,r=o===0?i._tileset0:i._tileset1,s=r.subtreeLevels,a=o6(r,0,0,0),c=this.find(o,a);if(c===void 0)return;let d=c.implicitCoordinates,u=d.x,h=d.y,p=d.level,g=-V.PI,f=+V.PI,b=V.lerp(g,f,o/2),C=V.lerp(g,f,(o+1)/2),E=-V.PI*.5,T=+V.PI*.5,S=0,_=0,R=!0;for(;R;){let W=1/(1<<p),B=(C-b)*W,Y=b+u*B,N=(T-E)*W,A=E+h*N;S=(t-Y)/B,_=(n-A)/N;let I=VCe(r,d,S,_,s);if(c.childSubtreeIsAvailableAtCoordinates(I)){let Z=this.find(o,I);if(Z!==void 0)c=Z,d=c.implicitCoordinates,u=d.x,h=d.y,p=d.level;else return I}else R=!1}let L;for(let W=0;W<s;W++){let B=VCe(r,d,S,_,W);if(c.tileIsAvailableAtCoordinates(B))L=B;else break}return L};function VCe(e,t,n,i,o){let r=1<<o,s=V.clamp(n*r|0,0,r-1),a=V.clamp(i*r|0,0,r-1),c=o6(e,o,s,a);return t.getDescendantCoordinates(c)}wE.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var r6=vp;var fMi=y(x(),1);var vPi=y(x(),1);function Gy(e){e=e??Q.EMPTY_OBJECT,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;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=i5(e.westIndices,o,t),this._southIndices=i5(e.southIndices,r,t),this._eastIndices=i5(e.eastIndices,o,t),this._northIndices=i5(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(Gy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var n5=[];function i5(e,t,n){n5.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)n5[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(n5.sort(t),Pe.createTypedArray(n,n5)):e}var FCe="createVerticesFromQuantizedTerrainMesh",Apt=new Jn(FCe),gpt=new Jn(FCe,Gd.maximumAsynchronousTasks);Gy.prototype.createMesh=function(e){e=e??Q.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),h=(a?gpt:Apt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(h))return;let p=this;return Promise.resolve(h).then(function(g){let f=p._quantizedVertices.length/3,b=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,C=Pe.createTypedArray(b,g.indices),E=new Float32Array(g.vertices),T=g.center,S=g.minimumHeight,_=g.maximumHeight,R=p._boundingSphere,L=p._orientedBoundingBox,W=m.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,B=g.vertexStride,Y=ur.clone(g.encoding);return p._mesh=new oc(T,E,C,g.indexCountWithoutSkirts,f,S,_,d,R,W,B,L,Y,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var bpt=new Jn("upsampleQuantizedTerrainMesh",Gd.maximumAsynchronousTasks);Gy.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=bpt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let f=c?g*.5:this._westSkirtHeight,b=d?g*.5:this._southSkirtHeight,C=c?this._eastSkirtHeight:g*.5,E=d?this._northSkirtHeight:g*.5,T=this._credits;return Promise.resolve(p).then(function(S){let _=new Uint16Array(S.vertices),R=Pe.createTypedArray(_.length/3,S.indices),L;return l(S.encodedNormals)&&(L=new Uint8Array(S.encodedNormals)),new Gy({quantizedVertices:_,indices:R,encodedNormals:L,minimumHeight:S.minimumHeight,maximumHeight:S.maximumHeight,boundingSphere:ue.clone(S.boundingSphere),orientedBoundingBox:tn.clone(S.orientedBoundingBox),horizonOcclusionPoint:m.clone(S.horizonOcclusionPoint),westIndices:S.westIndices,southIndices:S.southIndices,eastIndices:S.eastIndices,northIndices:S.northIndices,westSkirtHeight:f,southSkirtHeight:b,eastSkirtHeight:C,northSkirtHeight:E,childTileMask:0,credits:T,createdByUpsampling:!0})})};var s6=32767,BCe=new m;Gy.prototype.interpolateHeight=function(e,t,n){let i=V.clamp((t-e.west)/e.width,0,1);i*=s6;let o=V.clamp((n-e.south)/e.height,0,1);return o*=s6,l(this._mesh)?Ept(this,i,o):Tpt(this,i,o)};function wCe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),h=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=h}var ypt=new M,xpt=new M,Cpt=new M;function Ept(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,ypt),g=r.decodeTextureCoordinates(o,u,xpt),f=r.decodeTextureCoordinates(o,h,Cpt);if(wCe(t,n,p.x,p.y,g.x,g.y,f.x,f.y)){let b=Ef.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,BCe);if(b.x>=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){let C=r.decodeHeight(o,d),E=r.decodeHeight(o,u),T=r.decodeHeight(o,h);return b.x*C+b.y*E+b.z*T}}}}function Tpt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=i[d],g=i[u],f=i[h],b=o[d],C=o[u],E=o[h];if(wCe(t,n,p,b,g,C,f,E)){let T=Ef.computeBarycentricCoordinates(t,n,p,b,g,C,f,E,BCe);if(T.x>=-1e-15&&T.y>=-1e-15&&T.z>=-1e-15){let S=T.x*r[d]+T.y*r[u]+T.z*r[h];return V.lerp(e._minimumHeight,e._maximumHeight,S/s6)}}}}Gy.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};Gy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var YE=Gy;function Spt(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.availabilityPromiseCache={}}function NCe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ie.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}NCe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function XCe(e,t,n){if(!t.format){let b="The tile format is not specified in the layer.json file.";throw e.previousError=Ko.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,b),new he(b)}if(!t.tiles||t.tiles.length===0){let b="The layer.json file does not specify any tile URL templates.";throw e.previousError=Ko.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,b),new he(b)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let b=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Ko.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,b),new he(b)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Vs({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let b=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Ko.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,b),new he(b)}if(e.levelZeroMaximumGeometricError=Do.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let b=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Ko.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,b),new he(b)}let u;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(h)){g=new Cf(e.tilingScheme,p.length);for(let b=0;b<p.length;++b){let C=p[b],E=e.tilingScheme.getNumberOfYTilesAtLevel(b);l(e.overallAvailability[b])||(e.overallAvailability[b]=[]);for(let T=0;T<C.length;++T){let S=C[T],_=E-S.endY-1,R=E-S.startY-1;e.overallAvailability[b].push([S.startX,_,S.endX,R]),g.addAvailableTileRange(b,S.startX,_,S.endX,R)}}}else l(h)&&(u=new Cf(e.tilingScheme,d),g=new Cf(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new Spt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await l6(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Ipt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
${t.message}`),e.previousError=Ko.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return l6(e,n);throw new he(i)}async function _pt(e,t,n){await XCe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Cf(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new bt(e.attribution);e.tileCredits.push(o)}return!0}async function l6(e,t){try{let n=await e.layerJsonResource.fetchJson();return _pt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await XCe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):Ipt(e,n,t)}}function Sf(e){e=e??Q.EMPTY_OBJECT,this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new Ce;let t=e.credit;typeof t=="string"&&(t=new bt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var a6={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function YCe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function Zpt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Sc({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function Rpt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*d,g=Uint16Array.BYTES_PER_ELEMENT*3,f=3,b=Uint16Array.BYTES_PER_ELEMENT,C=b*f,E=new DataView(t),T=new m(E.getFloat64(a,!0),E.getFloat64(a+8,!0),E.getFloat64(a+16,!0));a+=u;let S=E.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let _=E.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let R=new ue(new m(E.getFloat64(a,!0),E.getFloat64(a+8,!0),E.getFloat64(a+16,!0)),E.getFloat64(a+u,!0));a+=h;let L=new m(E.getFloat64(a,!0),E.getFloat64(a+8,!0),E.getFloat64(a+16,!0));a+=u;let W=E.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let B=new Uint16Array(t,a,W*3);a+=W*g,W>64*1024&&(b=Uint32Array.BYTES_PER_ELEMENT,C=b*f);let Y=B.subarray(0,W),N=B.subarray(W,2*W),A=B.subarray(W*2,3*W);_n.zigZagDeltaDecode(Y,N,A),a%b!==0&&(a+=b-a%b);let I=E.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Z=Pe.createTypedArrayFromArrayBuffer(W,t,a,I*f);a+=I*C;let G=0,w=Z.length;for(let oe=0;oe<w;++oe){let xe=Z[oe];Z[oe]=G-xe,xe===0&&++G}let X=E.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let v=Pe.createTypedArrayFromArrayBuffer(W,t,a,X);a+=X*b;let U=E.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let k=Pe.createTypedArrayFromArrayBuffer(W,t,a,U);a+=U*b;let P=E.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Pe.createTypedArrayFromArrayBuffer(W,t,a,P);a+=P*b;let H=E.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let ee=Pe.createTypedArrayFromArrayBuffer(W,t,a,H);a+=H*b;let z,te;for(;a<E.byteLength;){let oe=E.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=E.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,oe===a6.OCT_VERTEX_NORMALS&&e._requestVertexNormals)z=new Uint8Array(t,a,W*2);else if(oe===a6.WATER_MASK&&e._requestWaterMask)te=new Uint8Array(t,a,xe);else if(oe===a6.METADATA&&e._requestMetadata){let Ee=E.getUint32(a,!0);if(Ee>0){let Se=Cr(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Ee).available;if(l(Se))for(let Fe=0;Fe<Se.length;++Fe){let Ue=n+Fe+1,De=Se[Fe],Je=e._tilingScheme.getNumberOfYTilesAtLevel(Ue);for(let St=0;St<De.length;++St){let Oe=De[St],it=Je-Oe.endY-1,yt=Je-Oe.startY-1;e.availability.addAvailableTileRange(Ue,Oe.startX,it,Oe.endX,yt),r.availability.addAvailableTileRange(Ue,Oe.startX,it,Oe.endX,yt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=xe}let q=e.getLevelMaximumGeometricError(n)*5,me=e._tilingScheme.tileXYToRectangle(i,o,n),ye=tn.fromRectangle(me,S,_,e._tilingScheme.ellipsoid);return new YE({center:T,minimumHeight:S,maximumHeight:_,boundingSphere:R,orientedBoundingBox:ye,horizonOcclusionPoint:L,quantizedVertices:B,encodedNormals:z,indices:Z,westIndices:v,southIndices:k,eastIndices:O,northIndices:ee,westSkirtHeight:q,southSkirtHeight:q,eastSkirtHeight:q,northSkirtHeight:q,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:te,credits:e._tileCredits})}Sf.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!l(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let h=d6(this,e,t,n,u,d===0);h.result&&(a=!0,c=c.then(()=>h.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):PCe(this,e,t,n,r,i)};function PCe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new he("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let d,u,h=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=YCe(void 0)):d=YCe(c);let g=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(f){return l(f)?l(e._heightmapStructure)?Zpt(e,f,i,t,n):Rpt(e,f,i,t,n,o):Promise.reject(new he("Mesh buffer doesn't exist."))})}Object.defineProperties(Sf.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){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(){return this._availability}}});Sf.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Sf.fromIonAssetId=async function(e,t){let n=await os.fromAssetId(e);return Sf.fromUrl(n,t)};Sf.fromUrl=async function(e,t){t=t??Q.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ge.createIfNeeded(e);n.appendForwardSlash();let i=new NCe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await l6(i);let o=new Sf(t);return i.build(o),o};Sf.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(d6(this,e,t,n,i[r],r===0).result)return;return!1};Sf.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=d6(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function c6(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function d6(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,d=o.availability,u=c6(o,t,n,i);for(;l(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let h;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,h=o.availabilityPromiseCache[s],!l(h))){let p=new pr({throttle:!1,throttleByServer:!0,type:Ys.TERRAIN});h=PCe(e,u.x,u.y,u.level,o,p),l(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}u=c6(o,u.x,u.y,u.level)}return{result:!1}}Sf._getAvailabilityTile=c6;var NE=Sf;var EMi=y(x(),1);function ab(e){e=e??Q.EMPTY_OBJECT;let t=e.radius,n={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 Ul(n),this._workerName="createCircleGeometry"}ab.packedLength=Ul.packedLength;ab.pack=function(e,t,n){return Ul.pack(e._ellipseGeometry,t,n)};var MCe=new Ul({center:new m,semiMajorAxis:1,semiMinorAxis:1}),Ic={center:new m,radius:void 0,ellipsoid:ie.clone(ie.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new we,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};ab.unpack=function(e,t,n){let i=Ul.unpack(e,t,MCe);return Ic.center=m.clone(i._center,Ic.center),Ic.ellipsoid=ie.clone(i._ellipsoid,Ic.ellipsoid),Ic.ellipsoid=ie.clone(i._ellipsoid,MCe._ellipsoid),Ic.height=i._height,Ic.extrudedHeight=i._extrudedHeight,Ic.granularity=i._granularity,Ic.vertexFormat=we.clone(i._vertexFormat,Ic.vertexFormat),Ic.stRotation=i._stRotation,Ic.shadowVolume=i._shadowVolume,l(n)?(Ic.semiMajorAxis=i._semiMajorAxis,Ic.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Ul(Ic),n):(Ic.radius=i._semiMajorAxis,new ab(Ic))};ab.createGeometry=function(e){return Ul.createGeometry(e._ellipseGeometry)};ab.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new ab({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:we.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(ab.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var u6=ab;var GMi=y(x(),1);function dZ(e){e=e??Q.EMPTY_OBJECT;let t=e.radius,n={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 bu(n),this._workerName="createCircleOutlineGeometry"}dZ.packedLength=bu.packedLength;dZ.pack=function(e,t,n){return bu.pack(e._ellipseGeometry,t,n)};var Gpt=new bu({center:new m,semiMajorAxis:1,semiMinorAxis:1}),Ru={center:new m,radius:void 0,ellipsoid:ie.clone(ie.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};dZ.unpack=function(e,t,n){let i=bu.unpack(e,t,Gpt);return Ru.center=m.clone(i._center,Ru.center),Ru.ellipsoid=ie.clone(i._ellipsoid,Ru.ellipsoid),Ru.height=i._height,Ru.extrudedHeight=i._extrudedHeight,Ru.granularity=i._granularity,Ru.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Ru.semiMajorAxis=i._semiMajorAxis,Ru.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new bu(Ru),n):(Ru.radius=i._semiMajorAxis,new dZ(Ru))};dZ.createGeometry=function(e){return bu.createGeometry(e._ellipseGeometry)};var m6=dZ;var PMi=y(x(),1);function uZ(e){e=e??Q.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Qi({ellipsoid:e.ellipsoid??ie.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Do.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Ce;let n=e.credit;typeof n=="string"&&(n=new bt(n)),this._credit=n}Object.defineProperties(uZ.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});uZ.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Sc({buffer:c,width:r,height:s})})};uZ.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};uZ.prototype.getTileDataAvailable=function(e,t,n){};uZ.prototype.loadTileDataAvailability=function(e,t,n){};var h6=uZ;var UMi=y(x(),1);function UCe(e){this.proxy=e}UCe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var f6=UCe;var JMi=y(x(),1);function mZ(e){e=e??Q.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Qi({ellipsoid:e.ellipsoid??ie.default})),this._levelZeroMaximumGeometricError=Do.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Ce}Object.defineProperties(mZ.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});mZ.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Sc({buffer:new Uint8Array(256),width:16,height:16}))};mZ.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};mZ.prototype.getTileDataAvailable=function(e,t,n){};mZ.prototype.loadTileDataAvailability=function(e,t,n){};var kp=mZ;var RUi=y(x(),1);var uUi=y(x(),1);var rUi=y(x(),1);function Qp(e){e=e??Q.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new Ps,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function p6(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Qp.prototype,{projectionMatrix:{get:function(){return p6(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return p6(this),this._infinitePerspective}}});var Vpt=new m,Lpt=new m,Wpt=new m,Fpt=new m;Qp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=m.cross(t,n,Vpt),h=Lpt;m.multiplyByScalar(t,c,h),m.add(e,h,h);let p=Wpt;m.multiplyByScalar(t,d,p),m.add(e,p,p);let g=Fpt;m.multiplyByScalar(u,a,g),m.add(h,g,g),m.subtract(g,e,g),m.normalize(g,g),m.cross(g,n,g),m.normalize(g,g);let f=i[0];return l(f)||(f=i[0]=new ce),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(u,s,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(n,g,g),m.normalize(g,g),f=i[1],l(f)||(f=i[1]=new ce),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,r,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(u,g,g),m.normalize(g,g),f=i[2],l(f)||(f=i[2]=new ce),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,o,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(g,u,g),m.normalize(g,g),f=i[3],l(f)||(f=i[3]=new ce),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),f=i[4],l(f)||(f=i[4]=new ce),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-m.dot(t,h),m.negate(t,g),f=i[5],l(f)||(f=i[5]=new ce),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,p),this._cullingVolume};Qp.prototype.getPixelDimensions=function(e,t,n,i,o){p6(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};Qp.prototype.clone=function(e){return l(e)||(e=new Qp),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};Qp.prototype.equals=function(e){return l(e)&&e instanceof Qp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Qp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Qp&&V.equalsEpsilon(this.right,e.right,t,n)&&V.equalsEpsilon(this.left,e.left,t,n)&&V.equalsEpsilon(this.top,e.top,t,n)&&V.equalsEpsilon(this.bottom,e.bottom,t,n)&&V.equalsEpsilon(this.near,e.near,t,n)&&V.equalsEpsilon(this.far,e.far,t,n)};var kl=Qp;function Vd(e){e=e??Q.EMPTY_OBJECT,this._offCenterFrustum=new kl,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}Vd.packedLength=6;Vd.pack=function(e,t,n){return n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Vd.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Vd),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function If(e){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))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(Vd.prototype,{projectionMatrix:{get:function(){return If(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return If(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return If(this),this._fovy}},sseDenominator:{get:function(){return If(this),this._sseDenominator}},offCenterFrustum:{get:function(){return If(this),this._offCenterFrustum}}});Vd.prototype.computeCullingVolume=function(e,t,n){return If(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Vd.prototype.getPixelDimensions=function(e,t,n,i,o){return If(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Vd.prototype.clone=function(e){return l(e)||(e=new Vd),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Vd.prototype.equals=function(e){return!l(e)||!(e instanceof Vd)?!1:(If(this),If(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Vd.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Vd)?!1:(If(this),If(e),V.equalsEpsilon(this.fov,e.fov,t,n)&&V.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ui=Vd;var o5=0,Bpt=1;function XE(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??we.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof Ui?(s=o5,a=Ui.packedLength):t instanceof hn&&(s=Bpt,a=hn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Me.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+Me.packedLength+we.packedLength}XE.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===o5?(Ui.pack(o,t,n),n+=Ui.packedLength):(hn.pack(o,t,n),n+=hn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Me.pack(e._orientation,t,n),n+=Me.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n]=e._drawNearPlane?1:0,t};var wpt=new Ui,Ypt=new hn,Npt=new Me,Xpt=new m,Ppt=new we;XE.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===o5?(o=Ui.unpack(e,t,wpt),t+=Ui.packedLength):(o=hn.unpack(e,t,Ypt),t+=hn.packedLength);let r=m.unpack(e,t,Xpt);t+=m.packedLength;let s=Me.unpack(e,t,Npt);t+=Me.packedLength;let a=we.unpack(e,t,Ppt);t+=we.packedLength;let c=e[t]===1;if(!l(n))return new XE({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=Me.clone(s,n._orientation),n._vertexFormat=we.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function hZ(e,t,n,i,o,r,s,a){let c=e/3*2;for(let d=0;d<4;++d)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var Mpt=new $,Upt=new F,A6=new F,DCe=new m,vCe=new m,kCe=new m,Dpt=new m,vpt=new m,kpt=new m,Vy=new Array(3),kN=new Array(4);kN[0]=new ce(-1,-1,1,1);kN[1]=new ce(1,-1,1,1);kN[2]=new ce(1,1,1,1);kN[3]=new ce(-1,1,1,1);var QCe=new Array(4);for(let e=0;e<4;++e)QCe[e]=new ce;XE._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,Mpt),d=r??DCe,u=s??vCe,h=a??kCe;d=$.getColumn(c,0,d),u=$.getColumn(c,1,u),h=$.getColumn(c,2,h),m.normalize(d,d),m.normalize(u,u),m.normalize(h,h),m.negate(d,d);let p=F.computeView(e,h,u,d,Upt),g,f,b=i.projectionMatrix;if(n===o5){let C=F.multiply(b,p,A6);f=F.inverse(C,A6)}else g=F.inverseTransformation(p,A6);l(f)?(Vy[0]=i.near,Vy[1]=i.far):(Vy[0]=0,Vy[1]=i.near,Vy[2]=i.far);for(let C=0;C<2;++C)for(let E=0;E<4;++E){let T=ce.clone(kN[E],QCe[E]);if(l(f)){T=F.multiplyByVector(f,T,T);let S=1/T.w;m.multiplyByScalar(T,S,T),m.subtract(T,e,T),m.normalize(T,T);let _=m.dot(h,T);m.multiplyByScalar(T,Vy[C]/_,T),m.add(T,e,T)}else{let S=i.offCenterFrustum;l(S)&&(i=S);let _=Vy[C],R=Vy[C+1];T.x=(T.x*(i.right-i.left)+i.left+i.right)*.5,T.y=(T.y*(i.top-i.bottom)+i.bottom+i.top)*.5,T.z=(T.z*(_-R)-_-R)*.5,T.w=1,F.multiplyByVector(g,T,T)}o[12*C+E*3]=T.x,o[12*C+E*3+1]=T.y,o[12*C+E*3+2]=T.z}};XE.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(72);XE._computeNearFarPlanes(i,o,t,n,c);let d=24;c[d]=c[12],c[d+1]=c[13],c[d+2]=c[14],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[9],c[d+7]=c[10],c[d+8]=c[11],c[d+9]=c[21],c[d+10]=c[22],c[d+11]=c[23],d+=12,c[d]=c[15],c[d+1]=c[16],c[d+2]=c[17],c[d+3]=c[3],c[d+4]=c[4],c[d+5]=c[5],c[d+6]=c[0],c[d+7]=c[1],c[d+8]=c[2],c[d+9]=c[12],c[d+10]=c[13],c[d+11]=c[14],d+=12,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[15],c[d+4]=c[16],c[d+5]=c[17],c[d+6]=c[18],c[d+7]=c[19],c[d+8]=c[20],c[d+9]=c[6],c[d+10]=c[7],c[d+11]=c[8],d+=12,c[d]=c[6],c[d+1]=c[7],c[d+2]=c[8],c[d+3]=c[18],c[d+4]=c[19],c[d+5]=c[20],c[d+6]=c[21],c[d+7]=c[22],c[d+8]=c[23],c[d+9]=c[9],c[d+10]=c[10],c[d+11]=c[11],r||(c=c.subarray(12));let u=new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(12*a):void 0,f=l(s.bitangent)?new Float32Array(12*a):void 0,b=l(s.st)?new Float32Array(8*a):void 0,C=DCe,E=vCe,T=kCe,S=m.negate(C,Dpt),_=m.negate(E,vpt),R=m.negate(T,kpt);d=0,r&&(hZ(d,p,g,f,b,R,C,E),d+=12),hZ(d,p,g,f,b,T,S,E),d+=12,hZ(d,p,g,f,b,S,R,E),d+=12,hZ(d,p,g,f,b,_,R,S),d+=12,hZ(d,p,g,f,b,C,T,E),d+=12,hZ(d,p,g,f,b,E,T,S),l(p)&&(u.normal=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(u.tangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:g})),l(f)&&(u.bitangent=new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),l(b)&&(u.st=new We({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:b}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,f=p*4;h[g]=f,h[g+1]=f+1,h[g+2]=f+2,h[g+3]=f,h[g+4]=f+2,h[g+5]=f+3}return new pt({attributes:u,indices:h,primitiveType:Be.TRIANGLES,boundingSphere:ue.fromVertices(c)})};var PE=XE;var DUi=y(x(),1);var g6=0,Qpt=1;function QN(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof Ui?(r=g6,s=Ui.packedLength):t instanceof hn&&(r=Qpt,s=hn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Me.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+Me.packedLength}QN.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===g6?(Ui.pack(o,t,n),n+=Ui.packedLength):(hn.pack(o,t,n),n+=hn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Me.pack(e._orientation,t,n),n+=Me.packedLength,t[n]=e._drawNearPlane?1:0,t};var Opt=new Ui,zpt=new hn,Hpt=new Me,Kpt=new m;QN.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===g6?(o=Ui.unpack(e,t,Opt),t+=Ui.packedLength):(o=hn.unpack(e,t,zpt),t+=hn.packedLength);let r=m.unpack(e,t,Kpt);t+=m.packedLength;let s=Me.unpack(e,t,Hpt);t+=Me.packedLength;let a=e[t]===1;if(!l(n))return new QN({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=Me.clone(s,n._orientation),n._drawNearPlane=a,n};QN.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(24);PE._computeNearFarPlanes(i,o,t,n,s);let a=new yn({position:new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,h=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,h[c]=d,h[c+1]=d+1,h[c+2]=d+1,h[c+3]=d+2,h[c+4]=d+2,h[c+5]=d+3,h[c+6]=d+3,h[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,h[c]=d,h[c+1]=d+4,h[c+2]=d+1,h[c+3]=d+5,h[c+4]=d+2,h[c+5]=d+6,h[c+6]=d+3,h[c+7]=d+7;return new pt({attributes:a,indices:h,primitiveType:Be.LINES,boundingSphere:ue.fromVertices(s)})};var ON=QN;var kUi=y(x(),1),Jpt={SEARCH:0,AUTOCOMPLETE:1},Ly=Object.freeze(Jpt);var KUi=y(x(),1);function r5(){Ae.throwInstantiationError()}Object.defineProperties(r5.prototype,{credit:{get:Ae.throwInstantiationError}});r5.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(bt.getIonCredit)};r5.prototype.geocode=Ae.throwInstantiationError;var fZ=r5;var qUi=y(x(),1);function OCe(){Ae.throwInstantiationError()}OCe.createGeometry=function(e){Ae.throwInstantiationError()};var b6=OCe;var bDi=y(x(),1),nAt=y(y6(),1);var rDi=y(x(),1);var tDi=y(x(),1);function jpt(e,t){return(e&t)!==0}var $c=jpt;var qpt=[1,2,4,8],zCe=15,$pt=16,eAt=64,tAt=128;function Op(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}Op.clone=function(e,t){return l(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 Op(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Op.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Op.prototype.hasSubtree=function(){return $c(this._bits,$pt)};Op.prototype.hasImagery=function(){return $c(this._bits,eAt)};Op.prototype.hasTerrain=function(){return $c(this._bits,tAt)};Op.prototype.hasChildren=function(){return $c(this._bits,zCe)};Op.prototype.hasChild=function(e){return $c(this._bits,qpt[e])};Op.prototype.getChildBitmask=function(){return this._bits&zCe};var zN=Op;function iAt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var oAt=iAt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y
wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB
\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA#	\xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2
\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1
ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS
>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88
\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Gu(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=V.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Gu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Gu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ge)&&(t=e.url);let n=Ge.createIfNeeded(t);n.appendForwardSlash();let i=new Gu;i._resource=n;try{await rAt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${KCe(i,"",1).url}: ${o}`;throw new he(r)}return i};Gu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;$c(t,r)?$c(e,r)&&(s|=1):(s|=2,$c(e,r)||(s|=1)),i+=s}return i};Gu.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];$c(s,2)?$c(s,1)||(t|=r):(n|=r,$c(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Gu.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var HCe=new Jn("decodeGoogleEarthEnterprisePacket");Gu.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=KCe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return HCe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,h=-1;if(e!==""){h=e.length+1;let f=d[e];u=r[e],u._bits|=f._bits,delete d[e]}let p=Object.keys(d);p.sort(function(f,b){return f.length-b.length});let g=p.length;for(let f=0;f<g;++f){let b=p[f];if(d[b]!==null){let E=zN.clone(d[b]),T=b.length;if(T===h)E.setParent(u);else if(T>1){let S=r[b.substring(0,b.length-1)];E.setParent(S)}r[b]=E}else r[b]=null}})})};Gu.prototype.populateSubtree=function(e,t,n,i){let o=Gu.tileXYToQuadKey(e,t,n);return E6(this,o,i)};function E6(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new pr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),E6(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new he(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new pr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),E6(e,t,s)}).finally(function(){delete a[o]})}Gu.prototype.getTileInformation=function(e,t,n){let i=Gu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Gu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function KCe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var x6,C6;function rAt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(C6)){let n=en("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;C6=nx(n).then(function(){x6=window.cesiumGoogleEarthDbRootParser(nAt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return C6.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=x6.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return HCe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=x6.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.copyrightString;l(d)&&(o[c.providerId]=new bt(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=oAt})}var cb=Gu;var wDi=y(x(),1);function ME(e){e=e??Q.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(ME.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var qCe="createVerticesFromGoogleEarthEnterpriseBuffer",sAt=new Jn(qCe),aAt=new Jn(qCe,Gd.maximumAsynchronousTasks),JCe=new de,s5=new de;ME.prototype.createMesh=function(e){e=e??Q.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,JCe),t.tileXYToRectangle(n,i,o,s5);let d=c.cartographicToCartesian(de.center(s5)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?aAt:sAt).scheduleTask({buffer:this._buffer,nativeRectangle:JCe,rectangle:s5,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let f=this;return g.then(function(b){return f._mesh=new oc(d,new Float32Array(b.vertices),new Uint16Array(b.indices),b.indexCountWithoutSkirts,b.vertexCountWithoutSkirts,b.minimumHeight,b.maximumHeight,s5,ue.clone(b.boundingSphere3D),m.clone(b.occludeePointInScaledSpace),b.numberOfAttributes,tn.clone(b.orientedBoundingBox),ur.clone(b.encoding),b.westIndicesSouthToNorth,b.southIndicesEastToWest,b.eastIndicesNorthToSouth,b.northIndicesWestToEast),f._minimumHeight=b.minimumHeight,f._maximumHeight=b.maximumHeight,f._buffer=void 0,f._mesh})};ME.prototype.interpolateHeight=function(e,t,n){let i=V.clamp((t-e.west)/e.width,0,1),o=V.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?mAt(this,i,o):pAt(this,i,o,e)};var cAt=new Jn("upsampleQuantizedTerrainMesh",Gd.maximumAsynchronousTasks);ME.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=cAt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=this;return p.then(function(f){let b=new Uint16Array(f.vertices),C=Pe.createTypedArray(b.length/3,f.indices),E=g._skirtHeight;return new YE({quantizedVertices:b,indices:C,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:ue.clone(f.boundingSphere),orientedBoundingBox:tn.clone(f.orientedBoundingBox),horizonOcclusionPoint:m.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:E,southSkirtHeight:E,eastSkirtHeight:E,northSkirtHeight:E,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};ME.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};ME.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var lAt=new M,dAt=new M,uAt=new M,$Ce=new m;function mAt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,lAt),g=r.decodeTextureCoordinates(o,u,dAt),f=r.decodeTextureCoordinates(o,h,uAt),b=Ef.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,$Ce);if(b.x>=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){let C=r.decodeHeight(o,d),E=r.decodeHeight(o,u),T=r.decodeHeight(o,h);return b.x*C+b.y*E+b.z*T}}}var hAt=Uint16Array.BYTES_PER_ELEMENT,jCe=Uint32Array.BYTES_PER_ELEMENT,T6=Int32Array.BYTES_PER_ELEMENT,fAt=Float32Array.BYTES_PER_ELEMENT,S6=Float64Array.BYTES_PER_ELEMENT;function pAt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),d=0;for(let R=0;R<r;++R)d+=c.getUint32(d,!0),d+=jCe;d+=jCe,d+=2*S6;let u=V.toRadians(c.getFloat64(d,!0)*180);d+=S6;let h=V.toRadians(c.getFloat64(d,!0)*180);d+=S6;let p=i.width/u/2,g=i.height/h/2,f=c.getInt32(d,!0);d+=T6;let b=c.getInt32(d,!0)*3;d+=T6,d+=T6;let C=new Array(f),E=new Array(f),T=new Array(f),S;for(S=0;S<f;++S)C[S]=s+c.getUint8(d++)*p,E[S]=a+c.getUint8(d++)*g,T[S]=c.getFloat32(d,!0)*6371010,d+=fAt;let _=new Array(b);for(S=0;S<b;++S)_[S]=c.getUint16(d,!0),d+=hAt;for(S=0;S<b;S+=3){let R=_[S],L=_[S+1],W=_[S+2],B=C[R],Y=C[L],N=C[W],A=E[R],I=E[L],Z=E[W],G=Ef.computeBarycentricCoordinates(t,n,B,A,Y,I,N,Z,$Ce);if(G.x>=-1e-15&&G.y>=-1e-15&&G.z>=-1e-15)return G.x*T[R]+G.y*T[L]+G.z*T[W]}}var pZ=ME;var $Di=y(x(),1);var Qm={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},a5=new j;function c5(){this._terrainCache={},this._lastTidy=j.now()}c5.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:j.now()}};c5.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};c5.prototype.tidy=function(){if(j.now(a5),j.secondsDifference(a5,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];j.secondsDifference(a5,r.timestamp)>10&&delete e[o]}j.clone(a5,this._lastTidy)}};function Wy(e){e=e??Q.EMPTY_OBJECT,this._tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-V.PI,-V.PI,V.PI,V.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new bt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new c5,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new Ce}Object.defineProperties(Wy.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Wy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new he(`The server ${e.url} doesn't have terrain`);let n=new Wy(t);return n._metadata=e,n};var AAt=new Jn("decodeGoogleEarthEnterprisePacket");function eEe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Qm.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}Wy.prototype.requestTileGeometry=function(e,t,n,i){let o=cb.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new he("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Qm.UNKNOWN);let d=r.get(o);if(l(d)){let E=s.providers[a.terrainProvider];return Promise.resolve(new pZ({buffer:d,childTileMask:eEe(o,a,s),credits:l(E)?[E]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Qm.NONE)return Promise.reject(new he("Terrain tile doesn't exist"))}else return Promise.resolve(new Sc({buffer:new Uint8Array(256),width:16,height:16}));let u,h=o,p=-1;switch(c){case Qm.SELF:p=a.terrainVersion;break;case Qm.PARENT:h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),p=u.terrainVersion;break;case Qm.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new he("Terrain tile doesn't exist"));let g=this._terrainPromises,f=this._terrainRequests,b,C;if(l(g[h]))b=g[h],C=f[h];else{C=i;let E=gAt(this,h,p,C).fetchArrayBuffer();if(!l(E))return;b=E.then(function(T){return l(T)?AAt.scheduleTask({buffer:T,type:"Terrain",key:s.key},[T]).then(function(S){let _=s.getTileInformationFromQuadKey(h);_.terrainState=Qm.SELF,r.add(h,S[0]);let R=_.terrainProvider,L=S.length-1;for(let W=0;W<L;++W){let B=h+W.toString(),Y=s.getTileInformationFromQuadKey(B);l(Y)&&(r.add(B,S[W+1]),Y.terrainState=Qm.PARENT,Y.terrainProvider===0&&(Y.terrainProvider=R))}}):Promise.reject(new he("Failed to load terrain."))}),g[h]=b,f[h]=C,b=b.finally(function(){delete g[h],delete f[h]})}return b.then(function(){let E=r.get(o);if(l(E)){let T=s.providers[a.terrainProvider];return new pZ({buffer:E,childTileMask:eEe(o,a,s),credits:l(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new he("Failed to load terrain."))}).catch(function(E){return C.state===pi.CANCELLED?(i.state=C.state,Promise.reject(E)):(a.terrainState=Qm.NONE,Promise.reject(E))})};Wy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Wy.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=cb.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Qm.NONE)return!1;if((!l(s)||s===Qm.UNKNOWN)&&(r.terrainState=Qm.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new pr({throttle:!1,throttleByServer:!0,type:Ys.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};Wy.prototype.loadTileDataAvailability=function(e,t,n){};function gAt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var I6=Wy;var svi=y(x(),1);var bAt="https://maps.googleapis.com/maps/api/geocode/json",tEe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function _6(e){e=e??Q.EMPTY_OBJECT;let t=e.key;this._resource=new Ge({url:bAt,queryParameters:{key:t}}),this._credit=new bt(tEe,!0)}Object.defineProperties(_6.prototype,{credit:{get:function(){return this._credit}}});_6.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new he(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:de.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:tEe,collapsible:!1}}})};var Z6=_6;var uvi=y(x(),1);var Js={};Js.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Js.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Js.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Js.defaultAccessToken=void 0;Js.defaultShareKey=void 0;Js._getAuthorizationHeader=function(){return l(Js.defaultShareKey)?`Basic ${Js.defaultShareKey}`:`Bearer ${Js.defaultAccessToken}`};Js.apiEndpoint=new Ge({url:"https://api.bentley.com"});Js.getExports=async function(e,t){let n=new Ge({url:`${Js.apiEndpoint}mesh-export`,headers:{Authorization:Js._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Js.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new he(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new he("Not allowed, forbidden");if(i.statusCode===422)throw new he(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new he("Too many requests")}throw new he(`Unknown request failure ${i.statusCode}`)}};Js.getRealityDataMetadata=async function(e,t){let n=new Ge({url:`${Js.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Js._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new he(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new he("Not allowed, forbidden");if(i.statusCode===404)throw new he(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new he(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new he("Too many requests")}throw new he(`Unknown request failure ${i.statusCode}`)}};Js.getRealityDataURL=async function(e,t,n){let i=new Ge({url:`${Js.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Js._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new he(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new he("Not allowed, forbidden");if(o.statusCode===404)throw new he(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new he(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new he("Too many requests")}throw new he(`Unknown request failure ${o.statusCode}`)}};var ma=Js;var xvi=y(x(),1);var hvi=y(x(),1);function yAt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var HN=yAt;var pEe={},xAt=32.184,CAt=2451545,nEe=-.0529921,iEe=-.1059842,oEe=13.0120009,rEe=13.3407154,sEe=.9856003,aEe=26.4057084,cEe=13.064993,lEe=.3287146,dEe=1.7484877,uEe=-.1589763,mEe=.0036096,hEe=.1643573,fEe=12.9590088,R6=new j;pEe.ComputeMoon=function(e,t){l(e)||(e=j.now()),R6=j.addSeconds(e,xAt,R6);let n=j.totalDays(R6)-CAt,i=n/ai.DAYS_PER_JULIAN_CENTURY,o=(125.045+nEe*n)*V.RADIANS_PER_DEGREE,r=(250.089+iEe*n)*V.RADIANS_PER_DEGREE,s=(260.008+oEe*n)*V.RADIANS_PER_DEGREE,a=(176.625+rEe*n)*V.RADIANS_PER_DEGREE,c=(357.529+sEe*n)*V.RADIANS_PER_DEGREE,d=(311.589+aEe*n)*V.RADIANS_PER_DEGREE,u=(134.963+cEe*n)*V.RADIANS_PER_DEGREE,h=(276.617+lEe*n)*V.RADIANS_PER_DEGREE,p=(34.226+dEe*n)*V.RADIANS_PER_DEGREE,g=(15.134+uEe*n)*V.RADIANS_PER_DEGREE,f=(119.743+mEe*n)*V.RADIANS_PER_DEGREE,b=(239.961+hEe*n)*V.RADIANS_PER_DEGREE,C=(25.053+fEe*n)*V.RADIANS_PER_DEGREE,E=Math.sin(o),T=Math.sin(r),S=Math.sin(s),_=Math.sin(a),R=Math.sin(c),L=Math.sin(d),W=Math.sin(u),B=Math.sin(h),Y=Math.sin(p),N=Math.sin(g),A=Math.sin(f),I=Math.sin(b),Z=Math.sin(C),G=Math.cos(o),w=Math.cos(r),X=Math.cos(s),v=Math.cos(a),U=Math.cos(c),k=Math.cos(d),P=Math.cos(u),O=Math.cos(h),H=Math.cos(p),ee=Math.cos(g),z=Math.cos(f),te=Math.cos(b),q=Math.cos(C),me=(269.9949+.0031*i-3.8787*E-.1204*T+.07*S-.0172*_+.0072*L-.0052*N+.0043*Z)*V.RADIANS_PER_DEGREE,ye=(66.5392+.013*i+1.5419*G+.0239*w-.0278*X+.0068*v-.0029*k+9e-4*P+8e-4*ee-9e-4*q)*V.RADIANS_PER_DEGREE,oe=(38.3213+13.17635815*n-14e-13*n*n+3.561*E+.1208*T-.0642*S+.0158*_+.0252*R-.0066*L-.0047*W-.0046*B+.0028*Y+.0052*N+.004*A+.0019*I-.0044*Z)*V.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*G*nEe+.1208*w*iEe-.0642*X*oEe+.0158*v*rEe+.0252*U*sEe-.0066*k*aEe-.0047*P*cEe-.0046*O*lEe+.0028*H*dEe+.0052*ee*uEe+.004*z*mEe+.0019*te*hEe-.0044*q*fEe)/86400*V.RADIANS_PER_DEGREE;return l(t)||(t=new HN),t.rightAscension=me,t.declination=ye,t.rotation=oe,t.rotationRate=xe,t};var KN=pEe;var Gvi=y(x(),1);function AEe(e){(!l(e)||typeof e!="function")&&(e=KN.ComputeMoon),this._computeFunction=e}var EAt=new m,TAt=new m,SAt=new m;function IAt(e,t,n){let i=EAt;i.x=Math.cos(e+V.PI_OVER_TWO),i.y=Math.sin(e+V.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=SAt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=m.cross(r,i,TAt);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var _At=new $,ZAt=new Me;AEe.prototype.evaluate=function(e,t){l(e)||(e=j.now());let n=this._computeFunction(e),i=IAt(n.rightAscension,n.declination,t),o=V.zeroToTwoPi(n.rotation),r=Me.fromAxisAngle(m.UNIT_Z,o,ZAt),s=$.fromQuaternion(Me.conjugate(r,r),_At);return $.multiply(s,i,i)};var JN=AEe;var Wvi=y(x(),1);var jN={};jN.type=void 0;jN.getRequiredDataPoints=Ae.throwInstantiationError;jN.interpolateOrderZero=Ae.throwInstantiationError;jN.interpolate=Ae.throwInstantiationError;var G6=jN;var Bvi=y(x(),1),RAt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},lb=Object.freeze(RAt);var jvi=y(x(),1);var Uvi=y(x(),1);function V6(e){this._url=Ge.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(V6.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});V6.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Ly.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=de.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=m.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var qN=V6;function GAt(e){if(!Object.values(lb).some(t=>t===e))throw new Ae(`Invalid geocodeProviderType: "${e}"`)}var gEe=Object.freeze({[lb.GOOGLE]:"google",[lb.BING]:"bing",[lb.DEFAULT]:void 0});function VAt(e){return gEe[e]}function LAt(e){return Object.entries(gEe).find(t=>t[1]===e)[0]}function L6(e){e=e??Q.EMPTY_OBJECT;let t=e.geocodeProviderType??lb.DEFAULT,n=e.accessToken??_h.defaultAccessToken,i=Ge.createIfNeeded(e.server??_h.defaultServer);i.appendForwardSlash();let o=_h.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(bt.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new qN(r),this.geocodeProviderType=t}Object.defineProperties(L6.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return LAt(this._pelias.url.queryParameters.geocoder)},set:function(e){GAt(e);let t={...this._pelias.url.queryParameters,geocoder:VAt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});L6.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var UE=L6;var $vi=y(x(),1),WAt={SHIFT:0,CTRL:1,ALT:2},Wa=Object.freeze(WAt);var nki=y(x(),1);function l5(){Ae.throwInstantiationError()}Object.defineProperties(l5.prototype,{ellipsoid:{get:Ae.throwInstantiationError}});l5.prototype.project=Ae.throwInstantiationError;l5.prototype.unproject=Ae.throwInstantiationError;var W6=l5;var aki=y(x(),1);function AZ(e){e=e??Q.EMPTY_OBJECT;let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(AZ.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});AZ.prototype.findTimeInterval=To.prototype.findTimeInterval;AZ.prototype.wrapTime=To.prototype.wrapTime;AZ.prototype.clampTime=To.prototype.clampTime;AZ.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var F6=AZ;var bki=y(x(),1);var lki=y(x(),1),FAt={NONE:-1,PARTIAL:0,FULL:1},Dr=Object.freeze(FAt);function el(e,t){this._occluderPosition=m.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 d5=new m;Object.defineProperties(el.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,d5),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=m.multiplyByScalar(t,n,d5);let a=o*o*n;s=m.add(e,m.multiplyByScalar(r,a,d5),d5)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});el.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new el(e,t)};var yEe=new m;el.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,yEe),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var BAt=new m;el.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,BAt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,yEe),o=this._occluderRadius-n;if(o=m.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),o*o+n*n>m.magnitudeSquared(i)):!1;if(o>0){i=m.subtract(t,this._cameraPosition,i);let r=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var wAt=new m;el.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Dr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,wAt),o=this._occluderRadius-n,r=m.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return o*o+n*n<s?Dr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Dr.FULL:Dr.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?Dr.PARTIAL:Dr.FULL))}}return Dr.NONE};var u5=new m;el.computeOccludeePoint=function(e,t,n){let i=m.clone(t),o=m.clone(e.center),r=e.radius,s=n.length,a=m.normalize(m.subtract(i,o,u5),u5),c=-m.dot(a,o),d=el._anyRotationVector(o,a,c),u=el._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let h;for(let g=1;g<s;++g){if(h=el._horizonToPlaneNormalDotProduct(e,a,c,d,n[g]),!h)return;h<u&&(u=h)}if(u<.0017453283658983088)return;let p=r/u;return m.add(o,m.multiplyByScalar(a,p,u5),u5)};var YAt=[];el.computeOccludeePointFromRectangle=function(e,t){t=t??ie.default;let n=de.subsample(e,t,0,YAt),i=ue.fromPoints(n),o=m.ZERO;if(!m.equals(o,i.center))return el.computeOccludeePoint(new ue(o,t.minimumRadius),i.center,n)};var NAt=new m;el._anyRotationVector=function(e,t,n){let i=m.abs(t,NAt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new m,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,r),i),e,i),i)};var XAt=new m;el._rotationVector=function(e,t,n,i,o){let r=m.subtract(i,e,XAt);if(r=m.normalize(r,r),m.dot(t,r)<.9999999847691291){let s=m.cross(t,r,r);if(m.magnitude(s)>V.EPSILON13)return m.normalize(s,new m)}return o};var B6=new m,PAt=new m,m5=new m,bEe=new m;el._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=m.clone(o,B6),s=m.clone(e.center,PAt),a=e.radius,c=m.subtract(s,r,m5),d=m.magnitudeSquared(c),u=a*a;if(d<u)return!1;let h=d-u,p=Math.sqrt(h),f=1/Math.sqrt(d),C=p*f*p;c=m.normalize(c,c);let E=m.add(r,m.multiplyByScalar(c,C,bEe),bEe),T=Math.sqrt(h-C*C),S=this._rotationVector(s,t,n,r,i),_=m.fromElements(S.x*S.x*c.x+(S.x*S.y-S.z)*c.y+(S.x*S.z+S.y)*c.z,(S.x*S.y+S.z)*c.x+S.y*S.y*c.y+(S.y*S.z-S.x)*c.z,(S.x*S.z-S.y)*c.x+(S.y*S.z+S.x)*c.y+S.z*S.z*c.z,B6);_=m.normalize(_,_);let R=m.multiplyByScalar(_,T,B6);S=m.normalize(m.subtract(m.add(E,R,m5),s,m5),m5);let L=m.dot(t,S);S=m.normalize(m.subtract(m.subtract(E,R,S),s,S),S);let W=m.dot(t,S);return L<W?L:W};var $N=el;var _ki=y(x(),1);function w6(e,t,n){e=Ge.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new bt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(w6.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});w6.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Rt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=de.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var Y6=w6;var Gki=y(x(),1);var MAt={packedLength:void 0,pack:Ae.throwInstantiationError,unpack:Ae.throwInstantiationError},N6=MAt;var Wki=y(x(),1);var UAt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:Ae.throwInstantiationError,unpackInterpolationResult:Ae.throwInstantiationError},X6=UAt;var wki=y(x(),1);function xEe(){Ae.throwInstantiationError()}xEe.prototype.getURL=Ae.throwInstantiationError;var P6=xEe;var zki=y(x(),1);var Nki=y(x(),1),DAt={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},Gn=Object.freeze(DAt);function Fy(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function Q6(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function DE(e){if(e.shiftKey)return Wa.SHIFT;if(e.ctrlKey)return Wa.CTRL;if(e.altKey)return Wa.ALT}var ys={LEFT:0,MIDDLE:1,RIGHT:2};function Vu(e,t,n,i){function o(r){i(e,r)}n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function vAt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;rn.supportsPointerEvents()?(Vu(e,"pointerdown",t,KAt),Vu(e,"pointerup",t,VEe),Vu(e,"pointermove",t,JAt),Vu(e,"pointercancel",t,VEe)):(Vu(e,"mousedown",t,LEe),Vu(e,"mouseup",n,WEe),Vu(e,"mousemove",n,FEe),Vu(e,"touchstart",t,zAt),Vu(e,"touchend",n,IEe),Vu(e,"touchmove",n,HAt),Vu(e,"touchcancel",n,IEe)),Vu(e,"dblclick",t,QAt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Vu(e,i,t,OAt)}function kAt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var CEe={position:new M};function O6(e){e._lastSeenTouchEvent=Ni()}function z6(e){return Ni()-e._lastSeenTouchEvent>_f.mouseEmulationIgnoreMilliseconds}function k6(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function LEe(e,t){if(!z6(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ys.LEFT)i=Gn.LEFT_DOWN;else if(n===ys.MIDDLE)i=Gn.MIDDLE_DOWN;else if(n===ys.RIGHT)i=Gn.RIGHT_DOWN;else return;let o=Fy(e,t,e._primaryPosition);M.clone(o,e._primaryStartPosition),M.clone(o,e._primaryPreviousPosition);let r=DE(t),s=e.getInputAction(i,r);l(s)&&(M.clone(o,CEe.position),s(CEe),t.preventDefault())}var EEe={position:new M},TEe={position:new M};function M6(e,t,n,i){let o=DE(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=Fy(e,i,e._primaryPosition);if(l(r)&&(M.clone(a,EEe.position),r(EEe)),l(s)){let c=e._primaryStartPosition;k6(c,a,e._clickPixelTolerance)&&(M.clone(a,TEe.position),s(TEe))}}}function WEe(e,t){if(!z6(e))return;let n=t.button;n!==ys.LEFT&&n!==ys.MIDDLE&&n!==ys.RIGHT||(e._buttonDown[ys.LEFT]&&(M6(e,Gn.LEFT_UP,Gn.LEFT_CLICK,t),e._buttonDown[ys.LEFT]=!1),e._buttonDown[ys.MIDDLE]&&(M6(e,Gn.MIDDLE_UP,Gn.MIDDLE_CLICK,t),e._buttonDown[ys.MIDDLE]=!1),e._buttonDown[ys.RIGHT]&&(M6(e,Gn.RIGHT_UP,Gn.RIGHT_CLICK,t),e._buttonDown[ys.RIGHT]=!1))}var U6={startPosition:new M,endPosition:new M};function FEe(e,t){if(!z6(e))return;let n=DE(t),i=Fy(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Gn.MOUSE_MOVE,n);l(r)&&(M.clone(o,U6.startPosition),M.clone(i,U6.endPosition),r(U6)),M.clone(i,o),(e._buttonDown[ys.LEFT]||e._buttonDown[ys.MIDDLE]||e._buttonDown[ys.RIGHT])&&t.preventDefault()}var SEe={position:new M};function QAt(e,t){let n=t.button,i;if(n===ys.LEFT)i=Gn.LEFT_DOUBLE_CLICK;else return;let o=DE(t),r=e.getInputAction(i,o);l(r)&&(Fy(e,t,SEe.position),r(SEe))}function OAt(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=DE(t),o=e.getInputAction(Gn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function zAt(e,t){O6(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,Fy(e,r,new M));h5(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,M.clone(a.get(s)))}function IEe(e,t){O6(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);h5(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var _Ee={position:new M},D6={position1:new M,position2:new M},ZEe={position:new M},REe={position:new M},GEe={position:new M};function h5(e,t){let n=DE(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[ys.LEFT]){if(e._buttonDown[ys.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Gn.LEFT_UP,n),l(r)&&(M.clone(e._primaryPosition,ZEe.position),r(ZEe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Gn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];k6(c,d,e._clickPixelTolerance)&&(M.clone(e._primaryPosition,REe.position),s(REe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Gn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];M.clone(c,e._primaryPosition),M.clone(c,e._primaryStartPosition),M.clone(c,e._primaryPreviousPosition),e._buttonDown[ys.LEFT]=!0,r=e.getInputAction(Gn.LEFT_DOWN,n),l(r)&&(M.clone(c,_Ee.position),r(_Ee)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Gn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];k6(d,u,e._holdPixelTolerance)&&(M.clone(e._primaryPosition,GEe.position),s(GEe))}},_f.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Gn.PINCH_START,n),l(r)&&(M.clone(i.values[0],D6.position1),M.clone(i.values[1],D6.position2),r(D6),t.preventDefault()))}function HAt(e,t){O6(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);l(d)&&Fy(e,r,d)}BEe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,M.clone(a.get(s),c.get(s))}var v6={startPosition:new M,endPosition:new M},eX={distance:{startPosition:new M,endPosition:new M},angleAndHeight:{startPosition:new M,endPosition:new M}};function BEe(e,t){let n=DE(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[ys.LEFT]){let a=i.values[0];M.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Gn.MOUSE_MOVE,n),l(s)&&(M.clone(c,v6.startPosition),M.clone(a,v6.endPosition),s(v6)),M.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Gn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],h=c.x-a.x,p=c.y-a.y,g=Math.sqrt(h*h+p*p)*.25,f=u.x-d.x,b=u.y-d.y,C=Math.sqrt(f*f+b*b)*.25,E=(c.y+a.y)*.125,T=(u.y+d.y)*.125,S=Math.atan2(p,h),_=Math.atan2(b,f);M.fromElements(0,C,eX.distance.startPosition),M.fromElements(0,g,eX.distance.endPosition),M.fromElements(_,T,eX.angleAndHeight.startPosition),M.fromElements(S,E,eX.angleAndHeight.endPosition),s(eX)}}function KAt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Fy(e,t,new M)),h5(e,t),e._previousPositions.set(i,M.clone(n.get(i)))}else LEe(e,t)}function VEe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),h5(e,t),e._previousPositions.remove(i)}else WEe(e,t)}function JAt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;Fy(e,t,o),BEe(e,t);let r=e._previousPositions;M.clone(n.get(i),r.get(i))}else FEe(e,t)}function _f(e){this._inputEvents={},this._buttonDown={[ys.LEFT]:!1,[ys.MIDDLE]:!1,[ys.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-_f.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new M,this._primaryPosition=new M,this._primaryPreviousPosition=new M,this._positions=new Ft,this._previousPositions=new Ft,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,vAt(this)}_f.prototype.setInputAction=function(e,t,n){let i=Q6(t,n);this._inputEvents[i]=e};_f.prototype.getInputAction=function(e,t){let n=Q6(e,t);return this._inputEvents[n]};_f.prototype.removeInputAction=function(e,t){let n=Q6(e,t);delete this._inputEvents[n]};_f.prototype.isDestroyed=function(){return!1};_f.prototype.destroy=function(){return kAt(this),fe(this)};_f.mouseEmulationIgnoreMilliseconds=800;_f.touchHoldDelayMilliseconds=1500;var Lu=_f;var d9i=y(x(),1);function jAt(e,t,n,i,o,r,s){let a=zi.numberOfPoints(e,t,o),c,d=n.red,u=n.green,h=n.blue,p=n.alpha,g=i.red,f=i.green,b=i.blue,C=i.alpha;if(D.equals(n,i)){for(c=0;c<a;c++)r[s++]=D.floatToByte(d),r[s++]=D.floatToByte(u),r[s++]=D.floatToByte(h),r[s++]=D.floatToByte(p);return s}let E=(g-d)/a,T=(f-u)/a,S=(b-h)/a,_=(C-p)/a,R=s;for(c=0;c<a;c++)r[R++]=D.floatToByte(d+c*E),r[R++]=D.floatToByte(u+c*T),r[R++]=D.floatToByte(h+c*S),r[R++]=D.floatToByte(p+c*_);return R}function tX(e){e=e??Q.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??V.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ie.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*m.packedLength;o+=l(n)?1+n.length*D.packedLength:1,this.packedLength=o+ie.packedLength+3}tX.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};tX.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=ie.unpack(e,t);t+=ie.packedLength;let c=e[t++]===1,d=e[t++],u=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=d,n._granularity=u,n):new tX({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var f5=new Array(2),p5=new Array(2),qAt={positions:f5,height:p5,ellipsoid:void 0,minDistance:void 0,granularity:void 0};tX.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=V.chordLength(r,s.maximumRadius),c=l(n)&&!i,d,u=t.length,h,p,g,f,b=0;if(o===ln.GEODESIC||o===ln.RHUMB){let _,R,L;o===ln.GEODESIC?(_=V.chordLength(r,s.maximumRadius),R=zi.numberOfPoints,L=zi.generateArc):(_=r,R=zi.numberOfPointsRhumbLine,L=zi.generateRhumbArc);let W=zi.extractHeights(t,s),B=qAt;if(o===ln.GEODESIC?B.minDistance=a:B.granularity=r,B.ellipsoid=s,c){let Y=0;for(d=0;d<u-1;d++)Y+=R(t[d],t[d+1],_)+1;h=new Float64Array(Y*3),g=new Uint8Array(Y*4),B.positions=f5,B.height=p5;let N=0;for(d=0;d<u-1;++d){f5[0]=t[d],f5[1]=t[d+1],p5[0]=W[d],p5[1]=W[d+1];let A=L(B);if(l(n)){let I=A.length/3;f=n[d];for(let Z=0;Z<I;++Z)g[N++]=D.floatToByte(f.red),g[N++]=D.floatToByte(f.green),g[N++]=D.floatToByte(f.blue),g[N++]=D.floatToByte(f.alpha)}h.set(A,b),b+=A.length}}else if(B.positions=t,B.height=W,h=new Float64Array(L(B)),l(n)){for(g=new Uint8Array(h.length/3*4),d=0;d<u-1;++d){let N=t[d],A=t[d+1],I=n[d],Z=n[d+1];b=jAt(N,A,I,Z,a,g,b)}let Y=n[u-1];g[b++]=D.floatToByte(Y.red),g[b++]=D.floatToByte(Y.green),g[b++]=D.floatToByte(Y.blue),g[b++]=D.floatToByte(Y.alpha)}}else{p=c?u*2-2:u,h=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let _=0,R=0;for(d=0;d<u;++d){let L=t[d];if(c&&d>0&&(m.pack(L,h,_),_+=3,f=n[d-1],g[R++]=D.floatToByte(f.red),g[R++]=D.floatToByte(f.green),g[R++]=D.floatToByte(f.blue),g[R++]=D.floatToByte(f.alpha)),c&&d===u-1)break;m.pack(L,h,_),_+=3,l(n)&&(f=n[d],g[R++]=D.floatToByte(f.red),g[R++]=D.floatToByte(f.green),g[R++]=D.floatToByte(f.blue),g[R++]=D.floatToByte(f.alpha))}}let C=new yn;C.position=new We({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(C.color=new We({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=h.length/3;let E=(p-1)*2,T=Pe.createTypedArray(p,E),S=0;for(d=0;d<p-1;++d)T[S++]=d,T[S++]=d+1;return new pt({attributes:C,indices:T,primitiveType:Be.LINES,boundingSphere:ue.fromPoints(t)})};var H6=tX;var A9i=y(x(),1);function gZ(e){let t=e.radius??1,i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Va(i),this._workerName="createSphereGeometry"}gZ.packedLength=Va.packedLength;gZ.pack=function(e,t,n){return Va.pack(e._ellipsoidGeometry,t,n)};var $At=new Va,By={radius:void 0,radii:new m,vertexFormat:new we,stackPartitions:void 0,slicePartitions:void 0};gZ.unpack=function(e,t,n){let i=Va.unpack(e,t,$At);return By.vertexFormat=we.clone(i._vertexFormat,By.vertexFormat),By.stackPartitions=i._stackPartitions,By.slicePartitions=i._slicePartitions,l(n)?(m.clone(i._radii,By.radii),n._ellipsoidGeometry=new Va(By),n):(By.radius=i._radii.x,new gZ(By))};gZ.createGeometry=function(e){return Va.createGeometry(e._ellipsoidGeometry)};var K6=gZ;var b9i=y(x(),1),egt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Sn=egt;var C9i=y(x(),1);function wy(e){}Object.defineProperties(wy.prototype,{ellipsoid:{get:Ae.throwInstantiationError},rectangle:{get:Ae.throwInstantiationError},projection:{get:Ae.throwInstantiationError}});wy.prototype.getNumberOfXTilesAtLevel=Ae.throwInstantiationError;wy.prototype.getNumberOfYTilesAtLevel=Ae.throwInstantiationError;wy.prototype.rectangleToNativeRectangle=Ae.throwInstantiationError;wy.prototype.tileXYToNativeRectangle=Ae.throwInstantiationError;wy.prototype.tileXYToRectangle=Ae.throwInstantiationError;wy.prototype.positionToTileXY=Ae.throwInstantiationError;var J6=wy;var N9i=y(x(),1);function tgt(e,t){this.rectangle=e,this.maxLevel=t}function wEe(e){this.ellipsoid=e.ellipsoid??ie.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}wEe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function ngt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Qi({ellipsoid:e.ellipsoid});else throw new he(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Do.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=V.toRadians(parseFloat(s.getAttribute("minx"))),c=V.toRadians(parseFloat(s.getAttribute("miny"))),d=V.toRadians(parseFloat(s.getAttribute("maxx"))),u=V.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new tgt(new de(a,c,d,u),h))}}function igt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Ko.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new he(i)}async function ogt(e,t,n){try{let i=await t.fetchXML();ngt(e,i)}catch(i){igt(t,i,n)}}function Yy(e){e=e??Q.EMPTY_OBJECT,this._errorEvent=new Ce,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new bt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Yy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Yy.fromUrl=async function(e,t){t=t??Q.EMPTY_OBJECT;let n=new wEe(t),i=Ge.createIfNeeded(e);await ogt(n,i);let o=new Yy(t);return n.build(o),o._resource=i,o};Yy.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Sc({buffer:ah(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:rgt(a,e,t,n),structure:a._terrainDataStructure})})};Yy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var YEe=new de;function rgt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let d=r[c];if(d.maxLevel<=i)continue;let u=d.rectangle,h=de.intersection(u,s,YEe);l(h)&&(A5(o,u,t*2,n*2,i+1)&&(a|=4),A5(o,u,t*2+1,n*2,i+1)&&(a|=8),A5(o,u,t*2,n*2+1,i+1)&&(a|=1),A5(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function A5(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(de.intersection(r,t,YEe))}Yy.prototype.getTileDataAvailable=function(e,t,n){};Yy.prototype.loadTileDataAvailability=function(e,t,n){};var j6=Yy;var k9i=y(x(),1);function vE(e){e=e??Q.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=e.epoch??Ke.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(vE.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(vE.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=sgt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});vE.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,fe(this)};vE.prototype.isDestroyed=function(){return!1};vE.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};vE.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=this.epoch??Ke.MINIMUM_VALUE,s=j.secondsDifference(o,r),a=t.duration,c,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?this.tolerance??1:.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function sgt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var q6=vE;var O9i=y(x(),1),agt={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},$6=Object.freeze(agt);var J9i=y(x(),1);function cgt(e){return e=e??Q.EMPTY_OBJECT,NE.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var nX=cgt;var tQi=y(x(),1);function lgt(e){return e=e??Q.EMPTY_OBJECT,NE.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ie.WGS84})}var kE=lgt;var oQi=y(x(),1);var dgt=1953029805,ugt=2917034100;function eq(e,t){if(eq.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new he("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===dgt||o===ugt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,h=8;for(;s<c;)for(h=(h+8)%24,u=h;s<c&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(h=(h+8)%24,u=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}eq.passThroughDataForTesting=!1;var iX=eq;var sQi=y(x(),1);function mgt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var oX=mgt;var cQi=y(x(),1);var tq=[],nq=[];function hgt(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=tq,d=nq,u,h;for(u=0;u<s;++u)c[u]=e[i+u];for(h=0;h<a;++h)d[h]=e[o+h+1];u=0,h=0;for(let p=i;p<=r;++p){let g=c[u],f=d[h];u<s&&(h>=a||t(g,f,n)<=0)?(e[p]=g,++u):h<a&&(e[p]=f,++h)}}function iq(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);iq(e,t,n,i,r),iq(e,t,n,r+1,o),hgt(e,t,n,i,r,o)}function fgt(e,t,n){let i=e.length,o=Math.ceil(i*.5);tq.length=o,nq.length=o,iq(e,t,n,0,i-1),tq.length=0,nq.length=0}var zp=fgt;var hQi=y(x(),1);var pgt=new m;function Agt(e,t,n,i){let o=ux(e,t,n,i,pgt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var oq=Agt;var AQi=y(x(),1);async function ggt(e,t,n,i){return l(i)||(i=!1),xgt(e,t,n,i)}function bgt(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(XEe(i)):r=o.then(XEe(i)).catch(Cgt(i)),e.shift(),t.push(r),!0}function ygt(e){return new Promise(function(t){setTimeout(t,e)})}function rq(e,t,n){return e.length?bgt(e,t,n)?rq(e,t,n):ygt(100).then(()=>rq(e,t,n)):Promise.resolve()}function xgt(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let d=o.positionToTileXY(n[r],t);if(!l(d))continue;let u=d.toString();if(!a.hasOwnProperty(u)){let h={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=h,s.push(h)}a[u].positions.push(n[r])}let c=[];return rq(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function NEe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function XEe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!NEe(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];NEe(s,i,n)}}):Promise.resolve()}}function Cgt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var rX=ggt;var CQi=y(x(),1);var sq=new M;async function PEe(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let d=t[c],u=r.computeMaximumLevelAtPosition(d);if(o[c]=u,u===0){e.tilingScheme.positionToTileXY(d,1,sq);let p=e.loadTileDataAvailability(sq.x,sq.y,1);l(p)&&s.push(p)}let h=i[u];l(h)||(i[u]=h=[]),h.push(d)}await Promise.all(s),await Promise.all(i.map(function(c,d){if(l(c))return rX(e,d,c,n)}));let a=[];for(let c=0;c<t.length;++c){let d=t[c];r.computeMaximumLevelAtPosition(d)!==o[c]&&a.push(d)}return a.length>0&&await PEe(e,a,n),t}var QE=PEe;var TQi=y(x(),1);function Egt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var OE=Egt;var _Qi=y(x(),1);function Tgt(e){switch(e){case ne.FLOAT:return"float";case ne.FLOAT_VEC2:return"vec2";case ne.FLOAT_VEC3:return"vec3";case ne.FLOAT_VEC4:return"vec4";case ne.FLOAT_MAT2:return"mat2";case ne.FLOAT_MAT3:return"mat3";case ne.FLOAT_MAT4:return"mat4";case ne.SAMPLER_2D:return"sampler2D";case ne.BOOL:return"bool"}}var aq=Tgt;var RQi=y(x(),1);function Sgt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var sX=Sgt;var zuo=y(x(),1);var BQi=y(x(),1);async function cq(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===se.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===se.SCENE2D)return r;let c=[de.center(e),de.southeast(e),de.southwest(e),de.northeast(e),de.northwest(e)],d=await cq._sampleTerrainMostDetailed(n,c),u=!1,h=d.reduce(function(g,f){return l(f.height)?(u=!0,Math.max(f.height,g)):g},-Number.MAX_VALUE),p=r;return u&&(p.height+=h),p}cq._sampleTerrainMostDetailed=QE;var zE=cq;var hzi=y(x(),1);var YQi=y(x(),1),aX=`uniform vec4 u_initialColor;

#if TEXTURE_UNITS > 0
uniform sampler2D u_dayTextures[TEXTURE_UNITS];
uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];
uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];

#ifdef APPLY_ALPHA
uniform float u_dayTextureAlpha[TEXTURE_UNITS];
#endif

#ifdef APPLY_DAY_NIGHT_ALPHA
uniform float u_dayTextureNightAlpha[TEXTURE_UNITS];
uniform float u_dayTextureDayAlpha[TEXTURE_UNITS];
#endif

#ifdef APPLY_SPLIT
uniform float u_dayTextureSplit[TEXTURE_UNITS];
#endif

#ifdef APPLY_BRIGHTNESS
uniform float u_dayTextureBrightness[TEXTURE_UNITS];
#endif

#ifdef APPLY_CONTRAST
uniform float u_dayTextureContrast[TEXTURE_UNITS];
#endif

#ifdef APPLY_HUE
uniform float u_dayTextureHue[TEXTURE_UNITS];
#endif

#ifdef APPLY_SATURATION
uniform float u_dayTextureSaturation[TEXTURE_UNITS];
#endif

#ifdef APPLY_GAMMA
uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];
#endif

#ifdef APPLY_IMAGERY_CUTOUT
uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
#endif

#ifdef APPLY_COLOR_TO_ALPHA
uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
#endif

uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
#endif

#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
uniform sampler2D u_waterMask;
uniform vec4 u_waterMaskTranslationAndScale;
uniform float u_zoomedOutOceanSpecularIntensity;
#endif

#ifdef SHOW_OCEAN_WAVES
uniform sampler2D u_oceanNormalMap;
#endif

#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
uniform vec2 u_lightingFadeDistance;
#endif

#ifdef TILE_LIMIT_RECTANGLE
uniform vec4 u_cartographicLimitRectangle;
#endif

#ifdef GROUND_ATMOSPHERE
uniform vec2 u_nightFadeDistance;
#endif

#ifdef ENABLE_CLIPPING_PLANES
uniform highp sampler2D u_clippingPlanes;
uniform mat4 u_clippingPlanesMatrix;
uniform vec4 u_clippingPlanesEdgeStyle;
#endif

#ifdef ENABLE_CLIPPING_POLYGONS
uniform highp sampler2D u_clippingDistance;
in vec2 v_clippingPosition;
flat in int v_regionIndex;
#endif

#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
uniform float u_minimumBrightness;
#endif

// Based on colorCorrect
// The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift 
// are nonzero AND when (applyFog || showGroundAtmosphere) in the tile provider
// - The tileProvider.hue/saturation/brightnessShift are just passed through
//   from the Globe hue/saturation/brightness, like atmosphereBrightnessShift
// - The applyFog depends on enableFog, and some tile distance from the viewer
// - The showGroundAtmosphere is a flag that is passed through from the Globe,
//   and is true by default when the ellipsoid is WGS84
#ifdef COLOR_CORRECT
uniform vec3 u_hsbShift; // Hue, saturation, brightness
#endif

// Based on highlightFillTile
// This is set for terrain tiles when they are "fill" tiles, and
// the terrainProvider.fillHighlightColor was set to a value with
// nonzero alpha
#ifdef HIGHLIGHT_FILL_TILE
uniform vec4 u_fillHighlightColor;
#endif

// Based on translucent
// This is set depending on the GlobeTranslucencyState
#ifdef TRANSLUCENT
uniform vec4 u_frontFaceAlphaByDistance;
uniform vec4 u_backFaceAlphaByDistance;
uniform vec4 u_translucencyRectangle;
#endif

// Based on showUndergroundColor
// This is set when GlobeSurfaceTileProvider.isUndergroundVisible 
// returns true, AND the tileProvider.undergroundColor had a value with 
// nonzero alpha, and the tileProvider.undergroundColorAlphaByDistance
// was in the right range
#ifdef UNDERGROUND_COLOR
uniform vec4 u_undergroundColor;
uniform vec4 u_undergroundColorAlphaByDistance;
#endif

// Based on enableLighting && hasVertexNormals
// The enableLighting flag is passed in directly from the Globe.
// The hasVertexNormals flag is from the tileProvider
#ifdef ENABLE_VERTEX_LIGHTING
uniform float u_lambertDiffuseMultiplier;
uniform float u_vertexShadowDarkness;
#endif

in vec3 v_positionMC;
in vec3 v_positionEC;
in vec3 v_textureCoordinates;
in vec3 v_normalMC;
in vec3 v_normalEC;

#ifdef APPLY_MATERIAL
in float v_height;
in float v_slope;
in float v_aspect;
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
in float v_distance;
#endif

#if defined(GROUND_ATMOSPHERE) || defined(FOG)
in vec3 v_atmosphereRayleighColor;
in vec3 v_atmosphereMieColor;
in float v_atmosphereOpacity;
#endif

#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
float interpolateByDistance(vec4 nearFarScalar, float distance)
{
    float startDistance = nearFarScalar.x;
    float startValue = nearFarScalar.y;
    float endDistance = nearFarScalar.z;
    float endValue = nearFarScalar.w;
    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
    return mix(startValue, endValue, t);
}
#endif

#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
{
    return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
}
#endif

#ifdef TRANSLUCENT
bool inTranslucencyRectangle()
{
    return
        v_textureCoordinates.x > u_translucencyRectangle.x &&
        v_textureCoordinates.x < u_translucencyRectangle.z &&
        v_textureCoordinates.y > u_translucencyRectangle.y &&
        v_textureCoordinates.y < u_translucencyRectangle.w;
}
#endif

vec4 sampleAndBlend(
    vec4 previousColor,
    sampler2D textureToSample,
    vec2 tileTextureCoordinates,
    vec4 textureCoordinateRectangle,
    vec4 textureCoordinateTranslationAndScale,
    float textureAlpha,
    float textureNightAlpha,
    float textureDayAlpha,
    float textureBrightness,
    float textureContrast,
    float textureHue,
    float textureSaturation,
    float textureOneOverGamma,
    float split,
    vec4 colorToAlpha,
    float nightBlend)
{
    // This crazy step stuff sets the alpha to 0.0 if this following condition is true:
    //    tileTextureCoordinates.s < textureCoordinateRectangle.s ||
    //    tileTextureCoordinates.s > textureCoordinateRectangle.p ||
    //    tileTextureCoordinates.t < textureCoordinateRectangle.t ||
    //    tileTextureCoordinates.t > textureCoordinateRectangle.q
    // In other words, the alpha is zero if the fragment is outside the rectangle
    // covered by this texture.  Would an actual 'if' yield better performance?
    vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;

    alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;

#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
    textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
#endif

    vec2 translation = textureCoordinateTranslationAndScale.xy;
    vec2 scale = textureCoordinateTranslationAndScale.zw;
    vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
    vec4 value = texture(textureToSample, textureCoordinates);
    vec3 color = value.rgb;
    float alpha = value.a;

#ifdef APPLY_COLOR_TO_ALPHA
    vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
    colorDiff.r = czm_maximumComponent(colorDiff);
    alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);
#endif

#if !defined(APPLY_GAMMA)
    vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
    color = tempColor.rgb;
    alpha = tempColor.a;
#else
    color = pow(color, vec3(textureOneOverGamma));
#endif

#ifdef APPLY_SPLIT
    float splitPosition = czm_splitPosition;
    // Split to the left
    if (split < 0.0 && gl_FragCoord.x > splitPosition) {
       alpha = 0.0;
    }
    // Split to the right
    else if (split > 0.0 && gl_FragCoord.x < splitPosition) {
       alpha = 0.0;
    }
#endif

#ifdef APPLY_BRIGHTNESS
    color = mix(vec3(0.0), color, textureBrightness);
#endif

#ifdef APPLY_CONTRAST
    color = mix(vec3(0.5), color, textureContrast);
#endif

#ifdef APPLY_HUE
    color = czm_hue(color, textureHue);
#endif

#ifdef APPLY_SATURATION
    color = czm_saturation(color, textureSaturation);
#endif

    float sourceAlpha = alpha * textureAlpha;
    float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
    outAlpha += sign(outAlpha) - 1.0;

    vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;

    // When rendering imagery for a tile in multiple passes,
    // some GPU/WebGL implementation combinations will not blend fragments in
    // additional passes correctly if their computation includes an unmasked
    // divide-by-zero operation,
    // even if it's not in the output or if the output has alpha zero.
    //
    // For example, without sanitization for outAlpha,
    // this renders without artifacts:
    //   if (outAlpha == 0.0) { outColor = vec3(0.0); }
    //
    // but using czm_branchFreeTernary will cause portions of the tile that are
    // alpha-zero in the additional pass to render as black instead of blending
    // with the previous pass:
    //   outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);
    //
    // So instead, sanitize against divide-by-zero,
    // store this state on the sign of outAlpha, and correct on return.

    return vec4(outColor, max(outAlpha, 0.0));
}

vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);

const float fExposure = 2.0;

vec3 computeEllipsoidPosition()
{
    float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);
    vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
    xy *= czm_viewport.zw * mpp * 0.5;

    vec3 direction;
    if (czm_orthographicIn3D == 1.0)
    {
        direction = vec3(0.0, 0.0, -1.0);
    }
    else
    {
        direction = normalize(vec3(xy, -czm_currentFrustum.x));
    }

    czm_ray ray = czm_ray(vec3(0.0), direction);

    vec3 ellipsoid_center = czm_view[3].xyz;

    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);

    vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);
    return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;
}

void main()
{
#ifdef TILE_LIMIT_RECTANGLE
    if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
        v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
        {
            discard;
        }
#endif

#ifdef ENABLE_CLIPPING_PLANES
    float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
#endif

#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
    vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));   // normalized surface normal in model coordinates
    vec3 normalEC = czm_normal3D * normalMC;                                         // normalized surface normal in eye coordinates
#endif

#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
    float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
#else
    float nightBlend = 0.0;
#endif

    // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0
    // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the
    // fragments on the edges of tiles even though the vertex shader is outputting
    // coordinates strictly in the 0-1 range.
    vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);

#ifdef SHOW_TILE_BOUNDARIES
    if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
        v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
    {
        color = vec4(1.0, 0.0, 0.0, 1.0);
    }
#endif

#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
    float cameraDist;
    if (czm_sceneMode == czm_sceneMode2D)
    {
        cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
    }
    else if (czm_sceneMode == czm_sceneModeColumbusView)
    {
        cameraDist = -czm_view[3].z;
    }
    else
    {
        cameraDist = length(czm_view[3]);
    }
    float fadeOutDist = u_lightingFadeDistance.x;
    float fadeInDist = u_lightingFadeDistance.y;
    if (czm_sceneMode != czm_sceneMode3D) {
        vec3 radii = czm_ellipsoidRadii;
        float maxRadii = max(radii.x, max(radii.y, radii.z));
        fadeOutDist -= maxRadii;
        fadeInDist -= maxRadii;
    }
    float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
#else
    float fade = 0.0;
#endif

#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
    vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
    vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
    vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
    waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;

    float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;

    #ifdef SHOW_REFLECTIVE_OCEAN
    if (mask > 0.0)
    {
        mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);

        vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC);
        vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx);

        vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));

        color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);
    }
    #endif
#endif

#ifdef APPLY_MATERIAL
    czm_materialInput materialInput;
    materialInput.st = v_textureCoordinates.st;
    materialInput.normalEC = normalize(v_normalEC);
    materialInput.positionToEyeEC = -v_positionEC;
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));
    materialInput.slope = v_slope;
    materialInput.height = v_height;
    materialInput.aspect = v_aspect;
    #ifdef HAS_WATER_MASK
        materialInput.waterMask = mask;
    #endif

    czm_material material = czm_getMaterial(materialInput);
    vec4 materialColor = vec4(material.diffuse, material.alpha);
    color = alphaBlend(materialColor, color);
#endif

#ifdef ENABLE_VERTEX_LIGHTING
    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);
    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#elif defined(ENABLE_DAYNIGHT_SHADING)
    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
    diffuseIntensity = mix(1.0, diffuseIntensity, fade);
    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#else
    vec4 finalColor = color;
#endif

#ifdef ENABLE_CLIPPING_PLANES
    vec4 clippingPlanesEdgeColor = vec4(1.0);
    clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
    float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;

    if (clipDistance < clippingPlanesEdgeWidth)
    {
        finalColor = clippingPlanesEdgeColor;
    }
#endif

#ifdef ENABLE_CLIPPING_POLYGONS
    vec2 clippingPosition = v_clippingPosition;
    int regionIndex = v_regionIndex;
    clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
#endif

#ifdef HIGHLIGHT_FILL_TILE
    finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);
#endif

#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
    vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
    vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif

#if defined(GROUND_ATMOSPHERE) || defined(FOG)
    if (!czm_backFacing())
    {
        bool dynamicLighting = false;
        #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
            dynamicLighting = true;
        #endif

        vec3 rayleighColor;
        vec3 mieColor;
        float opacity;

        vec3 positionWC;
        vec3 lightDirection;

        // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.
        // Otherwise, the scattering is computed in the vertex shader.
        #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE
            positionWC = computeEllipsoidPosition();
            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
            computeAtmosphereScattering(
                positionWC,
                lightDirection,
                rayleighColor,
                mieColor,
                opacity
            );
        #else
            positionWC = v_positionMC;
            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
            rayleighColor = v_atmosphereRayleighColor;
            mieColor = v_atmosphereMieColor;
            opacity = v_atmosphereOpacity;
        #endif

        #ifdef COLOR_CORRECT
            const bool ignoreBlackPixels = true;
            rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels);
            mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels);
        #endif

        vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);

        // Fog is applied to tiles selected for fog, close to the Earth.
        #ifdef FOG
            vec3 fogColor = groundAtmosphereColor.rgb;

            // If there is lighting, apply that to the fog.
            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
                float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);
                fogColor *= darken;
            #endif

            #ifndef HDR
                fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
                fogColor.rgb = czm_inverseGamma(fogColor.rgb);
            #endif

            finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, czm_fogVisualDensityScalar), finalColor.a);

        #else
            // Apply ground atmosphere. This happens when the camera is far away from the earth.

            // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.
            // This value is larger near the "circumference", as it is further away from the camera. We use it to
            // brighten up that area of the ground atmosphere.
            const float transmittanceModifier = 0.5;
            float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);

            vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;

            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
                float fadeInDist = u_nightFadeDistance.x;
                float fadeOutDist = u_nightFadeDistance.y;

                float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);
                float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);
                vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);

                finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);
            #endif

            #ifndef HDR
                finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);
            #else
                finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);
            #endif

            finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);
        #endif
    }
#endif

#ifdef UNDERGROUND_COLOR
    if (czm_backFacing())
    {
        float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);
        float distance = max(v_distance - distanceFromEllipsoid, 0.0);
        float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);
        vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);
        finalColor = alphaBlend(undergroundColor, finalColor);
    }
#endif

#ifdef TRANSLUCENT
    if (inTranslucencyRectangle())
    {
      vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
      finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
    }
#endif

    out_FragColor =  finalColor;
}


#ifdef SHOW_REFLECTIVE_OCEAN

float waveFade(float edge0, float edge1, float x)
{
    float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
    return pow(1.0 - y, 5.0);
}

float linearFade(float edge0, float edge1, float x)
{
    return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
}

// Based on water rendering by Jonas Wagner:
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog

// low altitude wave settings
const float oceanFrequencyLowAltitude = 825000.0;
const float oceanAnimationSpeedLowAltitude = 0.004;
const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
const float oceanSpecularIntensity = 0.5;

// high altitude wave settings
const float oceanFrequencyHighAltitude = 125000.0;
const float oceanAnimationSpeedHighAltitude = 0.008;
const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;

vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
{
    vec3 positionToEyeEC = -positionEyeCoordinates;
    float positionToEyeECLength = length(positionToEyeEC);

    // The double normalize below works around a bug in Firefox on Android devices.
    vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));

    // Fade out the waves as the camera moves far from the surface.
    float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);

#ifdef SHOW_OCEAN_WAVES
    // high altitude waves
    float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
    vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
    vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);

    // low altitude waves
    time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
    noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
    vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);

    // blend the 2 wave layers based on distance to surface
    float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
    float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
    vec3 normalTangentSpace =
        (highAltitudeFade * normalTangentSpaceHighAltitude) +
        (lowAltitudeFade * normalTangentSpaceLowAltitude);
    normalTangentSpace = normalize(normalTangentSpace);

    // fade out the normal perturbation as we move farther from the water surface
    normalTangentSpace.xy *= waveIntensity;
    normalTangentSpace = normalize(normalTangentSpace);
#else
    vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
#endif

    vec3 normalEC = enuToEye * normalTangentSpace;

    const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);

    // Use diffuse light to highlight the waves
    float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
    vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);

#ifdef SHOW_OCEAN_WAVES
    // Where diffuse light is low or non-existent, use wave highlights based solely on
    // the wave bumpiness and no particular light direction.
    float tsPerturbationRatio = normalTangentSpace.z;
    vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
#else
    vec3 nonDiffuseHighlight = vec3(0.0);
#endif

    // Add specular highlights in 3D, and in all modes when zoomed in.
    float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
    float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
    float specular = specularIntensity * surfaceReflectance;

#ifdef HDR
    specular *= 1.4;

    float e = 0.2;
    float d = 3.3;
    float c = 1.7;

    vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
#else
    vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
#endif

    return vec4(color, imageryColor.a);
}

#endif // #ifdef SHOW_REFLECTIVE_OCEAN
`;var XQi=y(x(),1),cX=`#ifdef QUANTIZATION_BITS12
in vec4 compressed0;
in float compressed1;
#else
in vec4 position3DAndHeight;
in vec4 textureCoordAndEncodedNormals;
#endif

#ifdef GEODETIC_SURFACE_NORMALS
in vec3 geodeticSurfaceNormal;
#endif

#ifdef EXAGGERATION
uniform vec2 u_verticalExaggerationAndRelativeHeight;
#endif

uniform vec3 u_center3D;
uniform mat4 u_modifiedModelView;
uniform mat4 u_modifiedModelViewProjection;
uniform vec4 u_tileRectangle;

// Uniforms for 2D Mercator projection
uniform vec2 u_southAndNorthLatitude;
uniform vec2 u_southMercatorYAndOneOverHeight;

out vec3 v_positionMC;
out vec3 v_positionEC;

out vec3 v_textureCoordinates;
out vec3 v_normalMC;
out vec3 v_normalEC;

#ifdef APPLY_MATERIAL
out float v_slope;
out float v_aspect;
out float v_height;
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
out float v_distance;
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE)
out vec3 v_atmosphereRayleighColor;
out vec3 v_atmosphereMieColor;
out float v_atmosphereOpacity;
#endif

#ifdef ENABLE_CLIPPING_POLYGONS
uniform highp sampler2D u_clippingExtents;
out vec2 v_clippingPosition;
flat out int v_regionIndex;
#endif

// These functions are generated at runtime.
vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
float get2DYPositionFraction(vec2 textureCoordinates);

vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)
{
    return u_modifiedModelViewProjection * vec4(position, 1.0);
}

float get2DMercatorYPositionFraction(vec2 textureCoordinates)
{
    // The width of a tile at level 11, in radians and assuming a single root tile, is
    //   2.0 * czm_pi / pow(2.0, 11.0)
    // We want to just linearly interpolate the 2D position from the texture coordinates
    // when we're at this level or higher.  The constant below is the expression
    // above evaluated and then rounded up at the 4th significant digit.
    const float maxTileWidth = 0.003068;
    float positionFraction = textureCoordinates.y;
    float southLatitude = u_southAndNorthLatitude.x;
    float northLatitude = u_southAndNorthLatitude.y;
    if (northLatitude - southLatitude > maxTileWidth)
    {
        float southMercatorY = u_southMercatorYAndOneOverHeight.x;
        float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;

        float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);
        currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);
        positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);
    }
    return positionFraction;
}

float get2DGeographicYPositionFraction(vec2 textureCoordinates)
{
    return textureCoordinates.y;
}

vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)
{
    float yPositionFraction = get2DYPositionFraction(textureCoordinates);
    vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
    return u_modifiedModelViewProjection * rtcPosition2D;
}

vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)
{
    return getPositionPlanarEarth(position, 0.0, textureCoordinates);
}

vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)
{
    return getPositionPlanarEarth(position, height, textureCoordinates);
}

vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)
{
    // We do not do RTC while morphing, so there is potential for jitter.
    // This is unlikely to be noticeable, though.
    vec3 position3DWC = position + u_center3D;
    float yPositionFraction = get2DYPositionFraction(textureCoordinates);
    vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
    vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);
    vec4 morphPositionEC = czm_modelView * morphPosition;
    return czm_projection * morphPositionEC;
}

#ifdef QUANTIZATION_BITS12
uniform vec2 u_minMaxHeight;
uniform mat4 u_scaleAndBias;
#endif

void main()
{
#ifdef QUANTIZATION_BITS12
    vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
    vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
    vec3 position = vec3(xy, zh.x);
    float height = zh.y;
    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);

    height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
    position = (u_scaleAndBias * vec4(position, 1.0)).xyz;

#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL)
    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
    float encodedNormal = compressed1;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
    float encodedNormal = 0.0;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = compressed0.w;
#else
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = 0.0;
#endif

#else
    // A single float per element
    vec3 position = position3DAndHeight.xyz;
    float height = position3DAndHeight.w;
    vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;

#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = textureCoordAndEncodedNormals.z;
    float encodedNormal = textureCoordAndEncodedNormals.w;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = textureCoordAndEncodedNormals.z;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = textureCoordAndEncodedNormals.z;
    float encodedNormal = 0.0;
#else
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = 0.0;
#endif

#endif

    vec3 position3DWC = position + u_center3D;

#ifdef GEODETIC_SURFACE_NORMALS
    vec3 ellipsoidNormal = geodeticSurfaceNormal;
#else
    vec3 ellipsoidNormal = normalize(position3DWC);
#endif

#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
    float exaggeration = u_verticalExaggerationAndRelativeHeight.x;
    float relativeHeight = u_verticalExaggerationAndRelativeHeight.y;
    float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;

    // stop from going through center of earth
    float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);
    newHeight = max(newHeight, -minRadius);

    vec3 offset = ellipsoidNormal * (newHeight - height);
    position += offset;
    position3DWC += offset;
    height = newHeight;
#endif

    gl_Position = getPosition(position, height, textureCoordinates);

    v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
    v_positionMC = position3DWC;  // position in model coordinates

    v_textureCoordinates = vec3(textureCoordinates, webMercatorT);

#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
    vec3 normalMC = czm_octDecode(encodedNormal);

#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
    vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
    vec3 rejection = normalMC - projection;
    normalMC = normalize(projection + rejection * exaggeration);
#endif

    v_normalMC = normalMC;
    v_normalEC = czm_normal3D * v_normalMC;
#endif

#ifdef ENABLE_CLIPPING_POLYGONS
    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);
    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
    
    vec2 minDistance = vec2(czm_infinity);
    v_clippingPosition = vec2(czm_infinity);
    v_regionIndex = -1;

    for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
        vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);
        vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;

        vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
        vec2 distance = abs(rectUv - clamped) * extents.wz;

        float threshold = 0.01;
        if (minDistance.x > distance.x || minDistance.y > distance.y) {
            minDistance = distance;
            v_clippingPosition = rectUv;
            if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
                v_regionIndex = regionIndex;
            }
        }
    }
#endif

#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))

    bool dynamicLighting = false;

    #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
        dynamicLighting = true;
    #endif

#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
    vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
    vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif

    vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));

    computeAtmosphereScattering(
        position3DWC,
        lightDirection,
        v_atmosphereRayleighColor,
        v_atmosphereMieColor,
        v_atmosphereOpacity
    );
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
    v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);
#endif

#ifdef APPLY_MATERIAL
    float northPoleZ = czm_ellipsoidRadii.z;
    vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);
    vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));
    float dotProd = abs(dot(ellipsoidNormal, v_normalMC));
    v_slope = acos(dotProd);
    vec3 normalRejected = ellipsoidNormal * dotProd;
    vec3 normalProjected = v_normalMC - normalRejected;
    vec3 aspectVector = normalize(normalProjected);
    v_aspect = acos(dot(aspectVector, vectorEastMC));
    float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);
    v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);
    v_height = height;
#endif
}
`;var MQi=y(x(),1),bZ=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {

    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
    
    float atmosphereInnerRadius = length(positionWC);

    computeScattering(
        primaryRay,
        length(cameraToPositionWC),
        lightDirection,
        atmosphereInnerRadius,
        rayleighColor,
        mieColor,
        opacity
    );
}
`;var qQi=y(x(),1);var kQi=y(x(),1);var Igt=new M;function _gt(e,t){let n=e.unionClippingRegions,i=e.length,o=ss.useFloatTexture(t),r=ss.getTextureResolution(e,t,Igt),s=r.x,a=r.y,c=o?Ggt(s,a):Vgt(s,a);return c+=`
`,c+=n?Zgt(i):Rgt(i),c}function Zgt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
    vec4 position = czm_windowToEyeCoordinates(fragCoord);
    vec3 clipNormal = vec3(0.0);
    vec3 clipPosition = vec3(0.0);
    float clipAmount;
    float pixelWidth = czm_metersPerPixel(position);
    bool breakAndDiscard = false;
    for (int i = 0; i < ${e}; ++i)
    {
        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
        clipNormal = clippingPlane.xyz;
        clipPosition = -clippingPlane.w * clipNormal;
        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
        if (amount <= 0.0)
        {
            breakAndDiscard = true;
            // HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6
            break;
         }
    }
    if (breakAndDiscard) {
        discard;
    }
    return clipAmount;
}
`}function Rgt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
    bool clipped = true;
    vec4 position = czm_windowToEyeCoordinates(fragCoord);
    vec3 clipNormal = vec3(0.0);
    vec3 clipPosition = vec3(0.0);
    float clipAmount = 0.0;
    float pixelWidth = czm_metersPerPixel(position);
    for (int i = 0; i < ${e}; ++i)
    {
        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
        clipNormal = clippingPlane.xyz;
        clipPosition = -clippingPlane.w * clipNormal;
        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
        clipAmount = max(amount, clipAmount);
        clipped = clipped && (amount <= 0.0);
    }
    if (clipped)
    {
        discard;
    }
    return clipAmount;
 }
`}function Ggt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
    int pixY = clippingPlaneNumber / ${e};
    int pixX = clippingPlaneNumber - (pixY * ${e});
    // Sample from center of pixel
    float u = (float(pixX) + 0.5) * ${o};
    float v = (float(pixY) + 0.5) * ${r};
    vec4 plane = texture(packedClippingPlanes, vec2(u, v));
    return czm_transformPlane(plane, transform);
}
`}function Vgt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
    int clippingPlaneStartIndex = clippingPlaneNumber * 2;
    int pixY = clippingPlaneStartIndex / ${e};
    int pixX = clippingPlaneStartIndex - (pixY * ${e});
    // Sample from center of pixel
    float u = (float(pixX) + 0.5) * ${o};
    float v = (float(pixY) + 0.5) * ${r};
    vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
    vec4 plane;
    plane.xyz = czm_octDecode(oct, 65535.0);
    plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v)));
    return czm_transformPlane(plane, transform);
}
`}var HE=_gt;function Lgt(e,t,n,i,o,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o,this.clippingPolygonShaderState=r}function lq(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function Wgt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case se.SCENE3D:o=t;break;case se.SCENE2D:case se.COLUMBUS_VIEW:o=n;break;case se.MORPHING:o=i;break}return o}function Fgt(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
    czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex);
  }`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
    }`}function Bgt(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
    return czm_unpackClippingExtents(extentsTexture, index);
  }`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
      return vec4();
    }`}function wgt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}lq.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,d=e.applyAlpha,u=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,f=e.showOceanWaves,b=e.enableLighting,C=e.dynamicAtmosphereLighting,E=e.dynamicAtmosphereLightingFromSun,T=e.showGroundAtmosphere,S=e.perFragmentGroundAtmosphere,_=e.hasVertexNormals,R=e.useWebMercatorProjection,L=e.enableFog,W=e.enableClippingPlanes,B=e.clippingPlanes,Y=e.enableClippingPolygons,N=e.clippingPolygons,A=e.clippedByBoundaries,I=e.hasImageryLayerCutout,Z=e.colorCorrect,G=e.highlightFillTile,w=e.colorToAlpha,X=e.hasGeodeticSurfaceNormals,v=e.hasExaggeration,U=e.showUndergroundColor,k=e.translucent,P=0,O="",ee=n.renderedMesh.encoding;ee.quantization===La.BITS12&&(P=1,O="QUANTIZATION_BITS12");let te=0,q="";A&&(te=1,q="TILE_LIMIT_RECTANGLE");let me=0,ye="";I&&(me=1,ye="APPLY_IMAGERY_CUTOUT");let oe=t.mode,xe=oe|o<<2|r<<3|s<<4|a<<5|c<<6|d<<7|p<<8|g<<9|f<<10|b<<11|C<<12|E<<13|T<<14|S<<15|_<<16|R<<17|L<<18|P<<19|h<<20|W<<21|Y<<22|te<<23|me<<24|Z<<25|G<<26|w<<27|X<<28|v<<29|U<<30|k<<31|u<<32,Ee=0;l(B)&&B.length>0&&(Ee=W?B.clippingPlanesState:0);let Le=0;l(N)&&N.length>0&&(Le=Y?N.clippingPolygonsState:0);let Se=n.surfaceShader;if(l(Se)&&Se.numberOfDayTextures===i&&Se.flags===xe&&Se.material===this.material&&Se.clippingShaderState===Ee&&Se.clippingPolygonShaderState===Le)return Se.shaderProgram;let Fe=this._shadersByTexturesFlags[i];if(l(Fe)||(Fe=this._shadersByTexturesFlags[i]=[]),Se=Fe[xe],!l(Se)||Se.material!==this.material||Se.clippingShaderState!==Ee||Se.clippingPolygonShaderState!==Le){let Ue=this.baseVertexShaderSource.clone(),De=this.baseFragmentShaderSource.clone();Ee!==0&&De.sources.unshift(HE(B,t.context)),Le!==0&&(De.sources.unshift(Fgt(t.context)),Ue.sources.unshift(Bgt(t.context))),Ue.defines.push(O),De.defines.push(`TEXTURE_UNITS ${i}`,q,ye),o&&De.defines.push("APPLY_BRIGHTNESS"),r&&De.defines.push("APPLY_CONTRAST"),s&&De.defines.push("APPLY_HUE"),a&&De.defines.push("APPLY_SATURATION"),c&&De.defines.push("APPLY_GAMMA"),d&&De.defines.push("APPLY_ALPHA"),u&&De.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&De.defines.push("HAS_WATER_MASK"),g&&(De.defines.push("SHOW_REFLECTIVE_OCEAN"),Ue.defines.push("SHOW_REFLECTIVE_OCEAN")),f&&De.defines.push("SHOW_OCEAN_WAVES"),w&&De.defines.push("APPLY_COLOR_TO_ALPHA"),U&&(Ue.defines.push("UNDERGROUND_COLOR"),De.defines.push("UNDERGROUND_COLOR")),k&&(Ue.defines.push("TRANSLUCENT"),De.defines.push("TRANSLUCENT")),b&&(_?(Ue.defines.push("ENABLE_VERTEX_LIGHTING"),De.defines.push("ENABLE_VERTEX_LIGHTING")):(Ue.defines.push("ENABLE_DAYNIGHT_SHADING"),De.defines.push("ENABLE_DAYNIGHT_SHADING"))),C&&(Ue.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),De.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),E&&(Ue.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),De.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(Ue.defines.push("GROUND_ATMOSPHERE"),De.defines.push("GROUND_ATMOSPHERE"),S&&(Ue.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),De.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Ue.defines.push("INCLUDE_WEB_MERCATOR_Y"),De.defines.push("INCLUDE_WEB_MERCATOR_Y"),L&&(Ue.defines.push("FOG"),De.defines.push("FOG")),h&&De.defines.push("APPLY_SPLIT"),W&&De.defines.push("ENABLE_CLIPPING_PLANES"),Y&&(De.defines.push("ENABLE_CLIPPING_POLYGONS"),Ue.defines.push("ENABLE_CLIPPING_POLYGONS"),N.inverse&&De.defines.push("CLIPPING_INVERSE"),De.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`),Ue.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`)),Z&&De.defines.push("COLOR_CORRECT"),G&&De.defines.push("HIGHLIGHT_FILL_TILE"),X&&Ue.defines.push("GEODETIC_SURFACE_NORMALS"),v&&Ue.defines.push("EXAGGERATION");let Je=`    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
    {
        vec4 color = initialColor;
`;I&&(Je+=`        vec4 cutoutAndColorResult;
        bool texelUnclipped;
`);for(let Oe=0;Oe<i;++Oe)I?Je+=`        cutoutAndColorResult = u_dayTextureCutoutRectangles[${Oe}];
        texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
        cutoutAndColorResult = sampleAndBlend(
`:Je+=`        color = sampleAndBlend(
`,Je+=`            color,
            u_dayTextures[${Oe}],
            u_dayTextureUseWebMercatorT[${Oe}] ? textureCoordinates.xz : textureCoordinates.xy,
            u_dayTextureTexCoordsRectangle[${Oe}],
            u_dayTextureTranslationAndScale[${Oe}],
            ${d?`u_dayTextureAlpha[${Oe}]`:"1.0"},
            ${u?`u_dayTextureNightAlpha[${Oe}]`:"1.0"},
            ${u?`u_dayTextureDayAlpha[${Oe}]`:"1.0"},
            ${o?`u_dayTextureBrightness[${Oe}]`:"0.0"},
            ${r?`u_dayTextureContrast[${Oe}]`:"0.0"},
            ${s?`u_dayTextureHue[${Oe}]`:"0.0"},
            ${a?`u_dayTextureSaturation[${Oe}]`:"0.0"},
            ${c?`u_dayTextureOneOverGamma[${Oe}]`:"0.0"},
            ${h?`u_dayTextureSplit[${Oe}]`:"0.0"},
            ${w?`u_colorsToAlpha[${Oe}]`:"vec4(0.0)"},
            nightBlend);
`,I&&(Je+=`        color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
`);Je+=`        return color;
    }`,De.sources.push(Je),Ue.sources.push(Wgt(oe)),Ue.sources.push(wgt(R));let St=cn.fromCache({context:t.context,vertexShaderSource:Ue,fragmentShaderSource:De,attributeLocations:ee.getAttributeLocations()});Se=Fe[xe]=new Lgt(i,xe,this.material,St,Ee,Le)}return n.surfaceShader=Se,Se.shaderProgram};lq.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return fe(this)};var lX=lq;var jOi=y(x(),1);var Z5i=y(x(),1);var e5i=y(x(),1),Ygt={START:0,LOADING:1,DONE:2,FAILED:3},Fa=Object.freeze(Ygt);var n5i=y(x(),1),Ngt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},Vo=Object.freeze(Ngt);function mr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ce(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Vo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ue,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(mr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===Vo.RECEIVING||e===Vo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==Hn.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});mr.prototype.pick=function(e,t,n,i,o){if(!l(this.renderedMesh))return;let r=this.renderedMesh.pick(e,i,t,n);return m.clone(r,o)};mr.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=Vo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};mr.prototype.freeVertexArray=function(){mr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,mr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};mr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new mr),e.state===Fa.START&&(Xgt(e,t,n),e.state=Fa.LOADING)};mr.processStateMachine=function(e,t,n,i,o,r,s){mr.initialize(e,n,i);let a=e.data;if(e.state===Fa.LOADING&&Pgt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let d=a.terrainState===Vo.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let u=a.processImagery(e,n,t);if(d&&u){let h=e._loadedCallbacks,p={};for(let g in h)h.hasOwnProperty(g)&&(h[g](e)||(p[g]=h[g]));e._loadedCallbacks=p,e.state=Fa.DONE}c&&(e.renderable=!0)};mr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,d,u;for(d=0,u=c.length;d<u;++d){let h=c[d];if(!l(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===Hn.PLACEHOLDER){let g=h.loadingImagery.imageryLayer;if(g.ready){h.freeResources(),c.splice(d,1),g._createTileImagerySkeletons(e,t,d),--d,u=c.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);a=a&&p,s=s||p||l(h.readyImagery),r=r&&l(h.loadingImagery)&&(h.loadingImagery.state===Hn.FAILED||h.loadingImagery.state===Hn.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function MEe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=ur.clone(s);c.hasGeodeticSurfaceNormals=t,c=ur.clone(c);let d=c.stride,u=new Float32Array(a*d);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=d,o!==e.mesh?(mr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=mr._createVertexArrayForMesh(i.context,o)):(mr._freeVertexArray(e.vertexArray),e.vertexArray=mr._createVertexArrayForMesh(i.context,o)),mr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}mr.prototype.addGeodeticSurfaceNormals=function(e,t){MEe(this,!0,e,t)};mr.prototype.removeGeodeticSurfaceNormals=function(e){MEe(this,!1,void 0,e)};mr.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,d=c.exaggeration!==r,u=c.exaggerationRelativeHeight!==s;if(d||u){if(d)if(a&&!c.hasGeodeticSurfaceNormals){let p=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(p,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let p=e.customData;for(let g of p)g.level=-1}o.updateExaggeration(r,s)}};mr.prototype.updateSceneMode=function(e){let n=this.renderedMesh;n!==void 0&&n.updateSceneMode(e)};function Xgt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=Vo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Pgt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===Vo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||mr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===Vo.FAILED&&Mgt(s,e,t,n,e.x,e.y,e.level),s.terrainState===Vo.UNLOADED&&Ugt(s,n,e.x,e.y,e.level),s.terrainState===Vo.RECEIVED&&vgt(s,t,n,e.x,e.y,e.level),s.terrainState===Vo.TRANSFORMED&&(kgt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=Vo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Ogt(t.context,s);else{let d=s._findAncestorTileWithTerrainData(e);l(d)&&l(d.data.waterMaskTexture)&&(s.waterMaskTexture=d.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,d,s.waterMaskTranslationAndScale))}}function Mgt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=Fa.FAILED;return}let c=a.data.terrainData,d=a.x,u=a.y,h=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,d,u,h,o,r,s);l(p)&&(e.terrainState=Vo.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=Vo.RECEIVED)}).catch(function(){e.terrainState=Vo.FAILED}))}function Ugt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=Vo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=Vo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===pi.CANCELLED){e.terrainData=void 0,e.terrainState=Vo.UNLOADED,e.request=void 0;return}e.terrainState=Vo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Ko.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new pr({throttle:!1,throttleByServer:!0,type:Ys.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=Vo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=Vo.UNLOADED,e.request=void 0)}a()}var Dgt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function vgt(e,t,n,i,o,r){let s=n.tilingScheme,a=Dgt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);l(d)&&(e.terrainState=Vo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=Vo.TRANSFORMED}).catch(function(){e.terrainState=Vo.FAILED}))}mr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=mt.createVertexBuffer({context:e,typedArray:n,usage:Xe.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=mt.createIndexBuffer({context:e,typedArray:a,usage:Xe.STATIC_DRAW,indexDatatype:Pe.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new si({context:e,attributes:o,indexBuffer:s})};mr._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function kgt(e,t,n,i,o,r,s){e.vertexArray=mr._createVertexArrayForMesh(t,e.mesh),e.terrainState=Vo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Qgt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Wt.create({context:e,pixelFormat:je.LUMINANCE,pixelDatatype:ve.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Ht({wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:zt.LINEAR,magnificationFilter:ui.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Ogt(e,t){let n=t.terrainData.waterMask,i=Qgt(e),o,r=n.length;if(n instanceof ImageBitmap)o=Wt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Wt.create({context:e,pixelFormat:je.LUMINANCE,pixelDatatype:ve.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ce.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}mr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};mr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var Om=mr;var j5i=y(x(),1);var G5i=y(x(),1),UEe={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>=UEe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},ci=UEe;function xZ(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 ce}xZ.prototype.update=function(e,t,n){this.changedThisFrame&&(HEe(e,t,this.tile,n),this.changedThisFrame=!1)};xZ.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};xZ.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Om._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var zgt=new y0;xZ.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=zgt;a.clear();for(let d=0;d<t.length;++d){let u=t[d];l(u.data.vertexArray)&&a.enqueue(t[d])}let c=a.dequeue();for(;c!==void 0;){let d=c.findTileToWest(r),u=c.findTileToSouth(r),h=c.findTileToEast(r),p=c.findTileToNorth(r);ha(e,n,c,d,s,Sn.EAST,!1,a,i),ha(e,n,c,u,s,Sn.NORTH,!1,a,i),ha(e,n,c,h,s,Sn.WEST,!1,a,i),ha(e,n,c,p,s,Sn.SOUTH,!1,a,i);let g=d.findTileToNorth(r),f=d.findTileToSouth(r),b=h.findTileToNorth(r),C=h.findTileToSouth(r);ha(e,n,c,g,s,Sn.SOUTHEAST,!1,a,i),ha(e,n,c,b,s,Sn.SOUTHWEST,!1,a,i),ha(e,n,c,f,s,Sn.NORTHEAST,!1,a,i),ha(e,n,c,C,s,Sn.NORTHWEST,!1,a,i),c=a.dequeue()}};function ha(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||ci.wasKicked(d._lastSelectionResult)||ci.originalResult(d._lastSelectionResult)===ci.CULLED);){if(s)return;let u=d.parent;if(r>=Sn.NORTHWEST&&u!==void 0)switch(r){case Sn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case Sn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case Sn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case Sn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===ci.RENDERED){if(l(d.data.vertexArray))return;Hgt(e,t,n,d,r,o,a,c);return}if(ci.originalResult(i._lastSelectionResult)!==ci.CULLED)switch(r){case Sn.WEST:ha(e,t,n,i.northwestChild,o,r,!0,a,c),ha(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Sn.EAST:ha(e,t,n,i.southeastChild,o,r,!0,a,c),ha(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Sn.SOUTH:ha(e,t,n,i.southwestChild,o,r,!0,a,c),ha(e,t,n,i.southeastChild,o,r,!0,a,c);break;case Sn.NORTH:ha(e,t,n,i.northeastChild,o,r,!0,a,c),ha(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Sn.NORTHWEST:ha(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Sn.NORTHEAST:ha(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Sn.SOUTHWEST:ha(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Sn.SOUTHEAST:ha(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new Ae("Invalid edge")}}}function Hgt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new xZ(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Kgt(e,t,n,i,o,a)}function Kgt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(HEe(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case Sn.WEST:d=s.westMeshes,u=s.westTiles;break;case Sn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case Sn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case Sn.NORTH:d=s.northMeshes,u=s.northTiles;break;case Sn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case Sn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case Sn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case Sn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let h,p,g,f,b=n.rectangle,C,E=i.rectangle;switch(o){case Sn.WEST:for(C=(E.north-E.south)*V.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!V.greaterThan(b.north,f.south,C));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!V.greaterThanOrEquals(b.south,f.north,C));++p);break;case Sn.SOUTH:for(C=(E.east-E.west)*V.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!V.lessThan(b.west,f.east,C));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!V.lessThanOrEquals(b.east,f.west,C));++p);break;case Sn.EAST:for(C=(E.north-E.south)*V.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!V.lessThan(b.south,f.north,C));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!V.lessThanOrEquals(b.north,f.south,C));++p);break;case Sn.NORTH:for(C=(E.east-E.west)*V.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!V.greaterThan(b.east,f.west,C));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!V.greaterThanOrEquals(b.west,f.east,C));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||d[h]!==a,d[h]=a,u[h]=n):(s.changedThisFrame=!0,d.splice(h,p-h,a),u.splice(h,p-h,n))}var KE=new pe,Jgt=new pe,yZ=new m,hq=new m,dq=new M,uq=new M,Wu=new M;function T5(){this.height=0,this.encodedNormal=new M}function g5(e,t,n,i,o,r,s,a,c){if(l(o))return o;let d;if(l(r)&&l(s))d=(r.height+s.height)*.5;else if(l(r))d=r.height;else if(l(s))d=s.height;else if(l(a))d=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,g=0;l(h)&&(p=h.minimumHeight,g=h.maximumHeight),d=(p+g)*.5}return KEe(e,t,n,i,d,c),c}var jgt={minimumHeight:0,maximumHeight:0},qgt=new m,DEe=new T5,vEe=new T5,kEe=new T5,QEe=new T5,$gt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,ebt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function HEe(e,t,n,i){Om.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,h=y5(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,kEe),p=y5(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,DEe),g=y5(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,vEe),f=y5(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,QEe);h=g5(r,u,0,1,h,p,f,g,kEe),p=g5(r,u,0,0,p,h,g,f,DEe),g=g5(r,u,1,1,g,p,f,h,vEe),f=g5(r,u,1,1,f,g,h,p,QEe);let b=p.height,C=g.height,E=h.height,T=f.height,S=Math.min(b,C,E,T),_=Math.max(b,C,E,T),R=(S+_)*.5,L,W,B=e.getLevelMaximumGeometricError(n.level),Y=u.maximumRadius-B,N=Math.acos(Y/u.maximumRadius)*4;if(N*=1.5,s.width>N&&_-S<=B){let Z=new Sc({width:9,height:9,buffer:$gt,structure:{heightOffset:_}}),G=ebt;G.tilingScheme=n.tilingScheme,G.x=n.x,G.y=n.y,G.level=n.level,G.exaggeration=a,G.exaggerationRelativeHeight=c,r.mesh=Z._createMeshSync(G)}else{let Z=d,G=de.center(s,Jgt);G.height=R;let w=u.cartographicToCartesian(G,qgt),X=new ur(w,void 0,void 0,void 0,void 0,!0,!0,Z,a,c),v=5,U;for(U=r.westMeshes,L=0,W=U.length;L<W;++L)v+=U[L].eastIndicesNorthToSouth.length;for(U=r.southMeshes,L=0,W=U.length;L<W;++L)v+=U[L].northIndicesWestToEast.length;for(U=r.eastMeshes,L=0,W=U.length;L<W;++L)v+=U[L].westIndicesSouthToNorth.length;for(U=r.northMeshes,L=0,W=U.length;L<W;++L)v+=U[L].southIndicesEastToWest.length;let k=jgt;k.minimumHeight=S,k.maximumHeight=_;let P=X.stride,O=new Float32Array(v*P),H=0,ee=H;H=b5(u,s,X,O,H,0,1,h.height,h.encodedNormal,1,k),H=C5(r,u,X,O,H,r.westTiles,r.westMeshes,Sn.EAST,k);let z=H;H=b5(u,s,X,O,H,0,0,p.height,p.encodedNormal,0,k),H=C5(r,u,X,O,H,r.southTiles,r.southMeshes,Sn.NORTH,k);let te=H;H=b5(u,s,X,O,H,1,0,g.height,g.encodedNormal,0,k),H=C5(r,u,X,O,H,r.eastTiles,r.eastMeshes,Sn.WEST,k);let q=H;H=b5(u,s,X,O,H,1,1,f.height,f.encodedNormal,1,k),H=C5(r,u,X,O,H,r.northTiles,r.northMeshes,Sn.SOUTH,k),S=k.minimumHeight,_=k.maximumHeight;let me=tn.fromRectangle(s,S,_,n.tilingScheme.ellipsoid),ye=hi.geodeticLatitudeToMercatorAngle(s.south),oe=1/(hi.geodeticLatitudeToMercatorAngle(s.north)-ye),xe=(hi.geodeticLatitudeToMercatorAngle(G.latitude)-ye)*oe,Ee=u.geodeticSurfaceNormalCartographic(KE,hq),Le=_n.octEncode(Ee,dq),Se=H;X.encode(O,H*P,me.center,M.fromElements(.5,.5,Wu),R,Le,xe,Ee),++H;let Fe=H,Ue=Fe<256?1:2,De=(Fe-1)*3,Je=De*Ue,St=(O.length-Fe*P)*Float32Array.BYTES_PER_ELEMENT,Oe;if(St>=Je){let ut=Fe*P*Float32Array.BYTES_PER_ELEMENT;Oe=Fe<256?new Uint8Array(O.buffer,ut,De):new Uint16Array(O.buffer,ut,De)}else Oe=Fe<256?new Uint8Array(De):new Uint16Array(De);O=new Float32Array(O.buffer,0,Fe*P);let it=0;for(L=0;L<Fe-2;++L)Oe[it++]=Se,Oe[it++]=L,Oe[it++]=L+1;Oe[it++]=Se,Oe[it++]=L,Oe[it++]=0;let yt=[];for(L=z;L>=ee;--L)yt.push(L);let Ot=[];for(L=te;L>=z;--L)Ot.push(L);let Mn=[];for(L=q;L>=te;--L)Mn.push(L);let sn=[];for(sn.push(0),L=Se-1;L>=q;--L)sn.push(L);r.mesh=new oc(X.center,O,Oe,De,Fe,S,_,s,ue.fromOrientedBoundingBox(me),abt(e,me.center,s,S,_),X.stride,me,X,yt,Ot,Mn,sn)}let A=t.context;r._destroyVertexArray(i),r.vertexArray=Om._createVertexArrayForMesh(A,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let I=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let Z=o._findAncestorTileWithTerrainData(n);l(Z)&&l(Z.data.waterMaskTexture)&&(r.waterMaskTexture=Z.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,Z,r.waterMaskTranslationAndScale))}l(I)&&(--I.referenceCount,I.referenceCount===0&&I.destroy())}function b5(e,t,n,i,o,r,s,a,c,d,u){let h=KE;h.longitude=V.lerp(t.west,t.east,r),h.latitude=V.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,yZ),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,hq));let f=uq;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,g),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var E5=new de;function dX(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=de.clone(e.rectangle,E5),o.west-=V.TWO_PI,o.east-=V.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=de.clone(e.rectangle,E5),o.west+=V.TWO_PI,o.east+=V.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,h=(r.north-o.south)/d,p=(n.x-a)/(c-a),g=(n.y-u)/(h-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var tbt=new M;function mq(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var nbt=new M,ibt=new m;function obt(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,h=i.vertices,p=dX(t,n,u.decodeTextureCoordinates(h,o,Wu),Wu),g=dX(t,n,u.decodeTextureCoordinates(h,r,uq),uq),f;c?f=(s-p.x)/(g.x-p.x):f=(a-p.y)/(g.y-p.y);let b=u.decodeHeight(h,o),C=u.decodeHeight(h,r),E=n.rectangle;KE.longitude=V.lerp(E.west,E.east,s),KE.latitude=V.lerp(E.south,E.north,a),d.height=KE.height=V.lerp(b,C,f);let T;if(u.hasVertexNormals){let S=u.getOctEncodedNormal(h,o,tbt),_=u.getOctEncodedNormal(h,r,nbt),R=_n.octDecode(S.x,S.y,yZ),L=_n.octDecode(_.x,_.y,ibt);T=m.lerp(R,L,f,yZ),m.normalize(T,T),_n.octEncode(T,d.encodedNormal)}else T=e.geodeticSurfaceNormalCartographic(KE,yZ),_n.octEncode(T,d.encodedNormal)}function KEe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(KE,yZ);_n.octEncode(s,r.encodedNormal)}function y5(e,t,n,i,o,r,s,a,c,d,u){if(zEe(e,t,a,s,!1,n,i,u)||zEe(e,t,d,c,!0,n,i,u))return u;let p;if(fq(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],mq(r,p,n,i,u),u;let g;if(n===0?i===0?g=x5(e.westMeshes,e.westTiles,Sn.EAST,e.southMeshes,e.southTiles,Sn.NORTH,n,i):g=x5(e.northMeshes,e.northTiles,Sn.SOUTH,e.westMeshes,e.westTiles,Sn.EAST,n,i):i===0?g=x5(e.southMeshes,e.southTiles,Sn.NORTH,e.eastMeshes,e.eastTiles,Sn.WEST,n,i):g=x5(e.eastMeshes,e.eastTiles,Sn.WEST,e.northMeshes,e.northTiles,Sn.SOUTH,n,i),l(g))return KEe(e,t,n,i,g,u),u}function x5(e,t,n,i,o,r,s,a){let c=OEe(e,t,!1,n,s,a),d=OEe(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function C5(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=rbt(e,t,n,i,o,r[d],s[d],a,c);return o}function rbt(e,t,n,i,o,r,s,a,c){let d=r.rectangle;a===Sn.EAST&&e.tile.x===0?(d=de.clone(r.rectangle,E5),d.west-=V.TWO_PI,d.east-=V.TWO_PI):a===Sn.WEST&&r.x===0&&(d=de.clone(r.rectangle,E5),d.west+=V.TWO_PI,d.east+=V.TWO_PI);let u=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Wu),h=Wu.x,p=Wu.y);let g,f;switch(a){case Sn.WEST:g=s.westIndicesSouthToNorth,f=!1;break;case Sn.NORTH:g=s.northIndicesWestToEast,f=!0;break;case Sn.EAST:g=s.eastIndicesNorthToSouth,f=!1;break;case Sn.SOUTH:g=s.southIndicesEastToWest,f=!0;break}let b=r,C=e.tile,E=s.encoding,T=s.vertices,S=n.stride,_,R;E.hasWebMercatorT&&(_=hi.geodeticLatitudeToMercatorAngle(u.south),R=1/(hi.geodeticLatitudeToMercatorAngle(u.north)-_));for(let L=0;L<g.length;++L){let W=g[L],B=E.decodeTextureCoordinates(T,W,Wu);dX(b,C,B,B);let Y=B.x,N=B.y,A=f?Y:N;if(A<0||A>1||Math.abs(Y-h)<V.EPSILON5&&Math.abs(N-p)<V.EPSILON5)continue;let I=Math.abs(Y)<V.EPSILON5||Math.abs(Y-1)<V.EPSILON5,Z=Math.abs(N)<V.EPSILON5||Math.abs(N-1)<V.EPSILON5;if(I&&Z)continue;let G=E.decodePosition(T,W,yZ),w=E.decodeHeight(T,W),X;E.hasVertexNormals?X=E.getOctEncodedNormal(T,W,dq):(X=dq,X.x=0,X.y=0);let v=N;if(E.hasWebMercatorT){let k=V.lerp(u.south,u.north,N);v=(hi.geodeticLatitudeToMercatorAngle(k)-_)*R}let U;n.hasGeodeticSurfaceNormals&&(U=t.geodeticSurfaceNormal(G,hq)),n.encode(i,o*S,G,B,w,X,v,U),c.minimumHeight=Math.min(c.minimumHeight,w),c.maximumHeight=Math.max(c.maximumHeight,w),++o}return o}function OEe(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let d=s;d!==a;d+=c){let u=e[d],h=t[d];if(!fq(h,u))continue;let p;switch(i){case Sn.WEST:p=u.westIndicesSouthToNorth;break;case Sn.SOUTH:p=u.southIndicesEastToWest;break;case Sn.EAST:p=u.eastIndicesNorthToSouth;break;case Sn.NORTH:p=u.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return u.encoding.decodeHeight(u.vertices,g)}}function fq(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function zEe(e,t,n,i,o,r,s,a){let c,d,u,h,p,g=i[o?0:n.length-1],f=n[o?0:n.length-1];if(fq(g,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,d=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,d=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,d=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,d=o,u=!o),c.length>0)){h=o?0:c.length-1,p=c[h],f.encoding.decodeTextureCoordinates(f.vertices,p,Wu);let b=dX(g,e.tile,Wu,Wu);if(b.x===r&&b.y===s)return mq(f,p,r,s,a),!0;if(h=bo(c,d?r:s,function(C,E){f.encoding.decodeTextureCoordinates(f.vertices,C,Wu);let T=dX(g,e.tile,Wu,Wu);return u?d?T.x-r:T.y-s:d?r-T.x:s-T.y}),h<0){if(h=~h,h>0&&h<c.length)return obt(t,g,e.tile,f,c[h-1],c[h],r,s,d,a),!0}else return mq(f,c[h],r,s,a),!0}return!1}var sbt=[new m,new m,new m,new m];function abt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=sbt;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var CZ=xZ;function Zr(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Rn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new Ce,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(Zr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(Zr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(Zr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(Zr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new Ce,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new D(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=de.clone(de.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=se.SCENE3D}Object.defineProperties(Zr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=ce.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Wh.setOwner(e,this,"_clippingPolygons")}}});function cbt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}Zr.prototype.update=function(e){this._imageryLayers._update()};function lbt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}Zr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(cbt)})),lbt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)Om._freeVertexArray(t[i]);t.length=0};Zr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};Zr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=ke.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ka.LESS}}),this._blendRenderState=ke.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL},blending:fn.ALPHA_BLEND});let a=Qe(this._renderState,!0);a.cull.enabled=!1,this._disableCullingRenderState=ke.fromCache(a),a=Qe(this._blendRenderState,!0),a.cull.enabled=!1,this._disableCullingBlendRenderState=ke.fromCache(a)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&CZ.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(a){a.data.updateExaggeration(a,e,t)});let r=this._oldSceneMode!==e.mode;this._oldSceneMode=e.mode,r&&t.forEachLoadedTile(function(a){a.data.updateSceneMode(e.mode)});let s=this._tilesToRenderByTextureCount;for(let a=0,c=s.length;a<c;++a){let d=s[a];if(l(d))for(let u=0,h=d.length;u<h;++u){let p=d[u],g=p.data.tileBoundingRegion;Fbt(this,p,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,g.minimumHeight)}}};function eTe(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}Zr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)eTe(t[n],e)};Zr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};Zr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};Zr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===ci.CULLED_BUT_NEEDED,o=n.terrainState),Om.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==Dr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,Om.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var dbt=new ue,tTe=new de,ubt=new de,mbt=new pe;function I5(e,t){if(t.west<t.east)return t;let n=de.clone(t,ubt);return de.center(e,mbt).longitude>0?n.east=V.PI:n.west=-V.PI,n}function nTe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!de.equals(e.cartographicLimitRectangle,de.MAX_VALUE))}Zr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=nTe(this,t);if(t.fog.enabled&&!o&&V.fog(i,t.fog.density)>=1)return Dr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return Dr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let d=I5(e.rectangle,this.cartographicLimitRectangle),u=de.simpleIntersection(d,e.rectangle,tTe);if(!l(u))return Dr.NONE;if(de.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==se.SCENE3D&&(c=dbt,ue.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===se.MORPHING&&l(r.renderedMesh)&&(c=ue.union(s.boundingSphere,c,c))),!l(c))return Dr.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let C=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=C!==Jt.INSIDE,C===Jt.OUTSIDE)return Dr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let C=p.computeIntersectionWithBoundingVolume(s);e.isClipped=C!==Jt.OUTSIDE}let g,f=a.computeVisibility(c);if(f===Jt.OUTSIDE?g=Dr.NONE:f===Jt.INTERSECTING?g=Dr.PARTIAL:f===Jt.INSIDE&&(g=Dr.FULL),g===Dr.NONE)return g;let b=t.mode===se.SCENE3D&&t.camera.frustum instanceof hn;if(t.mode===se.SCENE3D&&!b&&l(n)&&!o){let C=r.occludeePointInScaledSpace;return!l(C)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(C,s.minimumHeight)?g:Dr.NONE}return g};Zr.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var hbt=[],fbt=[];Zr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=hbt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===Vo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let h=s[a],p=h.loadingImagery,g=!l(p)||p.state===Hn.FAILED||p.state===Hn.INVALID,f=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[f]=g&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=fbt;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let h=u.pop(),p=h._lastSelectionResultFrame===d?h._lastSelectionResult:ci.NONE;if(p===ci.RENDERED){let g=h.data;if(!l(g))continue;if(!o&&h.data.terrainState===Vo.READY)return!1;let f=h.data.imagery;for(a=0,c=f.length;a<c;++a){let b=f[a],C=b.loadingImagery,E=!l(C)||C.state===Hn.FAILED||C.state===Hn.INVALID,T=(b.loadingImagery||b.readyImagery).imageryLayer._layerIndex;if(E&&!i[T])return!1}}else p===ci.REFINED&&u.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var pbt=new m;Zr.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=m.subtract(i.center,o,pbt),a=m.magnitude(s);return a<V.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,r))*e._distance)};var JEe=new F,S5=new F,Abt=new ce,gbt=new ce,bbt=new ce,ybt=new m,jEe=new m,xbt=new m,Cbt=new m;Zr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let d=i[a];l(d.readyImagery)&&d.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Ebt=[new m,new m,new m,new m];function qEe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Ebt;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}Zr.prototype.computeDistanceToTile=function(e,t){Tbt(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,d=Math.abs(c-r),u=Math.abs(c-s);d>u?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function Tbt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Om);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new lu({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,d=e,u=i.mesh,h=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,c=!0;else if(h!==void 0&&h._minimumHeight!==void 0&&h._maximumHeight!==void 0)r.minimumHeight=h._minimumHeight,r.maximumHeight=h._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let f=g.mesh,b=g.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(b!==void 0&&b._minimumHeight!==void 0&&b._maximumHeight!==void 0){r.minimumHeight=b._minimumHeight,r.maximumHeight=b._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Eo.getHeight(r.minimumHeight,p,g),r.maximumHeight=Eo.getHeight(r.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=tn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ue.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=m.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=qEe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let b=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||b)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=qEe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}Zr.prototype.isDestroyed=function(){return!1};Zr.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),fe(this)};function Sbt(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,d;for(d=0;d<c;++d)if(o=a[d],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}Zr.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,d=c.length,u=-1,h=0;for(a=0;a<d;++a){let g=c[a];if((g.readyImagery??g.loadingImagery).imageryLayer===e)u===-1&&(u=a),++h;else if(u!==-1)break}if(u===-1)return;let p=u+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Sbt(h,e,n),s.state=Fa.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=Fa.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==ci.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};Zr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],d=c.loadingImagery;if(l(d)||(d=c.readyImagery),d.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};Zr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};Zr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Ibt=new F,_bt=new F;function $Ee(e,t){let n={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_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=F.multiplyByPoint(i,this.properties.rtc,jEe);return F.setTranslation(i,o,JEe),JEe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,jEe);return F.setTranslation(i,r,S5),F.multiply(o,S5,S5),S5},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,Ibt):F.IDENTITY;return F.inverseTranspose(o,_bt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new ce(0,0,.5,1),fillHighlightColor:new D(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new M(65e5,9e6),nightFadeDistance:new M(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,center3D:void 0,rtc:new m,modifiedModelView:new F,tileRectangle:new ce,verticalExaggerationAndRelativeHeight:new M(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new M,southMercatorYAndOneOverHeight:new M,waterMask:void 0,waterMaskTranslationAndScale:new ce,minMaxHeight:new M,scaleAndBias:new F,clippingPlanesEdgeColor:D.clone(D.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ce,frontFaceAlphaByDistance:new ce,backFaceAlphaByDistance:new ce,localizedTranslucencyRectangle:new ce,undergroundColor:D.clone(D.TRANSPARENT),undergroundColorAlphaByDistance:new ce,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?Rt(n,t.materialUniformMap):n}function Zbt(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Rbt(e,r,o),i.wireframeVertexArray.mesh=o}}function Rbt(e,t,n){let o={indices:n.indices,primitiveType:Be.TRIANGLES};Dn.toWireframe(o);let r=o.indices,s=mt.createIndexBuffer({context:e,typedArray:r,usage:Xe.STATIC_DRAW,indexDatatype:Pe.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new si({context:e,attributes:t._attributes,indexBuffer:s})}var iTe,oTe,_5;(function(){let e=new Bt({geometry:gh.fromDimensions({dimensions:new m(2,2,2)})}),t=new Bt({geometry:new Zg({radius:1})}),n=new F,i,o;function r(s){return new Nn({geometryInstances:s,appearance:new pn({translucent:!1,flat:!0}),asynchronous:!1})}iTe=function(s,a){return s===i||(_5(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=qt.fromColor(a),o=r(e)),o},oTe=function(s,a){return s===i||(_5(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=qt.fromColor(a),o=r(t)),o},_5=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Gbt=new ce(0,0,0,0),Vbt={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Lbt=D.TRANSPARENT,Wbt=new kt;function Fbt(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new CZ(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let ut=r.credits;for(let Nt=0,In=ut.length;Nt<In;++Nt)o.addCreditToNextFrame(ut[Nt])}let s=Yt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,h=u.translucent,p=u.frontFaceAlphaByDistance,g=u.backFaceAlphaByDistance,f=u.rectangle,b=e.undergroundColor??Lbt,C=e.undergroundColorAlphaByDistance??Wbt,E=nTe(e,n)&&n.mode===se.SCENE3D&&b.alpha>0&&(C.nearValue>0||C.farValue>0),T=e.lambertDiffuseMultiplier,S=e.vertexShadowDarkness,_=e.hasWaterMask&&l(a),R=_&&e.showWaterEffect,L=e.oceanNormalMap,W=R&&l(L),B=e.terrainProvider,Y=l(B)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!d,A=e.showGroundAtmosphere&&n.mode===se.SCENE3D,I=Rn.castShadows(e.shadows)&&!h,Z=Rn.receiveShadows(e.shadows)&&!h,G=e.hueShift,w=e.saturationShift,X=e.brightnessShift,v=!(V.equalsEpsilon(G,0,V.EPSILON7)&&V.equalsEpsilon(w,0,V.EPSILON7)&&V.equalsEpsilon(X,0,V.EPSILON7)),U=!1;if(A){let ut=m.magnitude(n.camera.positionWC),Nt=e.nightFadeOutDistance;U=ut>Nt}_&&--s,W&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=u.numberOfTextureUniforms;let k=i.renderedMesh,P=k.center,O=k.encoding,H=i.tileBoundingRegion,ee=n.verticalExaggeration,z=n.verticalExaggerationRelativeHeight,te=ee!==1,q=O.hasGeodeticSurfaceNormals,me=Abt,ye=0,oe=0,xe=0,Ee=0,Le=!1;if(n.mode!==se.SCENE3D){let ut=n.mapProjection,Nt=ut.project(de.southwest(t.rectangle),xbt),In=ut.project(de.northeast(t.rectangle),Cbt);if(me.x=Nt.x,me.y=Nt.y,me.z=In.x,me.w=In.y,n.mode!==se.MORPHING&&(P=ybt,P.x=0,P.y=(me.z+me.x)*.5,P.z=(me.w+me.y)*.5,me.x-=P.y,me.y-=P.z,me.z-=P.y,me.w-=P.z),n.mode===se.SCENE2D&&O.quantization===La.BITS12){let lt=1/(Math.pow(2,12)-1)*.5,fi=(me.z-me.x)*lt,ao=(me.w-me.y)*lt;me.x-=fi,me.y-=ao,me.z+=fi,me.w+=ao}ut instanceof hi&&(ye=t.rectangle.south,oe=t.rectangle.north,xe=hi.geodeticLatitudeToMercatorAngle(ye),Ee=1/(hi.geodeticLatitudeToMercatorAngle(oe)-xe),Le=!0)}let Se=Vbt;Se.frameState=n,Se.surfaceTile=i,Se.hasWaterMask=_,Se.showReflectiveOcean=R,Se.showOceanWaves=W,Se.enableLighting=e.enableLighting,Se.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Se.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Se.showGroundAtmosphere=A,Se.atmosphereLightIntensity=e.atmosphereLightIntensity,Se.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Se.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Se.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Se.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Se.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Se.perFragmentGroundAtmosphere=U,Se.hasVertexNormals=Y,Se.useWebMercatorProjection=Le,Se.clippedByBoundaries=i.clippedByBoundaries,Se.hasGeodeticSurfaceNormals=q,Se.hasExaggeration=te;let Fe=i.imagery,Ue=0,De=Fe.length,Je=e.showSkirts&&!d&&!h,St=e.backFaceCulling&&!d&&!h,Oe=St?e._renderState:e._disableCullingRenderState,it=St?e._blendRenderState:e._disableCullingBlendRenderState,yt=Oe,Ot=e._firstPassInitialColor,Mn=n.context;if(l(e._debug.boundingSphereTile)||_5(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let ut=e._drawCommands.length;for(let Nt=0;Nt<ut;++Nt)e._uniformMaps[Nt]=$Ee(n,e)}do{let ut=0,Nt,In;if(e._drawCommands.length<=e._usedDrawCommands?(Nt=new nt,Nt.owner=t,Nt.cull=!1,Nt.boundingVolume=new ue,Nt.orientedBoundingBox=void 0,In=$Ee(n,e),e._drawCommands.push(Nt),e._uniformMaps.push(In)):(Nt=e._drawCommands[e._usedDrawCommands],In=e._uniformMaps[e._usedDrawCommands]),Nt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let ws=H.boundingVolume,Xa=H.boundingSphere;l(ws)?iTe(ws,D.RED).update(n):l(Xa)&&oTe(Xa,D.RED).update(n)}let lt=In.properties;ce.clone(Ot,lt.initialColor),lt.oceanNormalMap=L,lt.lightingFadeDistance.x=e.lightingFadeOutDistance,lt.lightingFadeDistance.y=e.lightingFadeInDistance,lt.nightFadeDistance.x=e.nightFadeOutDistance,lt.nightFadeDistance.y=e.nightFadeInDistance,lt.atmosphereLightIntensity=e.atmosphereLightIntensity,lt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,lt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,lt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,lt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,lt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,lt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let fi=d?g:p,ao=d?p:g;l(fi)&&(ce.fromElements(fi.near,fi.nearValue,fi.far,fi.farValue,lt.frontFaceAlphaByDistance),ce.fromElements(ao.near,ao.nearValue,ao.far,ao.farValue,lt.backFaceAlphaByDistance)),ce.fromElements(C.near,C.nearValue,C.far,C.farValue,lt.undergroundColorAlphaByDistance),D.clone(b,lt.undergroundColor),lt.lambertDiffuseMultiplier=T,lt.vertexShadowDarkness=S;let po=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;po&&D.clone(e.fillHighlightColor,lt.fillHighlightColor),lt.verticalExaggerationAndRelativeHeight.x=ee,lt.verticalExaggerationAndRelativeHeight.y=z,lt.center3D=k.center,m.clone(P,lt.rtc),ce.clone(me,lt.tileRectangle),lt.southAndNorthLatitude.x=ye,lt.southAndNorthLatitude.y=oe,lt.southMercatorYAndOneOverHeight.x=xe,lt.southMercatorYAndOneOverHeight.y=Ee;let ri=gbt,co=I5(t.rectangle,e.cartographicLimitRectangle),lo=bbt,Di=I5(t.rectangle,f);m.fromElements(G,w,X,lt.hsbShift);let Wi=t.rectangle,Qn=1/Wi.width,uo=1/Wi.height;ri.x=(co.west-Wi.west)*Qn,ri.y=(co.south-Wi.south)*uo,ri.z=(co.east-Wi.west)*Qn,ri.w=(co.north-Wi.south)*uo,ce.clone(ri,lt.localizedCartographicLimitRectangle),lo.x=(Di.west-Wi.west)*Qn,lo.y=(Di.south-Wi.south)*uo,lo.z=(Di.east-Wi.west)*Qn,lo.w=(Di.north-Wi.south)*uo,ce.clone(lo,lt.localizedTranslucencyRectangle);let vo=N&&V.fog(t._distance,n.fog.density)>V.EPSILON3;v=v&&(vo||A);let hr=!1,Vr=!1,qs=!1,xs=!1,Na=!1,Ao=!1,Vn=!1,Qo=!1,Oo=!1,$s=!1;for(;ut<s&&Ue<De;){let ws=Fe[Ue],Xa=ws.readyImagery;if(++Ue,!l(Xa)||Xa.imageryLayer.alpha===0)continue;let Yf=ws.useWebMercatorT?Xa.textureWebMercator:Xa.texture,Fo=Xa.imageryLayer;l(ws.textureTranslationAndScale)||(ws.textureTranslationAndScale=Fo._calculateTextureTranslationAndScale(t,ws)),lt.dayTextures[ut]=Yf,lt.dayTextureTranslationAndScale[ut]=ws.textureTranslationAndScale,lt.dayTextureTexCoordsRectangle[ut]=ws.textureCoordinateRectangle,lt.dayTextureUseWebMercatorT[ut]=ws.useWebMercatorT,lt.dayTextureAlpha[ut]=Fo.alpha,Ao=Ao||lt.dayTextureAlpha[ut]!==1,lt.dayTextureNightAlpha[ut]=Fo.nightAlpha,Vn=Vn||lt.dayTextureNightAlpha[ut]!==1,lt.dayTextureDayAlpha[ut]=Fo.dayAlpha,Vn=Vn||lt.dayTextureDayAlpha[ut]!==1,lt.dayTextureBrightness[ut]=Fo.brightness,hr=hr||lt.dayTextureBrightness[ut]!==ds.DEFAULT_BRIGHTNESS,lt.dayTextureContrast[ut]=Fo.contrast,Vr=Vr||lt.dayTextureContrast[ut]!==ds.DEFAULT_CONTRAST,lt.dayTextureHue[ut]=Fo.hue,qs=qs||lt.dayTextureHue[ut]!==ds.DEFAULT_HUE,lt.dayTextureSaturation[ut]=Fo.saturation,xs=xs||lt.dayTextureSaturation[ut]!==ds.DEFAULT_SATURATION,lt.dayTextureOneOverGamma[ut]=1/Fo.gamma,Na=Na||lt.dayTextureOneOverGamma[ut]!==1/ds.DEFAULT_GAMMA,lt.dayTextureSplit[ut]=Fo.splitDirection,Qo=Qo||lt.dayTextureSplit[ut]!==0;let Jl=lt.dayTextureCutoutRectangles[ut];if(l(Jl)||(Jl=lt.dayTextureCutoutRectangles[ut]=new ce),ce.clone(ce.ZERO,Jl),l(Fo.cutoutRectangle)){let Bo=I5(Wi,Fo.cutoutRectangle),ql=de.simpleIntersection(Bo,Wi,tTe);Oo=l(ql)||Oo,Jl.x=(Bo.west-Wi.west)*Qn,Jl.y=(Bo.south-Wi.south)*uo,Jl.z=(Bo.east-Wi.west)*Qn,Jl.w=(Bo.north-Wi.south)*uo}let jl=lt.colorsToAlpha[ut];l(jl)||(jl=lt.colorsToAlpha[ut]=new ce);let pa=l(Fo.colorToAlpha)&&Fo.colorToAlphaThreshold>0;if($s=$s||pa,pa){let Bo=Fo.colorToAlpha;jl.x=Bo.red,jl.y=Bo.green,jl.z=Bo.blue,jl.w=Fo.colorToAlphaThreshold}else jl.w=-1;if(l(Xa.credits)){let Bo=Xa.credits;for(let ql=0,An=Bo.length;ql<An;++ql)o.addCreditToNextFrame(Bo[ql])}++ut}lt.dayTextures.length=ut,lt.waterMask=a,ce.clone(c,lt.waterMaskTranslationAndScale),lt.minMaxHeight.x=O.minimumHeight,lt.minMaxHeight.y=O.maximumHeight,F.clone(O.matrix,lt.scaleAndBias);let Fi=e._clippingPlanes,Wo=l(Fi)&&Fi.enabled&&t.isClipped;Wo&&(lt.clippingPlanesEdgeColor=D.clone(Fi.edgeColor,lt.clippingPlanesEdgeColor),lt.clippingPlanesEdgeWidth=Fi.edgeWidth);let dc=e._clippingPolygons,ea=l(dc)&&dc.enabled&&t.isClipped;Se.numberOfDayTextures=ut,Se.applyBrightness=hr,Se.applyContrast=Vr,Se.applyHue=qs,Se.applySaturation=xs,Se.applyGamma=Na,Se.applyAlpha=Ao,Se.applyDayNightAlpha=Vn,Se.applySplit=Qo,Se.enableFog=vo,Se.enableClippingPlanes=Wo,Se.clippingPlanes=Fi,Se.enableClippingPolygons=ea,Se.clippingPolygons=dc,Se.hasImageryLayerCutout=Oo,Se.colorCorrect=v,Se.highlightFillTile=po,Se.colorToAlpha=$s,Se.showUndergroundColor=E,Se.translucent=h;let Lr=i.renderedMesh.indices.length;Je||(Lr=i.renderedMesh.indexCountWithoutSkirts),Nt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Se),Nt.castShadows=I,Nt.receiveShadows=Z,Nt.renderState=yt,Nt.primitiveType=Be.TRIANGLES,Nt.vertexArray=i.vertexArray||i.fill.vertexArray,Nt.count=Lr,Nt.uniformMap=In,Nt.pass=Ve.GLOBE,e._debug.wireframe&&(Zbt(Mn,e,t),l(i.wireframeVertexArray)&&(Nt.vertexArray=i.wireframeVertexArray,Nt.primitiveType=Be.LINES,Nt.count=Lr*2));let Wr=Nt.boundingVolume,rh=Nt.orientedBoundingBox;n.mode!==se.SCENE3D?(ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,H.minimumHeight,H.maximumHeight,Wr),m.fromElements(Wr.center.z,Wr.center.x,Wr.center.y,Wr.center),n.mode===se.MORPHING&&(Wr=ue.union(H.boundingSphere,Wr,Wr))):(Nt.boundingVolume=ue.clone(H.boundingSphere,Wr),Nt.orientedBoundingBox=tn.clone(H.boundingVolume,rh)),Nt.dirty=!0,h&&u.updateDerivedCommands(Nt,n),eTe(Nt,n),yt=it,Ot=Gbt}while(Ue<De)}var uX=Zr;var n3i=y(x(),1);function rTe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=de.clone(de.MAX_VALUE)}Object.defineProperties(rTe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=kt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=kt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=de.clone(de.MAX_VALUE)),de.clone(e,this._rectangle)}}});var mX=rTe;var Y3i=y(x(),1);var s3i=y(x(),1);function sTe(e){this._ellipsoid=new tf(e.ellipsoid,m.ZERO)}Object.defineProperties(sTe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var hX=sTe;var h3i=y(x(),1);var pq=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}clear(){this.cache.clear()}},Bbt=1e3;function Ba(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=ci.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new pq(Bbt),this.state=Fa.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Ba.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new Ba({tilingScheme:e,x:s,y:r,level:0});return i};var wbt=256;function Ybt(e,t,n,i){let o=n.width/wbt*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}Ba.prototype._getCacheKey=function(e,t){return Ybt(e.longitude,e.latitude,this._rectangle,t)};Ba.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};Ba.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};Ba.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};Ba.prototype.updateCustomData=function(){let e=this._addedCustomData,t=this._removedCustomData;if(e.length===0&&t.length===0)return;let n=this.customData;for(let i=0;i<e.length;++i){let o=e[i];n.add(o),aTe(this,o.positionCartographic)._addedCustomData.push(o)}this._addedCustomData.length=0;for(let i=0;i<t.length;++i){let o=t[i];n.has(o)&&n.delete(o),aTe(this,o.positionCartographic)._removedCustomData.push(o)}this._removedCustomData.length=0};var Nbt=new pe;function aTe(e,t){let n=e.northwestChild.rectangle,i=de.southeast(n,Nbt),o=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+o){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}Object.defineProperties(Ba.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 l(this._southwestChild)||(this._southwestChild=new Ba({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new Ba({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new Ba({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new Ba({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<Fa.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Ba.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};Ba.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Ba.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Ba.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Ba.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Ba.prototype.freeResources=function(){this.clearPositionCache(),this.state=Fa.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),Z5(this._southwestChild),this._southwestChild=void 0,Z5(this._southeastChild),this._southeastChild=void 0,Z5(this._northwestChild),this._northwestChild=void 0,Z5(this._northeastChild),this._northeastChild=void 0};function Z5(e){l(e)&&e.freeResources()}var fX=Ba;var A3i=y(x(),1);function R5(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}R5.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};R5.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),cTe(this,t)),t=i}};function cTe(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}R5.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&cTe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var pX=R5;function zm(e){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};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new pX,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new hX({ellipsoid:n}),this._tileLoadProgressEvent=new Ce,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(zm.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});zm.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Xbt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,dTe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData;for(let s of r)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}zm.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Fa.START&&e(t),t=t.replacementNext};zm.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};zm.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};zm.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function dTe(e){let 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}zm.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Xbt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),dTe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};zm.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Dbt(this,e),qbt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Pbt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=Ce.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}zm.prototype.endFrame=function(e){!e.passes.render||e.mode===se.MORPHING||(Hbt(this,e),jbt(this,e),Pbt(this,e))};zm.prototype.isDestroyed=function(){return!1};zm.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var gX,lTe=new pe;function Mbt(e,t){let n=de.center(e.rectangle,lTe),i=n.longitude-gX.longitude,o=n.latitude-gX.latitude;n=de.center(t.rectangle,lTe);let r=n.longitude-gX.longitude,s=n.latitude-gX.latitude;return i*i+o*o-(r*r+s*s)}var Ubt=new m,AX=[];function Dbt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o=e._tileProvider;if(!l(e._levelZeroTiles)){let h=o.tilingScheme;if(l(h)){let p=o.tilingScheme;e._levelZeroTiles=fX.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(AX.length<g){AX=new Array(g);for(let f=0;f<g;++f)AX[f]===void 0&&(AX[f]=new bX)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,s=r.length>1?e._occluders:void 0;gX=t.camera.positionCartographic,r.sort(Mbt);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(h=>{let p=r.find(g=>de.contains(g.rectangle,h.positionCartographic));p&&p._addedCustomData.push(h)}),c.forEach(h=>{let p=r.find(g=>de.contains(g.rectangle,h.positionCartographic));p&&p._removedCustomData.push(h)}),r.forEach(h=>h.updateCustomData()),a.length=0,c.length=0;let d=t.camera;e._cameraPositionCartographic=d.positionCartographic;let u=F.getTranslation(d.transform,Ubt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(u,e._cameraReferenceFrameOriginCartographic);for(let h=0;h<r.length;++h){let p=r[h];e._tileReplacementQueue.markTileRendered(p),p.renderable?_c(e,p,o,t,s,!1,AX[h]):(db(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function db(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function bX(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function uTe(){this.southwest=new bX,this.southeast=new bX,this.northwest=new bX,this.northeast=new bX}uTe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var gq=new Array(31);for(let e=0;e<gq.length;++e)gq[e]=new uTe;function vbt(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=Obt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:ci.NONE,g=e.tileProvider;if(s||i){let f=ci.originalResult(p)===ci.RENDERED,b=ci.originalResult(p)===ci.CULLED||p===ci.NONE,C=n.state===Fa.DONE,E=f||b||C;if(E||l(g.canRenderWithoutLosingDetail)&&(E=g.canRenderWithoutLosingDetail(n)),E){s&&db(e,e._tileLoadQueueMedium,n,t),G5(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===ci.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ci.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&db(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){G5(e,n),db(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===ci.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ci.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ci.REFINED;let b=e._tilesToRender.length,C=e._tileLoadQueueLow.length,E=e._tileLoadQueueMedium.length,T=e._tileLoadQueueHigh.length,S=e._tileToUpdateHeights.length;if(kbt(e,a,c,d,u,t,i,o),b!==e._tilesToRender.length){let _=o.allAreRenderable,R=o.anyWereRenderedLastFrame,L=o.notYetRenderableCount,W=!1;if(!_&&!R){let B=e._tilesToRender;for(let N=b;N<B.length;++N){let A=B[N];for(;A!==void 0&&A._lastSelectionResult!==ci.KICKED&&A!==n;)A._lastSelectionResult=ci.kick(A._lastSelectionResult),A=A.parent}e._tilesToRender.length=b,e._tileToUpdateHeights.length=S,G5(e,n),n._lastSelectionResult=ci.RENDERED;let Y=p===ci.RENDERED;!Y&&L>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=C,e._tileLoadQueueMedium.length=E,e._tileLoadQueueHigh.length=T,db(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,W=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=Y,Y||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!W&&db(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ci.RENDERED,G5(e,n),db(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===ci.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function kbt(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,h=gq[t.level],p=h.southwest,g=h.southeast,f=h.northwest,b=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(_c(e,t,d,r,u,s,p),_c(e,n,d,r,u,s,g),_c(e,i,d,r,u,s,f),_c(e,o,d,r,u,s,b)):(_c(e,i,d,r,u,s,f),_c(e,t,d,r,u,s,p),_c(e,o,d,r,u,s,b),_c(e,n,d,r,u,s,g)):c.latitude<t.rectangle.north?(_c(e,n,d,r,u,s,g),_c(e,t,d,r,u,s,p),_c(e,o,d,r,u,s,b),_c(e,i,d,r,u,s,f)):(_c(e,o,d,r,u,s,b),_c(e,i,d,r,u,s,f),_c(e,n,d,r,u,s,g),_c(e,t,d,r,u,s,p)),h.combine(a)}function Qbt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&de.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&de.contains(n,e._cameraReferenceFrameOriginCartographic)}function _c(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Dr.NONE)return vbt(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Qbt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&db(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:ci.NONE;c!==ci.CULLED_BUT_NEEDED&&c!==ci.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=ci.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(db(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=ci.CULLED):t._lastSelectionResult=ci.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Obt(e,t,n){if(t.mode===se.SCENE2D||t.camera.frustum instanceof hn||t.camera.frustum instanceof is)return zbt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=V.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function zbt(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),h=d/u;return t.fog.enabled&&t.mode!==se.SCENE2D&&(h-=V.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function G5(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function Hbt(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=Ni()+e._loadQueueTimeSlice,s=e._tileProvider,a=Aq(e,t,s,r,n,!1);a=Aq(e,t,s,r,i,a),Aq(e,t,s,r,o,a)}function Kbt(e,t){return e._loadPriority-t._loadPriority}function Aq(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(Kbt);for(let s=0,a=o.length;s<a&&(Ni()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var EZ=new xn,V5=new pe,Ny=new m,Jbt=[];function jbt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Jbt;n.length=0;let i=e._tileToUpdateHeights,o=Ni(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let C=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:ci.NONE;(C===ci.RENDERED||C===ci.CULLED_BUT_NEEDED)&&n.push(h),h.clearPositionCache(),i.shift();continue}let p=h.customData;l(h._customDataIterator)||(h._customDataIterator=p.values());let g=h._customDataIterator,f=!1,b;for(;!(b=g.next()).done;){let C=b.value,E=h.data.terrainData,T=l(E)&&E.wasCreatedByUpsampling();if(h.level>C.level&&!T){let S,_=h.getPositionCacheEntry(C.positionCartographic,e.maximumScreenSpaceError);if(l(_))S=_;else{if(l(C.positionOnEllipsoidSurface)||(C.positionOnEllipsoidSurface=m.fromRadians(C.positionCartographic.longitude,C.positionCartographic.latitude,0,d)),a===se.SCENE3D){let R=d.geodeticSurfaceNormal(C.positionOnEllipsoidSurface,EZ.direction),L=d.getSurfaceNormalIntersectionWithZAxis(C.positionOnEllipsoidSurface,11500,EZ.origin);if(!l(L)){let W=0;l(h.data.tileBoundingRegion)&&(W=h.data.tileBoundingRegion.minimumHeight);let B=Math.min(W,-11500),Y=m.multiplyByScalar(R,Math.abs(B)+1,Ny);m.subtract(C.positionOnEllipsoidSurface,Y,EZ.origin)}}else pe.clone(C.positionCartographic,V5),V5.height=-11500,c.project(V5,Ny),m.fromElements(Ny.z,Ny.x,Ny.y,Ny),m.clone(Ny,EZ.origin),m.clone(m.UNIT_X,EZ.direction);S=h.data.pick(EZ,a,c,!1,Ny),l(S)&&h.setPositionCacheEntry(C.positionCartographic,e.maximumScreenSpaceError,S)}if(l(S)){if(l(C.callback)){let R=d.cartesianToCartographic(S,V5);C.callback(R)}C.level=h.level}}if(Ni()>=s){f=!0;break}}if(f){h._customDataIterator=g;break}else h._customDataIterator=void 0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function qbt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var yX=zm;function Zf(e){e=e??ie.default;let t=new kp({ellipsoid:e}),n=new jC;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new lX,this._material=void 0,this._surface=new yX({tileProvider:new uX({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new Ce,this._undergroundColor=D.clone(D.BLACK),this._undergroundColorAlphaByDistance=new kt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new mX,yq(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ge({url:en("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ie.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=V.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=V.PI*e.minimumRadius,this.nightFadeOutDistance=V.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*V.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Rn.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.vertexShadowDarkness=.3}Object.defineProperties(Zf.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},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}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=de.clone(de.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),l(this._material)&&yq(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,yq(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=D.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=kt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function yq(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Fh,bZ];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(aX),e._surfaceShaderSet.baseVertexShaderSource=new ze({sources:[Fh,bZ,cX],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new ze({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function $bt(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),o=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var e0t=[],t0t={start:0,stop:0};Zf.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=e0t;s.length=0;for(let d of this._surface._tilesRenderedThisFrame){let u=d.data;if(!l(u))continue;let h=u.pickBoundingSphere;if(o!==se.SCENE3D)u.pickBoundingSphere=h=ue.fromRectangleWithHeights2D(d.rectangle,r,u.tileBoundingRegion.minimumHeight,u.tileBoundingRegion.maximumHeight,h),m.fromElements(h.center.z,h.center.x,h.center.y,h.center);else if(l(u.renderedMesh))ue.clone(u.tileBoundingRegion.boundingSphere,h);else continue;let p=di.raySphere(e,h,t0t);l(p)&&s.push(u)}s.sort($bt(e.origin));let a,c=s.length;for(let d=0;d<c&&(a=s[d].pick(e,t.mode,t.mapProjection,n,i),!l(a));++d);return a};var n0t=new pe;Zf.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==se.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,n0t);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var i0t=new m,mTe=new m,o0t=new pe,r0t=new xn;function bq(e,t){return l(e)&&de.contains(e.rectangle,t)?e:void 0}Zf.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!de.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=bq(n._southwestChild,e)||bq(n._southeastChild,e)||bq(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,i0t),d=r0t,u=a.geodeticSurfaceNormal(c,d.direction),h=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(h)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(g??0,-11500),b=m.multiplyByScalar(u,Math.abs(f)+1,mTe);m.subtract(c,b,d.origin)}let p=n.data.pick(d,se.SCENE3D,s,!1,mTe);if(l(p))return a.cartesianToCartographic(p,o0t).height};Zf.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Zf.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let d=this;a.fetchImage().then(function(u){c===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new Wt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===se.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Zf.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Zf.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Zf.prototype.isDestroyed=function(){return!1};Zf.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(),fe(this)};var xX=Zf;var nHi=y(x(),1);var Uzi=y(x(),1);var pzi=y(x(),1),TZ=`uniform vec3 u_radii;
uniform vec3 u_oneOverEllipsoidRadiiSquared;

in vec3 v_positionEC;

vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)
{
    vec3 positionEC = czm_pointAlongRay(ray, intersection);
    vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;
    vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));
    vec3 sphericalNormal = normalize(positionMC / u_radii);
    vec3 normalMC = geodeticNormal * side;              // normalized surface normal (always facing the viewer) in model coordinates
    vec3 normalEC = normalize(czm_normal * normalMC);   // normalized surface normal in eye coordinates

    vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal);
    vec3 positionToEyeEC = -positionEC;

    czm_materialInput materialInput;
    materialInput.s = st.s;
    materialInput.st = st;
    materialInput.str = (positionMC + u_radii) / u_radii;
    materialInput.normalEC = normalEC;
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
    materialInput.positionToEyeEC = positionToEyeEC;
    czm_material material = czm_getMaterial(materialInput);

#ifdef ONLY_SUN_LIGHTING
    return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);
#else
    return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}

void main()
{
    // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii
    // in the vertex shader. Only when it is larger than some constant, march along the ray.
    // Otherwise perform one intersection test which will be the common case.

    // Test if the ray intersects a sphere with the ellipsoid's maximum radius.
    // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test
    // may cause false negatives. This will discard fragments before marching the ray forward.
    float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;
    vec3 direction = normalize(v_positionEC);
    vec3 ellipsoidCenter = czm_modelView[3].xyz;

    float t1 = -1.0;
    float t2 = -1.0;

    float b = -2.0 * dot(direction, ellipsoidCenter);
    float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;

    float discriminant = b * b - 4.0 * c;
    if (discriminant >= 0.0) {
        t1 = (-b - sqrt(discriminant)) * 0.5;
        t2 = (-b + sqrt(discriminant)) * 0.5;
    }

    if (t1 < 0.0 && t2 < 0.0) {
        discard;
    }

    float t = min(t1, t2);
    if (t < 0.0) {
        t = 0.0;
    }

    // March ray forward to intersection with larger sphere and find
    czm_ray ray = czm_ray(t * direction, direction);

    vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);

    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);

    if (czm_isEmpty(intersection))
    {
        discard;
    }

    // If the viewer is outside, compute outsideFaceColor, with normals facing outward.
    vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);

    // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.
    vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);

    out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);
    out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);

#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
    t = (intersection.start != 0.0) ? intersection.start : intersection.stop;
    vec3 positionEC = czm_pointAlongRay(ray, t);
    vec4 positionCC = czm_projection * vec4(positionEC, 1.0);
#ifdef LOG_DEPTH
    czm_writeLogDepth(1.0 + positionCC.w);
#else
    float z = positionCC.z / positionCC.w;

    float n = czm_depthRange.near;
    float f = czm_depthRange.far;

    gl_FragDepth = (z * (f - n) + f + n) * 0.5;
#endif
#endif
}
`;var gzi=y(x(),1),SZ=`in vec3 position;

uniform vec3 u_radii;

out vec3 v_positionEC;

void main()
{
    // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.
    // Scale to consider the radii.  We could also do this once on the CPU when using the BoxGeometry,
    // but doing it here allows us to change the radii without rewriting the vertex data, and
    // allows all ellipsoids to reuse the same vertex data.
    vec4 p = vec4(u_radii * position, 1.0);
    
    vec4 pEC = czm_modelView * p;
    v_positionEC = pEC.xyz;     // position in eye coordinates
    gl_Position = czm_projection * pEC;
    // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums
    // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the
    // ellipsoid (does not write depth) that was rendered in the farther frustum.
    //
    // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates
    // artifacts since some fragments can be alpha blended twice.  This is solved by only rendering
    // the ellipsoid in the closest frustum to the viewer.
    gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);

    czm_vertexLogDepth();
}
`;var xq={position:0};function L5(e){e=e??Q.EMPTY_OBJECT,this.center=m.clone(e.center??m.ZERO),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new ue,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=e.show??!0,this.material=e.material??ho.fromType(ho.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=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 nt({owner:e._owner??this}),this._pickCommand=new nt({owner:e._owner??this,pickOnly:!0});let 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 s0t(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=hc.createGeometry(hc.fromDimensions({dimensions:new m(2,2,2),vertexFormat:we.POSITION_ONLY}));return t=si.fromGeometry({context:e,geometry:n,attributeLocations:xq,bufferUsage:Xe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}L5.prototype.update=function(e){if(!this.show||e.mode!==se.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=ke.fromCache({cull:{enabled:!0,face:wi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?fn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=s0t(t));let o=!1,r=this.radii;if(!m.equals(this._radii,r)){m.clone(r,this._radii);let b=this._oneOverEllipsoidRadiiSquared;b.x=1/(r.x*r.x),b.y=1/(r.y*r.y),b.z=1/(r.z*r.z),o=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(r),ue.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,d=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,h,p;(s||a||i||d)&&(h=new ze({sources:[SZ]}),p=new ze({sources:[this.material.shaderSource,TZ]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=cn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:xq}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=Rt(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let g=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Ve.TRANSLUCENT:Ve.OPAQUE,g.push(u)),f.pick){let b=this._pickCommand;(!l(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||a||!l(this._pickSP)||d)&&(h=new ze({sources:[SZ]}),p=new ze({sources:[this.material.shaderSource,TZ],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=cn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:xq}),b.vertexArray=this._va,b.renderState=this._rs,b.shaderProgram=this._pickSP,b.uniformMap=Rt(Rt(this._uniforms,this._pickUniforms),this.material._uniforms),b.executeInClosestFrustum=n),b.boundingVolume=this._boundingSphere,b.modelMatrix=this._computedModelMatrix,b.pass=n?Ve.TRANSLUCENT:Ve.OPAQUE,g.push(b)}};L5.prototype.isDestroyed=function(){return!1};L5.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(),fe(this)};var CX=L5;function EX(e){e=e??Q.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=en("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ie.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new CX({radii:this.ellipsoid.radii,material:ho.fromType(ho.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new JN}Object.defineProperties(EX.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var W5=new $,a0t=new $,c0t=new m,F5=[];EX.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Tt.computeIcrfToFixedMatrix(n,W5))||Tt.computeTemeToPseudoFixedMatrix(n,W5);let i=this._axes.evaluate(n,a0t);$.transpose(i,i),$.multiply(W5,i,i);let o=Mb.computeMoonPositionInEarthInertialFrame(n,c0t);$.multiplyByVector(W5,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=F5,F5.length=0,t.update(e),e.commandList=r,F5.length===1?F5[0]:void 0};EX.prototype.isDestroyed=function(){return!1};EX.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),fe(this)};var TX=EX;var Eco=y(x(),1);var AHi=y(x(),1);var oHi=y(x(),1),SX=`in vec2 v_textureCoordinates;
const float M_PI = 3.141592653589793;

float vdcRadicalInverse(int i)
{
    float r;
    float base = 2.0;
    float value = 0.0;
    float invBase = 1.0 / base;
    float invBi = invBase;
    for (int x = 0; x < 100; x++)
    {
        if (i <= 0)
        {
            break;
        }
        r = mod(float(i), base);
        value += r * invBi;
        invBi *= invBase;
        i = int(float(i) * invBase);
    }
    return value;
}

vec2 hammersley2D(int i, int N)
{
    return vec2(float(i) / float(N), vdcRadicalInverse(i));
}

vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
{
    float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
    float phi = 2.0 * M_PI * xi.x;
    float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
    float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
    vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
    vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
    vec3 tangentX = normalize(cross(upVector, N));
    vec3 tangentY = cross(N, tangentX);
    return tangentX * H.x + tangentY * H.y + N * H.z;
}

/**
 * Estimate the geometric self-shadowing of the microfacets in a surface,
 * using the Smith Joint GGX visibility function.
 * Note: Vis = G / (4 * NdotL * NdotV)
 * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
 * see Real-Time Rendering. Page 331 to 336.
 * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
 *
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
 * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
 */
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
{
    float alphaRoughnessSq = alphaRoughness * alphaRoughness;

    float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
    float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);

    float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0
    if (GGX > 0.0)
    {
        return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0
    }
    return 0.0;
}

vec2 integrateBrdf(float roughness, float NdotV)
{
    vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
    float A = 0.0;
    float B = 0.0;
    const int NumSamples = 1024;
    float alphaRoughness = roughness * roughness;
    for (int i = 0; i < NumSamples; i++)
    {
        vec2 xi = hammersley2D(i, NumSamples);
        vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0));
        vec3 L = 2.0 * dot(V, H) * H - V;
        float NdotL = clamp(L.z, 0.0, 1.0);
        float NdotH = clamp(H.z, 0.0, 1.0);
        float VdotH = clamp(dot(V, H), 0.0, 1.0);
        if (NdotL > 0.0)
        {
            float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
            float G_Vis = 4.0 * G * VdotH * NdotL / NdotH;
            float Fc = pow(1.0 - VdotH, 5.0);
            A += (1.0 - Fc) * G_Vis;
            B += Fc * G_Vis;
        }
    }
    return vec2(A, B) / float(NumSamples);
}

void main()
{
    out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
}
`;function IX(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(IX.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function l0t(e,t,n){let i=t.createViewportQuadCommand(SX,{framebuffer:n,renderState:ke.fromCache({viewport:new $e(0,0,256,256)})});e._drawCommand=i}IX.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Wt({context:t,width:256,height:256,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,sampler:Ht.NEAREST});this._colorTexture=n;let i=new ns({context:t,colorTextures:[n],destroyAttachments:!1});l0t(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};IX.prototype.isDestroyed=function(){return!1};IX.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),fe(this)};var _X=IX;var sKi=y(x(),1);var RHi=y(x(),1);var ATe={};function d0t(e,t,n){let i,o,r;if(e instanceof Ui){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof kl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var u0t=new m,hTe=new m;function gTe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return V.lerp(e,-V.PI_OVER_TWO,p)}let h=(u-r)/c;return V.lerp(-V.PI_OVER_TWO,t,1-h)}}return function(o){return V.lerp(e,t,o)}}function Eq(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,d=e.up,u=e.right,h=e.frustum,p=m.subtract(a,c,u0t),g=m.magnitude(m.multiplyByScalar(d,m.dot(p,d),hTe)),f=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),hTe));r=Math.min(d0t(h,g,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return V.lerp(n,i,a)}}function ZX(e,t){return V.equalsEpsilon(e,V.TWO_PI,V.EPSILON11)&&(e=0),t>e+Math.PI?e+=V.TWO_PI:t<e-Math.PI&&(e-=V.TWO_PI),e}var bTe=new m;function m0t(e,t,n,i,o,r,s,a){let c=e.camera,d=m.clone(c.position,bTe),u=c.pitch,h=ZX(c.heading,i),p=ZX(c.roll,r),g=Eq(c,n,d.z,n.z,s),f=gTe(u,o,g,a);function b(C){let E=C.time/t;c.setView({orientation:{heading:V.lerp(h,i,E),pitch:f(E),roll:V.lerp(p,r,E)}}),M.lerp(d,n,E,c.position),c.position.z=g(E)}return b}function h0t(e,t){e.longitude<t.longitude?e.longitude+=V.TWO_PI:t.longitude+=V.TWO_PI}function f0t(e,t){let n=e.longitude-t.longitude;n<-V.PI?e.longitude+=V.TWO_PI:n>V.PI&&(t.longitude+=V.TWO_PI)}var p0t=new pe,A0t=new pe;function g0t(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,g=pe.clone(u.positionCartographic,p0t),f=u.pitch,b=ZX(u.heading,i),C=ZX(u.roll,r),E=p.cartesianToCartographic(n,A0t);g.longitude=V.zeroToTwoPi(g.longitude),E.longitude=V.zeroToTwoPi(E.longitude);let T=!1;if(l(a)){let L=V.zeroToTwoPi(a),W=Math.min(g.longitude,E.longitude),B=Math.max(g.longitude,E.longitude),Y=L>=W&&L<=B;if(l(c)){let N=Math.abs(g.longitude-E.longitude),A=V.TWO_PI-N;(Y?N:A)<(Y?A:N)*c&&!Y&&(T=!0)}else Y||(T=!0)}T?h0t(g,E):f0t(g,E);let S=Eq(u,n,g.height,E.height,s),_=gTe(f,o,S,d);function R(){let L=g.longitude,W=E.longitude,B=g.latitude,Y=E.latitude;return function(A){let I=A.time/t,Z=m.fromRadians(V.lerp(L,W,I),V.lerp(B,Y,I),S(I),p);u.setView({destination:Z,orientation:{heading:V.lerp(b,i,I),pitch:_(I),roll:V.lerp(C,r,I)}})}}return R()}function b0t(e,t,n,i,o,r,s){let a=e.camera,c=m.clone(a.position,bTe),d=ZX(a.heading,i),u=a.frustum.right-a.frustum.left,h=Eq(a,n,u,n.z,s);function p(g){let f=g.time/t;a.setView({orientation:{heading:V.lerp(d,i,f)}}),M.lerp(c,n,f,a.position);let b=h(f),C=a.frustum,E=C.top/C.right,T=(b-(C.right-C.left))*.5;C.right+=T,C.left-=T,C.top=E*C.right,C.bottom=-C.top}return p}var fTe=new pe,y0t=new m;function Cq(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function pTe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}ATe.createTween=function(e,t){t=t??Q.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===se.MORPHING)return Cq();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==se.SCENE3D&&(s.cartesianToCartographic(n,fTe),n=r.project(fTe,y0t));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let f=t.duration;l(f)||(f=Math.ceil(m.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let b=t.heading??0,C=t.pitch??-V.PI_OVER_TWO,E=t.roll??0,T=e.screenSpaceCameraController;T.enableInputs=!1;let S=pTe(T,t.complete),_=pTe(T,t.cancel),R=p.frustum,L=e.mode===se.SCENE2D;if(L=L&&M.equalsEpsilon(p.position,n,V.EPSILON6),L=L&&V.equalsEpsilon(Math.max(R.right-R.left,R.top-R.bottom),n.z,V.EPSILON6),L=L||e.mode!==se.SCENE2D&&m.equalsEpsilon(n,p.position,V.EPSILON10),L=L&&V.equalsEpsilon(V.negativePiToPi(b),V.negativePiToPi(p.heading),V.EPSILON10)&&V.equalsEpsilon(V.negativePiToPi(C),V.negativePiToPi(p.pitch),V.EPSILON10)&&V.equalsEpsilon(V.negativePiToPi(E),V.negativePiToPi(p.roll),V.EPSILON10),L)return Cq(S,_);let W=new Array(4);if(W[se.SCENE2D]=b0t,W[se.SCENE3D]=g0t,W[se.COLUMBUS_VIEW]=m0t,f<=0)return Cq(function(){W[i](e,1,n,b,C,E,a,c,d,u)({time:1}),typeof S=="function"&&S()},_);let B=W[i](e,f,n,b,C,E,a,c,d,u);if(!l(h)){let Y=p.positionCartographic.height,N=i===se.SCENE3D?s.cartesianToCartographic(n).height:n.z;Y>N&&Y>11500?h=bs.CUBIC_OUT:h=bs.QUINTIC_IN_OUT}return{duration:f,easingFunction:h,startObject:{time:0},stopObject:{time:f},update:B,complete:S,cancel:_}};var RX=ATe;var VHi=y(x(),1),x0t={ROTATE:0,INFINITE_SCROLL:1},Ql=Object.freeze(x0t);function dn(e){this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new pe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new Ui,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=V.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 Ce,this._moveEnd=new Ce,this._changed=new Ce,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,_Te(this),this._mode=se.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new pe(Math.PI,V.PI_OVER_TWO)),this._max2Dfrustum=void 0,XTe(this,dn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*dn.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}dn.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);dn.TRANSFORM_2D_INVERSE=F.inverseTransformation(dn.TRANSFORM_2D,new F);dn.DEFAULT_VIEW_RECTANGLE=de.fromDegrees(-95,-20,-70,90);dn.DEFAULT_VIEW_FACTOR=.5;dn.DEFAULT_OFFSET=new Xm(0,-V.PI_OVER_FOUR,0);function _Te(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function C0t(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ni()):e.timeSinceMoved=Math.max(Ni()-e._lastMovedTimestamp,0)/1e3}}dn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==se.SCENE2D};dn.prototype._updateCameraChanged=function(){let e=this;if(C0t(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%V.TWO_PI;i=i>V.PI?V.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%V.TWO_PI;s=s>V.PI?V.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===se.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,f=e.frustum,b=e._changedFrustum,C=p.x+f.left,E=p.x+f.right,T=g.x+b.left,S=g.x+b.right,_=p.y+f.bottom,R=p.y+f.top,L=g.y+b.bottom,W=g.y+b.top,B=Math.max(C,T),Y=Math.min(E,S),N=Math.max(_,L),A=Math.min(R,W),I;if(B>=Y||N>=R)I=1;else{let Z=b;C<T&&E>S&&_<L&&R>W&&(Z=f),I=1-(Y-B)*(A-N)/((Z.right-Z.left)*(Z.top-Z.bottom))}I>t&&(e._changed.raiseEvent(I),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let c=V.acosClamped(m.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let h=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||h>t)&&(e._changed.raiseEvent(Math.max(d,h)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function E0t(e){Tt.basisTo2D(e._projection,e._transform,e._actualTransform)}var T0t=new pe,S0t=new m,B5=new m,I0t=new ce,_0t=new ce,Z0t=new ce,R0t=new ce,G0t=new ce;function V0t(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,I0t),o=n.cartesianToCartographic(i,T0t),r=t.project(o,S0t),s=_0t;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ce.clone(ce.UNIT_X,G0t),c=ce.add(F.getColumn(e._transform,0,B5),i,B5);n.cartesianToCartographic(c,o),t.project(o,r);let d=Z0t;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,m.subtract(d,s,d),d.x=0;let u=R0t;if(m.magnitudeSquared(d)>V.EPSILON10)m.cross(a,d,u);else{let h=ce.add(F.getColumn(e._transform,1,B5),i,B5);n.cartesianToCartographic(h,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,m.subtract(u,s,u),u.x=0,m.magnitudeSquared(u)<V.EPSILON10&&(ce.clone(ce.UNIT_Y,d),ce.clone(ce.UNIT_Z,u))}m.cross(u,a,d),m.normalize(d,d),m.cross(a,d,u),m.normalize(u,u),F.setColumn(e._actualTransform,0,d,e._actualTransform),F.setColumn(e._actualTransform,1,u,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var Tq=new m;function nl(e){let t=e._mode,n=!1,i=0;t===se.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!m.equals(o,e.position)||n;r&&(o=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,d=!m.equals(c,e.up);d&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let u=e._right,h=!m.equals(u,e.right);h&&(m.normalize(e.right,e.right),u=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===se.COLUMBUS_VIEW||e._mode===se.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(dn.TRANSFORM_2D,e._actualTransform):e._mode===se.COLUMBUS_VIEW?E0t(e):V0t(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(g,o,e._positionWC),t===se.SCENE3D||t===se.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=Tq;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===se.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||h){let f=m.dot(s,m.cross(c,u,Tq));if(Math.abs(1-f)>V.EPSILON2){let b=1/m.magnitudeSquared(c),C=m.dot(c,s)*b,E=m.multiplyByScalar(s,C,Tq);c=m.normalize(m.subtract(c,E,e._up),e._up),m.clone(c,e.up),u=m.cross(s,c,e._right),m.clone(u,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=F.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=F.multiplyByPointAsVector(g,u,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(r||a||d||h||p)&&_Te(e)}function ZTe(e,t){let n;return V.equalsEpsilon(Math.abs(e.z),1,V.EPSILON3)?n=Math.atan2(t.y,t.x)-V.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-V.PI_OVER_TWO,V.TWO_PI-V.zeroToTwoPi(n)}function RTe(e){return V.PI_OVER_TWO-V.acosClamped(e.z)}function GTe(e,t,n){let i=0;return V.equalsEpsilon(Math.abs(e.z),1,V.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=V.zeroToTwoPi(i+V.TWO_PI)),i}var N5=new F,X5=new F;Object.defineProperties(dn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return nl(this),this._invTransform}},viewMatrix:{get:function(){return nl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return nl(this),this._invViewMatrix}},positionCartographic:{get:function(){return nl(this),this._positionCartographic}},positionWC:{get:function(){return nl(this),this._positionWC}},directionWC:{get:function(){return nl(this),this._directionWC}},upWC:{get:function(){return nl(this),this._upWC}},rightWC:{get:function(){return nl(this),this._rightWC}},heading:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,N5),n=Tt.eastNorthUpToFixedFrame(this.positionWC,e,X5);this._setTransform(n);let i=ZTe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,N5),n=Tt.eastNorthUpToFixedFrame(this.positionWC,e,X5);this._setTransform(n);let i=RTe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,N5),n=Tt.eastNorthUpToFixedFrame(this.positionWC,e,X5);this._setTransform(n);let i=GTe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});dn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==se.MORPHING,t=this._mode===se.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===se.SCENE2D&&FTe(this,this.position)};var L0t=new m,W0t=new m,F0t=new m;dn.prototype._setTransform=function(e){let t=m.clone(this.positionWC,L0t),n=m.clone(this.upWC,W0t),i=m.clone(this.directionWC,F0t);F.clone(e,this._transform),this._transformChanged=!0,nl(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),m.cross(this.direction,this.up,this.right),nl(this)};var B0t=new M,w0t=new xn,Y0t=new m,N0t=new m;function VTe(e){if(!F.equals(F.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=B0t;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,w0t);o=n.pickWorldCoordinates(a,t,!0,Y0t)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,N0t));let s;if(l(o)||l(r)){let a=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}dn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof hn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=VTe(this)))};var P5=new m,Rq=new F,X0t=new F,Gq=new Me,Vq=new $,LTe=new pe;function P0t(e,t,n){let i=F.clone(e.transform,Rq),o=Tt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,X0t);e._setTransform(o),m.clone(m.ZERO,e.position),n.heading=n.heading-V.PI_OVER_TWO;let r=Me.fromHeadingPitchRoll(n,Gq),s=$.fromQuaternion(r,Vq);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function M0t(e,t,n,i){let o=F.clone(e.transform,Rq);if(e._setTransform(F.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,LTe);t=a.project(c,P5)}m.clone(t,e.position)}n.heading=n.heading-V.PI_OVER_TWO;let r=Me.fromHeadingPitchRoll(n,Gq),s=$.fromQuaternion(r,Vq);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function U0t(e,t,n,i){let o=F.clone(e.transform,Rq);if(e._setTransform(F.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,LTe);t=c.project(d,P5)}M.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Ql.ROTATE){n.heading=n.heading-V.PI_OVER_TWO,n.pitch=-V.PI_OVER_TWO,n.roll=0;let r=Me.fromHeadingPitchRoll(n,Gq),s=$.fromQuaternion(r,Vq);$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(o)}var D0t=new m,v0t=new m,k0t=new m;function WTe(e,t,n,i){let o=m.clone(n.direction,D0t),r=m.clone(n.up,v0t);if(e._scene.mode===se.SCENE3D){let a=e._projection.ellipsoid,c=Tt.eastNorthUpToFixedFrame(t,a,N5),d=F.inverseTransformation(c,X5);F.multiplyByPointAsVector(d,o,o),F.multiplyByPointAsVector(d,r,r)}let s=m.cross(o,r,k0t);return i.heading=ZTe(o,r),i.pitch=RTe(o),i.roll=GTe(o,r,s),i}var Zq={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},IZ=new uc;dn.prototype.setView=function(e){e=e??Q.EMPTY_OBJECT;let t=e.orientation??Q.EMPTY_OBJECT,n=this._mode;if(n===se.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??m.clone(this.positionWC,P5);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,P5),i=!1),l(t.direction)&&(t=WTe(this,o,t,Zq.orientation)),IZ.heading=t.heading??0,IZ.pitch=t.pitch??-V.PI_OVER_TWO,IZ.roll=t.roll??0,n===se.SCENE3D?P0t(this,o,IZ):n===se.SCENE2D?U0t(this,o,IZ,i):M0t(this,o,IZ,i)};var Q0t=new m;dn.prototype.flyHome=function(e){let t=this._mode;if(t===se.MORPHING&&this._scene.completeMorph(),t===se.SCENE2D)this.flyTo({destination:dn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===se.SCENE3D){let n=this.getRectangleCameraCoordinates(dn.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*dn.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===se.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,Q0t).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};dn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ce),nl(this),F.multiplyByVector(this._actualInvTransform,e,t)};dn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),nl(this),F.multiplyByPoint(this._actualInvTransform,e,t)};dn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),nl(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};dn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ce),nl(this),F.multiplyByVector(this._actualTransform,e,t)};dn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),nl(this),F.multiplyByPoint(this._actualTransform,e,t)};dn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),nl(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function FTe(e,t){let n=e._scene.mapMode2D===Ql.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var yTe=new m;dn.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,yTe),m.add(n,yTe,n),this._mode===se.SCENE2D&&FTe(this,n),this._adjustOrthographicFrustum(!0)};dn.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?M5(this,e):this.move(this.direction,e)};dn.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?M5(this,-e):this.move(this.direction,-e)};dn.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};dn.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};dn.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};dn.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};dn.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,-e)};dn.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,e)};dn.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,-e)};dn.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,e)};var O0t=new Me,z0t=new $;dn.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Me.fromAxisAngle(e,-n,O0t),o=$.fromQuaternion(i,z0t),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};dn.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};dn.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var H0t=new Me,K0t=new $;dn.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Me.fromAxisAngle(e,-n,H0t),o=$.fromQuaternion(i,K0t);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};dn.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,BTe(this,e)};dn.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,BTe(this,-e)};var J0t=new m,j0t=new m,q0t=new m,xTe=new m;function BTe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,V.EPSILON2)){let i=m.normalize(n,J0t),o=m.equalsEpsilon(i,e.constrainedAxis,V.EPSILON2),r=m.equalsEpsilon(i,m.negate(e.constrainedAxis,xTe),V.EPSILON2);if(!o&&!r){let s=m.normalize(e.constrainedAxis,j0t),a=m.dot(i,s),c=V.acosClamped(a);t>0&&t>c&&(t=c-V.EPSILON4),a=m.dot(i,m.negate(s,xTe)),c=V.acosClamped(a),t<0&&-t>c&&(t=-c+V.EPSILON4);let d=m.cross(s,i,q0t);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}dn.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,wTe(this,-e)};dn.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,wTe(this,e)};function wTe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function M5(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Ql.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Ql.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function YTe(e,t){e.move(e.direction,t)}dn.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?M5(this,e):YTe(this,e)};dn.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?M5(this,-e):YTe(this,-e)};dn.prototype.getMagnitude=function(){if(this._mode===se.SCENE3D)return m.magnitude(this.position);if(this._mode===se.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===se.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var $0t=new F;dn.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ie.default,o=Tt.eastNorthUpToFixedFrame(e,i,$0t);this.lookAtTransform(o,t)};var eyt=new m,tyt=new Me,nyt=new Me,iyt=new $;function NTe(e,t,n){t=V.clamp(t,-V.PI_OVER_TWO,V.PI_OVER_TWO),e=V.zeroToTwoPi(e)-V.PI_OVER_TWO;let i=Me.fromAxisAngle(m.UNIT_Y,-t,tyt),o=Me.fromAxisAngle(m.UNIT_Z,-e,nyt),r=Me.multiply(o,i,o),s=$.fromQuaternion(r,iyt),a=m.clone(m.UNIT_X,eyt);return $.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}dn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=NTe(t.heading,t.pitch,t.range):n=t,this._mode===se.SCENE2D){M.clone(M.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<V.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(F.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<V.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var GX=new pe,oyt=new pe,ryt=new m,syt=new m,ayt=new m,cyt=new m,lyt=new m,dyt=new m,uyt=new m,Sq=new m,myt={direction:new m,right:new m,up:new m},CTe;function tl(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function XTe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:myt,{north:s,south:a,west:c}=t,{east:d}=t;c>d&&(d+=V.TWO_PI);let u=(c+d)*.5,h;if(a<-V.PI_OVER_TWO+V.RADIANS_PER_DEGREE&&s>V.PI_OVER_TWO-V.RADIANS_PER_DEGREE)h=0;else{let Y=GX;Y.longitude=u,Y.latitude=s,Y.height=0;let N=oyt;N.longitude=u,N.latitude=a,N.height=0;let A=CTe;(!l(A)||A.ellipsoid!==o)&&(CTe=A=new RA(void 0,void 0,o)),A.setEndPoints(Y,N),h=A.interpolateUsingFraction(.5,GX).latitude}let p=GX;p.longitude=u,p.latitude=h,p.height=0;let g=o.cartographicToCartesian(p,uyt),f=GX;f.longitude=d,f.latitude=s;let b=o.cartographicToCartesian(f,ryt);f.longitude=c;let C=o.cartographicToCartesian(f,ayt);f.longitude=u;let E=o.cartographicToCartesian(f,lyt);f.latitude=a;let T=o.cartographicToCartesian(f,dyt);f.longitude=d;let S=o.cartographicToCartesian(f,cyt);f.longitude=c;let _=o.cartographicToCartesian(f,syt);m.subtract(C,g,C),m.subtract(S,g,S),m.subtract(b,g,b),m.subtract(_,g,_),m.subtract(E,g,E),m.subtract(T,g,T);let R=o.geodeticSurfaceNormal(g,r.direction);m.negate(R,R);let L=m.cross(R,m.UNIT_Z,r.right);m.normalize(L,L);let W=m.cross(L,R,r.up),B;if(e.frustum instanceof hn){let Y=Math.max(m.distance(b,C),m.distance(S,_)),N=Math.max(m.distance(b,S),m.distance(C,_)),A,I,Z=e.frustum._offCenterFrustum,G=Z.right/Z.top,w=N*G;Y>w?(A=Y,I=A/G):(I=N,A=w),B=Math.max(A,I)}else{let Y=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*Y;if(B=Math.max(tl(R,W,C,Y),tl(R,W,S,Y),tl(R,W,b,Y),tl(R,W,_,Y),tl(R,W,E,Y),tl(R,W,T,Y),tl(R,L,C,N),tl(R,L,S,N),tl(R,L,b,N),tl(R,L,_,N),tl(R,L,E,N),tl(R,L,T,N)),a<0&&s>0){let A=GX;A.longitude=c,A.latitude=0,A.height=0;let I=o.cartographicToCartesian(A,Sq);m.subtract(I,g,I),B=Math.max(B,tl(R,W,I,Y),tl(R,L,I,N)),A.longitude=d,I=o.cartographicToCartesian(A,Sq),m.subtract(I,g,I),B=Math.max(B,tl(R,W,I,Y),tl(R,L,I,N))}}return m.add(g,m.multiplyByScalar(R,-B,Sq),n)}var hyt=new pe,fyt=new m,pyt=new m;function Ayt(e,t,n){let i=e._projection;t.west>t.east&&(t=de.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=hyt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,fyt);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,pyt);if(F.multiplyByPoint(o,c,c),F.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/d)*.5}else{let d=a.x-c.x,u=a.y-c.y;n.z=Math.max(d,u)}return n}var gyt=new pe,byt=new m,yyt=new m;function xyt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Ql.INFINITE_SCROLL?o+=V.TWO_PI:(t=de.MAX_VALUE,o=t.east));let r=gyt;r.longitude=o,r.latitude=t.north;let s=i.project(r,byt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,yyt),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,h,p=e.frustum.right/e.frustum.top,g=d*p;return c>g?(u=c,h=u/p):(h=d,u=g),d=Math.max(2*u,2*h),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}dn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===se.SCENE3D)return XTe(this,e,t);if(n===se.COLUMBUS_VIEW)return Ayt(this,e,t);if(n===se.SCENE2D)return xyt(this,e,t)};var Cyt=new xn;function Eyt(e,t,n,i){n=n??ie.default;let o=e.getPickRay(t,Cyt),r=di.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return xn.getPoint(o,s,i)}var Tyt=new xn;function Syt(e,t,n,i){let r=e.getPickRay(t,Tyt).origin;r=m.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-V.PI_OVER_TWO||s.latitude>V.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Iyt=new xn;function _yt(e,t,n,i){let o=e.getPickRay(t,Iyt),r=-o.origin.x/o.direction.x;xn.getPoint(o,r,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-V.PI_OVER_TWO||s.latitude>V.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}dn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=t??ie.default,this._mode===se.SCENE3D)n=Eyt(this,e,t,n);else if(this._mode===se.SCENE2D)n=Syt(this,e,this._projection,n);else if(this._mode===se.COLUMBUS_VIEW)n=_yt(this,e,this._projection,n);else return;return n}};var Zyt=new m,Ryt=new m,Gyt=new m;function Vyt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,h=e.positionWC;m.clone(h,n.origin);let p=m.multiplyByScalar(e.directionWC,c,Zyt);m.add(h,p,p);let g=m.multiplyByScalar(e.rightWC,d*c*a,Ryt),f=m.multiplyByScalar(e.upWC,u*c*s,Gyt),b=m.add(p,g,n.direction);return m.add(b,f,b),m.subtract(b,h,b),m.normalize(b,b),n}var w5=new m;function Lyt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;if(m.clone(e.positionWC,u),m.multiplyByScalar(e.rightWC,c,w5),m.add(w5,u,u),m.multiplyByScalar(e.upWC,d,w5),m.add(w5,u,u),m.clone(e.directionWC,n.direction),e._mode===se.SCENE2D&&e._scene.mapMode2D===Ql.INFINITE_SCROLL){let h=e._maxCoord.x;u.y=V.mod(u.y+h,2*h)-h}return n}dn.prototype.getPickRay=function(e,t){l(t)||(t=new xn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?Vyt(this,e,t):Lyt(this,e,t)};var Wyt=new m,Fyt=new m;dn.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,Wyt),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),Fyt);return Math.max(0,m.magnitude(n)-e.radius)};var Byt=new M;dn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Byt);return Math.max(o.x,o.y)};function wyt(e,t,n,i,o,r){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let d=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:bs.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var Yyt=new m,ETe=new m,Nyt=new m,Xyt=new m;function Pyt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(m.UNIT_X,Yyt),r=-m.dot(o,n)/m.dot(o,i),s=m.add(n,m.multiplyByScalar(i,r,ETe),ETe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Nyt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=m.magnitude(m.subtract(n,s,Xyt)),u=c*d,h=a*d,p=e._maxCoord.x,g=e._maxCoord.y,f=Math.max(u-p,p),b=Math.max(h-g,g);if(n.z<-f||n.z>f||n.y<-b||n.y>b){let C=s.y<-f||s.y>f,E=s.z<-b||s.z>b;if(C||E)return wyt(e,n,s,f,b,t)}}dn.prototype.createCorrectPositionTween=function(e){if(this._mode===se.COLUMBUS_VIEW)return Pyt(this,e)};var Myt=new m,wa={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};dn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};dn.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=wa.destination,e.orientation.heading=wa.heading,e.orientation.pitch=wa.pitch,e.orientation.roll=wa.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};dn.prototype.flyTo=function(e){e=e??Q.EMPTY_OBJECT;let t=e.destination;if(this._mode===se.MORPHING)return;this.cancelFlight();let i=t instanceof de;i&&(t=this.getRectangleCameraCoordinates(t,Myt));let o=e.orientation??Q.EMPTY_OBJECT;if(l(o.direction)&&(o=WTe(this,t,o,Zq.orientation)),l(e.duration)&&e.duration<=0){let u=Zq;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;wa.destination=t,wa.heading=o.heading,wa.pitch=o.pitch,wa.roll=o.roll,wa.duration=e.duration,wa.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},wa.cancel=e.cancel,wa.endTransform=e.endTransform,wa.convert=i?!1:e.convert,wa.maximumHeight=e.maximumHeight,wa.pitchAdjustHeight=e.pitchAdjustHeight,wa.flyOverLongitude=e.flyOverLongitude,wa.flyOverLongitudeWeight=e.flyOverLongitudeWeight,wa.easingFunction=e.easingFunction;let a=this._scene,c=RX.createTween(a,wa);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==se.SCENE2D&&(l(d)||(d=dn.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function Uyt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Dyt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var vyt=100;function PTe(e,t,n){n=Xm.clone(l(n)?n:dn.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=vyt:e.frustum instanceof hn||e._mode===se.SCENE2D?n.range=Dyt(e,s):n.range=Uyt(e,s),n.range=V.clamp(n.range,i,o)}return n}dn.prototype.viewBoundingSphere=function(e,t){t=PTe(this,e,t),this.lookAt(e.center,t)};var kyt=new F,Qyt=new m,Oyt=new m,zyt=new m,Hyt=new m,Kyt=new ce,Jyt=new Me,jyt=new $;dn.prototype.flyToBoundingSphere=function(e,t){t=t??Q.EMPTY_OBJECT;let n=this._mode===se.SCENE2D||this._mode===se.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=PTe(this,e,t.offset),o;n?o=m.multiplyByScalar(m.UNIT_Z,i.range,Qyt):o=NTe(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??ie.default,a=Tt.eastNorthUpToFixedFrame(e.center,s,kyt);F.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=m.subtract(e.center,o,Oyt),m.normalize(c,c),d=F.multiplyByPointAsVector(a,m.UNIT_Z,zyt),1-Math.abs(m.dot(c,d))<V.EPSILON6){let h=Me.fromAxisAngle(c,i.heading,Jyt),p=$.fromQuaternion(h,jyt);m.fromCartesian4(F.getColumn(a,1,Kyt),d),$.multiplyByVector(p,d,d)}let u=m.cross(c,d,Hyt);m.cross(u,c,d),m.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:c,up:d},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 TTe=new m,STe=new m,Iq=new m,ITe=new m,VX=[new m,new m,new m,new m];function qyt(e,t){let n=t.radii,i=e.positionWC,o=m.multiplyComponents(t.oneOverRadii,i,TTe),r=m.magnitude(o),s=m.normalize(o,STe),a,c;m.equalsEpsilon(s,m.UNIT_Z,V.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,Iq),Iq),c=m.normalize(m.cross(s,a,ITe),ITe));let d=Math.sqrt(m.magnitudeSquared(o)-1),u=m.multiplyByScalar(s,1/r,TTe),h=d/r,p=m.multiplyByScalar(a,h,STe),g=m.multiplyByScalar(c,h,Iq),f=m.add(u,g,VX[0]);m.subtract(f,p,f),m.multiplyComponents(n,f,f);let b=m.subtract(u,g,VX[1]);m.subtract(b,p,b),m.multiplyComponents(n,b,b);let C=m.subtract(u,g,VX[2]);m.add(C,p,C),m.multiplyComponents(n,C,C);let E=m.add(u,g,VX[3]);return m.add(E,p,E),m.multiplyComponents(n,E,E),VX}var _q=new M,$yt=new m,Xy=[new pe,new pe,new pe,new pe];function Y5(e,t,n,i,o,r){_q.x=e,_q.y=t;let s=i.pickEllipsoid(_q,o,$yt);return l(s)?(Xy[n]=o.cartesianToCartographic(s,Xy[n]),1):(Xy[n]=o.cartesianToCartographic(r[n],Xy[n]),0)}dn.prototype.computeViewRectangle=function(e,t){e=e??ie.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ue(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Jt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=qyt(this,e);if(c+=Y5(0,0,0,this,e,d),c+=Y5(0,a,1,this,e,d),c+=Y5(s,a,2,this,e,d),c+=Y5(s,0,3,this,e,d),c<2)return de.MAX_VALUE;t=de.fromCartographicArray(Xy,t);let u=0,h=Xy[3].longitude;for(let p=0;p<4;++p){let g=Xy[p].longitude,f=Math.abs(g-h);f>V.PI?u+=V.TWO_PI-f:u+=f,h=g}return V.equalsEpsilon(Math.abs(u),V.TWO_PI,V.EPSILON9)&&(t.west=-V.PI,t.east=V.PI,Xy[0].latitude>=0?t.north=V.PI_OVER_TWO:t.south=-V.PI_OVER_TWO),t};dn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof Ui)return;let e=this._scene;this.frustum=new Ui,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=V.toRadians(60)};dn.prototype.switchToOrthographicFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof hn)return;let e=VTe(this),t=this._scene;this.frustum=new hn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};dn.clone=function(e,t){return l(t)||(t=new dn(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var So=dn;var cKi=y(x(),1);function ext(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Hm=ext;var pKi=y(x(),1);var kTe=y(Md(),1),MTe=576,txt=100,LX="#ffffff",U5="#48b";function QTe(e,t){this.credit=e,this.count=t??1}function nxt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(bt.equals(o,t))return!0}return!1}function ixt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;bt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var OTe="cesium-credit-delimiter";function UTe(e){let t=document.createElement("span");return t.textContent=e,t.className=OTe,t}function DTe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function vTe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(UTe(n));else{let u=o[d];u.className!==OTe&&e.replaceChild(UTe(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(DTe(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(DTe(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function oxt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<MTe?(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((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=MTe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function rxt(e){let t=`
.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);
}

.cesium-credit-lightbox {
  background-color: #303336;
  color: ${LX};
  position: relative;
  min-height: ${txt}px;
  margin: auto;
}
.cesium-credit-lightbox > ul > li a,
.cesium-credit-lightbox > ul > li a:visited,
.cesium-credit-wrapper a,
.cesium-credit-wrapper a:visited {
  color: ${LX};
}
.cesium-credit-lightbox > ul > li a:hover {
  color: ${U5};
}
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
  border: 1px solid #444;
  border-radius: 5px;
  max-width: 470px;
}
.cesium-credit-lightbox.cesium-credit-lightbox-mobile {
  height: 100%;
  width: 100%;
}
.cesium-credit-lightbox-title {
  padding: 20px 20px 0 20px;
}
.cesium-credit-lightbox-close {
  font-size: 18pt;
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 6px;
  color: ${LX};
}
.cesium-credit-lightbox-close:hover {
  color: ${U5};
}
.cesium-credit-lightbox > ul {
  margin: 0;
  padding: 12px 20px 12px 40px;
  font-size: 13px;
}
.cesium-credit-lightbox > ul > li {
  padding-bottom: 6px;
}
.cesium-credit-lightbox > ul > li * {
  padding: 0;
  margin: 0;
}

.cesium-credit-expand-link {
  padding-left: 5px;
  cursor: pointer;
  text-decoration: underline;
  color: ${LX};
}
.cesium-credit-expand-link:hover {
  color: ${U5};
}

.cesium-credit-text {
  color: ${LX};
}

.cesium-credit-delimiter {
  padding: 0 5px;
}

.cesium-credit-textContainer *,
.cesium-credit-logoContainer * {
  display: inline;
}

.cesium-credit-textContainer a:hover {
  color: ${U5}
}

.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type {
  padding-left: 5px;
}
`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function vr(e,t,n){let i=this;n=n??document.body;let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(f){r.contains(f.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="&times;",c.className="cesium-credit-lightbox-close",r.appendChild(c);let d=document.createElement("ul");r.appendChild(d);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),rxt(e);let g=bt.clone(vr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=h,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=d,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Ft,lightboxCredits:new Ft},this._defaultCredit=void 0,this.viewport=n,this.container=e}function zTe(e,t,n,i){i=i??1;let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new QTe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}vr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=bt.clone(HTe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,zTe(this,t,e)};vr.prototype.addStaticCredit=function(e){let t=this._staticCredits;nxt(t,e)||t.push(e)};vr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};vr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};vr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};vr.prototype.update=function(){this._expanded&&oxt(this)};vr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&bt.equals(vr.cesiumCredit,this._cesiumCredit)||zTe(this,s,r,Number.MAX_VALUE)}bt.equals(vr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=bt.clone(vr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};vr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;vTe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",vTe(this._creditList,t,void 0,"li"),ixt(this)};vr.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),fe(this)};vr.prototype.isDestroyed=function(){return!1};vr._cesiumCredit=void 0;vr._cesiumCreditInitialized=!1;var D5;function HTe(){if(!l(D5)){let e=en("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new kTe.default(e).path()),D5=new bt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return vr._cesiumCreditInitialized||(vr._cesiumCredit=D5,vr._cesiumCreditInitialized=!0),D5}Object.defineProperties(vr,{cesiumCredit:{get:function(){return HTe(),vr._cesiumCredit},set:function(e){vr._cesiumCredit=e,vr._cesiumCreditInitialized=!0}}});vr.CreditDisplayElement=QTe;var WX=vr;var BKi=y(x(),1);function v5(e){e=e??Q.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??D.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var sxt=new m,axt=new $,cxt=new Me,lxt=new Ui,dxt=new kl,uxt=new hn,mxt=new is,hxt=new D,fxt=[1,1e5];v5.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Ui?a=lxt:s instanceof kl?a=dxt:s instanceof hn?a=uxt:a=mxt,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=fxt,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,h=r.directionWC,p=r.upWC,g=r.rightWC;g=m.negate(g,sxt);let f=axt;$.setColumn(f,0,g,f),$.setColumn(f,1,p,f),$.setColumn(f,2,h,f);let b=Me.fromRotationMatrix(f,cxt);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new Nn({geometryInstances:new Bt({geometry:new PE({origin:u,orientation:b,frustum:a,_drawNearPlane:i===0}),attributes:{color:qt.fromColor(D.fromAlpha(this._color,.1,hxt))},id:this.id,pickPrimitive:this}),appearance:new pn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Nn({geometryInstances:new Bt({geometry:new ON({origin:u,orientation:b,frustum:a,_drawNearPlane:i===0}),attributes:{color:qt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new pn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};v5.prototype.isDestroyed=function(){return!1};v5.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let 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 fe(this)};var Hp=v5;var sJi=y(x(),1);var YKi=y(x(),1),FX=`in vec4 positionEC;

void main()
{
    vec3 position;
    vec3 direction;
    if (czm_orthographicIn3D == 1.0)
    {
        vec2 uv = (gl_FragCoord.xy -  czm_viewport.xy) / czm_viewport.zw;
        vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom
        vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top
        position = vec3(mix(minPlane, maxPlane, uv), 0.0);
        direction = vec3(0.0, 0.0, -1.0);
    } 
    else 
    {
        position = vec3(0.0);
        direction = normalize(positionEC.xyz);
    }

    czm_ray ray = czm_ray(position, direction);

    vec3 ellipsoid_center = czm_view[3].xyz;

    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
    if (!czm_isEmpty(intersection))
    {
        out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
    }
    else
    {
        discard;
    }

    czm_writeLogDepth();
}
`;var XKi=y(x(),1),BX=`in vec4 position;

out vec4 positionEC;

void main()
{
    positionEC = czm_modelView * position;
    gl_Position = czm_projection * positionEC;

    czm_vertexLogDepth();
}
`;function YX(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=e??0}var wX=rn.supportsTypedArrays()?new Float32Array(12):[],KTe=new m,JTe=new m,Lq=new m,jTe=new m,k5=new m;function pxt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof hn)o=m.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,h,KTe),g=m.normalize(p,JTe),f=m.normalize(m.cross(m.UNIT_Z,p,Lq),Lq),b=m.normalize(m.cross(g,f,jTe),jTe),C=m.magnitude(p),E=Math.sqrt(C*C-1);o=m.multiplyByScalar(g,1/C,KTe);let T=E/C;r=m.multiplyByScalar(f,T,JTe),s=m.multiplyByScalar(b,T,Lq)}let a=m.add(o,s,k5);m.subtract(a,r,a),m.multiplyComponents(n,a,a),m.pack(a,wX,0);let c=m.subtract(o,s,k5);m.subtract(c,r,c),m.multiplyComponents(n,c,c),m.pack(c,wX,3);let d=m.add(o,s,k5);m.add(d,r,d),m.multiplyComponents(n,d,d),m.pack(d,wX,6);let u=m.subtract(o,s,k5);return m.add(u,r,u),m.multiplyComponents(n,u,u),m.pack(u,wX,9),wX}YX.prototype.update=function(e){if(this._mode=e.mode,e.mode!==se.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ie(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=ke.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new nt({renderState:this._rs,boundingVolume:new ue(m.ZERO,i.maximumRadius),pass:Ve.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new ze({sources:[BX]}),a=new ze({sources:[FX]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=cn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=pxt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new pt({attributes:{position:new We({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Be.TRIANGLES});this._va=si.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Xe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};YX.prototype.execute=function(e,t){this._mode===se.SCENE3D&&this._command.execute(e,t)};YX.prototype.isDestroyed=function(){return!1};YX.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var NX=YX;var pJi=y(x(),1);function ZZ(){}var Axt=/\bgl_FragDepth\b/,gxt=/\bdiscard\b/;function bxt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(Axt.test(r[a])||gxt.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main()
{
    out_FragColor = vec4(1.0);
}
`;i=new ze({sources:[a]})}else if(!o&&s){let a=`void main()
{
    out_FragColor = vec4(1.0);
    czm_writeLogDepth();
}
`;i=new ze({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function yxt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=ke.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=ke.fromCache(o);return n[t.id]=r,r}ZZ.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=nt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=bxt(n,t.shaderProgram),i.depthOnlyCommand.renderState=yxt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var xxt=/\s+czm_writeLogDepth\(/,Cxt=/\s+czm_vertexLogDepth\(/;function Ext(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let u=0;u<c.length;++u)if(Cxt.test(c[u])){a=!0;break}if(!a){for(let h=0;h<c.length;++h)c[h]=ze.replaceMain(c[h],"czm_log_depth_main");c.push(`

void main()
{
    czm_log_depth_main();
    czm_vertexLogDepth();
}
`)}c=s.sources,a=!1;for(let u=0;u<c.length;++u)xxt.test(c[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<c.length;u++)c[u]=ze.replaceMain(c[u],"czm_log_depth_main");d=`
void main()
{
    czm_log_depth_main();
    czm_writeLogDepth();
}
`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}ZZ.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Ext(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Txt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main () 
{ 
    czm_non_pick_main(); 
    if (${c}.a == 0.0) { 
        discard; 
    } 
    ${c} = ${n}; 
} `,u=r.length,h=new Array(u+1);for(let g=0;g<u;++g)h[g]=ze.replaceMain(r[g],"czm_non_pick_main");h[u]=d;let p=new ze({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function qTe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=ke.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=ke.fromCache(o);return n[t.id]=r,r}ZZ.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=nt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Txt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=qTe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function _Z(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function $Te(e){return e.isArray?e.arrayLength:Et.getComponentCount(e.type)}function Sxt(e){let t=$Te(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function eSe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function tSe(e,t){let n=jt.getMaximum(t);return`(${e}) / float(${n})`}function Ixt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=eSe(n,i,o)}return e.normalized||(n=tSe(n,e.componentType)),n}function _xt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=eSe(o,r,s)}return e.normalized||(o=tSe(o,e.componentType)),o}function Zxt(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,d=n.classProperty,u=Sxt(d),h=["0.0","0.0","0.0","0.0"],p=$Te(d);if(p===1)h[0]=Ixt(d,c);else{let C=["x","y","z","w"];for(let E=0;E<p;E++)h[E]=_xt(d,c,C[E])}let g=t.fragmentShaderSource.defines.slice();g.push(iu.METADATA_PICKING_ENABLED),_Z(g,iu.METADATA_PICKING_VALUE_TYPE,u),_Z(g,iu.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),_Z(g,iu.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),_Z(g,iu.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),_Z(g,iu.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),_Z(g,iu.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let f=new ze({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:f,attributeLocations:t._attributeLocations})}ZZ.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=nt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Zxt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=qTe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function Rxt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}ZZ.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Rxt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Kp=ZZ;var EJi=y(x(),1);function Q5(e){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;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=V.toRadians(o),t._beta=V.toRadians(i.beta),t._gamma=V.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Gxt=new Me,nSe=new Me,Vxt=new $;function Lxt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Me.fromAxisAngle(o,n,nSe),c=Me.fromAxisAngle(r,i,Gxt),d=Me.multiply(c,a,c),u=Me.fromAxisAngle(s,t,nSe);Me.multiply(u,d,d);let h=$.fromQuaternion(d,Vxt);$.multiplyByVector(h,r,r),$.multiplyByVector(h,s,s),$.multiplyByVector(h,o,o)}Q5.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;Lxt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};Q5.prototype.isDestroyed=function(){return!1};Q5.prototype.destroy=function(){return this._removeListener(),fe(this)};var XX=Q5;var RJi=y(x(),1);function Wq(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(Wq.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var Wxt=new m;Wq.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==se.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,V.EPSILON4),-Math.max(this._heightFalloff,0)),s=m.normalize(n.positionWC,Wxt),a=Math.abs(m.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var PX=Wq;var LJi=y(x(),1);function Fxt(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=se.SCENE3D,this.morphTime=se.getMorphTime(se.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0,this.edgeVisibilityRequested=!1}var MX=Fxt;var kJi=y(x(),1);var rc={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},JE=rc.DERIVED_COMMANDS_MAXIMUM_LENGTH,mSe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function jE(){this._frontFaceAlphaByDistance=new kt(0,1,0,1),this._backFaceAlphaByDistance=new kt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=de.clone(de.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(JE),this._derivedBlendCommandTypes=new Array(JE),this._derivedPickCommandTypes=new Array(JE),this._derivedCommandTypesToUpdate=new Array(JE),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(jE.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});jE.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=iSe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=iSe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=oSe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=oSe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Nxt(this,e,t),this._sunVisibleThroughGlobe=Bxt(this,e),this._environmentVisible=wxt(this,e),this._useDepthPlane=Yxt(this,e),this._numberOfTextureUniforms=Xxt(this),this._rectangle=de.clone(t.translucency.rectangle,this._rectangle),Pxt(this,e)};function iSe(e,t,n,i){return e?l(n)?(kt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function oSe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Bxt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function wxt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Yxt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Nxt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==se.SCENE2D&&t.context.depthTexture}function Xxt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Pxt(e,t){e._derivedCommandsLength=Fq(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Fq(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Fq(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<JE;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=eCt())}function Fq(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?rc.PICK_FRONT_FACE:d?rc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:rc.TRANSLUCENT_FRONT_FACE,h=i?rc.PICK_BACK_FACE:d?rc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:rc.TRANSLUCENT_BACK_FACE;return t.mode===se.SCENE2D?(o[r++]=rc.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=rc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=h):(o[r++]=h,o[r++]=u)):c?(n||(o[r++]=rc.DEPTH_ONLY_BACK_FACE),o[r++]=rc.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=rc.DEPTH_ONLY_FRONT_FACE),o[r++]=rc.OPAQUE_BACK_FACE,o[r++]=u),r)}function Km(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function rSe(e,t){return e.indexOf(t)>-1}function Mxt(e,t){Km(e.defines,"TRANSLUCENT"),Km(t.defines,"TRANSLUCENT")}function Uxt(e,t){Km(e.defines,"GROUND_ATMOSPHERE"),Km(t.defines,"GROUND_ATMOSPHERE"),Km(e.defines,"FOG"),Km(t.defines,"FOG"),Km(e.defines,"TRANSLUCENT"),Km(t.defines,"TRANSLUCENT")}function Bq(e,t){if(rSe(t.defines,"TILE_LIMIT_RECTANGLE")||rSe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() 
{ 
    out_FragColor = vec4(1.0); 
} 
`;t.sources=[n]}function wq(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=ze.replaceMain(n[r],"czm_globe_translucency_main");n.push(`

uniform sampler2D u_classificationTexture; 
void main() 
{ 
    vec2 st = gl_FragCoord.xy / czm_viewport.zw; 
#ifdef MANUAL_DEPTH_TEST 
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); 
    if (logDepthOrDepth != 0.0) 
    { 
        vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); 
        float depthEC = eyeCoordinate.z / eyeCoordinate.w; 
        if (v_positionEC.z < depthEC) 
        { 
            discard; 
        } 
    } 
#endif 
    czm_globe_translucency_main(); 
    vec4 classificationColor = texture(u_classificationTexture, st); 
    if (classificationColor.a > 0.0) 
    { 
        // Reverse premultiplication process to get the correct composited result of the classification primitives 
        classificationColor.rgb /= classificationColor.a; 
    } 
    out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); 
} 
`)}function hSe(e,t){wq(e,t),Km(e.defines,"GROUND_ATMOSPHERE"),Km(t.defines,"GROUND_ATMOSPHERE"),Km(e.defines,"FOG"),Km(t.defines,"FOG")}function Dxt(e,t){wq(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function vxt(e,t){hSe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function sSe(e,t){let n=`uniform sampler2D u_classificationTexture; 
void main() 
{ 
    vec2 st = gl_FragCoord.xy / czm_viewport.zw; 
    vec4 pickColor = texture(u_classificationTexture, st); 
    if (pickColor == vec4(0.0)) 
    { 
        discard; 
    } 
    out_FragColor = pickColor; 
} 
`;t.sources=[n]}function kxt(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],d.defines=l(d.defines)?d.defines.slice(0):[],o(c,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:a})}return s}function Qxt(e){e.cull.face=wi.BACK,e.cull.enabled=!0}function Oxt(e){e.cull.face=wi.FRONT,e.cull.enabled=!0}function zxt(e){e.cull.face=wi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Hxt(e){e.cull.face=wi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Kxt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function aSe(e){e.cull.face=wi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=fn.ALPHA_BLEND}function cSe(e){e.cull.face=wi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=fn.ALPHA_BLEND}function Jxt(e){e.cull.face=wi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function jxt(e){e.cull.face=wi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function qxt(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=ke.getState(e);i(s),r=ke.fromCache(s),o[e.id]=r}return r}function RZ(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function $xt(e,t,n,i,o){return l(o)?!i&&l(n)?n:Rt(t,o(e),!1):t}function Rf(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function eCt(){return[new Rf({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:Mxt,getRenderStateFunction:Qxt,getUniformMapFunction:void 0}),new Rf({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:Uxt,getRenderStateFunction:Oxt,getUniformMapFunction:void 0}),new Rf({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:Bq,getRenderStateFunction:zxt,getUniformMapFunction:void 0}),new Rf({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:Bq,getRenderStateFunction:Hxt,getUniformMapFunction:void 0}),new Rf({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:Bq,getRenderStateFunction:Kxt,getUniformMapFunction:void 0}),new Rf({pass:Ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:wq,getRenderStateFunction:aSe,getUniformMapFunction:RZ}),new Rf({pass:Ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:hSe,getRenderStateFunction:cSe,getUniformMapFunction:RZ}),new Rf({pass:Ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Dxt,getRenderStateFunction:aSe,getUniformMapFunction:RZ}),new Rf({pass:Ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:vxt,getRenderStateFunction:cSe,getUniformMapFunction:RZ}),new Rf({pass:Ve.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:sSe,getRenderStateFunction:Jxt,getUniformMapFunction:RZ}),new Rf({pass:Ve.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:sSe,getRenderStateFunction:jxt,getUniformMapFunction:RZ})]}var lSe=new Array(JE),dSe=new Array(JE);jE.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)dSe[o]=this._derivedCommandPacks[n[o]],lSe[o]=mSe[n[o]];tCt(this,e,i,n,lSe,dSe,t)}};function tCt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=a.uniformMapDirtyFrame??0,h=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,b=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),b&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let C=0;C<n;++C){let E=r[C],T=i[C],S=o[C],_=a[S],R,L,W;l(_)?(R=_.uniformMap,L=_.shaderProgram,W=_.renderState):(R=void 0,L=void 0,W=void 0),_=nt.shallowClone(t,_),a[S]=_;let B=_.derivedCommands.uniformMapDirtyFrame??0,Y=_.derivedCommands.shaderProgramDirtyFrame??0,N=_.derivedCommands.renderStateDirtyFrame??0,A=g||B<u,I=f||Y<h,Z=b||N<p;A&&(_.derivedCommands.uniformMapDirtyFrame=d),I&&(_.derivedCommands.shaderProgramDirtyFrame=d),Z&&(_.derivedCommands.renderStateDirtyFrame=d),_.derivedCommands.type=T,_.pass=E.pass,_.pickOnly=E.pickOnly,_.uniformMap=$xt(e,t.uniformMap,R,A,E.getUniformMapFunction),_.shaderProgram=kxt(s.context,t.shaderProgram,L,I,E.getShaderProgramFunction,S),_.renderState=qxt(t.renderState,W,Z,E.getRenderStateFunction,E.renderStateCache)}}}jE.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=mSe[o[a]];n.commandList.push(s[c])}};function fSe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function uSe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var nCt=[rc.OPAQUE_FRONT_FACE,rc.OPAQUE_BACK_FACE],iCt=[rc.DEPTH_ONLY_FRONT_FACE,rc.DEPTH_ONLY_BACK_FACE,rc.DEPTH_ONLY_FRONT_AND_BACK_FACE];jE.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ve.GLOBE],a=e.indices[Ve.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),fSe(s,a,t,i,o,nCt))};jE.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Ve.GLOBE],c=e.indices[Ve.GLOBE],d=e.commands[Ve.TERRAIN_CLASSIFICATION],u=e.indices[Ve.TERRAIN_CLASSIFICATION];if(c===0||u===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&uSe(d,u,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,fSe(a,c,t,i,o,iCt),r.depthTexture){let b=n.packDepth(r,o);s.globeDepthTexture=b}uSe(d,u,t,i,o),s.globeDepthTexture=g,o.framebuffer=f};var UX=jE;var uji=y(x(),1);var OJi=y(x(),1),Ld=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;function Jp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new xi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new xi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new li({color:new D(0,0,0,0),owner:this}),this._clearCommand=new li({color:new D(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Jp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Jp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var oCt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:$n.EQUAL,frontOperation:{fail:Ct.KEEP,zFail:Ct.KEEP,zPass:Ct.KEEP},backFunction:$n.NEVER,reference:0,mask:Qt.CLASSIFICATION_MASK},blending:fn.ALPHA_BLEND},rCt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:$n.NOT_EQUAL,frontOperation:{fail:Ct.KEEP,zFail:Ct.KEEP,zPass:Ct.KEEP},backFunction:$n.NEVER,reference:0,mask:Qt.CLASSIFICATION_MASK},blending:fn.ALPHA_BLEND},sCt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Qt.setCesium3DTileBit(),stencilMask:Qt.CESIUM_3D_TILE_MASK,blending:fn.ALPHA_BLEND},aCt=`uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
uniform sampler2D classifiedTexture;
in vec2 v_textureCoordinates;
void main()
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    if (color.a == 0.0)
    {
        discard;
    }
    bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0)));
#ifdef UNCLASSIFIED
    vec4 highlightColor = czm_invertClassificationColor;
    if (isClassified)
    {
        discard;
    }
#else
    vec4 highlightColor = vec4(1.0);
    if (!isClassified)
    {
        discard;
    }
#endif
    out_FragColor = color * highlightColor;
    gl_FragDepth = texture(depthTexture, v_textureCoordinates).r;
}
`,cCt=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    if (color.a == 0.0)
    {
        discard;
    }
#ifdef UNCLASSIFIED
    out_FragColor = color * czm_invertClassificationColor;
#else
    out_FragColor = color;
#endif
}
`;Jp.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Wt({context:e,width:s,height:a,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:ve.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new kd({context:e,width:s,height:a,format:ml.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;l(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),l(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=ke.fromCache(oCt),this._rsClassified=ke.fromCache(rCt),this._rsDefault=ke.fromCache(sCt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=l(this._previousFramebuffer)?cCt:aCt,u=new ze({defines:["UNCLASSIFIED"],sources:[d]}),h=new ze({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Ld,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Jp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Jp.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Jp.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Jp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Jp.prototype.isDestroyed=function(){return!1};Jp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),fe(this)};var GZ=Jp;var Aji=y(x(),1);function O5(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(O5.prototype,{total:{get:function(){return this._total}}});function Py(e){let t=new Array(yc.NUMBER_OF_JOB_TYPES);t[yc.TEXTURE]=new O5(l(e)?e[yc.TEXTURE]:10),t[yc.PROGRAM]=new O5(l(e)?e[yc.PROGRAM]:10),t[yc.BUFFER]=new O5(l(e)?e[yc.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}Py.getTimestamp=Ni;Object.defineProperties(Py.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Py.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Py.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};Py.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,d;for(d=0;d<c&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Py.getTimestamp();e.execute();let a=Py.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var DX=Py;var Eji=y(x(),1);function z5(e){e=e??Q.EMPTY_OBJECT;let t=Xn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ni(),this._lastMsSampleTime=Ni(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(z5.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});z5.prototype.update=function(e){let t=Ni(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};z5.prototype.destroy=function(){return fe(this)};var ub=z5;var v6i=y(x(),1);var wji=y(x(),1);var sc={};sc.decodeRawMetadataValue=function(e,t,n){switch(e){case jt.INT8:return t.getInt8(n);case jt.UINT8:return t.getUint8(n);case jt.INT16:return t.getInt16(n,!0);case jt.UINT16:return t.getUint16(n,!0);case jt.INT32:return t.getInt32(n,!0);case jt.UINT32:return t.getUint32(n,!0);case jt.INT64:return t.getBigInt64(n,!0);case jt.UINT64:return t.getBigUint64(n,!0);case jt.FLOAT32:return t.getFloat32(n,!0);case jt.FLOAT64:return t.getFloat64(n,!0)}throw new he(`Invalid component type: ${e}`)};sc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=sc.decodeRawMetadataValue(i,t,n);return e.normalized?jt.normalize(o,i):o};sc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=jt.getSizeInBytes(i),r=e.type,s=Et.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,g=sc.decodeRawMetadataValueComponent(e,t,p);u[h]=g}return u}let c=n*a;return sc.decodeRawMetadataValueComponent(e,t,c)};sc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=sc.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return sc.decodeRawMetadataValueElement(e,n,0)};sc.convertToObjectType=function(e,t){if(!l(t)||e===Et.SCALAR||e===Et.STRING||e===Et.BOOLEAN||e===Et.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case Et.VEC2:return M.unpack(n,0,new M);case Et.VEC3:return m.unpack(n,0,new m);case Et.VEC4:return ce.unpack(n,0,new ce);case Et.MAT2:return ki.unpack(n,0,new ki);case Et.MAT3:return $.unpack(n,0,new $);case Et.MAT4:return F.unpack(n,0,new F)}throw new he(`Invalid metadata object type: ${e}`)};sc.convertFromObjectType=function(e,t){if(!l(t)||e===Et.SCALAR||e===Et.STRING||e===Et.BOOLEAN||e===Et.ENUM)return t;switch(e){case Et.VEC2:return M.pack(t,Array(2));case Et.VEC3:return m.pack(t,Array(3));case Et.VEC4:return ce.pack(t,Array(4));case Et.MAT2:return ki.pack(t,Array(4));case Et.MAT3:return $.pack(t,Array(9));case Et.MAT4:return F.pack(t,Array(16))}throw new he(`Invalid metadata object type: ${e}`)};sc.decodeMetadataValues=function(e,t,n){let i=sc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=sc.convertFromObjectType(e.type,t.offset),s=sc.convertFromObjectType(e.type,t.scale);i=tp.valueTransformInPlace(i,r,s,jt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],d=sc.convertToObjectType(e.type,c);s[a]=d}return s}return sc.convertToObjectType(e.type,i)};var vX=Object.freeze(sc);var Dji=y(x(),1);function qE(){this._framebuffer=new xi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(qE.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function lCt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function dCt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture;

in vec2 v_textureCoordinates;

void main()
{
  vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates);
  float globeDepth = czm_unpackDepth(globeDepthPacked);
  float depth = texture(colorTexture, v_textureCoordinates).r;
  out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0,
    czm_packDepth(depth), globeDepthPacked);
}
`,{renderState:ke.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}qE.prototype.update=function(e,t){lCt(this,e,t),dCt(this,e,t)};var uCt=new ce,mCt=new ce(1,1/255,1/65025,1/16581375);qE.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=ce.unpack(i,0,uCt);return ce.divideByScalar(o,255,o),ce.dot(o,mCt)};qE.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};qE.prototype.isDestroyed=function(){return!1};qE.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),fe(this)};var kX=qE;var A6i=y(x(),1);var jji=y(x(),1);function My(e){e=e||{},this._framebufferManager=new xi({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new li({color:new D(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(My.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});My.prototype.update=function(e,t,n,i,o){let r=t.width,s=t.height,a=n?e.halfFloatingPointTexture?ve.HALF_FLOAT:ve.FLOAT:ve.UNSIGNED_BYTE,c=this._framebufferManager.update(e,r,s,1,a,je.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(o)?o:this._framebufferManager.getDepthStencilTexture()),c};My.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};My.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&D.clone(e,this._clearCommand.color),this._clearCommand};My.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};My.prototype.isDestroyed=function(){return!1};My.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,fe(this)};var QX=My;var e4i=y(x(),1);function hCt(e,t){this.near=e??0,this.far=t??0;let n=Ve.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var OX=hCt;var b4i=y(x(),1);var n4i=y(x(),1),Uy=`uniform highp sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function jp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new xi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new xi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new xi,this._tempCopyDepthFramebuffer=new xi,this._updateDepthFramebuffer=new xi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new $e,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(jp.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function pSe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!$e.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,$e.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=$e.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!$e.equals(r,e._rs.viewport)||a)&&(e._rs=ke.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ke.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:fn.ALPHA_BLEND}),e._rsUpdate=ke.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:$n.EQUAL,frontOperation:{fail:Ct.KEEP,zFail:Ct.KEEP,zPass:Ct.KEEP},backFunction:$n.NEVER,reference:Qt.CESIUM_3D_TILE_MASK,mask:Qt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Uy,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Ld,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Uy,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Ld,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new li({color:new D(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}jp.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?ve.HALF_FLOAT:ve.FLOAT:ve.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),pSe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};jp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};jp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};jp.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),pSe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};jp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};jp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(D.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};jp.prototype.isDestroyed=function(){return!1};jp.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),fe(this)};var zX=jp;var G4i=y(x(),1);function $E(){this._framebuffer=new xi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new xi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new $e,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties($E.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function fCt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function pCt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?ve.HALF_FLOAT:ve.FLOAT:ve.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function ACt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!$e.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,$e.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=$e.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!$e.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Uy,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new li({color:new D(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}$E.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;pCt(this,n,o,r,e),ACt(this,n,o,r,i),this._useHdr=e};$E.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};$E.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};$E.prototype.isDestroyed=function(){return!1};$E.prototype.destroy=function(){return fCt(this),fe(this)};var HX=$E;var q4i=y(x(),1);var L4i=y(x(),1),VZ=`#ifdef MRT
layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;
#else
layout (location = 0) out vec4 out_FragColor;
#endif

uniform vec4 u_bgColor;
uniform sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)
    {
#ifdef MRT
        out_FragData_0 = u_bgColor;
        out_FragData_1 = vec4(u_bgColor.a);
#else
        out_FragColor = u_bgColor;
#endif
        return;
    }
    
    discard;
}
`;var F4i=y(x(),1),KX=`/**
 * Compositing for Weighted Blended Order-Independent Transparency. See:
 * - http://jcgt.org/published/0002/02/09/
 * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
 */

uniform sampler2D u_opaque;
uniform sampler2D u_accumulation;
uniform sampler2D u_revealage;

in vec2 v_textureCoordinates;

void main()
{
    vec4 opaque = texture(u_opaque, v_textureCoordinates);
    vec4 accum = texture(u_accumulation, v_textureCoordinates);
    float r = texture(u_revealage, v_textureCoordinates).r;

#ifdef MRT
    vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
#else
    vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
#endif

    out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;

    if (opaque != czm_backgroundColor)
    {
        out_FragColor.a = 1.0;
    }
}
`;function mb(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let 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=new xi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new xi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new xi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new xi({createColorAttachments:!1}),this._opaqueClearCommand=new li({color:new D(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new li({color:new D(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new li({color:new D(0,0,0,0),owner:this}),this._alphaClearCommand=new li({color:new D(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new $e,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function ASe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Yq(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function gSe(e){ASe(e),Yq(e)}function gCt(e,t,n,i){ASe(e),e._accumulationTexture=new Wt({context:t,width:n,height:i,pixelFormat:je.RGBA,pixelDatatype:ve.FLOAT}),e._revealageTexture=new Wt({context:t,pixelFormat:je.RGBA,pixelDatatype:ve.FLOAT,width:n,height:i,flipY:!1})}function bCt(e,t){Yq(e);let n=ne.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Yq(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!c||!d)&&(gSe(e),e._translucentMultipassSupport=!1,i=!1)}return i}mb.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,gCt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!bCt(this,e))return;this._useHDR=i;let u=this,h,p;l(this._compositeCommand)||(h=new ze({sources:[KX]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new ze({defines:["MRT"],sources:[VZ]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new ze({sources:[VZ]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!$e.equals(this._viewport,t.viewport),f=g!==this._useScissorTest;this._useScissorTest=g,$e.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=$e.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!$e.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=ke.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var yCt={enabled:!0,color:new D(0,0,0,0),equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:zo.ONE,functionDestinationRgb:zo.ONE,functionSourceAlpha:zo.ZERO,functionDestinationAlpha:zo.ONE_MINUS_SOURCE_ALPHA},xCt={enabled:!0,color:new D(0,0,0,0),equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:zo.ONE,functionDestinationRgb:zo.ONE,functionSourceAlpha:zo.ONE,functionDestinationAlpha:zo.ONE},CCt={enabled:!0,color:new D(0,0,0,0),equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:zo.ZERO,functionDestinationRgb:zo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:zo.ZERO,functionDestinationAlpha:zo.ONE_MINUS_SOURCE_ALPHA};function Nq(e,t,n,i){let o=n[i.id];if(!l(o)){let r=ke.getState(i);r.depthMask=!1,r.blending=t,o=ke.fromCache(r),n[i.id]=o}return o}function ECt(e,t,n){return Nq(t,yCt,e._translucentRenderStateCache,n)}function TCt(e,t,n){return Nq(t,xCt,e._translucentRenderStateCache,n)}function SCt(e,t,n){return Nq(t,CCt,e._alphaRenderStateCache,n)}var ICt=`    vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
    float ai = czm_out_FragColor.a;
    float wzi = czm_alphaWeight(ai);
    out_FragData_0 = vec4(Ci * wzi, ai);
    out_FragData_1 = vec4(ai * wzi);
`,_Ct=`    vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
    float ai = czm_out_FragColor.a;
    float wzi = czm_alphaWeight(ai);
    out_FragColor = vec4(Ci, ai) * wzi;
`,ZCt=`    float ai = czm_out_FragColor.a;
    out_FragColor = vec4(ai);
`;function Xq(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return ze.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT
vec4 czm_out_FragColor;
bool czm_discard = false;
`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],d="";for(let u=0;u<c.length;u++){let h=c[u];d=`layout (location = ${h[1]}) out vec4 ${h[0]};
${d}`}return a.sources.push(d),a.sources.push(`void main()
{
    czm_translucent_main();
    if (czm_discard)
    {
        discard;
    }
${i}}
`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function RCt(e,t){return Xq(e,t,"translucentMRT",ICt)}function GCt(e,t){return Xq(e,t,"translucentMultipass",_Ct)}function VCt(e,t){return Xq(e,t,"alphaMultipass",ZCt)}mb.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=RCt(t,e.shaderProgram),n.translucentCommand.renderState=ECt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),n.alphaCommand=nt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=GCt(t,e.shaderProgram),n.translucentCommand.renderState=TCt(this,t,e.renderState),n.alphaCommand.shaderProgram=VCt(t,e.shaderProgram),n.alphaCommand.renderState=SCt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function LCt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let b=o[f];b=c?b.derivedCommands.logDepth.command:b,b=u?b.derivedCommands.hdr.command:b;let C=p&&b.receiveShadows?b.derivedCommands.oit.shadows.translucentCommand:b.derivedCommands.oit.translucentCommand;n(C,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,b=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(b,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let f=0;f<o.length;++f){let b=o[f];b=c?b.derivedCommands.logDepth.command:b,b=u?b.derivedCommands.hdr.command:b;let C=p&&b.receiveShadows?b.derivedCommands.oit.shadows.alphaCommand:b.derivedCommands.oit.alphaCommand;n(C,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,b=p&&f.receiveShadows?f.derivedCommands.oit.shadows.alphaCommand:f.derivedCommands.oit.alphaCommand;n(b,t,i,g)}i.framebuffer=h}function WCt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let b=o[f];b=c?b.derivedCommands.logDepth.command:b,b=u?b.derivedCommands.hdr.command:b;let C=p&&b.receiveShadows?b.derivedCommands.oit.shadows.translucentCommand:b.derivedCommands.oit.translucentCommand;n(C,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,b=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(b,t,i,g)}i.framebuffer=h}mb.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){WCt(this,e,t,n,i,o);return}LCt(this,e,t,n,i,o)};mb.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};mb.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,D.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};mb.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};mb.prototype.isDestroyed=function(){return!1};mb.prototype.destroy=function(){return gSe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),fe(this)};var JX=mb;var o8i=y(x(),1);function jX(){this._framebuffer=new xi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(jX.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function FCt(e){e._framebuffer.destroy()}function BCt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Bc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new $e},o.viewport=new $e,e._passState=o}jX.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&BCt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};jX.prototype.isDestroyed=function(){return!1};jX.prototype.destroy=function(){return FCt(this),fe(this)};var qX=jX;var A8i=y(x(),1);function eT(e){let t=new Bc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new $e},t.viewport=new $e,this._context=e,this._fb=new xi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function bSe(e,t,n,i,o=1){let r=Math.max(n,i),s=r*r,a=Math.floor(n*.5),c=Math.floor(i*.5),d=0,u=0,h=0,p=-1,g=new Set;for(let f=0;f<s;++f){if(-a<=d&&d<=a&&-c<=u&&u<=c){let b=4*((c-u)*n+d+a),C=D.bytesToRgba(t[b],t[b+1],t[b+2],t[b+3]),E=e.getObjectByPickColor(C);if(l(E)&&(g.add(E),g.size>=o))break}if(d===u||d<0&&-d===u||d>0&&d===1-u){let b=h;h=-p,p=b}d+=h,u+=p}return[...g]}eT.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return $e.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};eT.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,o=e.height??1,r=this._context,s=this._fb.framebuffer,a=ve.UNSIGNED_BYTE,c=je.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=r.readPixelsToPBO({x:e.x,y:e.y,width:i,height:o,framebuffer:s}),u=I1.create({context:r});try{await u.waitForSignal(g=>t.afterRender.push(g));let h=je.createTypedArray(c,a,i,o);return d.getBufferData(h),bSe(r,h,i,o,n)}catch{throw new he("Async Picking Request Timeout")}finally{u.destroy(),d.destroy()}};eT.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,o=this._context,r=o.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return bSe(o,r,n,i,t)};eT.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};eT.prototype.isDestroyed=function(){return!1};eT.prototype.destroy=function(){return this._fb.destroy(),fe(this)};var $X=eT;var T8i=y(x(),1);function hb(){this._numSamples=1,this._colorFramebuffer=new xi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new xi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new D(0,0,0,0),this._clearCommand=new li({color:new D(0,0,0,0),depth:1,owner:this})}function wCt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(hb.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});hb.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?ve.HALF_FLOAT:ve.FLOAT:ve.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};hb.prototype.clear=function(e,t,n){D.clone(n,this._clearCommand.color),D.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};hb.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};hb.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};hb.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};hb.prototype.isDestroyed=function(){return!1};hb.prototype.destroy=function(){return wCt(this),fe(this)};var tT=hb;var x7i=y(x(),1);var Z8i=y(x(),1);function nT(){}nT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};nT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=ze.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=ze.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; 
void main() 
{ 
    czm_shadow_cast_main(); 
    v_positionEC = (czm_inverseProjection * gl_Position).xyz; 
}`)}return new ze({defines:i,sources:o})};nT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=ze.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let u=0;u<c;++u)r[u]=ze.replaceMain(r[u],"czm_shadow_cast_main");let d="";return t&&(a||(d+=`in vec3 v_positionEC; 
`),d+=`uniform vec4 shadowMap_lightPositionEC; 
`),i?d+=`void main() 
{ 
`:d+=`void main() 
{ 
    czm_shadow_cast_main(); 
    if (out_FragColor.a == 0.0) 
    { 
       discard; 
    } 
`,t?d+=`    float distance = length(${s}); 
    if (distance >= shadowMap_lightPositionEC.w) 
    { 
        discard; 
    } 
    distance /= shadowMap_lightPositionEC.w; // radius 
    out_FragColor = czm_packDepth(distance); 
`:n?d+=`    out_FragColor = vec4(1.0); 
`:d+=`    out_FragColor = czm_packDepth(gl_FragCoord.z); 
`,d+=`} 
`,r.push(d),new ze({defines:o,sources:r})};nT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${d}${u}${t}${n}${i}`};nT.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new ze({defines:i,sources:o})};nT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=ze.findNormalVarying(e),s=!i&&l(r)||i&&o,a=ze.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,f=t.debugCascadeColors,b=t.softShadows,C=h?t._pointBias:i?t._terrainBias:t._primitiveBias,E=e.defines.slice(0),T=e.sources.slice(0),S=T.length;for(let L=0;L<S;++L)T[L]=ze.replaceMain(T[L],"czm_shadow_receive_main");h?E.push("USE_CUBE_MAP_SHADOW"):d&&E.push("USE_SHADOW_DEPTH_TEXTURE"),b&&!h&&E.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?E.push("ENABLE_VERTEX_LIGHTING"):E.push("ENABLE_DAYNIGHT_SHADING")),n&&C.normalShading&&s&&(E.push("USE_NORMAL_SHADING"),C.normalShadingSmooth>0&&E.push("USE_NORMAL_SHADING_SMOOTH"));let _="";h?_+=`uniform samplerCube shadowMap_textureCube; 
`:_+=`uniform sampler2D shadowMap_texture; 
`;let R;return c?R=`    return vec4(${a}, 1.0); 
`:R=`#ifndef LOG_DEPTH 
    return czm_windowToEyeCoordinates(gl_FragCoord); 
#else 
    return vec4(v_logPositionEC, 1.0); 
#endif 
`,_+=`uniform mat4 shadowMap_matrix; 
uniform vec3 shadowMap_lightDirectionEC; 
uniform vec4 shadowMap_lightPositionEC; 
uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; 
uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; 
#ifdef LOG_DEPTH 
in vec3 v_logPositionEC; 
#endif 
vec4 getPositionEC() 
{ 
${R}} 
vec3 getNormalEC() 
{ 
${s?`    return normalize(${r}); 
`:`    return vec3(1.0); 
`}} 
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) 
{ 
${C.normalOffset&&s?`    float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; 
    float normalOffsetScale = 1.0 - nDotL; 
    vec3 offset = normalOffset * normalOffsetScale * normalEC; 
    positionEC.xyz += offset; 
`:""}} 
`,_+=`void main() 
{ 
    czm_shadow_receive_main(); 
    vec4 positionEC = getPositionEC(); 
    vec3 normalEC = getNormalEC(); 
    float depth = -positionEC.z; 
`,_+=`    czm_shadowParameters shadowParameters; 
    shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; 
    shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; 
    shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; 
    shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; 
`,i?_+=`    shadowParameters.depthBias *= max(depth * 0.01, 1.0); 
`:u||(_+=`    shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); 
`),h?_+=`    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; 
    float distance = length(directionEC); 
    directionEC = normalize(directionEC); 
    float radius = shadowMap_lightPositionEC.w; 
    // Stop early if the fragment is beyond the point light radius 
    if (distance > radius) 
    { 
        return; 
    } 
    vec3 directionWC  = czm_inverseViewRotation * directionEC; 
    shadowParameters.depth = distance / radius; 
    shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); 
    shadowParameters.texCoords = directionWC; 
    float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); 
`:p?_+=`    vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); 
    float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); 
    applyNormalOffset(positionEC, normalEC, nDotL); 
    vec4 shadowPosition = shadowMap_matrix * positionEC; 
    // Spot light uses a perspective projection, so perform the perspective divide 
    shadowPosition /= shadowPosition.w; 
    // Stop early if the fragment is not in the shadow bounds 
    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) 
    { 
        return; 
    } 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    shadowParameters.nDotL = nDotL; 
    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); 
`:g?_+=`    float maxDepth = shadowMap_cascadeSplits[1].w; 
    // Stop early if the eye depth exceeds the last cascade 
    if (depth > maxDepth) 
    { 
        return; 
    } 
    // Get the cascade based on the eye-space depth 
    vec4 weights = czm_cascadeWeights(depth); 
    // Apply normal offset 
    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); 
    applyNormalOffset(positionEC, normalEC, nDotL); 
    // Transform position into the cascade 
    vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; 
    // Get visibility 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    shadowParameters.nDotL = nDotL; 
    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); 
    // Fade out shadows that are far away 
    float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; 
    float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); 
    visibility = mix(visibility, 1.0, fade); 
${f?`    // Draw cascade colors for debugging 
    out_FragColor *= czm_cascadeColor(weights); 
`:""}`:_+=`    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); 
    applyNormalOffset(positionEC, normalEC, nDotL); 
    vec4 shadowPosition = shadowMap_matrix * positionEC; 
    // Stop early if the fragment is not in the shadow bounds 
    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) 
    { 
        return; 
    } 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    shadowParameters.nDotL = nDotL; 
    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); 
`,_+=`    out_FragColor.rgb *= visibility; 
} 
`,T.push(_),new ze({defines:E,sources:T})};var qp=nT;function $p(e){e=e??Q.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(rn.isEdge()||(rn.isChrome()||rn.isFirefox())&&rn.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,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 F,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new ce,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new H5,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ue,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new M,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new is:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ce,new ce],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new ce;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new YCt(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,Mq(this),this._clearCommand=new li({depth:1,color:new D}),this._clearPassState=new Bc(t),this._size=e.size??2048,this.size=this._size}$p.MAXIMUM_DISTANCE=2e4;function YCt(e){this.camera=new H5,this.passState=new Bc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Pq(e,t){return ke.fromCache({cull:{enabled:!0,face:wi.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 Mq(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Pq(t,e._primitiveBias),e._terrainRenderState=Pq(t,e._terrainBias),e._pointRenderState=Pq(t,e._pointBias)}$p.prototype.debugCreateRenderStates=function(){Mq(this)};Object.defineProperties($p.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){DCt(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}}});function Uq(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function NCt(e,t){let n=new kd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:ml.DEPTH_COMPONENT16}),i=new Wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,sampler:Ht.NEAREST}),o=new ns({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function XCt(e,t){let n=new Wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:ve.UNSIGNED_INT_24_8,sampler:Ht.NEAREST}),i=new ns({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function PCt(e,t){let n=new kd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:ml.DEPTH_COMPONENT16}),i=new zr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,sampler:Ht.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new ns({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function CSe(e,t){e._isPointLight?PCt(e,t):e._usesDepthTexture?XCt(e,t):NCt(e,t)}function MCt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ne.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Mq(e),Uq(e),CSe(e,t))}function UCt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Uq(e),CSe(e,t),MCt(e,t),ESe(e,t))}function ESe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function DCt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Yt.maximumCubeMapSize>=t?t:Yt.maximumCubeMapSize,o.x=t,o.y=t;let r=new $e(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Yt.maximumTextureSize>=t?t:Yt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new $e(0,0,t,t)):i===4&&(t=Yt.maximumTextureSize>=t*2?t:Yt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new $e(0,0,t,t),n[1].passState.viewport=new $e(t,0,t,t),n[2].passState.viewport=new $e(0,t,t,t),n[3].passState.viewport=new $e(t,t,t,t));e._clearPassState.viewport=new $e(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,d=a.y/o.y,u=a.width/o.x,h=a.height/o.y;s.textureOffsets=new F(u,0,0,c,0,h,0,d,0,0,1,0,0,0,0,1)}}var vCt=new $e;function kCt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; 
in vec2 v_textureCoordinates; 
void main() 
{ 
    vec2 uv = v_textureCoordinates; 
    vec3 dir; 
 
    if (uv.y < 0.5) 
    { 
        if (uv.x < 0.333) 
        { 
            dir.x = -1.0; 
            dir.y = uv.x * 6.0 - 1.0; 
            dir.z = uv.y * 4.0 - 1.0; 
        } 
        else if (uv.x < 0.666) 
        { 
            dir.y = -1.0; 
            dir.x = uv.x * 6.0 - 3.0; 
            dir.z = uv.y * 4.0 - 1.0; 
        } 
        else 
        { 
            dir.z = -1.0; 
            dir.x = uv.x * 6.0 - 5.0; 
            dir.y = uv.y * 4.0 - 1.0; 
        } 
    } 
    else 
    { 
        if (uv.x < 0.333) 
        { 
            dir.x = 1.0; 
            dir.y = uv.x * 6.0 - 1.0; 
            dir.z = uv.y * 4.0 - 3.0; 
        } 
        else if (uv.x < 0.666) 
        { 
            dir.y = 1.0; 
            dir.x = uv.x * 6.0 - 3.0; 
            dir.z = uv.y * 4.0 - 3.0; 
        } 
        else 
        { 
            dir.z = 1.0; 
            dir.x = uv.x * 6.0 - 5.0; 
            dir.y = uv.y * 4.0 - 3.0; 
        } 
    } 
 
    float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); 
    out_FragColor = vec4(vec3(shadow), 1.0); 
} 
`:n=`uniform sampler2D shadowMap_texture; 
in vec2 v_textureCoordinates; 
void main() 
{ 
${e._usesDepthTexture?`    float shadow = texture(shadowMap_texture, v_textureCoordinates).r; 
`:`    float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); 
`}    out_FragColor = vec4(vec3(shadow), 1.0); 
} 
`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ve.OVERLAY,i}function QCt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=vCt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=kCt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!$e.equals(a.renderState.viewport,s))&&(a.renderState=ke.fromCache({viewport:$e.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var eA=new Array(8);eA[0]=new ce(-1,-1,-1,1);eA[1]=new ce(1,-1,-1,1);eA[2]=new ce(1,1,-1,1);eA[3]=new ce(-1,1,-1,1);eA[4]=new ce(-1,-1,1,1);eA[5]=new ce(1,-1,1,1);eA[6]=new ce(1,1,1,1);eA[7]=new ce(-1,1,1,1);var Dy=new F,Dq=new Array(8);for(let e=0;e<8;++e)Dq[e]=new ce;function OCt(e,t){let n=new Bt({geometry:new gh({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:qt.fromColor(t)}}),i=new Bt({geometry:new Zg({radius:.5}),attributes:{color:qt.fromColor(t)}});return new Nn({geometryInstances:[n,i],appearance:new pn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var zCt=[D.RED,D.GREEN,D.BLUE,D.MAGENTA],HCt=new m;function KCt(e,t){QCt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new Hp({camera:e._sceneCamera,color:D.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Hp({camera:e._shadowMapCamera,color:D.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new Hp({camera:e._passes[i].camera,color:zCt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Me.IDENTITY,r=e._pointLightRadius*2,s=m.fromElements(r,r,r,HCt),a=F.fromTranslationQuaternionRotationScale(i,o,s,Dy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=OCt(a,D.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Hp({camera:e._shadowMapCamera,color:D.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function H5(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new pe,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new F}H5.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),pe.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var JCt=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);H5.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(JCt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var jCt=new Array(5),qCt=new Ui,$Ct=new Array(4),TSe=new m,SSe=new m;function eEt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,d=r/o,u=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,u=.9);let p=$Ct,g=jCt;for(g[0]=o,g[s]=r,a=0;a<s;++a){let N=(a+1)/s,A=o*Math.pow(d,N),I=o+c*N,Z=V.lerp(I,A,u);g[a+1]=Z,p[a]=Z-g[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=g[0];for(a=0;a<s-1;++a)N+=p[a],g[a+1]=N}ce.unpack(g,0,e._cascadeSplits[0]),ce.unpack(g,1,e._cascadeSplits[1]),ce.unpack(p,0,e._cascadeDistances);let f=n.frustum,b=f.left,C=f.right,E=f.bottom,T=f.top,S=f.near,_=f.far,R=n.positionWC,L=n.directionWC,W=n.upWC,B=i.frustum.clone(qCt),Y=n.getViewProjection();for(a=0;a<s;++a){B.near=g[a],B.far=g[a+1];let N=F.multiply(B.projectionMatrix,i.viewMatrix,Dy),A=F.inverse(N,Dy),I=F.multiply(Y,A,Dy),Z=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,TSe),G=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,SSe);for(let k=0;k<8;++k){let P=ce.clone(eA[k],Dq[k]);F.multiplyByVector(I,P,P),m.divideByScalar(P,P.w,P),m.minimumByComponent(P,Z,Z),m.maximumByComponent(P,G,G)}Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.z=0,G.x=Math.min(G.x,1),G.y=Math.min(G.y,1),G.z=Math.min(G.z,1);let w=e._passes[a],X=w.camera;X.clone(n);let v=X.frustum;v.left=b+Z.x*(C-b),v.right=b+G.x*(C-b),v.bottom=E+Z.y*(T-E),v.top=E+G.y*(T-E),v.near=S+Z.z*(_-S),v.far=S+G.z*(_-S),w.cullingVolume=X.frustum.computeCullingVolume(R,L,W);let U=e._cascadeMatrices[a];F.multiply(X.getViewProjection(),i.inverseViewMatrix,U),F.multiply(w.textureOffsets,U,U)}}var tEt=new F,nEt=new m,iEt=new m,ySe=new m;function oEt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,Dy),r=F.inverse(o,Dy),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,V.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,nEt);a=m.cross(c,s,iEt),m.normalize(a,a),m.normalize(c,c);let d=m.fromElements(0,0,0,ySe),u=F.computeView(d,s,a,c,tEt),h=F.multiply(u,r,Dy),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,TSe),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,SSe);for(let _=0;_<8;++_){let R=ce.clone(eA[_],Dq[_]);F.multiplyByVector(h,R,R),m.divideByScalar(R,R.w,R),m.minimumByComponent(R,p,p),m.maximumByComponent(R,g,g)}g.z+=1e3,p.z-=10;let f=ySe;f.x=-(.5*(p.x+g.x)),f.y=-(.5*(p.y+g.y)),f.z=-g.z;let b=F.fromTranslation(f,Dy);u=F.multiply(b,u,u);let C=.5*(g.x-p.x),E=.5*(g.y-p.y),T=g.z-p.z,S=n.frustum;S.left=-C,S.right=C,S.bottom=-E,S.top=E,S.near=.01,S.far=T,F.clone(u,n.viewMatrix),F.inverse(u,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var rEt=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],sEt=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],aEt=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function cEt(e,t){let n=new Ui;n.fov=V.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=rEt[i],o.upWC=sEt[i],o.rightWC=aEt[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var lEt=new m,dEt=new m,ISe=new ue,xSe=ISe.center;function uEt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=ISe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,lEt),s=m.negate(i.directionWC,dEt),a=m.dot(r,s);if(e.fadingEnabled){let c=V.clamp(a/.1,0,1);e._darkness=V.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ue.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,r,xSe),xSe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ue.clone(o,e._boundingSphere)}}function mEt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,r.directionWC):e._isPointLight?m.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),m.normalize(s,s),m.negate(s,s),F.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=So.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,uEt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}$p.prototype.update=function(e){if(mEt(this,e),this._needsUpdate)if(UCt(this,e.context),this._isPointLight&&cEt(this,e),this._cascadesEnabled&&(oEt(this,e),this._numberOfCascades>1&&eEt(this,e)),this._isPointLight)this._shadowMapCullingVolume=Ps.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&KCt(this,e)};$p.prototype.updatePass=function(e,t){ESe(this,e,t)};var hEt=new M;function _Se(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={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(){let r=hEt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ce.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ce.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ce,combinedUniforms2:new ce};return Rt(t,o,!1)}function fEt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=nt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Ve.GLOBE,h=n.pass!==Ve.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,f=qp.getShadowCastShaderKeyword(p,u,g,h);if(s=i.shaderCache.getDerivedShaderProgram(d,f),!l(s)){let C=d.vertexShaderSource,E=d.fragmentShaderSource,T=qp.createShadowCastVertexShader(C,p,u),S=qp.createShadowCastFragmentShader(E,p,g,h);s=i.shaderCache.createDerivedShaderProgram(d,f,{vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Qe(a,!1),a.cull=Qe(a.cull,!1),a.cull.enabled=!1,a=ke.fromCache(a)),c=_Se(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}$p.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,d=t.pass===Ve.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=nt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||f||n||g){let b=qp.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(h=i.shaderCache.getDerivedShaderProgram(s,b),!l(h)){let C=qp.createShadowReceiveVertexShader(a,d,u),E=qp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);h=i.shaderCache.createDerivedShaderProgram(s,b,{vertexShaderSource:C,fragmentShaderSource:E,attributeLocations:s._attributeLocations})}p=_Se(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};$p.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=fEt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};$p.prototype.isDestroyed=function(){return!1};$p.prototype.destroy=function(){Uq(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(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return fe(this)};var fb=$p;var Q7i=y(x(),1);var E7i=y(x(),1),eP=`uniform sampler2D u_opaqueDepthTexture;
uniform sampler2D u_translucentDepthTexture;

in vec2 v_textureCoordinates;

void main()
{
    float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;
    float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;
    translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
    out_FragColor = czm_packDepth(translucentDepth);
}
`;var S7i=y(x(),1),iT=`uniform sampler2D colorTexture;

#ifdef DEBUG_SHOW_DEPTH
uniform sampler2D u_packedTranslucentDepth;
#endif

in vec2 v_textureCoordinates;

void main()
{
#ifdef DEBUG_SHOW_DEPTH
    if (v_textureCoordinates.x < 0.5)
    {
        out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));
        out_FragColor.a = 1.0;
    }
#else
    vec4 color = texture(colorTexture, v_textureCoordinates);

#ifdef PICK
    if (color == vec4(0.0))
    {
        discard;
    }
#else
    // Reverse premultiplication process to get the correct composited result of the classification primitives
    color.rgb /= color.a;
#endif
    out_FragColor = color;
#endif
}
`;var pEt=!1;function vy(e){this._drawClassificationFBO=new xi({createDepthAttachments:!1}),this._accumulationFBO=new xi({createDepthAttachments:!1}),this._packFBO=new xi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new li({color:new D(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new li({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new $e,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(vy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function ZSe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function RSe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function AEt(e,t,n,i){ZSe(e),e._translucentDepthStencilTexture=new Wt({context:t,width:n,height:i,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:ve.UNSIGNED_INT_24_8,sampler:Ht.NEAREST})}function gEt(e,t,n,i){RSe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function bEt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(AEt(e,t,o,r),gEt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new ze({sources:[eP]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new ze({sources:[iT]}),a={colorTexture:function(){return e._textureToComposite}},pEt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,h=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new ze({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=nt.shallowClone(u);g.shaderProgram=p,u.derivedCommands.pick=g}l(e._copyCommand)||(s=new ze({sources:[iT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new ze({sources:[iT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!$e.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,$e.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=$e.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!$e.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!$e.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:$n.EQUAL,reference:Qt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!$e.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:fn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}vy.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){bEt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,!d.depthForTranslucentClassification)continue;let u=d.derivedCommands.depth.depthOnlyCommand;t(u,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};vy.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ve.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ve.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Ve.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(c[u],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};vy.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),yEt(this,e,t)};function yEt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}vy.prototype.isSupported=function(){return this._supported};vy.prototype.isDestroyed=function(){return!1};vy.prototype.destroy=function(){return ZSe(this),RSe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),fe(this)};var tP=vy;function xEt(){this.command=void 0,this.near=void 0,this.far=void 0}function K5(e,t,n){let i=e.context,o;i.depthTexture&&(o=new zX);let r;e._useOIT&&i.depthTexture&&(r=new JX(i));let s=new Bc(i);s.viewport=$e.clone(n),this.camera=t,this._cameraClone=So.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new $X(i),this.pickDepthFramebuffer=new qX,this.sceneFramebuffer=new tT,this.edgeFramebuffer=new QX,this.globeDepth=o,this.globeTranslucencyFramebuffer=new HX,this.oit=r,this.translucentTileClassification=new tP(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var vq=new m,kq=new m;function CEt(e,t,n){let i=Math.max(m.maximumComponent(m.abs(e.position,vq)),m.maximumComponent(m.abs(t.position,kq))),o=1/Math.max(1,i);return m.multiplyByScalar(e.position,o,vq),m.multiplyByScalar(t.position,o,kq),m.equalsEpsilon(vq,kq,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}K5.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return CEt(t,n,V.EPSILON15)?(this._cameraStartFired&&Ni()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ni(),So.clone(t,n),!0)};function EEt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===se.SCENE2D,d=t.nearToFarDistance2D;i*=1+V.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let u;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=u;for(let p=0;p<u;++p){let g,f;c?(g=Math.min(i-d,n+p*d),f=Math.min(i,g+d)):(g=Math.max(n,Math.pow(a,p)*n),f=Math.min(i,a*g));let b=h[p];l(b)?(b.near=g,b.far=f):b=h[p]=new OX(g,f)}}function TEt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,d=a.commandsInFrustums;d[c]=l(d[c])?d[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var GSe=new Ps,SEt=new Or;K5.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let Y=0;Y<u.length;++Y)for(let N=0;N<Ve.NUMBER_OF_PASSES;++N)u[Y].indices[N]=0;c.length=0,d.length=0;let h=this._commandExtents,p=h.length,g=0,f=+Number.MAX_VALUE,b=-Number.MAX_VALUE,{shadowsEnabled:C}=o,E=+Number.MAX_VALUE,T=-Number.MAX_VALUE,S=Number.MAX_VALUE,_=t.mode===se.SCENE3D?t.occluder:void 0,{cullingVolume:R}=t,L=GSe.planes;for(let Y=0;Y<5;++Y)L[Y]=R.planes[Y];R=GSe;for(let Y=0;Y<i.length;++Y){let N=i[Y],{pass:A,boundingVolume:I}=N;if(A===Ve.COMPUTE)c.push(N);else if(A===Ve.OVERLAY)d.push(N);else{let Z,G;if(l(I)){if(!e.isVisible(R,N,_))continue;let X=I.computePlaneDistances(r,s,SEt);if(Z=X.start,G=X.stop,f=Math.min(f,Z),b=Math.max(b,G),C&&N.receiveShadows&&Z<fb.MAXIMUM_DISTANCE&&!(A===Ve.GLOBE&&Z<-100&&G>100)){let v=G-Z;A!==Ve.GLOBE&&Z<100&&(S=Math.min(S,v)),E=Math.min(E,Z),T=Math.max(T,G)}}else N instanceof li?(Z=a.near,G=a.far):(Z=a.near,G=a.far,f=Math.min(f,Z),b=Math.max(b,G));let w=h[g];l(w)||(w=h[g]=new xEt),w.command=N,w.near=Z,w.far=G,g++}}C&&(E=Math.min(Math.max(E,a.near),a.far),T=Math.max(Math.min(T,a.far),E),o.nearPlane=E,o.farPlane=T,o.closestObjectSize=S),EEt(this,e,f,b);for(let Y=0;Y<g;Y++)TEt(this,e,h[Y]);if(g<p)for(let Y=g;Y<p;Y++){let N=h[Y];if(!l(N.command))break;N.command=void 0}let W=u.length,{frustumSplits:B}=t;B.length=W+1;for(let Y=0;Y<W;++Y)B[Y]=u[Y].near,Y===W-1&&(B[Y+1]=u[Y].far)};K5.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var oT=K5;var LSe=.1,IEt=new Hm({pass:nr.MOST_DETAILED_PRELOAD}),_Et=new Hm({pass:nr.MOST_DETAILED_PICK}),nP=new Hm({pass:nr.PICK});function fa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new $e(0,0,1,1),n=new So(e);n.frustum=new hn({width:LSe,aspectRatio:1,near:.1}),this._pickOffscreenView=new oT(e,n,t)}fa.prototype.update=function(){this._pickPositionCacheDirty=!0};fa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new kX,n[t]=i),i};var ZEt=new is,REt=new m,J5=new m,GEt=new M,VEt=new F;function LEt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=F.clone(r.transform,VEt);r._setTransform(F.IDENTITY);let h=m.clone(r.position,REt);m.multiplyByScalar(r.right,c,J5),m.add(J5,h,h),m.multiplyByScalar(r.up,d,J5),m.add(J5,h,h),r._setTransform(u),e.mode===se.SCENE2D&&m.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,GEt),g=ZEt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(h,r.directionWC,r.upWC)}var WEt=new kl,FEt=new M;function BEt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),d=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,g=h*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,FEt),b=f.x*n*.5,C=f.y*i*.5,E=WEt;return E.top=g+C,E.bottom=g-C,E.right=p+b,E.left=p-b,E.near=a,E.far=s.far,E.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function j5(e,t,n,i,o){let r=e.camera.frustum;return r instanceof hn||r instanceof is?LEt(e,t,n,i,o):BEt(e,t,n,i,o)}var iP=new $e(0,0,3,3),q5=new M,oP=new D(0,0,0,0);function Qq(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}function WSe(e,t,n,i,o){let{context:r,frameState:s,defaultView:a}=e,{viewport:c,pickFramebuffer:d}=a;e.view=a,c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let u=a.passState;u.viewport=$e.clone(c,u.viewport);let h=no.transformWindowToDrawingBuffer(e,t,q5);Qq(r.drawingBufferHeight,h,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=j5(e,h,n.width,n.height,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=nP,r.uniformState.update(s),e.updateEnvironment(),u=d.begin(n,c),e.updateAndExecuteCommands(u,oP),e.resolveFramebuffers(u)}function FSe(e){let{context:t}=e;t.endFrame()}fa.prototype.pickAsync=async function(e,t,n,i,o=1){let{context:r,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,d=iP;WSe(e,t,d,n,i);let u;return r.webgl2?u=c.endAsync(d,s,o):(u=c.end(d,o),u=Promise.resolve(u),At("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),FSe(e),u};fa.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:s}=r,a=iP;WSe(e,t,a,n,i);let c=s.end(a,o);return FSe(e),c};fa.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=$e.clone(a,d.viewport);let u=no.transformWindowToDrawingBuffer(e,t,q5),h=Qq(o.drawingBufferHeight,u,n,i,iP);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=j5(e,u,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=nP,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(h,a),e.updateAndExecuteCommands(d,oP),e.resolveFramebuffers(d);let p=c.readCenterPixel(h);return o.endFrame(),p};fa.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=$e.clone(s,c.viewport);let d=no.transformWindowToDrawingBuffer(e,t,q5),u=Qq(i.drawingBufferHeight,d,1,1,iP);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=j5(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=nP,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,oP);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,vX.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function wEt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=$e.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=j5(e,t,1,1,s),o.tilesetPassState=nP,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,oP),e.resolveFramebuffers(c),i.endFrame()}var YEt=new Ui,NEt=new kl,XEt=new hn,PEt=new is;fa.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=no.transformWindowToDrawingBuffer(e,t,q5);e.pickTranslucentDepth?wEt(e,d):(e.updateFrameState(),c.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;l(s.frustum.fov)?u=s.frustum.clone(YEt):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(NEt):l(s.frustum.width)?u=s.frustum.clone(XEt):u=s.frustum.clone(PEt);let{frustumCommandsList:h}=a,p=h.length;for(let g=0;g<p;++g){let b=this.getPickDepth(e,g).getDepth(o,d.x,d.y);if(l(b)&&b>0&&b<1){let C=h[g],E;return e.mode===se.SCENE2D?(E=s.position.z,s.position.z=E-C.near+1,u.far=Math.max(1,C.far-C.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=C.near*(g!==0?e.opaqueFrustumNearOffset:1),u.far=C.far,c.updateFrustum(u)),n=no.drawingBufferToWorldCoordinates(e,d,b,n),e.mode===se.SCENE2D&&(s.position.z=E,c.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var MEt=new pe;fa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==se.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,MEt);o.cartographicToCartesian(r,n)}return n};function UEt(e,t,n,i,o,r){for(let s of e){let a=s.object,c=s.position,d=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!d&&(n.push(s),n.length>=t))return!0;let u=a.primitive,h=!1;if(typeof u.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=u.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(h=!0,p.show=Zn.toValue(!1,p.show),o.push(p))}a instanceof Ea&&(h=!0,a.show=!1,r.push(a)),h||(u.show=!1,i.push(u))}}function BSe(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!UEt(s,t,n,i,o,r);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<o.length;++a){let c=o[a];c.show=Zn.toValue(!0,c.show)}for(let a=0;a<r.length;++a)r[a].show=!0;return n}fa.prototype.drillPick=function(e,t,n,i,o){return BSe(a=>this.pick(e,t,i,o,a).map(d=>({object:d,position:void 0,exclude:!1})),n).map(a=>a.object)};var VSe=new m,DEt=new m;function vEt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function wSe(e,t,n,i){let o=t.direction,r=m.mostOrthogonalAxis(o,VSe),s=m.cross(o,r,VSe),a=m.cross(o,s,DEt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??LSe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function kEt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=wSe(e,o,r,a),d=IEt;d.camera=a,d.cullingVolume=c;let u=!0,h=s.length;for(let p=0;p<h;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}fa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)kEt(this,e,t[n])&&t.splice(n--,1)};function YSe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Ml&&YSe(o,t,n))}}function $5(e,t,n,i,o,r){let s=[];if(YSe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new vEt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function QEt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function OEt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,wSe(e,n,o,u.camera);let h=$e.clone(u.viewport,iP),p=u.pickFramebuffer.begin(h,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=_Et:c.tilesetPassState=nP,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,oP),t.resolveFramebuffers(p);let g,f=u.pickFramebuffer.end(h,1)[0];if(t.context.depthTexture){let{frustumCommandsList:b}=u,C=b.length;for(let E=0;E<C;++E){let S=e.getPickDepth(t,E).getDepth(a,0,0);if(l(S)&&S>0&&S<1){let _=b[E],R=_.near*(E!==0?t.opaqueFrustumNearOffset:1),L=_.far,W=R+S*(L-R);g=xn.getPoint(n,W);break}}}if(t.view=t.defaultView,a.endFrame(),l(f)||l(g))return{object:f,position:g,exclude:!l(g)&&r||QEt(f,i)}}function Oq(e,t,n,i,o,r,s,a){return BSe(function(){let d=OEt(e,t,n,o,r,s,a);return d?[d]:void 0},i)}function LZ(e,t,n,i,o,r,s){let a=Oq(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function eO(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}fa.prototype.pickFromRay=function(e,t,n,i){return LZ(this,e,t,n,i,!1,!1)};fa.prototype.drillPickFromRay=function(e,t,n,i,o){return Oq(this,e,t,n,i,o,!1,!1)};fa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=xn.clone(t),n=l(n)?n.slice():n,eO(e,$5(o,e,t,n,i,function(){return LZ(o,e,t,n,i,!1,!0)}))};fa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=xn.clone(t),i=l(i)?i.slice():i,eO(e,$5(r,e,t,i,o,function(){return Oq(r,e,t,n,i,o,!1,!0)}))};var zEt=new m,HEt=new m,KEt=new xn,NSe=new pe;function zq(e,t){let n=e.ellipsoid,i=Zi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,HEt),r=pe.toCartesian(t,n,zEt),s=KEt;s.origin=r,s.direction=o;let a=new xn;return xn.getPoint(s,i,a.origin),m.negate(o,a.direction),a}function XSe(e,t){let n=e.ellipsoid,i=pe.fromCartesian(t,n,NSe);return zq(e,i)}function PSe(e,t){let n=e.ellipsoid;return pe.fromCartesian(t,n,NSe).height}function JEt(e,t,n,i,o){let r=zq(t,n);return $5(e,t,r,i,o,function(){let s=LZ(e,t,r,i,o,!0,!0);if(l(s))return PSe(t,s.position)})}function jEt(e,t,n,i,o,r){let s=XSe(t,n);return $5(e,t,s,i,o,function(){let a=LZ(e,t,s,i,o,!0,!0);if(l(a))return m.clone(a.position,r)})}fa.prototype.sampleHeight=function(e,t,n,i){let o=zq(e,t),r=LZ(this,e,o,n,i,!0,!1);if(l(r))return PSe(e,r.position)};fa.prototype.clampToHeight=function(e,t,n,i,o){let r=XSe(e,t),s=LZ(this,e,r,n,i,!0,!1);if(l(s))return m.clone(s.position,o)};fa.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=JEt(this,e,t[s],n,i);return eO(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};fa.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=jEt(this,e,t[s],n,i,t[s]);return eO(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};fa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var rP=fa;var Aeo=y(x(),1);var k$i=y(x(),1);var Q6i=y(x(),1),sP=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    color /= texture(autoExposure, vec2(0.5)).r;
#else
    color *= vec3(exposure);
#endif
    color = czm_acesTonemapping(color);
    color = czm_inverseGamma(color);

    out_FragColor = vec4(color, fragmentColor.a);
}
`;var z6i=y(x(),1),aP=`precision highp float;

uniform sampler2D randomTexture;
uniform sampler2D depthTexture;
uniform float intensity;
uniform float bias;
uniform float lengthCap;
uniform int stepCount;
uniform int directionCount;

vec4 pixelToEye(vec2 screenCoordinate)
{
    vec2 uv = screenCoordinate / czm_viewport.zw;
    float depth = czm_readDepth(depthTexture, uv);
    vec2 xy = 2.0 * uv - vec2(1.0);
    vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
    posEC = posEC / posEC.w;
    // Avoid numerical error at far plane
    if (depth >= 1.0) {
        posEC.z = czm_currentFrustum.y;
    }
    return posEC;
}

// Reconstruct surface normal in eye coordinates, avoiding edges
vec3 getNormalXEdge(vec3 positionEC)
{
    // Find the 3D surface positions at adjacent screen pixels
    vec2 centerCoord = gl_FragCoord.xy;
    vec3 positionLeft = pixelToEye(centerCoord + vec2(-1.0, 0.0)).xyz;
    vec3 positionRight = pixelToEye(centerCoord + vec2(1.0, 0.0)).xyz;
    vec3 positionUp = pixelToEye(centerCoord + vec2(0.0, 1.0)).xyz;
    vec3 positionDown = pixelToEye(centerCoord + vec2(0.0, -1.0)).xyz;

    // Compute potential tangent vectors
    vec3 dx0 = positionEC - positionLeft;
    vec3 dx1 = positionRight - positionEC;
    vec3 dy0 = positionEC - positionDown;
    vec3 dy1 = positionUp - positionEC;

    // The shorter tangent is more likely to be on the same surface
    vec3 dx = length(dx0) < length(dx1) ? dx0 : dx1;
    vec3 dy = length(dy0) < length(dy1) ? dy0 : dy1;

    return normalize(cross(dx, dy));
}

const float sqrtTwoPi = sqrt(czm_twoPi);

float gaussian(float x, float standardDeviation) {
    float argument = x / standardDeviation;
    return exp(-0.5 * argument * argument) / (sqrtTwoPi * standardDeviation);
}

void main(void)
{
    vec4 positionEC = pixelToEye(gl_FragCoord.xy);

    // Exit if we are too close to the back of the frustum, where the depth value is invalid.
    float maxValidDepth = czm_currentFrustum.y - lengthCap;
    if (-positionEC.z > maxValidDepth)
    {
        out_FragColor = vec4(1.0);
        return;
    }

    vec3 normalEC = getNormalXEdge(positionEC.xyz);
    float gaussianVariance = lengthCap * sqrt(-positionEC.z);
    // Choose a step length such that the marching stops just before 3 * variance.
    float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0);
    float metersPerPixel = czm_metersPerPixel(positionEC, 1.0);
    // Minimum step is 1 pixel to avoid double sampling
    float pixelsPerStep = max(stepLength / metersPerPixel, 1.0);
    stepLength = pixelsPerStep * metersPerPixel;

    float angleStepScale = 1.0 / float(directionCount);
    float angleStep = angleStepScale * czm_twoPi;
    float cosStep = cos(angleStep);
    float sinStep = sin(angleStep);
    mat2 rotateStep = mat2(cosStep, sinStep, -sinStep, cosStep);

    // Initial sampling direction (different for each pixel)
    const float randomTextureSize = 255.0;
    vec2 randomTexCoord = fract(gl_FragCoord.xy / randomTextureSize);
    float randomVal = texture(randomTexture, randomTexCoord).x;
    vec2 sampleDirection = vec2(cos(angleStep * randomVal), sin(angleStep * randomVal));

    float ao = 0.0;
    // Loop over sampling directions
#if __VERSION__ == 300
    for (int i = 0; i < directionCount; i++)
    {
#else
    for (int i = 0; i < 16; i++)
    {
        if (i >= directionCount) {
            break;
        }
#endif
        sampleDirection = rotateStep * sampleDirection;

        float localAO = 0.0;
        vec2 radialStep = pixelsPerStep * sampleDirection;

#if __VERSION__ == 300
        for (int j = 0; j < stepCount; j++)
        {
#else
        for (int j = 0; j < 64; j++)
        {
            if (j >= stepCount) {
                break;
            }
#endif
            // Step along sampling direction, away from output pixel
            vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5);

            // Exit if we stepped off the screen
            if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) {
                break;
            }

            // Compute step vector from output point to sampled point
            vec4 samplePositionEC = pixelToEye(samplePixel);
            vec3 stepVector = samplePositionEC.xyz - positionEC.xyz;

            // Estimate the angle from the surface normal.
            float dotVal = clamp(dot(normalEC, normalize(stepVector)), 0.0, 1.0);
            dotVal = czm_branchFreeTernary(dotVal > bias, dotVal, 0.0);
            dotVal = czm_branchFreeTernary(-samplePositionEC.z <= maxValidDepth, dotVal, 0.0);

            // Weight contribution based on the distance from the output point
            float sampleDistance = length(stepVector);
            float weight = gaussian(sampleDistance, gaussianVariance);
            localAO += weight * dotVal;
        }
        ao += localAO;
    }

    ao *= angleStepScale * stepLength;
    ao = 1.0 - clamp(ao, 0.0, 1.0);
    ao = pow(ao, intensity);
    out_FragColor = vec4(vec3(ao), 1.0);
}
`;var K6i=y(x(),1),cP=`uniform sampler2D colorTexture;
uniform sampler2D ambientOcclusionTexture;
uniform bool ambientOcclusionOnly;
in vec2 v_textureCoordinates;

void main(void)
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates);
    out_FragColor = ambientOcclusionOnly ? ao : ao * color;
}
`;var j6i=y(x(),1),lP=`uniform sampler2D colorTexture;
uniform float gradations;

in vec2 v_textureCoordinates;

void main(void)
{
    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
#ifdef CZM_SELECTED_FEATURE
    if (czm_selected()) {
        out_FragColor = vec4(rgb, 1.0);
        return;
    }
#endif
    float luminance = czm_luminance(rgb);
    float darkness = luminance * gradations;
    darkness = (darkness - fract(darkness)) / gradations;
    out_FragColor = vec4(vec3(darkness), 1.0);
}
`;var $6i=y(x(),1),dP=`uniform sampler2D colorTexture;
uniform sampler2D bloomTexture;
uniform bool glowOnly;

in vec2 v_textureCoordinates;

void main(void)
{
    vec4 color = texture(colorTexture, v_textureCoordinates);

#ifdef CZM_SELECTED_FEATURE
    if (czm_selected()) {
        out_FragColor = color;
        return;
    }
#endif

    vec4 bloom = texture(bloomTexture, v_textureCoordinates);
    out_FragColor = glowOnly ? bloom : bloom + color;
}
`;var tqi=y(x(),1),uP=`uniform sampler2D colorTexture;
uniform float brightness;

in vec2 v_textureCoordinates;

void main(void)
{
    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
    vec3 target = vec3(0.0);
    out_FragColor = vec4(mix(target, rgb, brightness), 1.0);
}
`;var iqi=y(x(),1),mP=`uniform sampler2D colorTexture;
uniform float contrast;
uniform float brightness;

in vec2 v_textureCoordinates;

void main(void)
{
    vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz;
    sceneColor = czm_RGBToHSB(sceneColor);
    sceneColor.z += brightness;
    sceneColor = czm_HSBToRGB(sceneColor);

    float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));
    sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);
    out_FragColor = vec4(sceneColor, 1.0);
}
`;var rqi=y(x(),1),hP=`uniform sampler2D colorTexture;
uniform sampler2D blurTexture;
uniform sampler2D depthTexture;
uniform float focalDistance;

in vec2 v_textureCoordinates;

vec4 toEye(vec2 uv, float depth)
{
   vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
   vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);
   posInCamera = posInCamera / posInCamera.w;
   return posInCamera;
}

float computeDepthBlur(float depth)
{
    float f;
    if (depth < focalDistance)
    {
        f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);
    }
    else
    {
        f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);
        f = pow(f, 0.1);
    }
    f *= f;
    f = clamp(f, 0.0, 1.0);
    return pow(f, 0.5);
}

void main(void)
{
    float depth = czm_readDepth(depthTexture, v_textureCoordinates);
    vec4 posInCamera = toEye(v_textureCoordinates, depth);
    float d = computeDepthBlur(-posInCamera.z);
    out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d);
}
`;var aqi=y(x(),1),fP=`uniform sampler2D depthTexture;

in vec2 v_textureCoordinates;

void main(void)
{
    float depth = czm_readDepth(depthTexture, v_textureCoordinates);
    out_FragColor = vec4(vec3(depth), 1.0);
}
`;var lqi=y(x(),1),pP=`uniform sampler2D depthTexture;
uniform float length;
uniform vec4 color;

in vec2 v_textureCoordinates;

void main(void)
{
    float directions[3];
    directions[0] = -1.0;
    directions[1] = 0.0;
    directions[2] = 1.0;

    float scalars[3];
    scalars[0] = 3.0;
    scalars[1] = 10.0;
    scalars[2] = 3.0;

    float padx = czm_pixelRatio / czm_viewport.z;
    float pady = czm_pixelRatio / czm_viewport.w;

#ifdef CZM_SELECTED_FEATURE
    bool selected = false;
    for (int i = 0; i < 3; ++i)
    {
        float dir = directions[i];
        selected = selected || czm_selected(vec2(-padx, dir * pady));
        selected = selected || czm_selected(vec2(padx, dir * pady));
        selected = selected || czm_selected(vec2(dir * padx, -pady));
        selected = selected || czm_selected(vec2(dir * padx, pady));
        if (selected)
        {
            break;
        }
    }
    if (!selected)
    {
        out_FragColor = vec4(color.rgb, 0.0);
        return;
    }
#endif

    float horizEdge = 0.0;
    float vertEdge = 0.0;

    for (int i = 0; i < 3; ++i)
    {
        float dir = directions[i];
        float scale = scalars[i];

        horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;
        horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;

        vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;
        vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;
    }

    float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);
    out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);
}
`;var uqi=y(x(),1),AP=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

// See slides 142 and 143:
//     http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    float exposure = texture(autoExposure, vec2(0.5)).r;
    color /= exposure;
#else
    color *= vec3(exposure);
#endif

	const float A = 0.22; // shoulder strength
	const float B = 0.30; // linear strength
	const float C = 0.10; // linear angle
	const float D = 0.20; // toe strength
	const float E = 0.01; // toe numerator
	const float F = 0.30; // toe denominator

	const float white = 11.2; // linear white point value

	vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;
	float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;

	c = czm_inverseGamma(c / w);
	out_FragColor = vec4(c, fragmentColor.a);
}
`;var hqi=y(x(),1),gP=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    color /= texture(autoExposure, vec2(0.5)).r;
#else
    color *= vec3(exposure);
#endif
    color = czm_pbrNeutralTonemapping(color);
    color = czm_inverseGamma(color);

    out_FragColor = vec4(color, fragmentColor.a);
}
`;var pqi=y(x(),1),bP=`in vec2 v_textureCoordinates;

uniform sampler2D colorTexture;

const float fxaaQualitySubpix = 0.5;
const float fxaaQualityEdgeThreshold = 0.125;
const float fxaaQualityEdgeThresholdMin = 0.0833;

void main()
{
    vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;
    vec4 color = FxaaPixelShader(
        v_textureCoordinates,
        colorTexture,
        fxaaQualityRcpFrame,
        fxaaQualitySubpix,
        fxaaQualityEdgeThreshold,
        fxaaQualityEdgeThresholdMin);
    float alpha = texture(colorTexture, v_textureCoordinates).a;
    out_FragColor = vec4(color.rgb, alpha);
}
`;var gqi=y(x(),1),ky=`#define SAMPLES 8

uniform float delta;
uniform float sigma;
uniform float direction; // 0.0 for x direction, 1.0 for y direction

uniform sampler2D colorTexture;

#ifdef USE_STEP_SIZE
uniform float stepSize;
#else
uniform vec2 step;
#endif

in vec2 v_textureCoordinates;

//  Incremental Computation of the Gaussian:
//  https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html

void main()
{
    vec2 st = v_textureCoordinates;
    vec2 dir = vec2(1.0 - direction, direction);

#ifdef USE_STEP_SIZE
    vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));
#else
    vec2 step = step;
#endif

    vec3 g;
    g.x = 1.0 / (sqrt(czm_twoPi) * sigma);
    g.y = exp((-0.5 * delta * delta) / (sigma * sigma));
    g.z = g.y * g.y;

    vec4 result = texture(colorTexture, st) * g.x;
    for (int i = 1; i < SAMPLES; ++i)
    {
        g.xy *= g.yz;

        vec2 offset = float(i) * dir * step;
        result += texture(colorTexture, st - offset) * g.x;
        result += texture(colorTexture, st + offset) * g.x;
    }

    out_FragColor = result;
}
`;var yqi=y(x(),1),yP=`uniform sampler2D colorTexture;
uniform sampler2D dirtTexture;
uniform sampler2D starTexture;
uniform vec2 dirtTextureDimensions;
uniform float distortion;
uniform float ghostDispersal;
uniform float haloWidth;
uniform float dirtAmount;
uniform float earthRadius;
uniform float intensity;

in vec2 v_textureCoordinates;

// whether it is in space or not
// 6500000.0 is empirical value
#define DISTANCE_TO_SPACE 6500000.0

// return ndc from world coordinate biased earthRadius
vec4 getNDCFromWC(vec3 WC, float earthRadius)
{
    vec4 positionEC = czm_view * vec4(WC, 1.0);
    positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);
    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
    return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);
}

// Check if current pixel is included Earth
// if then mask it gradually
float isInEarth(vec2 texcoord, vec2 sceneSize)
{
    vec2 NDC = texcoord * 2.0 - 1.0;
    vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);
    vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);
    NDC.xy -= earthPosSC.xy;

    float X = abs(NDC.x) * sceneSize.x;
    float Y = abs(NDC.y) * sceneSize.y;

    return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));
}

// For Chromatic effect
vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)
{
    vec2 sceneSize = czm_viewport.zw;
    vec3 color;
    if(isSpace)
    {
        color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;
        color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;
        color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;
    }
    else
    {
        color.r = texture(tex, texcoord + direction * distortion.r).r;
        color.g = texture(tex, texcoord + direction * distortion.g).g;
        color.b = texture(tex, texcoord + direction * distortion.b).b;
    }
    return vec4(clamp(color, 0.0, 1.0), 0.0);
}

void main(void)
{
    vec4 originalColor = texture(colorTexture, v_textureCoordinates);
    vec3 rgb = originalColor.rgb;
    bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;

    // Sun position
    vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);
    vec4 sunPositionEC = czm_view * sunPos;
    vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);
    sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);

    // If sun is not in the screen space, use original color.
    if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
    {
        // Lens flare is disabled when not in space until #5932 is fixed.
        //    https://github.com/CesiumGS/cesium/issues/5932
        out_FragColor = originalColor;
        return;
    }

    vec2 texcoord = vec2(1.0) - v_textureCoordinates;
    vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
    vec2 invPixelSize = 1.0 / pixelSize;
    vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);

    // ghost vector to image centre:
    vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
    vec3 direction = normalize(vec3(ghostVec, 0.0));

    // sample ghosts:
    vec4 result = vec4(0.0);
    vec4 ghost = vec4(0.0);
    for (int i = 0; i < 4; ++i)
    {
        vec2 offset = fract(texcoord + ghostVec * float(i));
        // Only bright spots from the centre of the source image
        ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
    }
    result += ghost;

    // sample halo
    vec2 haloVec = normalize(ghostVec) * haloWidth;
    float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
    weightForHalo = pow(1.0 - weightForHalo, 5.0);

    result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;

    // dirt on lens
    vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;
    if (dirtTexCoords.x > 1.0)
    {
        dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) :  fract(dirtTexCoords.x);
    }
    if (dirtTexCoords.y > 1.0)
    {
        dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) :  fract(dirtTexCoords.y);
    }
    result += dirtAmount * texture(dirtTexture, dirtTexCoords);

    // Rotating starburst texture's coordinate
    // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))
    float camrot = czm_view[0].z + czm_view[1].y;
    float cosValue = cos(camrot);
    float sinValue = sin(camrot);
    mat3 rotation = mat3(
        cosValue, -sinValue, 0.0,
        sinValue, cosValue, 0.0,
        0.0, 0.0, 1.0
    );

    vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);
    vec3 st2 = vec3((rotation * st1).xy, 1.0);
    vec3 st3 = st2 * 0.5 + vec3(0.5);
    vec2 lensStarTexcoord = st3.xy;
    float weightForLensFlare = length(vec3(sunPos.xy, 0.0));
    float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);

    if (!isSpace)
    {
        result *= oneMinusWeightForLensFlare * intensity * 0.2;
    }
    else
    {
        result *= oneMinusWeightForLensFlare * intensity;
        result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;
    }

    result += texture(colorTexture, v_textureCoordinates);

    out_FragColor = result;
}
`;var Cqi=y(x(),1),xP=`uniform sampler2D colorTexture;
uniform vec3 white;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

// See equation 4:
//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
    float exposure = texture(autoExposure, vec2(0.5)).r;
    color /= exposure;
#else
    color *= vec3(exposure);
#endif
    color = (color * (1.0 + color / white)) / (1.0 + color);
    color = czm_inverseGamma(color);
    out_FragColor = vec4(color, fragmentColor.a);
}
`;var Tqi=y(x(),1),CP=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

float rand(vec2 co)
{
    return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
}

void main(void)
{
    float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;
    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
    vec3 green = vec3(0.0, 1.0, 0.0);
    out_FragColor = vec4((noiseValue + rgb) * green, 1.0);
}
`;var Iqi=y(x(),1),EP=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

// See equation 3:
//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
    float exposure = texture(autoExposure, vec2(0.5)).r;
    color /= exposure;
#else
    color *= vec3(exposure);
#endif
    color = color / (1.0 + color);
    color = czm_inverseGamma(color);
    out_FragColor = vec4(color, fragmentColor.a);
}
`;var Zqi=y(x(),1),TP=`uniform sampler2D colorTexture;
uniform sampler2D silhouetteTexture;

in vec2 v_textureCoordinates;

void main(void)
{
    vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
    vec4 color = texture(colorTexture, v_textureCoordinates);
    out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
}
`;var Gqi=y(x(),1);/**
 * @license
 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of NVIDIA CORPORATION nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */var SP=`/**
 * @license
 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of NVIDIA CORPORATION nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples
// Original source (archived): https://archive.org/details/nvidiagame-works-graphics-samples-master
// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h
// Shader link in fork: https://github.com/lyntel/GraphicsSamples/blob/3d30817ebeeade64fe6a4fc3aa1fe4265c29b6fd/samples/es3-kepler/FXAA/FXAA3_11.h

// Steps used to integrate into Cesium:
// * The following defines are set:
//       #define FXAA_PC 1
//       #define FXAA_WEBGL_1 1
//       #define FXAA_GREEN_AS_LUMA 1
//       #define FXAA_EARLY_EXIT 1
//       #define FXAA_GLSL_120 1
// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.
// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace
//   /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.
// * There are no implicit conversions from ivec* to vec* so replace:
//       #define FxaaInt2 ivec2
//           with
//       #define FxaaInt2 vec2
// * The texture2DLod function is only available in vertex shaders so replace:
//       #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
//       #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
//           with
//       #define FxaaTexTop(t, p) texture(t, p)
//       #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.
// * The following parameters to FxaaPixelShader are unused and can be removed:
//       fxaaConsolePosPos
//       fxaaConsoleRcpFrameOpt
//       fxaaConsoleRcpFrameOpt2
//       fxaaConsole360RcpFrameOpt2
//       fxaaConsoleEdgeSharpness
//       fxaaConsoleEdgeThreshold
//       fxaaConsoleEdgeThresholdMi
//       fxaaConsole360ConstDir

//
// Choose the quality preset.
// This needs to be compiled into the shader as it effects code.
// Best option to include multiple presets is to
// in each shader define the preset, then include this file.
//
// OPTIONS
// -----------------------------------------------------------------------
// 10 to 15 - default medium dither (10=fastest, 15=highest quality)
// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
// 39       - no dither, very expensive
//
// NOTES
// -----------------------------------------------------------------------
// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
// 13 = about same speed as FXAA 3.9 and better than 12
// 23 = closest to FXAA 3.9 visually and performance wise
//  _ = the lowest digit is directly related to performance
// _  = the highest digit is directly related to style
//
//#define FXAA_QUALITY_PRESET 12


#if (FXAA_QUALITY_PRESET == 10)
    #define FXAA_QUALITY_PS 3
    #define FXAA_QUALITY_P0 1.5
    #define FXAA_QUALITY_P1 3.0
    #define FXAA_QUALITY_P2 12.0
#endif
#if (FXAA_QUALITY_PRESET == 11)
    #define FXAA_QUALITY_PS 4
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 3.0
    #define FXAA_QUALITY_P3 12.0
#endif
#if (FXAA_QUALITY_PRESET == 12)
    #define FXAA_QUALITY_PS 5
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 4.0
    #define FXAA_QUALITY_P4 12.0
#endif
#if (FXAA_QUALITY_PRESET == 13)
    #define FXAA_QUALITY_PS 6
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 4.0
    #define FXAA_QUALITY_P5 12.0
#endif
#if (FXAA_QUALITY_PRESET == 14)
    #define FXAA_QUALITY_PS 7
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 4.0
    #define FXAA_QUALITY_P6 12.0
#endif
#if (FXAA_QUALITY_PRESET == 15)
    #define FXAA_QUALITY_PS 8
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 4.0
    #define FXAA_QUALITY_P7 12.0
#endif
#if (FXAA_QUALITY_PRESET == 20)
    #define FXAA_QUALITY_PS 3
    #define FXAA_QUALITY_P0 1.5
    #define FXAA_QUALITY_P1 2.0
    #define FXAA_QUALITY_P2 8.0
#endif
#if (FXAA_QUALITY_PRESET == 21)
    #define FXAA_QUALITY_PS 4
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 8.0
#endif
#if (FXAA_QUALITY_PRESET == 22)
    #define FXAA_QUALITY_PS 5
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 8.0
#endif
#if (FXAA_QUALITY_PRESET == 23)
    #define FXAA_QUALITY_PS 6
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 8.0
#endif
#if (FXAA_QUALITY_PRESET == 24)
    #define FXAA_QUALITY_PS 7
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 3.0
    #define FXAA_QUALITY_P6 8.0
#endif
#if (FXAA_QUALITY_PRESET == 25)
    #define FXAA_QUALITY_PS 8
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 4.0
    #define FXAA_QUALITY_P7 8.0
#endif
#if (FXAA_QUALITY_PRESET == 26)
    #define FXAA_QUALITY_PS 9
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 4.0
    #define FXAA_QUALITY_P8 8.0
#endif
#if (FXAA_QUALITY_PRESET == 27)
    #define FXAA_QUALITY_PS 10
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 4.0
    #define FXAA_QUALITY_P9 8.0
#endif
#if (FXAA_QUALITY_PRESET == 28)
    #define FXAA_QUALITY_PS 11
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 2.0
    #define FXAA_QUALITY_P9 4.0
    #define FXAA_QUALITY_P10 8.0
#endif
#if (FXAA_QUALITY_PRESET == 29)
    #define FXAA_QUALITY_PS 12
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 2.0
    #define FXAA_QUALITY_P9 2.0
    #define FXAA_QUALITY_P10 4.0
    #define FXAA_QUALITY_P11 8.0
#endif
#if (FXAA_QUALITY_PRESET == 39)
    #define FXAA_QUALITY_PS 12
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.0
    #define FXAA_QUALITY_P2 1.0
    #define FXAA_QUALITY_P3 1.0
    #define FXAA_QUALITY_P4 1.0
    #define FXAA_QUALITY_P5 1.5
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 2.0
    #define FXAA_QUALITY_P9 2.0
    #define FXAA_QUALITY_P10 4.0
    #define FXAA_QUALITY_P11 8.0
#endif

#define FxaaBool bool
#define FxaaFloat float
#define FxaaFloat2 vec2
#define FxaaFloat3 vec3
#define FxaaFloat4 vec4
#define FxaaHalf float
#define FxaaHalf2 vec2
#define FxaaHalf3 vec3
#define FxaaHalf4 vec4
#define FxaaInt2 vec2
#define FxaaTex sampler2D

#define FxaaSat(x) clamp(x, 0.0, 1.0)
#define FxaaTexTop(t, p) texture(t, p)
#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))

FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }

FxaaFloat4 FxaaPixelShader(
    //
    // Use noperspective interpolation here (turn off perspective interpolation).
    // {xy} = center of pixel
    FxaaFloat2 pos,
    //
    // Input color texture.
    // {rgb_} = color in linear or perceptual color space
    // if (FXAA_GREEN_AS_LUMA == 0)
    //     {___a} = luma in perceptual color space (not linear)
    FxaaTex tex,
    //
    // Only used on FXAA Quality.
    // This must be from a constant/uniform.
    // {x_} = 1.0/screenWidthInPixels
    // {_y} = 1.0/screenHeightInPixels
    FxaaFloat2 fxaaQualityRcpFrame,
    //
    // Only used on FXAA Quality.
    // This used to be the FXAA_QUALITY_SUBPIX define.
    // It is here now to allow easier tuning.
    // Choose the amount of sub-pixel aliasing removal.
    // This can effect sharpness.
    //   1.00 - upper limit (softer)
    //   0.75 - default amount of filtering
    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)
    //   0.25 - almost off
    //   0.00 - completely off
    FxaaFloat fxaaQualitySubpix,
    //
    // Only used on FXAA Quality.
    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.
    // It is here now to allow easier tuning.
    // The minimum amount of local contrast required to apply algorithm.
    //   0.333 - too little (faster)
    //   0.250 - low quality
    //   0.166 - default
    //   0.125 - high quality
    //   0.063 - overkill (slower)
    FxaaFloat fxaaQualityEdgeThreshold,
    //
    // Only used on FXAA Quality.
    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.
    // It is here now to allow easier tuning.
    // Trims the algorithm from processing darks.
    //   0.0833 - upper limit (default, the start of visible unfiltered edges)
    //   0.0625 - high quality (faster)
    //   0.0312 - visible limit (slower)
    // Special notes when using FXAA_GREEN_AS_LUMA,
    //   Likely want to set this to zero.
    //   As colors that are mostly not-green
    //   will appear very dark in the green channel!
    //   Tune by looking at mostly non-green content,
    //   then start at zero and increase until aliasing is a problem.
    FxaaFloat fxaaQualityEdgeThresholdMin
) {
/*--------------------------------------------------------------------------*/
    FxaaFloat2 posM;
    posM.x = pos.x;
    posM.y = pos.y;
    FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
    #define lumaM rgbyM.y
    FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
/*--------------------------------------------------------------------------*/
    FxaaFloat maxSM = max(lumaS, lumaM);
    FxaaFloat minSM = min(lumaS, lumaM);
    FxaaFloat maxESM = max(lumaE, maxSM);
    FxaaFloat minESM = min(lumaE, minSM);
    FxaaFloat maxWN = max(lumaN, lumaW);
    FxaaFloat minWN = min(lumaN, lumaW);
    FxaaFloat rangeMax = max(maxWN, maxESM);
    FxaaFloat rangeMin = min(minWN, minESM);
    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
    FxaaFloat range = rangeMax - rangeMin;
    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
    FxaaBool earlyExit = range < rangeMaxClamped;
/*--------------------------------------------------------------------------*/
    if(earlyExit)
        return rgbyM;
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNS = lumaN + lumaS;
    FxaaFloat lumaWE = lumaW + lumaE;
    FxaaFloat subpixRcpRange = 1.0/range;
    FxaaFloat subpixNSWE = lumaNS + lumaWE;
    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNESE = lumaNE + lumaSE;
    FxaaFloat lumaNWNE = lumaNW + lumaNE;
    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNWSW = lumaNW + lumaSW;
    FxaaFloat lumaSWSE = lumaSW + lumaSE;
    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
/*--------------------------------------------------------------------------*/
    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
    FxaaBool horzSpan = edgeHorz >= edgeVert;
    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
/*--------------------------------------------------------------------------*/
    if(!horzSpan) lumaN = lumaW;
    if(!horzSpan) lumaS = lumaE;
    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
/*--------------------------------------------------------------------------*/
    FxaaFloat gradientN = lumaN - lumaM;
    FxaaFloat gradientS = lumaS - lumaM;
    FxaaFloat lumaNN = lumaN + lumaM;
    FxaaFloat lumaSS = lumaS + lumaM;
    FxaaBool pairN = abs(gradientN) >= abs(gradientS);
    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
    if(pairN) lengthSign = -lengthSign;
    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
/*--------------------------------------------------------------------------*/
    FxaaFloat2 posB;
    posB.x = posM.x;
    posB.y = posM.y;
    FxaaFloat2 offNP;
    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
    if(!horzSpan) posB.x += lengthSign * 0.5;
    if( horzSpan) posB.y += lengthSign * 0.5;
/*--------------------------------------------------------------------------*/
    FxaaFloat2 posN;
    posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
    posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
    FxaaFloat2 posP;
    posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
    posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
    FxaaFloat subpixE = subpixC * subpixC;
    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
/*--------------------------------------------------------------------------*/
    if(!pairN) lumaNN = lumaSS;
    FxaaFloat gradientScaled = gradient * 1.0/4.0;
    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
    FxaaFloat subpixF = subpixD * subpixE;
    FxaaBool lumaMLTZero = lumaMM < 0.0;
/*--------------------------------------------------------------------------*/
    lumaEndN -= lumaNN * 0.5;
    lumaEndP -= lumaNN * 0.5;
    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
    FxaaBool doneNP = (!doneN) || (!doneP);
    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
/*--------------------------------------------------------------------------*/
    if(doneNP) {
        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
        doneN = abs(lumaEndN) >= gradientScaled;
        doneP = abs(lumaEndP) >= gradientScaled;
        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
        doneNP = (!doneN) || (!doneP);
        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
/*--------------------------------------------------------------------------*/
        #if (FXAA_QUALITY_PS > 3)
        if(doneNP) {
            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
            doneN = abs(lumaEndN) >= gradientScaled;
            doneP = abs(lumaEndP) >= gradientScaled;
            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
            doneNP = (!doneN) || (!doneP);
            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
/*--------------------------------------------------------------------------*/
            #if (FXAA_QUALITY_PS > 4)
            if(doneNP) {
                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                doneN = abs(lumaEndN) >= gradientScaled;
                doneP = abs(lumaEndP) >= gradientScaled;
                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
                doneNP = (!doneN) || (!doneP);
                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
/*--------------------------------------------------------------------------*/
                #if (FXAA_QUALITY_PS > 5)
                if(doneNP) {
                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                    doneN = abs(lumaEndN) >= gradientScaled;
                    doneP = abs(lumaEndP) >= gradientScaled;
                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
                    doneNP = (!doneN) || (!doneP);
                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
/*--------------------------------------------------------------------------*/
                    #if (FXAA_QUALITY_PS > 6)
                    if(doneNP) {
                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                        doneN = abs(lumaEndN) >= gradientScaled;
                        doneP = abs(lumaEndP) >= gradientScaled;
                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
                        doneNP = (!doneN) || (!doneP);
                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
/*--------------------------------------------------------------------------*/
                        #if (FXAA_QUALITY_PS > 7)
                        if(doneNP) {
                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                            doneN = abs(lumaEndN) >= gradientScaled;
                            doneP = abs(lumaEndP) >= gradientScaled;
                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
                            doneNP = (!doneN) || (!doneP);
                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
/*--------------------------------------------------------------------------*/
    #if (FXAA_QUALITY_PS > 8)
    if(doneNP) {
        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
        doneN = abs(lumaEndN) >= gradientScaled;
        doneP = abs(lumaEndP) >= gradientScaled;
        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
        doneNP = (!doneN) || (!doneP);
        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
/*--------------------------------------------------------------------------*/
        #if (FXAA_QUALITY_PS > 9)
        if(doneNP) {
            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
            doneN = abs(lumaEndN) >= gradientScaled;
            doneP = abs(lumaEndP) >= gradientScaled;
            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
            doneNP = (!doneN) || (!doneP);
            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
/*--------------------------------------------------------------------------*/
            #if (FXAA_QUALITY_PS > 10)
            if(doneNP) {
                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                doneN = abs(lumaEndN) >= gradientScaled;
                doneP = abs(lumaEndP) >= gradientScaled;
                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
                doneNP = (!doneN) || (!doneP);
                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
/*--------------------------------------------------------------------------*/
                #if (FXAA_QUALITY_PS > 11)
                if(doneNP) {
                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                    doneN = abs(lumaEndN) >= gradientScaled;
                    doneP = abs(lumaEndP) >= gradientScaled;
                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
                    doneNP = (!doneN) || (!doneP);
                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
/*--------------------------------------------------------------------------*/
                    #if (FXAA_QUALITY_PS > 12)
                    if(doneNP) {
                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                        doneN = abs(lumaEndN) >= gradientScaled;
                        doneP = abs(lumaEndP) >= gradientScaled;
                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
                        doneNP = (!doneN) || (!doneP);
                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
/*--------------------------------------------------------------------------*/
                    }
                    #endif
/*--------------------------------------------------------------------------*/
                }
                #endif
/*--------------------------------------------------------------------------*/
            }
            #endif
/*--------------------------------------------------------------------------*/
        }
        #endif
/*--------------------------------------------------------------------------*/
    }
    #endif
/*--------------------------------------------------------------------------*/
                        }
                        #endif
/*--------------------------------------------------------------------------*/
                    }
                    #endif
/*--------------------------------------------------------------------------*/
                }
                #endif
/*--------------------------------------------------------------------------*/
            }
            #endif
/*--------------------------------------------------------------------------*/
        }
        #endif
/*--------------------------------------------------------------------------*/
    }
/*--------------------------------------------------------------------------*/
    FxaaFloat dstN = posM.x - posN.x;
    FxaaFloat dstP = posP.x - posM.x;
    if(!horzSpan) dstN = posM.y - posN.y;
    if(!horzSpan) dstP = posP.y - posM.y;
/*--------------------------------------------------------------------------*/
    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
    FxaaFloat spanLength = (dstP + dstN);
    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
    FxaaFloat spanLengthRcp = 1.0/spanLength;
/*--------------------------------------------------------------------------*/
    FxaaBool directionN = dstN < dstP;
    FxaaFloat dst = min(dstN, dstP);
    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
    FxaaFloat subpixG = subpixF * subpixF;
    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
/*--------------------------------------------------------------------------*/
    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
    return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
}
`;var Xqi=y(x(),1);function rT(){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=new xi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new M,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(rT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function MSe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function qEt(e,t){MSe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?ve.HALF_FLOAT:ve.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new xi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function USe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function $Et(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function eTt(e,t){let n=`uniform sampler2D colorTexture; 
in vec2 v_textureCoordinates; 
float sampleTexture(vec2 offset) { 
`;return e===0?n+=`    vec4 color = texture(colorTexture, v_textureCoordinates + offset); 
    return czm_luminance(color.rgb); 
`:n+=`    return texture(colorTexture, v_textureCoordinates + offset).r; 
`,n+=`}

`,n+=`uniform vec2 colorTextureDimensions; 
uniform vec2 minMaxLuminance; 
uniform sampler2D previousLuminance; 
void main() { 
    float color = 0.0; 
    float xStep = 1.0 / colorTextureDimensions.x; 
    float yStep = 1.0 / colorTextureDimensions.y; 
    int count = 0; 
    for (int i = 0; i < 3; ++i) { 
        for (int j = 0; j < 3; ++j) { 
            vec2 offset; 
            offset.x = -xStep + float(i) * xStep; 
            offset.y = -yStep + float(j) * yStep; 
            if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { 
                continue; 
            } 
            color += sampleTexture(offset); 
            ++count; 
        } 
    } 
    if (count > 0) { 
        color /= float(count); 
    } 
`,e===t-1&&(n+=`    float previous = texture(previousLuminance, vec2(0.5)).r; 
    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); 
    color = previous + (color - previous) / (60.0 * 1.5); 
    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); 
`),n+=`    out_FragColor = vec4(color); 
} 
`,n}function tTt(e,t){USe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(eTt(r,i),{framebuffer:n[r].framebuffer,uniformMap:$Et(e,r)});e._commands=o}rT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new li({color:new D(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};rT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,qEt(this,e),tTt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};rT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};rT.prototype.isDestroyed=function(){return!1};rT.prototype.destroy=function(){return MSe(this),USe(this),fe(this)};var IP=rT;var a$i=y(x(),1);var Mqi=y(x(),1),nTt={NEAREST:0,LINEAR:1},Fu=nTt;function sT(e){e=e??Q.EMPTY_OBJECT;let{name:t=Kn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=Fu.NEAREST,pixelFormat:a=je.RGBA,pixelDatatype:c=ve.UNSIGNED_BYTE,clearColor:d=D.BLACK,scissorRectangle:u}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=d,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;let h=new Bc;h.scissorTest={enabled:!0,rectangle:l(u)?$e.clone(u):new $e},this._passState=h,this._ready=!1,this._name=t,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(sT.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(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(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 iTt=/uniform\s+sampler2D\s+depthTexture/g;sT.prototype._isSupported=function(e){return!iTt.test(this._fragmentShader)||e.depthTexture};function oTt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof Wt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Wt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function rTt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function sTt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function aTt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=rTt(e,r),n[r]=oTt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Wt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=sTt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Rt(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 cTt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE
uniform sampler2D czm_idTexture;
uniform sampler2D czm_selectedIdTexture;
uniform float czm_selectedIdTextureStep;
in vec2 v_textureCoordinates;
bool czm_selected(vec2 offset)
{
    bool selected = false;
    vec4 id = texture(czm_idTexture, v_textureCoordinates + offset);
    for (int i = 0; i < ${t}; ++i)
    {
        vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5));
        if (all(equal(id, selectedId)))
        {
            return true;
        }
    }
    return false;
}
bool czm_selected()
{
    return czm_selected(vec2(0.0));
}

${e}`}function lTt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=cTt(n,o)}let i=new ze({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function dTt(e){let t=e._sampleMode,n,i;t===Fu.LINEAR?(n=zt.LINEAR,i=ui.LINEAR):(n=zt.NEAREST,i=ui.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Ht({wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function uTt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function mTt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function hTt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:d}=i[a];e._actualUniforms[c]=new Wt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],d=r[c],u=e._textureCache.getStageByName(d);if(l(u))e._actualUniforms[c]=mTt(e,d);else if(typeof d=="string"){let h=new Ge({url:d});s.push(h.fetchImage().then(uTt(e,c)))}else e._texturesToCreate.push({name:c,source:d})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function DSe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof Wt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function fTt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function pTt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Wt({context:t,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:Ht.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,d=c.length;for(let u=0;u<d;++u){let h=c[u].color;r[o]=D.floatToByte(h.red),r[o+1]=D.floatToByte(h.green),r[o+2]=D.floatToByte(h.blue),r[o+3]=D.floatToByte(h.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=D.floatToByte(c.red),r[o+1]=D.floatToByte(c.green),r[o+2]=D.floatToByte(c.blue),r[o+3]=D.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Wt({context:t,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:Ht.NEAREST})}sT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&DSe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=fTt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,pTt(this,e),aTt(this),hTt(this,e),lTt(this,e),dTt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=ke.fromCache({viewport:new $e(0,0,i.width,i.height)}))),this._command.renderState=o};sT.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Ht.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};sT.prototype.isDestroyed=function(){return!1};sT.prototype.destroy=function(){return DSe(this),fe(this)};var Lo=sT;var h$i=y(x(),1);function aT(e){e=e??Q.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Kn()),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}Object.defineProperties(aT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].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}}});aT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};aT.prototype.get=function(e){return this._stages[e]};function ATt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}aT.prototype.update=function(e,t){this._selectedDirty=ATt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};aT.prototype.isDestroyed=function(){return!1};aT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var Wd=aT;var $r={};function Hq(e){let o=`#define USE_STEP_SIZE
${ky}`,r=new Lo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Fu.LINEAR}),s=new Lo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Fu.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=c}}}),new Wd({name:e,stages:[r,s],uniforms:a})}$r.createBlurStage=function(){return Hq("czm_blur")};$r.createDepthOfFieldStage=function(){let e=Hq("czm_depth_of_field_blur"),t=new Lo({name:"czm_depth_of_field_composite",fragmentShader:hP,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Wd({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};$r.isDepthOfFieldSupported=function(e){return e.context.depthTexture};$r.createEdgeDetectionStage=function(){let e=Kn();return new Lo({name:`czm_edge_detection_${e}`,fragmentShader:pP,uniforms:{length:.25,color:D.clone(D.BLACK)}})};$r.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function gTt(e){if(!l(e))return $r.createEdgeDetectionStage();let t=new Wd({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; 
`,o+=`        vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); 
        if (edge${a}.a > 0.0) 
        { 
            color = edge${a}; 
            break; 
        } 
`,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates; 
void main() { 
    vec4 color = vec4(0.0); 
    for (int i = 0; i < ${e.length}; i++) 
    { 
${o}    } 
    out_FragColor = color; 
} 
`,s=new Lo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Wd({name:"czm_edge_detection_composite",stages:[t,s]})}$r.createSilhouetteStage=function(e){let t=gTt(e),n=new Lo({name:"czm_silhouette_color_edges",fragmentShader:TP,uniforms:{silhouetteTexture:t.name}});return new Wd({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};$r.isSilhouetteSupported=function(e){return e.context.depthTexture};$r.createBloomStage=function(){let e=new Lo({name:"czm_bloom_contrast_bias",fragmentShader:mP,uniforms:{contrast:128,brightness:-.3}}),t=Hq("czm_bloom_blur"),n=new Wd({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Lo({name:"czm_bloom_generate_composite",fragmentShader:dP,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new Wd({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};$r.createAmbientOcclusionStage=function(){let e=new Lo({name:"czm_ambient_occlusion_generate",fragmentShader:aP,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Lo({name:"czm_ambient_occlusion_composite",fragmentShader:cP,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new Wd({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};$r.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var bTt=`#define FXAA_QUALITY_PRESET 39 
${SP}
${bP}`;$r.createFXAAStage=function(){return new Lo({name:"czm_FXAA",fragmentShader:bTt,sampleMode:Fu.LINEAR})};$r.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=sP,new Lo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};$r.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=AP,new Lo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};$r.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=gP,new Lo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};$r.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=EP,new Lo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};$r.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=xP,new Lo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:D.WHITE,autoExposure:void 0,exposure:1}})};$r.createAutoExposureStage=function(){return new IP};$r.createBlackAndWhiteStage=function(){return new Lo({name:"czm_black_and_white",fragmentShader:lP,uniforms:{gradations:5}})};$r.createBrightnessStage=function(){return new Lo({name:"czm_brightness",fragmentShader:uP,uniforms:{brightness:.5}})};$r.createNightVisionStage=function(){return new Lo({name:"czm_night_vision",fragmentShader:CP})};$r.createDepthViewStage=function(){return new Lo({name:"czm_depth_view",fragmentShader:fP})};$r.createLensFlareStage=function(){return new Lo({name:"czm_lens_flare",fragmentShader:yP,uniforms:{dirtTexture:en("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:en("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ie.WGS84.maximumRadius}})};var Bu=$r;var q$i=y(x(),1);function pb(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function ZP(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Kq(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[ZP(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let d=0;d<c;++d){let u=s[a[d]];if(typeof u=="string"){let h=e.getStageByName(u);l(h)&&(r[ZP(h)]=!0)}}}return i.name}function _P(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let h=0;h<c;++h){let p=i.get(h);l(p.length)?a=_P(e,t,n,p,o):a=Kq(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=ZP(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=ZP(i.get(d));let h=n[u];for(let p=0;p<d;++p)h[ZP(i.get(p))]=!0}return a}function yTt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=_P(e,t,n,i,void 0);a=_P(e,t,n,o,a),a=Kq(e,t,n,r,a),a=_P(e,t,n,e,a),Kq(e,t,n,s,a)}else _P(e,t,n,e,void 0);return n}function xTt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,d=o._clearColor,u,h,p=e._framebuffers,g=p.length;for(u=0;u<g;++u){if(h=p[u],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||c!==h.pixelDatatype||!D.equals(d,h.clearColor))continue;let f=h.stages,b=f.length,C=!1;for(let E=0;E<b;++E)if(n[f[E]]){C=!0;break}if(!C)break}return l(h)&&u<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new xi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(h),h)}function CTt(e,t){let n=yTt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=xTt(e,i,n[i]))}function Jq(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function ETt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,d=Math.ceil(n*c),u=Math.ceil(i*c),h=Math.min(d,u);a.forcePowerOfTwo&&(V.isPowerOfTwo(h)||(h=V.nextPowerOfTwo(h)),d=h,u=h),a.buffer.update(t,d,u),a.clear=new li({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}pb.prototype.updateDependencies=function(){this._updateDependencies=!0};pb.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(Jq(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&CTt(this,e);let c=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==c||this._height!==d;!n&&!u||(this._width=c,this._height=d,this._updateDependencies=!1,Jq(this),ETt(this,e))};pb.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};pb.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};pb.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};pb.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};pb.prototype.isDestroyed=function(){return!1};pb.prototype.destroy=function(){return Jq(this),fe(this)};var cT=pb;var eeo=y(x(),1),TTt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var Ab=Object.freeze(TTt);var jq=[];function Ol(){let e=Bu.createFXAAStage(),t=Bu.createAmbientOcclusionStage(),n=Bu.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Bu.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Ab.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new cT(this),r={},s=jq;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let d=c.length;if(l(d))for(let u=0;u<d;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(Ol.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return qq(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case Ab.REINHARD:n=Bu.createReinhardTonemappingStage(t);break;case Ab.MODIFIED_REINHARD:n=Bu.createModifiedReinhardTonemappingStage(t);break;case Ab.FILMIC:n=Bu.createFilmicTonemappingStage(t);break;case Ab.PBR_NEUTRAL:n=Bu.createPbrNeutralTonemappingStage(t);break;default:n=Bu.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function qq(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}Ol.prototype.add=function(e){let t=this._stageNames,n=jq;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Ol.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=jq;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Ol.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Ol.prototype.get=function(e){return qq(this),this._stages[e]};Ol.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Ol.prototype.getStageByName=function(e){return this._stageNames[e]};Ol.prototype.update=function(e,t,n){qq(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let E=0;E<r.length;++E){let T=r[E];T.ready&&T.enabled&&T._isSupported(e)&&(o[s++]=T)}o.length=s;let a=s!==i.length;if(!a){for(let E=0;E<s;++E)if(o[E]!==i[E]){a=!0;break}}let c=this._ao,d=this._bloom,u=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let g=c.enabled&&c._isSupported(e),f=d.enabled&&d._isSupported(e),b=h.enabled&&h._isSupported(e),C=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||f!==this._bloomEnabled||b!==this._tonemappingEnabled||C!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=f,this._tonemappingEnabled=b,this._fxaaEnabled=C,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let T=new Uint8Array(196608);for(let S=0;S<196608;S+=3)T[S]=Math.floor(Math.random()*255);this._randomTexture=new Wt({context:e,pixelFormat:je.RGB,pixelDatatype:ve.UNSIGNED_BYTE,source:{arrayBufferView:T,width:256,height:256},sampler:new Ht({wrapS:bn.REPEAT,wrapT:bn.REPEAT,minificationFilter:zt.NEAREST,magnificationFilter:ui.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),d.update(e,t),h.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let E=0;E<r.length;++E)r[E].update(e,t);s=0;for(let E=0;E<r.length;++E){let T=r[E];T.ready&&T.enabled&&T._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};Ol.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function lT(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Ol.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return lT(t)};function tA(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){tA(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)tA(e.get(r),t,lT(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)tA(e.get(r),t,n,i,o)}Ol.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,d=this._autoExposure,u=this._tonemapping,h=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),b=s.enabled&&s._isSupported(e);if(!b&&!h&&!p&&!f&&r===0)return;let C=t;h&&a.ready&&(tA(a,e,C,n,i),C=lT(a)),p&&c.ready&&(tA(c,e,C,n,i),C=lT(c)),g&&d.ready&&tA(d,e,C,n,i),f&&u.ready&&(tA(u,e,C,n,i),C=lT(u));let E=C;if(r>0){tA(o[0],e,C,n,i);for(let T=1;T<r;++T)tA(o[T],e,lT(o[T-1]),n,i);E=lT(o[r-1])}b&&s.ready&&tA(s,e,E,n,i)};Ol.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Ld,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Ol.prototype.isDestroyed=function(){return!1};Ol.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),fe(this)};var RP=Ol;var Beo=y(x(),1);function dT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}dT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};dT.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof hn,!(this._previousMode===se.SCENE2D||this._previousMode===se.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE2D,!0),n._mode=se.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===se.COLUMBUS_VIEW?nSt(this,e):lSt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var STt=new m,ITt=new m,_Tt=new m,ZTt=new m,RTt=new m,GTt=new m,VTt=new m,LTt=new pe,WTt=new F,FTt=new Ui,BTt=new hn,wTt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};dT.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===se.COLUMBUS_VIEW||this._previousMode===se.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,se.COLUMBUS_VIEW,!0),n.camera._setTransform(F.IDENTITY);let i=STt,o=ITt,r=_Tt;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,o),o),m.cross(m.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===se.SCENE2D)m.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,m.negate(m.UNIT_Z,o),m.clone(m.UNIT_Y,r);else{m.clone(d.positionWC,i),m.clone(d.directionWC,o),m.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,VTt),h=Tt.eastNorthUpToFixedFrame(u,t,WTt);F.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,LTt),i),F.multiplyByPointAsVector(h,o,o),F.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=BTt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=FTt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=V.toRadians(60));let a=wTt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=uSt(a);GP(this,c),this._previousMode===se.SCENE2D?dSt(this,e,a,c):(a.position2D=F.multiplyByPoint(So.TRANSFORM_2D,i,ZTt),a.direction2D=F.multiplyByPointAsVector(So.TRANSFORM_2D,o,RTt),a.up2D=F.multiplyByPointAsVector(So.TRANSFORM_2D,r,GTt),n._mode=se.MORPHING,$Se(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var t$={position:new m,direction:new m,up:new m,frustum:void 0},kSe=new Ui;dT.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===se.SCENE3D||this._previousMode===se.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE3D,!0),n._mode=se.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===se.SCENE2D)OTt(this,e,t);else{let i;e>0?(i=t$,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=QSe(this,t);let o,r=n.camera;r.frustum instanceof hn?o=r.frustum.clone():(o=kSe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=V.toRadians(60)),i.frustum=o;let s=tIe(i);GP(this,s),e$(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};dT.prototype.isDestroyed=function(){return!1};dT.prototype.destroy=function(){return tO(this),fe(this)};function GP(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Lu(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Gn.LEFT_DOWN),e._morphHandler.setInputAction(n,Gn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Gn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Gn.WHEEL)}}function tO(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var YTt=new pe,NTt=new m,XTt=new F;function QSe(e,t){let n=e._scene,i=n.camera,o=t$,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,YTt);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,NTt),u=Tt.eastNorthUpToFixedFrame(d,t,XTt);return F.multiplyByPointAsVector(u,i.direction,s),F.multiplyByPointAsVector(u,i.up,a),o}var PTt=new m,MTt=new m,UTt=new m,DTt=new m,vTt=new m,kTt=new m;function e$(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(r.position,PTt),a=m.clone(r.direction,MTt),c=m.clone(r.up,UTt),d=F.multiplyByPoint(So.TRANSFORM_2D_INVERSE,n.position,DTt),u=F.multiplyByPointAsVector(So.TRANSFORM_2D_INVERSE,n.direction,vTt),h=F.multiplyByPointAsVector(So.TRANSFORM_2D_INVERSE,n.up,kTt);function p(f){Jm(s,d,f.time,r.position),Jm(a,u,f.time,r.direction),Jm(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:bs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){eIe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var QTt=new hn,OSe=new m,zSe=new m,HSe=new m,n$=new m,KSe=new m,JSe=new m;function OTt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=t$,m.fromDegrees(0,0,5*n.maximumRadius,n,r.position),m.negate(r.position,r.direction),m.normalize(r.direction,r.direction),m.clone(m.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=QSe(e,n));let s;e._morphToOrthographic?(s=QTt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=kSe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=V.toRadians(60)),r.frustum=s;let a=tIe(r);GP(e,a);let c;e._morphToOrthographic?c=function(){e$(e,t,r,a)}:c=function(){qSe(e,t,r,function(){e$(e,t,r,a)})},t>0?(i._mode=se.SCENE2D,o.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,n$),complete:function(){i._mode=se.MORPHING,c()}})):c()}function Jm(e,t,n,i){return m.lerp(e,t,n,i)}function jSe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof hn)return;let a=s.frustum.fov,c=V.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=V.lerp(a,c,p.time);let g=d/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:bs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var zTt=new m,HTt=new m,KTt=new m,$q=new m,JTt=new m,jTt=new m,qTt=new is,$Tt=new xn,eSt=new m,tSt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function nSt(e,t){t*=.5;let n=e._scene,i=n.camera,o=m.clone(i.position,zTt),r=m.clone(i.direction,HTt),s=m.clone(i.up,KTt),a=m.negate(m.UNIT_Z,JTt),c=m.clone(m.UNIT_Y,jTt),d=$q;if(t>0)m.clone(m.ZERO,$q),d.z=5*n.ellipsoid.maximumRadius;else{m.clone(o,$q);let C=$Tt;F.multiplyByPoint(So.TRANSFORM_2D,o,C.origin),F.multiplyByPointAsVector(So.TRANSFORM_2D,r,C.direction);let E=n.globe;if(l(E)){let T=E.pickWorldCoordinates(C,n,!0,eSt);l(T)&&(F.multiplyByPoint(So.TRANSFORM_2D_INVERSE,T,d),d.z+=m.distance(o,d))}}let u=qTt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let h=tSt;h.position=d,h.direction=a,h.up=c,h.frustum=u;let p=nIe(h);GP(e,p);function g(C){Jm(o,d,C.time,i.position),Jm(r,a,C.time,i.direction),Jm(s,c,C.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(C,E){C.position.z=E}let b=n.tweens.add({duration:t,easingFunction:bs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){jSe(e,t,h,f,p)}});e._currentTweens.push(b)}var vSe=new pe,iSt={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new is},oSt={position:new m,direction:new m,up:new m,frustum:void 0},rSt=new m,sSt=new xn,aSt=new F,cSt=new m;function lSt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=iSt;if(t>0)m.clone(m.ZERO,r.position),r.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,vSe),i.mapProjection.project(vSe,r.position),m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);let h=sSt;m.clone(r.position2D,h.origin);let p=m.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,cSt),f=Tt.eastNorthUpToFixedFrame(g,n,aSt);F.inverseTransformation(f,f),F.multiplyByPointAsVector(f,p,p),F.multiplyByPointAsVector(So.TRANSFORM_2D,p,p);let b=i.globe;if(l(b)){let C=b.pickWorldCoordinates(h,i,!0,rSt);if(l(C)){let E=m.distance(r.position2D,C);C.x+=E,m.clone(C,r.position2D)}}}function s(h,p){h.position.x=p}F.multiplyByPoint(So.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(So.TRANSFORM_2D,r.direction,r.direction2D),F.multiplyByPointAsVector(So.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=oSt;F.multiplyByPoint(So.TRANSFORM_2D_INVERSE,r.position2D,c.position),m.clone(r.direction,c.direction),m.clone(r.up,c.up),c.frustum=a;let d=nIe(c);GP(e,d);function u(){jSe(e,t,r,s,d)}$Se(e,t,r,u)}function qSe(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=V.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=V.lerp(c,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:bs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(h)}function dSt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(n.position,n$),a=m.clone(n.direction,KSe),c=m.clone(n.up,JSe);o._mode=se.MORPHING;function d(){r.frustum=n.frustum.clone();let u=m.clone(r.position,OSe),h=m.clone(r.direction,zSe),p=m.clone(r.up,HSe);u.z=s.z;function g(b){Jm(u,s,b.time,r.position),Jm(h,a,b.time,r.direction),Jm(p,c,b.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:bs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():qSe(e,0,n,d)}function $Se(e,t,n,i){let o=e._scene,r=o.camera,s=m.clone(r.position,OSe),a=m.clone(r.direction,zSe),c=m.clone(r.up,HSe),d=m.clone(n.position2D,n$),u=m.clone(n.direction2D,KSe),h=m.clone(n.up2D,JSe);function p(f){Jm(s,d,f.time,r.position),Jm(a,u,f.time,r.direction),Jm(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:bs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){eIe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function eIe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:bs.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function tIe(e){return function(t){let n=t._scene;n._mode=se.SCENE3D,n.morphTime=se.getMorphTime(se.SCENE3D),tO(t);let i=n.camera;(t._previousMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE3D,r)}}function nIe(e){return function(t){let n=t._scene;n._mode=se.SCENE2D,n.morphTime=se.getMorphTime(se.SCENE2D),tO(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE2D,o)}}function uSt(e){return function(t){let n=t._scene;n._mode=se.COLUMBUS_VIEW,n.morphTime=se.getMorphTime(se.COLUMBUS_VIEW),tO(t);let i=n.camera;(t._previousModeMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.COLUMBUS_VIEW,r)}}var VP=dT;var Rto=y(x(),1);var Oeo=y(x(),1);var Yeo=y(x(),1),mSt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},qi=Object.freeze(mSt);function Ya(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function hSt(e,t){M.clone(e.distance.startPosition,t.distance.startPosition),M.clone(e.distance.endPosition,t.distance.endPosition),M.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),M.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function iIe(e,t,n){let i=Ya(qi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new M;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new M,endPosition:new M},d.angleAndHeight={startPosition:new M,endPosition:new M},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,M.lerp(u.position1,u.position2,.5,s[i])},Gn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Gn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(hSt(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(M.clone(u.distance.endPosition,d.distance.endPosition),M.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let h=d.angleAndHeight.endPosition.x,p=d.prevAngle,g=Math.PI*2;for(;h>=p+Math.PI;)h-=g;for(;h<p-Math.PI;)h+=g;d.angleAndHeight.endPosition.x=-h*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Gn.PINCH_MOVE,t)}function oIe(e,t){let n=Ya(qi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new M,endPosition:new M,valid:!1}),s.startPosition=new M,M.clone(M.ZERO,s.startPosition),s.endPosition=new M,e._eventHandler.setInputAction(function(c){let d=7.5*V.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,M.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Gn.WHEEL,t)}function WZ(e,t,n){let i=Ya(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new M;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new M,endPosition:new M,valid:!1});let c,d;n===qi.LEFT_DRAG?(c=Gn.LEFT_DOWN,d=Gn.LEFT_UP):n===qi.RIGHT_DRAG?(c=Gn.RIGHT_DOWN,d=Gn.RIGHT_UP):n===qi.MIDDLE_DRAG&&(c=Gn.MIDDLE_DOWN,d=Gn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,M.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){i$(Ya(n,void 0),e);for(let u of Object.values(Wa)){let h=Ya(n,u);i$(h,e)}},d,t)}function i$(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function rIe(e,t){M.clone(e.startPosition,t.startPosition),M.clone(e.endPosition,t.endPosition)}function fSt(e,t,n){let i=n._isDown,o=!1,r=Ya(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,i$(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new M,endPosition:new M,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function sIe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in qi)if(qi.hasOwnProperty(s)){let a=qi[s];if(l(a)){let c=Ya(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new M,endPosition:new M,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new M,endPosition:new M})}}e._eventHandler.setInputAction(function(s){for(let a in qi)if(qi.hasOwnProperty(a)){let c=qi[a];if(l(c)){let d=Ya(c,t);fSt(c,t,e),r[d]&&(n[d]?(rIe(i[d],o[d]),o[d].valid=!0,rIe(s,i[d]),n[d]=!1):M.clone(s.endPosition,i[d].endPosition))}}M.clone(s.endPosition,e._currentMousePosition)},Gn.MOUSE_MOVE,t)}function jm(e){this._eventHandler=new Lu(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new M,oIe(this,void 0),iIe(this,void 0,e),WZ(this,void 0,qi.LEFT_DRAG),WZ(this,void 0,qi.RIGHT_DRAG),WZ(this,void 0,qi.MIDDLE_DRAG),sIe(this,void 0);for(let t in Wa)if(Wa.hasOwnProperty(t)){let n=Wa[t];l(n)&&(oIe(this,n),iIe(this,n,e),WZ(this,n,qi.LEFT_DRAG),WZ(this,n,qi.RIGHT_DRAG),WZ(this,n,qi.MIDDLE_DRAG),sIe(this,n))}}Object.defineProperties(jm.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Ya(qi.WHEEL)]||!this._update[Ya(qi.WHEEL,Wa.SHIFT)]||!this._update[Ya(qi.WHEEL,Wa.CTRL)]||!this._update[Ya(qi.WHEEL,Wa.ALT)];return this._buttonsDown>0||e}}});jm.prototype.isMoving=function(e,t){let n=Ya(e,t);return!this._update[n]};jm.prototype.getMovement=function(e,t){let n=Ya(e,t);return this._movement[n]};jm.prototype.getLastMovement=function(e,t){let n=Ya(e,t),i=this._lastMovement[n];if(i.valid)return i};jm.prototype.isButtonDown=function(e,t){let n=Ya(e,t);return this._isDown[n]};jm.prototype.getStartMousePosition=function(e,t){if(e===qi.WHEEL)return this._currentMousePosition;let n=Ya(e,t);return this._eventStartPosition[n]};jm.prototype.getButtonPressTime=function(e,t){let n=Ya(e,t);return this._pressTime[n]};jm.prototype.getButtonReleaseTime=function(e,t){let n=Ya(e,t);return this._releaseTime[n]};jm.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};jm.prototype.isDestroyed=function(){return!1};jm.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),fe(this)};var LP=jm;var tto=y(x(),1);function nO(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=Qe(n),this._stopObject=Qe(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(nO.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}}});nO.prototype.cancelTween=function(){this._tweens.remove(this)};function Gf(){this._tweens=[]}Object.defineProperties(Gf.prototype,{length:{get:function(){return this._tweens.length}}});Gf.prototype.add=function(e){if(e=e??Q.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new nO(this);let t=e.duration/ai.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/ai.SECONDS_PER_MILLISECOND,o=e.easingFunction??bs.LINEAR_NONE,r=e.startObject,s=new Gxe(r);s.to(Qe(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new nO(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Gf.prototype.addProperty=function(e){e=e??Q.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Gf.prototype.addAlpha=function(e){e=e??Q.EMPTY_OBJECT;let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Gf.prototype.addOffsetIncrement=function(e){e=e??Q.EMPTY_OBJECT;let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Gf.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Gf.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Gf.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Gf.prototype.get=function(e){return this._tweens[e]};Gf.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/ai.SECONDS_PER_MILLISECOND:Ni();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var uT=Gf;function FP(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=qi.LEFT_DRAG,this.zoomEventTypes=[qi.RIGHT_DRAG,qi.WHEEL,qi.PINCH],this.rotateEventTypes=qi.LEFT_DRAG,this.tiltEventTypes=[qi.MIDDLE_DRAG,qi.PINCH,{eventType:qi.LEFT_DRAG,modifier:Wa.CTRL},{eventType:qi.RIGHT_DRAG,modifier:Wa.CTRL}],this.lookEventTypes={eventType:qi.LEFT_DRAG,modifier:Wa.SHIFT};let t=e.ellipsoid??ie.default;this.minimumPickingTerrainHeight=ie.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ie.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ie.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ie.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new LP(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 uT,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new M(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new M(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new M,this._strafeEndMousePosition=new M,this._zoomMouseStart=new M(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._panLastMousePosition=new M,this._panLastWorldPosition=new m,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new pe(Math.PI,V.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function pSt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function ASt(e){return M.equalsEpsilon(e.startPosition,e.endPosition,V.EPSILON14)}var gSt=.4;function bSt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new M,endPosition:new M,motion:new M,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=c&&d&&(d.getTime()-c.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(c&&d&&u<gSt){let g=pSt(p,i),f=e.getLastMovement(t,n);if(!l(f)||ASt(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=M.clone(f.startPosition,a.startPosition),a.endPosition=M.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=M.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||M.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let b=e.getStartMousePosition(t,n);o(r,b,a)}}}function ySt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var aIe=[];function zl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(aIe[0]=n,n=aIe);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,h=d.modifier,p=s.isMoving(u,h)&&s.getMovement(u,h),g=s.getStartMousePosition(u,h);e.enableInputs&&t&&(p?(i(e,g,p),ySt(e,r)):o<1&&bSt(s,u,h,o,i,e,r))}}var iO=new xn,xSt=new m,CSt=new M,ESt=new m,TSt=new M,SSt=new m,ISt=new m,_St=new m,ZSt=new m,yIe=new m,RSt=new m,GSt=new m,VSt=new m,LSt=new m,WSt=new m,FSt=new m,BSt=new m,wSt=new m,YSt=new m,NSt=new m,mT=new m,cIe=new m,lIe=new m,o$={orientation:new uc};function m$(e,t,n,i,o,r){let s=1;l(r)&&(s=V.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,h=o-d,p=i*h;p=V.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let f=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(f>0&&Math.abs(o-d)<1||f<0&&Math.abs(o-u)<1)return;o-f<d?f=o-d-1:o-f>u&&(f=o-u)}let b=e._scene,C=b.camera,E=b.mode,T=o$.orientation;T.heading=C.heading,T.pitch=C.pitch,T.roll=C.roll;let S=n.inertiaEnabled??M.equals(t,e._zoomMouseStart),_=e._zoomingOnVector,R=e._rotatingZoom,L;if(S||(e._zoomMouseStart=M.clone(t,e._zoomMouseStart),l(e._globe)&&E===se.SCENE2D?(L=C.getPickRay(t,iO).origin,L=m.fromElements(L.y,L.z,L.x)):l(e._globe)&&(L=gb(e,t,xSt)),l(L)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(L,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,_=e._zoomingOnVector=!1,R=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){C.zoomIn(f);return}let W=E===se.COLUMBUS_VIEW;if(C.positionCartographic.height<2e6&&(R=!0),!S||R){if(E===se.SCENE2D){let B=e._zoomWorldPosition,Y=C.position;if(!m.equals(B,Y)&&C.positionCartographic.height<e._maxCoord.x*2){let N=C.position.x,A=m.subtract(B,Y,ESt);m.normalize(A,A);let I=m.distance(B,Y)*f/(C.getMagnitude()*.5);C.move(A,I*.5),(C.position.x<0&&N>0||C.position.x>0&&N<0)&&(L=C.getPickRay(t,iO).origin,L=m.fromElements(L.y,L.z,L.x),e._zoomWorldPosition=m.clone(L,e._zoomWorldPosition))}}else if(E===se.SCENE3D){let B=m.normalize(C.position,yIe);if(e._cameraUnderground||e._zoomingUnderground||C.positionCartographic.height<3e3&&Math.abs(m.dot(C.direction,B))<.6)W=!0;else{let Y=b.canvas,N=TSt;N.x=Y.clientWidth/2,N.y=Y.clientHeight/2;let A=gb(e,N,SSt);if(!l(A))W=!0;else if(C.positionCartographic.height<1e6)if(m.dot(C.direction,B)>=-.5)W=!0;else{let I=GSt;m.clone(C.position,I);let Z=e._zoomWorldPosition,G=RSt;if(G=m.normalize(Z,G),m.dot(G,B)<0)return;let w=NSt,X=WSt;m.clone(C.direction,X),m.add(I,m.multiplyByScalar(X,1e3,mT),w);let v=FSt,U=BSt;m.subtract(Z,I,v),m.normalize(v,U);let k=m.dot(B,U);if(k>=0){e._zoomMouseStart.x=-1;return}let P=Math.acos(-k),O=m.magnitude(I),H=m.magnitude(Z),ee=O-f,z=m.magnitude(v),te=Math.asin(V.clamp(z/H*Math.sin(P),-1,1)),q=Math.asin(V.clamp(ee/H*Math.sin(P),-1,1)),me=te-q+P,ye=VSt;m.normalize(I,ye);let oe=LSt;oe=m.cross(U,ye,oe),oe=m.normalize(oe,oe),m.normalize(m.cross(ye,oe,mT),X),m.multiplyByScalar(m.normalize(w,mT),m.magnitude(w)-f,w),m.normalize(I,I),m.multiplyByScalar(I,ee,I);let xe=wSt;m.multiplyByScalar(m.add(m.multiplyByScalar(ye,Math.cos(me)-1,cIe),m.multiplyByScalar(X,Math.sin(me),lIe),mT),ee,xe),m.add(I,xe,I),m.normalize(w,ye),m.normalize(m.cross(ye,oe,mT),X);let Ee=YSt;m.multiplyByScalar(m.add(m.multiplyByScalar(ye,Math.cos(me)-1,cIe),m.multiplyByScalar(X,Math.sin(me),lIe),mT),m.magnitude(w),Ee),m.add(w,Ee,w),m.clone(I,C.position),m.normalize(m.subtract(w,I,mT),C.direction),m.clone(C.direction,C.direction),m.cross(C.direction,C.up,C.right),m.cross(C.right,C.direction,C.up),C.setView(o$);return}else{let I=m.normalize(A,ISt),Z=m.normalize(e._zoomWorldPosition,_St),G=m.dot(Z,I);if(G>0&&G<1){let w=V.acosClamped(G),X=m.cross(Z,I,ZSt),v=Math.abs(w)>V.toRadians(20)?C.positionCartographic.height*.75:C.positionCartographic.height-f,U=f/v;C.rotate(X,w*U)}}}}e._rotatingZoom=!W}if(!S&&W||_){let B,Y=no.worldToWindowCoordinates(b,e._zoomWorldPosition,CSt);E!==se.COLUMBUS_VIEW&&M.equals(t,e._zoomMouseStart)&&l(Y)?B=C.getPickRay(Y,iO):B=C.getPickRay(t,iO);let N=B.direction;(E===se.COLUMBUS_VIEW||E===se.SCENE2D)&&m.fromElements(N.y,N.z,N.x,N),C.move(N,f),e._zoomingOnVector=!0}else C.zoomIn(f);e._cameraUnderground||C.setView(o$)}var XSt=new xn,PSt=new xn,MSt=new m;function USt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,XSt).origin,s=o.getPickRay(n.endPosition,PSt).origin;r=m.fromElements(r.y,r.z,r.x,r),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(r,s,MSt),c=m.magnitude(a);c>0&&(m.normalize(a,a),o.move(a,c))}function dIe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;m$(e,t,n,e.zoomFactor,o.getMagnitude())}var DSt=new M,vSt=new M;function uIe(e,t,n){if(l(n.angleAndHeight)){kSt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=DSt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=M.normalize(c,c);let d=vSt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=M.normalize(d,d);let u=V.acosClamped(c.x);c.y<0&&(u=V.TWO_PI-u);let h=V.acosClamped(d.x);d.y<0&&(h=V.TWO_PI-h);let p=h-u;o.twistRight(p)}function kSt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function QSt(e){let t=e._scene.mapMode2D===Ql.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(zl(e,e.enableTranslate,e.translateEventTypes,USt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),zl(e,e.enableZoom,e.zoomEventTypes,dIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&zl(e,e.enableRotate,e.tiltEventTypes,uIe,e.inertiaSpin,"_lastInertiaTiltMovement")):(zl(e,e.enableZoom,e.zoomEventTypes,dIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&zl(e,e.enableRotate,e.translateEventTypes,uIe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var xIe=new xn,OSt=new m,zSt=new m;function gb(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,OSt)),!l(o))return m.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,xIe),d=o.pickWorldCoordinates(c,i,a,zSt),u=l(s)?m.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=l(d)?m.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<h?m.clone(s,n):m.clone(d,n)}var HSt=new pe;function dO(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===se.SCENE3D){let c=t.cartesianToCartographic(i.position,HSt);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var KSt=new m;function CIe(e,t){let n=t.origin,i=t.direction,o=dO(e),r=m.normalize(n,KSt),s=Math.abs(m.dot(r,i));return s=Math.max(s,.5)*2,o*s}function EIe(e,t,n,i){let o=m.distance(t.origin,n),r=dO(e),s=V.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),xn.getPoint(t,o,i)}function TIe(e,t,n,i){let o;return l(n)?(o=m.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=dO(e))):o=dO(e),xn.getPoint(t,o,i)}var JSt=new M;function SIe(e,t){let n=t.endPosition,i=M.subtract(t.endPosition,t.startPosition,JSt),o=e._strafeEndMousePosition;M.add(o,i,o),t.endPosition=o,h$(e,t,e._strafeStartPosition),t.endPosition=n}var mIe=new xn,jSt=new xn,r$=new m,qSt=new m,$St=new m,eIt=new m,tIt=new an(m.UNIT_X,0),nIt=new M,iIt=new M;function oIt(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Yu(e,t,n);return}if(e._strafing){SIe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=M.clone(n.startPosition,nIt),a=M.clone(n.endPosition,iIt),c=o.getPickRay(s,mIe),d=m.clone(m.ZERO,eIt),u=m.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=gb(e,s,r$),l(h)&&(d.x=h.x)),r||d.x>o.position.z&&l(h)){let S=h;r&&(S=TIe(e,c,h,r$)),M.clone(t,e._strafeMousePosition),M.clone(t,e._strafeEndMousePosition),m.clone(S,e._strafeStartPosition),e._strafing=!0,h$(e,n,e._strafeStartPosition);return}let p=an.fromPointNormal(d,u,tIt);c=o.getPickRay(s,mIe);let g=di.rayPlane(c,p,r$),f=o.getPickRay(a,jSt),b=di.rayPlane(f,p,qSt);if(!l(g)||!l(b)){e._looking=!0,Yu(e,t,n),M.clone(t,e._translateMousePosition);return}let C=m.subtract(g,b,$St),E=C.x;C.x=C.y,C.y=C.z,C.z=E;let T=m.magnitude(C);T>V.EPSILON6&&(m.normalize(C,C),o.move(C,T))}var IIe=new M,sO=new xn,aO=new m,rIt=new m,_Ie=new F,sIt=new F,aIt=new m,cIt=new an(m.UNIT_X,0),s$=new m,l$=new pe,ZIe=new F,lIt=new Me,dIt=new $,cO=new m;function uIt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),M.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Yu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,mIt(e,t,n)):hIt(e,t,n)}function mIt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=IIe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,sO),c=m.UNIT_X,d=a.origin,u=a.direction,h,p=m.dot(c,u);if(Math.abs(p)>V.EPSILON6&&(h=-m.dot(c,d)/p),!l(h)||h<=0){e._looking=!0,Yu(e,t,n),M.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(u,h,aO);m.add(d,g,g);let f=i.mapProjection,b=f.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let C=f.unproject(g,l$);b.cartographicToCartesian(C,g);let E=Tt.eastNorthUpToFixedFrame(g,b,_Ie),T=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=F.clone(o.transform,ZIe);o._setTransform(E),wu(e,t,n,m.UNIT_Z),o._setTransform(_),e._globe=T,e._ellipsoid=S;let R=S.maximumRadius;e._rotateFactor=1/R,e._rotateRateRangeAdjustment=R}function hIt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=m.UNIT_X;if(M.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,aO);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=gb(e,t,aO)),!l(s)){a=o.getPickRay(t,sO);let A=a.origin,I=a.direction,Z,G=m.dot(c,I);if(Math.abs(G)>V.EPSILON6&&(Z=-m.dot(c,A)/G),!l(Z)||Z<=0){e._looking=!0,Yu(e,t,n),M.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(I,Z,aO),m.add(A,s,s)}r&&(l(a)||(a=o.getPickRay(t,sO)),EIe(e,a,s,s)),M.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let d=i.canvas,u=IIe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,sO);let h=m.clone(m.ZERO,aIt);h.x=s.x;let p=an.fromPointNormal(h,c,cIt),g=di.rayPlane(a,p,rIt),f=o._projection,b=f.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let C=f.unproject(s,l$);b.cartographicToCartesian(C,s);let E=Tt.eastNorthUpToFixedFrame(s,b,_Ie),T;l(g)?(m.fromElements(g.y,g.z,g.x,g),C=f.unproject(g,l$),b.cartographicToCartesian(C,g),T=Tt.eastNorthUpToFixedFrame(g,b,sIt)):T=E;let S=e._globe,_=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let R=m.UNIT_Z,L=F.clone(o.transform,ZIe);o._setTransform(E);let W=m.cross(m.UNIT_Z,m.normalize(o.position,s$),s$),B=m.dot(o.right,W);if(wu(e,t,n,R,!1,!0),o._setTransform(T),B<0){let A=n.startPosition.y-n.endPosition.y;(r&&A<0||!r&&A>0)&&(R=void 0);let I=o.constrainedAxis;o.constrainedAxis=void 0,wu(e,t,n,R,!0,!1),o.constrainedAxis=I}else wu(e,t,n,R,!0,!1);if(l(o.constrainedAxis)){let A=m.cross(o.direction,o.constrainedAxis,cO);m.equalsEpsilon(A,m.ZERO,V.EPSILON6)||(m.dot(A,o.right)<0&&m.negate(A,A),m.cross(A,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(L),e._globe=S,e._ellipsoid=_;let Y=_.maximumRadius;e._rotateFactor=1/Y,e._rotateRateRangeAdjustment=Y;let N=m.clone(o.positionWC,s$);if(e.enableCollisionDetection&&A$(e,!0),!m.equals(o.positionWC,N)){o._setTransform(T),o.worldToCameraCoordinatesPoint(N,N);let A=m.magnitudeSquared(N);m.magnitudeSquared(o.position)>A&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(A),o.position));let I=m.angleBetween(N,o.position),Z=m.cross(N,o.position,N);m.normalize(Z,Z);let G=Me.fromAxisAngle(Z,I,lIt),w=$.fromQuaternion(G,dIt);$.multiplyByVector(w,o.direction,o.direction),$.multiplyByVector(w,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(L)}}var RIe=new M,GIe=new xn,VIe=new m;function fIt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=RIe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,GIe),d=c.origin,u=c.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=gb(e,a,VIe));let g;if(l(p)&&(g=m.distance(d,p)),s){let f=CIe(e,c,h);l(g)?g=Math.min(g,f):g=f}if(!l(g)){let f=m.UNIT_X;g=-m.dot(f,d)/m.dot(f,u)}m$(e,t,n,e.zoomFactor,g)}function pIt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))zl(e,e.enableRotate,e.rotateEventTypes,wu,e.inertiaSpin,"_lastInertiaSpinMovement"),zl(e,e.enableZoom,e.zoomEventTypes,WIe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),zl(e,e.enableTilt,e.tiltEventTypes,uIt,e.inertiaSpin,"_lastInertiaTiltMovement"),zl(e,e.enableTranslate,e.translateEventTypes,oIt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),zl(e,e.enableZoom,e.zoomEventTypes,fIt,e.inertiaZoom,"_lastInertiaZoomMovement"),zl(e,e.enableLook,e.lookEventTypes,Yu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var AIt=new xn,gIt=new an(m.UNIT_X,0),bIt=new m,yIt=new m;function h$(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,AIt),s=m.clone(o.direction,yIt);i.mode===se.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=an.fromPointNormal(n,s,gIt),c=di.rayPlane(r,a,bIt);l(c)&&(s=m.subtract(n,c,s),i.mode===se.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(o.position,s,o.position))}var hIe=new m,LIe=new pe,d$=new m,u$=new ie,xIt=new m,CIt=new m,EIt=new m;function TIt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){wu(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,xIt);if(M.equals(t,e._rotateMousePosition)){if(e._looking)Yu(e,t,n,d);else if(e._rotating)wu(e,t,n);else if(e._strafing)SIe(e,n);else{if(m.magnitude(o.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=d$,c.x=c.y=c.z=a,s=ie.fromCartesian3(c,u$),c$(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,LIe).height,h=e._globe;if(l(h)&&u<e._minimumPickingTerrainHeight){let p=gb(e,n.startPosition,EIt);if(l(p)){let g=!1,f=o.getPickRay(n.startPosition,xIe);if(r)g=!0,TIe(e,f,p,p);else{let b=s.geodeticSurfaceNormal(p,CIt);Math.abs(m.dot(f.direction,b))<.05?g=!0:g=m.magnitude(o.position)<m.magnitude(p)}g?(M.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,h$(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=d$,c.x=c.y=c.z=a,s=ie.fromCartesian3(c,u$),c$(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,Yu(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,hIe))?(c$(e,t,n,e._ellipsoid),m.clone(hIe,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,wu(e,t,n)):(e._looking=!0,Yu(e,t,n,d));M.clone(t,e._rotateMousePosition)}function wu(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=m.magnitude(a.position),h=e._rotateFactor*(u-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let f=h*p*Math.PI*2,b=h*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let C=e.maximumTiltAngle,E=m.dot(a.direction,i),T=Math.PI-Math.acos(E)+b;T>C&&(b-=T-C)}o||a.rotateRight(f),r||a.rotateUp(b),a.constrainedAxis=d}var a$=ce.clone(ce.UNIT_W),fIe=ce.clone(ce.UNIT_W),oO=new m,FZ=new m,rO=new m,pIe=new m,SIt=new M,IIt=new M,_It=new M,ZIt=new M,RIt=new xn;function c$(e,t,n,i){let o=e._scene,r=o.camera,s=M.clone(n.startPosition,SIt),a=M.clone(n.endPosition,IIt),c=i.cartesianToCartographic(r.positionWC,LIe).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=m.clone(e._panLastWorldPosition,a$),!l(e._globe)&&!M.equalsEpsilon(s,e._panLastMousePosition)&&(d=gb(e,s,a$)),!l(e._globe)&&l(d))){let h=m.subtract(d,r.positionWC,FZ),p=m.multiplyByScalar(r.directionWC,m.dot(r.directionWC,h),FZ),g=m.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,ZIt),b=M.subtract(a,s,_It),C=m.multiplyByScalar(r.rightWC,b.x*f.x,FZ),E=m.normalize(r.positionWC,yIe),T=r.getPickRay(a,RIt).direction,S=m.subtract(T,m.projectVector(T,r.rightWC,rO),rO),_=m.angleBetween(S,r.directionWC),R=1;l(r.frustum.fov)&&(R=Math.max(Math.tan(_),.1));let L=Math.abs(m.dot(r.directionWC,E)),W=-b.y*f.y*2/Math.sqrt(R)*(1-L),B=m.multiplyByScalar(T,W,rO);L=Math.abs(m.dot(r.upWC,E));let Y=m.multiplyByScalar(r.upWC,-b.y*(1-L)*f.y,pIe);u=m.add(d,C,fIe),u=m.add(u,B,u),u=m.add(u,Y,u),m.clone(u,e._panLastWorldPosition),M.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,a$),u=r.pickEllipsoid(a,i,fIe)),!l(d)||!l(u)){e._rotating=!0,wu(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let h=r.constrainedAxis,p=m.mostOrthogonalAxis(h,oO);m.cross(p,h,p),m.normalize(p,p);let g=m.cross(h,p,FZ),f=m.magnitude(d),b=m.dot(h,d),C=Math.acos(b/f),E=m.multiplyByScalar(h,b,rO);m.subtract(d,E,E),m.normalize(E,E);let T=m.magnitude(u),S=m.dot(h,u),_=Math.acos(S/T),R=m.multiplyByScalar(h,S,pIe);m.subtract(u,R,R),m.normalize(R,R);let L=Math.acos(m.dot(E,p));m.dot(E,g)<0&&(L=V.TWO_PI-L);let W=Math.acos(m.dot(R,p));m.dot(R,g)<0&&(W=V.TWO_PI-W);let B=L-W,Y;m.equalsEpsilon(h,r.position,V.EPSILON2)?Y=r.right:Y=m.cross(h,r.position,oO);let N=m.cross(h,Y,oO),A=m.dot(N,m.subtract(d,h,FZ)),I=m.dot(N,m.subtract(u,h,FZ)),Z;A>0&&I>0?Z=_-C:A>0&&I<=0?m.dot(r.position,h)>0?Z=-C-_:Z=C+_:Z=C-_,r.rotateRight(B),r.rotateUp(Z)}else{m.normalize(d,d),m.normalize(u,u);let h=m.dot(d,u),p=m.cross(d,u,oO);if(h<1&&!m.equalsEpsilon(p,m.ZERO,V.EPSILON14)){let g=Math.acos(h);r.rotate(p,g)}}}var GIt=new m,VIt=new pe,AIe=0;function WIe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,d;c?d=t:(d=RIe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,GIe),h,p=o.cartesianToCartographic(s.position,VIt).height,g=Math.abs(AIe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(h=gb(e,d,VIe));let b;if(l(h)&&(b=m.distance(u.origin,h),AIe=b),c){let E=CIe(e,u,p);l(b)?b=Math.min(b,E):b=E}l(b)||(b=p);let C=m.normalize(s.position,GIt);m$(e,t,n,e.zoomFactor,b,m.dot(C,s.direction))}var FIe=new M,lO=new xn,WP=new m,LIt=new m,BIe=new F,WIt=new F,wIe=new F,FIt=new Me,BIt=new $,f$=new pe,p$=new m;function wIt(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),M.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,p$);Yu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,f$);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,NIt(e,t,n)):XIt(e,t,n)}var YIt=new pe;function NIt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,YIt).height;if(a-s-1<V.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=FIe;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,lO),h,p=di.rayEllipsoid(u,i);if(l(p))h=xn.getPoint(u,p.start,WP);else if(a>e._minimumTrackBallHeight){let T=di.grazingAltitudeLocation(u,i);if(!l(T))return;let S=i.cartesianToCartographic(T,f$);S.height=0,h=i.cartographicToCartesian(S,WP)}else{e._looking=!0;let T=e._ellipsoid.geodeticSurfaceNormal(r.position,p$);Yu(e,t,n,T),M.clone(t,e._tiltCenterMousePosition);return}let g=Tt.eastNorthUpToFixedFrame(h,i,BIe),f=e._globe,b=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let C=F.clone(r.transform,wIe);r._setTransform(g),wu(e,t,n,m.UNIT_Z),r._setTransform(C),e._globe=f,e._ellipsoid=b;let E=b.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}function XIt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(M.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,WP);else{if(a=gb(e,t,WP),!l(a)){if(c=r.getPickRay(t,lO),d=di.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,f$).height<=e._minimumTrackBallHeight){e._looking=!0;let I=e._ellipsoid.geodeticSurfaceNormal(r.position,p$);Yu(e,t,n,I),M.clone(t,e._tiltCenterMousePosition)}return}a=xn.getPoint(c,d.start,WP)}s&&(l(c)||(c=r.getPickRay(t,lO)),EIe(e,c,a,a)),M.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let u=o.canvas,h=FIe;h.x=u.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,lO);let p=m.magnitude(a),g=m.fromElements(p,p,p,d$),f=ie.fromCartesian3(g,u$);if(d=di.rayEllipsoid(c,f),!l(d))return;let b=m.magnitude(c.origin)>p?d.start:d.stop,C=xn.getPoint(c,b,LIt),E=Tt.eastNorthUpToFixedFrame(a,i,BIe),T=Tt.eastNorthUpToFixedFrame(C,f,WIt),S=e._globe,_=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let R=m.UNIT_Z,L=F.clone(r.transform,wIe);r._setTransform(T);let W=m.cross(C,r.positionWC,cO);if(m.dot(r.rightWC,W)<0){let A=n.startPosition.y-n.endPosition.y;(s&&A<0||!s&&A>0)&&(R=void 0);let I=r.constrainedAxis;r.constrainedAxis=void 0,wu(e,t,n,R,!0,!1),r.constrainedAxis=I}else wu(e,t,n,R,!0,!1);if(r._setTransform(E),wu(e,t,n,R,!1,!0),l(r.constrainedAxis)){let A=m.cross(r.direction,r.constrainedAxis,cO);m.equalsEpsilon(A,m.ZERO,V.EPSILON6)||(m.dot(A,r.right)<0&&m.negate(A,A),m.cross(A,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(L),e._globe=S,e._ellipsoid=_;let Y=_.maximumRadius;e._rotateFactor=1/Y,e._rotateRateRangeAdjustment=Y;let N=m.clone(r.positionWC,cO);if(e.enableCollisionDetection&&A$(e,!0),!m.equals(r.positionWC,N)){r._setTransform(T),r.worldToCameraCoordinatesPoint(N,N);let A=m.magnitudeSquared(N);m.magnitudeSquared(r.position)>A&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(A),r.position));let I=m.angleBetween(N,r.position),Z=m.cross(N,r.position,N);m.normalize(Z,Z);let G=Me.fromAxisAngle(Z,I,FIt),w=$.fromQuaternion(G,BIt);$.multiplyByVector(w,r.direction,r.direction),$.multiplyByVector(w,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(L)}}var PIt=new M,MIt=new M,gIe=new xn,bIe=new xn,UIt=new m,DIt=new m;function Yu(e,t,n,i){let r=e._scene.camera,s=PIt;s.x=n.startPosition.x,s.y=0;let a=MIt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,gIe),d=r.getPickRay(a,bIe),u=0,h,p;r.frustum instanceof hn?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction);let g=m.dot(h,p);g<1&&(u=Math.acos(g)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(l(i)?r.look(i,-u):l(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,gIe),d=r.getPickRay(a,bIe),u=0,r.frustum instanceof hn?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction),g=m.dot(h,p),g<1&&(u=Math.acos(g)),u=n.startPosition.y>n.endPosition.y?-u:u,i=i??f,l(i)){let b=r.direction,C=m.negate(i,UIt),E=m.equalsEpsilon(b,i,V.EPSILON2),T=m.equalsEpsilon(b,C,V.EPSILON2);if(!E&&!T){g=m.dot(b,i);let S=V.acosClamped(g);u>0&&u>S&&(u=S-V.EPSILON4),g=m.dot(b,C),S=V.acosClamped(g),u<0&&-u>S&&(u=-S+V.EPSILON4);let _=m.cross(i,b,DIt);r.look(_,u)}else(E&&u<0||T&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function vIt(e){zl(e,e.enableRotate,e.rotateEventTypes,TIt,e.inertiaSpin,"_lastInertiaSpinMovement"),zl(e,e.enableZoom,e.zoomEventTypes,WIe,e.inertiaZoom,"_lastInertiaZoomMovement"),zl(e,e.enableTilt,e.tiltEventTypes,wIt,e.inertiaSpin,"_lastInertiaTiltMovement"),zl(e,e.enableLook,e.lookEventTypes,Yu)}var kIt=new F,QIt=new pe;function A$(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===se.SCENE2D||i===se.MORPHING)return;let o=n.camera,r=n.ellipsoid??ie.WGS84,s=n.mapProjection,a,c;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,kIt),c=m.magnitude(o.position),o._setTransform(F.IDENTITY));let d=QIt;i===se.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let p=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,f=g/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===se.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}l(a)&&(o._setTransform(a),u&&(m.normalize(o.position,o.position),m.negate(o.position,o.direction),m.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),m.normalize(o.direction,o.direction),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up)))}FP.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===se.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var OIt=new m,zIt=new m;FP.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ie.default):(this._globe=void 0,this._ellipsoid=ie.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Eo.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Eo.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Eo.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,OIt),c=m.clone(t.directionWC,zIt);if(i===se.SCENE2D?QSt(this):i===se.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,pIt(this)):i===se.SCENE3D&&(this._horizontalRotationAxis=void 0,vIt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC);A$(this,d)}this._aggregator.reset()};FP.prototype.isDestroyed=function(){return!1};FP.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),fe(this)};var BP=FP;var jto=y(x(),1);var Vto=y(x(),1),wP=`uniform sampler2D colorTexture;
uniform sampler2D colorTexture2;

uniform vec2 center;
uniform float radius;

in vec2 v_textureCoordinates;

void main()
{
    vec4 color0 = texture(colorTexture, v_textureCoordinates);
    vec4 color1 = texture(colorTexture2, v_textureCoordinates);

    float x = length(gl_FragCoord.xy - center) / radius;
    float t = smoothstep(0.5, 0.8, x);
    out_FragColor = mix(color0 + color1, color1, t);
}
`;var Wto=y(x(),1),YP=`uniform sampler2D colorTexture;

uniform float avgLuminance;
uniform float threshold;
uniform float offset;

in vec2 v_textureCoordinates;

float key(float avg)
{
    float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));
    return max(0.0, guess) + 0.1;
}

// See section 9. "The bright-pass filter" of Realtime HDR Rendering
// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf

void main()
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    vec3 xyz = czm_RGBToXYZ(color.rgb);
    float luminance = xyz.r;

    float scaledLum = key(avgLuminance) * luminance / avgLuminance;
    float brightLum = max(scaledLum - threshold, 0.0);
    float brightness = brightLum / (offset + brightLum);

    xyz.r = brightness;
    out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);
}
`;function bb(){this._sceneFramebuffer=new tT;let e=.125,t=new Array(6);t[0]=new Lo({fragmentShader:Ld,textureScale:e,forcePowerOfTwo:!0,sampleMode:Fu.LINEAR});let n=t[1]=new Lo({fragmentShader:YP,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new M,t[2]=new Lo({fragmentShader:ky,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Lo({fragmentShader:ky,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Lo({fragmentShader:Ld,sampleMode:Fu.LINEAR}),this._uCenter=new M,this._uRadius=void 0,t[5]=new Lo({fragmentShader:wP,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Wd({stages:t});let o=new cT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}bb.prototype.get=function(e){return this._stages.get(e)};bb.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var HIt=new ce,YIe=new M,KIt=new M,NIe=new F;function JIt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=F.computeViewportTransformation(n,0,1,NIe),d=F.multiplyByPoint(r,o,HIt),u=Tt.pointToGLWindowCoordinates(s,c,o,YIe);d.x+=V.SOLAR_RADIUS;let h=Tt.pointToGLWindowCoordinates(a,c,d,d),p=M.magnitude(M.subtract(h,u,h))*30*2,g=KIt;g.x=p,g.y=p,e._uCenter=M.clone(u,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let f=t.drawingBufferWidth,b=t.drawingBufferHeight,C=e._stages,E=C.get(0),T=E.outputTexture.width,S=E.outputTexture.height,_=new $e;_.width=T,_.height=S,c=F.computeViewportTransformation(_,0,1,NIe),u=Tt.pointToGLWindowCoordinates(s,c,o,YIe),g.x*=T/f,g.y*=S/b;let R=E.scissorRectangle;R.x=Math.max(u.x-g.x*.5,0),R.y=Math.max(u.y-g.y*.5,0),R.width=Math.min(g.x,f),R.height=Math.min(g.y,b);for(let L=1;L<4;++L)$e.clone(R,C.get(L).scissorRectangle)}bb.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};bb.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),JIt(this,t,n),o};bb.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};bb.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Ld,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};bb.prototype.isDestroyed=function(){return!1};bb.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),fe(this)};var NP=bb;var ono=y(x(),1);function XIe(){this._cachedShowFrustumsShaders={}}function jIt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function qIt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=ze.replaceMain(u,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor;
`,a+=`uniform vec3 debugShowFrustumsColor;
`,a+=`void main() 
{ 
    czm_Debug_main(); 
`;let c;if(s>0)for(c=0;c<s;++c)a+=`    out_FragData_${r[c]}.rgb *= debugShowCommandsColor;
`,a+=`    out_FragData_${r[c]}.rgb *= debugShowFrustumsColor;
`;else a+=`    out_FragColor.rgb *= debugShowCommandsColor;
`,a+=`    out_FragColor.rgb *= debugShowFrustumsColor;
`;a+="}",o.sources.push(a);let d=jIt(i);return cn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var XP=new D;function $It(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=D.fromRandom()),t._debugColor):D.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(XP.red=t.debugOverlappingFrustums&1?1:0,XP.green=t.debugOverlappingFrustums&2?1:0,XP.blue=t.debugOverlappingFrustums&4?1:0,XP.alpha=1,XP):D.WHITE}),n}var e_t=new nt;XIe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=qIt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=nt.shallowClone(t,e_t);r.shaderProgram=o,r.uniformMap=$It(e,t),r.execute(e.context,n)};var PP=XIe;var dno=y(x(),1);function hT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new tn}hT.fromKeyframeNode=function(e,t,n,i){let o=new hT(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=t_t(e,s,n),o._orientedBoundingBox=i_t(e,r,n,o._orientedBoundingBox),o};function t_t(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],d=Et.getComponentCount(o[a]),u=r[a].slice(n*d,(n+1)*d);s[c]=u}return s}var PIe=new m,n_t=new m;function i_t(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),d=a-c*o.x,u=m.fromElements(d,c,s,PIe),h=m.divideComponents(m.subtract(u,e._paddingBefore,PIe),e.dimensions,n_t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(hT.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});hT.prototype.hasProperty=function(e){return l(this._metadata[e])};hT.prototype.getNames=function(){return Object.keys(this._metadata)};hT.prototype.getProperty=function(e){return this._metadata[e]};var MP=hT;var Pso=y(x(),1);var qio=y(x(),1);var pno=y(x(),1);function o_t(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,d=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,be.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,be.FRAGMENT);for(let A=0;A<c;A++){let I=i[A],Z=uO(o[A]),G=`PropertyStatistics_${I}`,w=`PropertyStatistics_${I}`;n.addStruct(G,w,be.FRAGMENT),n.addStructField(G,Z,"min"),n.addStructField(G,Z,"max")}let u="MetadataStatistics",h="MetadataStatistics",p="metadataStatistics";n.addStruct(u,h,be.FRAGMENT);for(let A=0;A<c;A++){let I=i[A],Z=`PropertyStatistics_${I}`,G=I;n.addStructField(u,Z,G)}let g="Metadata",f="Metadata",b="metadata";n.addStruct(g,f,be.FRAGMENT);for(let A=0;A<c;A++){let I=uO(o[A]);n.addStructField(g,I,i[A])}let C="Attributes",E="Attributes",T="attributes";n.addStruct(C,E,be.FRAGMENT),n.addStructField(C,"vec3","positionEC"),n.addStructField(C,"vec3","normalEC");let S="Voxel",_="Voxel",R="voxel";n.addStruct(S,_,be.FRAGMENT),n.addStructField(S,"vec3","viewDirUv"),n.addStructField(S,"float","travelDistance"),n.addStructField(S,"int","stepCount"),n.addStructField(S,"int","tileIndex"),n.addStructField(S,"int","sampleIndex"),n.addStructField(S,"float","distanceToDepthBuffer");let L="FragmentInput";n.addStruct(L,"FragmentInput",be.FRAGMENT),n.addStructField(L,h,p),n.addStructField(L,f,b),n.addStructField(L,E,T),n.addStructField(L,_,R);let B="Properties",Y="Properties",N="properties";n.addStruct(B,Y,be.FRAGMENT);for(let A=0;A<c;A++){let I=uO(o[A]);n.addStructField(B,I,i[A])}{let A="clearProperties";n.addFunction(A,`${Y} clearProperties()`,be.FRAGMENT),n.addFunctionLines(A,[`${Y} ${N};`]);for(let I=0;I<c;I++){let Z=uO(o[I],r[I]);n.addFunctionLines(A,[`${N}.${i[I]} = ${Z}(0.0);`])}n.addFunctionLines(A,[`return ${N};`])}{let A="sumProperties";n.addFunction(A,`${Y} sumProperties(${Y} propertiesA, ${Y} propertiesB)`,be.FRAGMENT),n.addFunctionLines(A,[`${Y} ${N};`]);for(let I=0;I<c;I++){let Z=i[I];n.addFunctionLines(A,[`${N}.${Z} = propertiesA.${Z} + propertiesB.${Z};`])}n.addFunctionLines(A,[`return ${N};`])}{let A="scaleProperties";n.addFunction(A,`${Y} scaleProperties(${Y} ${N}, float scale)`,be.FRAGMENT),n.addFunctionLines(A,[`${Y} scaledProperties = ${N};`]);for(let I=0;I<c;I++)n.addFunctionLines(A,[`scaledProperties.${i[I]} *= scale;`]);n.addFunctionLines(A,["return scaledProperties;"])}{let A="mixProperties";n.addFunction(A,`${Y} mixProperties(${Y} propertiesA, ${Y} propertiesB, float mixFactor)`,be.FRAGMENT),n.addFunctionLines(A,[`${Y} ${N};`]);for(let I=0;I<c;I++){let Z=i[I];n.addFunctionLines(A,[`${N}.${Z} = mix(propertiesA.${Z}, propertiesB.${Z}, mixFactor);`])}n.addFunctionLines(A,[`return ${N};`])}{let A="copyPropertiesToMetadata";n.addFunction(A,`void copyPropertiesToMetadata(in ${Y} ${N}, inout ${f} ${b})`,be.FRAGMENT);for(let I=0;I<c;I++){let Z=i[I];n.addFunctionLines(A,[`${b}.${Z} = ${N}.${Z};`])}}if(d){let A="setStatistics";n.addFunction(A,`void setStatistics(inout ${h} ${p})`,be.FRAGMENT);for(let I=0;I<c;I++){let Z=i[I],G=o[I],w=Et.getComponentCount(G);for(let X=0;X<w;X++){let v=s_t(G,X),U=s[I][X],k=a[I][X];!l(U)||!l(k)||n.addFunctionLines(A,[`${p}.${Z}.min${v} = ${MIe(U)};`,`${p}.${Z}.max${v} = ${MIe(k)};`])}}}{let A="getPropertiesFromMegatextureAtUv";n.addFunction(A,`${Y} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,be.FRAGMENT),n.addFunctionLines(A,[`${Y} ${N};`]);for(let I=0;I<c;I++){let Z=o[I],G=r[I],w=r_t(Z,G);n.addFunctionLines(A,[`properties.${i[I]} = texture(u_megatextureTextures[${I}], texcoord)${w};`])}n.addFunctionLines(A,[`return ${N};`])}}function uO(e){if(e===Et.SCALAR)return"float";if(e===Et.VEC2)return"vec2";if(e===Et.VEC3)return"vec3";if(e===Et.VEC4)return"vec4"}function r_t(e){if(e===Et.SCALAR)return".r";if(e===Et.VEC2)return".ra";if(e===Et.VEC3)return".rgb";if(e===Et.VEC4)return""}function MIe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function s_t(e,t){return e===Et.SCALAR?"":`[${t}]`}var UP=o_t;var Fno=y(x(),1);function Vf(e){let{planes:t,modelMatrix:n=F.IDENTITY,unionClippingRegions:i=!1}=e??Q.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=F.clone(n),this.planeAdded=new Ce,this.planeRemoved=new Ce,this._unionClippingRegions=i,this._testIntersection=i?UIe:DIe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let o=0;o<t.length;++o)this.add(t[o])}function UIe(e){return e===Jt.OUTSIDE}function DIe(e){return e===Jt.INSIDE}Object.defineProperties(Vf.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?UIe:DIe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});Vf.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Vf.prototype.get=function(e){return this._planes[e]};function vIe(e,t){for(let n=0;n<e.length;++n)if(an.equals(e[n],t))return n;return-1}Vf.prototype.contains=function(e){return vIe(this._planes,e)!==-1};Vf.prototype.remove=function(e){let t=this._planes,n=vIe(t,e);if(n===-1)return!1;e instanceof Us&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof Us&&(r.index=o)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Vf.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof Us&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var a_t=new an(m.fromElements(1,0,0),0);function c_t(e,t){let n=e._float32View,i=e._planes,o=0;for(let r=0;r<i.length;++r){let{normal:s,distance:a}=d_t(i[r],t,a_t);n[o]=s.x,n[o+1]=s.y,n[o+2]=s.z,n[o+3]=a,o+=4}}var g$=new ce,l_t=new m;function d_t(e,t,n){let{normal:i,distance:o}=e,r=ce.fromElements(i.x,i.y,i.z,o,g$),s=F.multiplyByVector(t,r,g$),a=m.fromCartesian4(s,l_t);return s=ce.divideByScalar(s,m.magnitude(a),g$),an.fromCartesian4(s,n)}function kIe(e,t){return t.x=Math.min(e,Yt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var u_t=new M;Vf.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=kIe(i,u_t);s.y*=2,n=new Wt({context:e.context,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:ve.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:o,height:r}=n;c_t(this,t),n.copyFrom({source:{width:o,height:r,arrayBufferView:this._float32View}})};Vf.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=e.length,r=kIe(o,n);return r.y*=2,r};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),fe(this)};var yb=Vf;var Nio=y(x(),1);var wno=y(x(),1),DP=`struct Ray {
    vec3 pos;
    vec3 dir;
};

float minComponent(in vec3 v) {
    return min(min(v.x, v.y), v.z);
}

float maxComponent(in vec3 v) {
    return max(max(v.x, v.y), v.z);
}
`;var Nno=y(x(),1),vP=`// See Intersection.glsl for the definition of intersectScene
// See IntersectionUtils.glsl for the definition of nextIntersection
// See convertLocalToBoxUv.glsl, convertLocalToCylinderUv.glsl, or convertLocalToEllipsoidUv.glsl
// for the definitions of convertLocalToShapeSpaceDerivative and getTileAndUvCoordinate. 
// The appropriate functions are selected based on the VoxelPrimitive shape type, 
// and added to the shader in Scene/VoxelRenderResources.js.
// See Octree.glsl for the definitions of TraversalData, SampleData,
// traverseOctreeFromBeginning, and traverseOctreeFromExisting
// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture

#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops
#if defined(PICKING_VOXEL)
    #define ALPHA_ACCUM_MAX 0.1
#else
    #define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0
#endif

uniform mat4 u_transformPositionViewToLocal;
uniform mat3 u_transformDirectionViewToLocal;
uniform vec3 u_cameraPositionLocal;
uniform vec3 u_cameraDirectionLocal;
uniform float u_stepSize;

#if defined(PICKING)
    uniform vec4 u_pickColor;
#endif

vec3 getSampleSize(in int level) {
    vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions);
    vec3 sampleSizeUv = 1.0 / sampleCount;
    return scaleShapeUvToShapeSpace(sampleSizeUv);
}

#define MINIMUM_STEP_SCALAR (0.02)
#define SHIFT_FRACTION (0.001)

/**
 * Given a coordinate within a tile, and sample spacings along a ray through
 * the coordinate, find the distance to the points where the ray entered and
 * exited the voxel cell, along with the surface normals at those points.
 * The surface normals are returned in shape space coordinates.
 */
RayShapeIntersection getVoxelIntersection(in vec3 tileUv, in vec3 sampleSizeAlongRay) {
    vec3 voxelCoord = tileUv * vec3(u_dimensions);
    vec3 directions = sign(sampleSizeAlongRay);
    vec3 positiveDirections = max(directions, 0.0);
    vec3 entryCoord = mix(ceil(voxelCoord), floor(voxelCoord), positiveDirections);
    vec3 exitCoord = entryCoord + directions;

    vec3 distanceFromEntry = -abs((entryCoord - voxelCoord) * sampleSizeAlongRay);
    float lastEntry = maxComponent(distanceFromEntry);
    bvec3 isLastEntry = equal(distanceFromEntry, vec3(lastEntry));
    vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
    vec4 entry = vec4(entryNormal, lastEntry);

    vec3 distanceToExit = abs((exitCoord - voxelCoord) * sampleSizeAlongRay);
    float firstExit = minComponent(distanceToExit);
    bvec3 isFirstExit = equal(distanceToExit, vec3(firstExit));
    vec3 exitNormal = vec3(isFirstExit) * directions;
    vec4 exit = vec4(exitNormal, firstExit);

    return RayShapeIntersection(entry, exit);
}

vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) {
    vec3 gradient = viewRay.dir * jacobianT;
    vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;

    RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);

    // Transform normal from shape space to Cartesian space to eye space
    vec3 voxelNormal = jacobianT * voxelIntersection.entry.xyz;
    voxelNormal = normalize(czm_normal * voxelNormal);

    // Compare with the shape intersection, to choose the appropriate normal
    vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w);
    vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry);

    float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize;
    float shift = fixedStep * SHIFT_FRACTION;
    float dt = voxelIntersection.exit.w + shift;
    if ((currentT + dt) > shapeIntersection.exit.w) {
        // Stop at end of shape
        dt = shapeIntersection.exit.w - currentT + shift;
    }
    float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift);

    return vec4(entry.xyz, stepSize);
}

vec2 packIntToVec2(int value) {
    float shifted = float(value) / 255.0;
    float lowBits = fract(shifted);
    float highBits = floor(shifted) / 255.0;
    return vec2(highBits, lowBits);
}

vec2 packFloatToVec2(float value) {
    float lowBits = fract(value);
    float highBits = floor(value) / 255.0;
    return vec2(highBits, lowBits);
}

int getSampleIndex(in SampleData sampleData) {
    // tileUv = 1.0 is a valid coordinate but sampleIndex = u_inputDimensions is not.
    // (tileUv = 1.0 corresponds to the far edge of the last sample, at index = u_inputDimensions - 1).
    // Clamp to [0, voxelDimensions - 0.5) to avoid numerical error before flooring
    vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5);
    vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate);
    ivec3 sampleIndex = ivec3(floor(inputCoordinate));
    // Convert to a 1D index for lookup in a 1D data array
    return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z);
}

/**
 * Compute the view ray at the current fragment, in the local coordinates of the shape.
 */
Ray getViewRayLocal() {
    vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
    vec3 origin;
    vec3 direction;
    if (czm_orthographicIn3D == 1.0) {
        eyeCoordinates.z = 0.0;
        origin = (u_transformPositionViewToLocal * eyeCoordinates).xyz;
        direction = u_cameraDirectionLocal;
    } else {
        origin = u_cameraPositionLocal;
        direction = u_transformDirectionViewToLocal * normalize(eyeCoordinates.xyz);
    }
    return Ray(origin, direction);
}

Ray getViewRayEC() {
    vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
    vec3 viewPosEC = (czm_orthographicIn3D == 1.0)
        ? vec3(eyeCoordinates.xy, 0.0)
        : vec3(0.0);
    vec3 viewDirEC = normalize(eyeCoordinates.xyz);
    return Ray(viewPosEC, viewDirEC);
}

void main()
{
    Ray viewRayLocal = getViewRayLocal();
    Ray viewRayEC = getViewRayEC();

    Intersections ix;
    vec2 screenCoord = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
    RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayLocal, viewRayEC, ix);
    // Exit early if the scene was completely missed.
    if (shapeIntersection.entry.w == NO_HIT) {
        discard;
    }

    float currentT = shapeIntersection.entry.w;
    float endT = shapeIntersection.exit.w;

    vec3 positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
    TileAndUvCoordinate tileAndUv = getTileAndUvCoordinate(positionEC);
    vec3 positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
    mat3 jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);

    // Traverse the tree from the start position
    TraversalData traversalData;
    SampleData sampleDatas[SAMPLE_COUNT];
    traverseOctreeFromBeginning(tileAndUv, traversalData, sampleDatas);
    vec4 step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT);

    FragmentInput fragmentInput;
    #if defined(STATISTICS)
        setStatistics(fragmentInput.metadataStatistics);
    #endif

    czm_modelMaterial materialOutput;
    vec4 colorAccum = vec4(0.0);

    for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
        // Read properties from the megatexture based on the traversal state
        Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);

        // Prepare the custom shader inputs
        copyPropertiesToMetadata(properties, fragmentInput.metadata);

        fragmentInput.attributes.positionEC = positionEC;
        // Re-normalize normals: some shape intersections may have been scaled to encode positive/negative shapes
        fragmentInput.attributes.normalEC = normalize(step.xyz);

        fragmentInput.voxel.viewDirUv = viewRayLocal.dir;

        fragmentInput.voxel.travelDistance = step.w;
        fragmentInput.voxel.stepCount = stepCount;
        fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
        fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]);
        fragmentInput.voxel.distanceToDepthBuffer = ix.distanceToDepthBuffer - currentT;

        // Run the custom shader
        fragmentMain(fragmentInput, materialOutput);

        // Sanitize the custom shader output
        vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
        color.rgb = max(color.rgb, vec3(0.0));
        color.a = clamp(color.a, 0.0, 1.0);

        // Pre-multiplied alpha blend
        colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);

        // Stop traversing if the alpha has been fully saturated
        if (colorAccum.a > ALPHA_ACCUM_MAX) {
            colorAccum.a = ALPHA_ACCUM_MAX;
            break;
        }

        if (step.w == 0.0) {
            // Shape is infinitely thin. The ray may have hit the edge of a
            // foreground voxel. Step ahead slightly to check for more voxels
            step.w == 0.00001;
        }

        // Keep raymarching
        currentT += step.w;
        // Check if there's more intersections.
        if (currentT > endT) {
            #if (INTERSECTION_COUNT == 1)
                break;
            #else
                shapeIntersection = nextIntersection(ix);
                if (shapeIntersection.entry.w == NO_HIT) {
                    break;
                } else {
                    // Found another intersection. Resume raymarching there
                    currentT = shapeIntersection.entry.w;
                    endT = shapeIntersection.exit.w;
                }
            #endif
        }
        positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
        tileAndUv = getTileAndUvCoordinate(positionEC);
        positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
        jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);

        // Traverse the tree from the current ray position.
        // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.
        traverseOctreeFromExisting(tileAndUv, traversalData, sampleDatas);
        step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT);
    }

    // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]
    colorAccum.a /= ALPHA_ACCUM_MAX;

    #if defined(PICKING)
        // If alpha is 0.0 there is nothing to pick
        if (colorAccum.a == 0.0) {
            discard;
        }
        out_FragColor = u_pickColor;
    #elif defined(PICKING_VOXEL)
        // If alpha is 0.0 there is nothing to pick
        if (colorAccum.a == 0.0) {
            discard;
        }
        vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex);
        vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0]));
        out_FragColor = vec4(megatextureId, sampleIndex);
    #else
        out_FragColor = colorAccum;
    #endif
}
`;var Pno=y(x(),1),kP=`in vec2 position;

uniform vec4 u_ndcSpaceAxisAlignedBoundingBox;

void main() {
    vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy;
    vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw;
    vec2 translation = 0.5 * (aabbMax + aabbMin);
    vec2 scale = 0.5 * (aabbMax - aabbMin);
    gl_Position = vec4(position * scale + translation, 0.0, 1.0);
}
`;var Uno=y(x(),1),QP=`/* Intersection defines
#define INTERSECTION_COUNT ###
*/

#define NO_HIT (-czm_infinity)
#define INF_HIT (czm_infinity * 0.5)

struct RayShapeIntersection {
    vec4 entry;
    vec4 exit;
};

vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1)
{
    if (intersect0.w == NO_HIT) {
        return intersect1;
    } else if (intersect1.w == NO_HIT) {
        return intersect0;
    }
    return (intersect0.w <= intersect1.w) ? intersect0 : intersect1;
}

vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1)
{
    return (intersect0.w >= intersect1.w) ? intersect0 : intersect1;
}

RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1)
{
    bool missed = (intersect0.entry.w == NO_HIT) ||
        (intersect1.entry.w == NO_HIT) ||
        (intersect0.exit.w < intersect1.entry.w) ||
        (intersect0.entry.w > intersect1.exit.w);
    if (missed) {
        vec4 miss = vec4(normalize(ray.dir), NO_HIT);
        return RayShapeIntersection(miss, miss);
    }

    vec4 entry = intersectionMax(intersect0.entry, intersect1.entry);
    vec4 exit = intersectionMin(intersect0.exit, intersect1.exit);

    return RayShapeIntersection(entry, exit);
}

struct Intersections {
    // Don't access these member variables directly - call the functions instead.

    // Store an array of ray-surface intersections. Each intersection is composed of:
    //  .xyz for the surface normal at the intersection point
    //  .w for the T value
    // The scale of the normal encodes the shape intersection type:
    //  length(intersection.xyz) = 1: positive shape entry
    //  length(intersection.xyz) = 2: positive shape exit
    //  length(intersection.xyz) = 3: negative shape entry
    //  length(intersection.xyz) = 4: negative shape exit
    // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,
    // so we need twice as many to track ray-*surface* intersections
    vec4 intersections[INTERSECTION_COUNT * 2];
    float distanceToDepthBuffer;

    #if (INTERSECTION_COUNT > 1)
        // Maintain state for future nextIntersection calls
        int index;
        int surroundCount;
        bool surroundIsPositive;
    #endif
};

RayShapeIntersection getFirstIntersection(in Intersections ix) 
{
    return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);
}

vec4 encodeIntersectionType(vec4 intersection, int index, bool entry)
{
    float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;
    return vec4(intersection.xyz * scale, intersection.w);
}

// Use defines instead of real functions because WebGL1 cannot access array with non-constant index.
#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))
#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)
#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter))
#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)

#if (INTERSECTION_COUNT > 1)
void initializeIntersections(inout Intersections ix) {
    // Sort the intersections from min T to max T with bubble sort.
    // Note: If this sorting function changes, some of the intersection test may
    // need to be updated. Search for "bubble sort" to find those areas.
    const int sortPasses = INTERSECTION_COUNT * 2 - 1;
    for (int n = sortPasses; n > 0; --n) {
        for (int i = 0; i < sortPasses; ++i) {
            // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot
            // loop with non-constant condition, so it has to break early instead
            if (i >= n) { break; }

            vec4 intersect0 = ix.intersections[i + 0];
            vec4 intersect1 = ix.intersections[i + 1];

            bool inOrder = intersect0.w <= intersect1.w;

            ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;
            ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;
        }
    }

    // Prepare initial state for nextIntersection
    ix.index = 0;
    ix.surroundCount = 0;
    ix.surroundIsPositive = false;
}
#endif

#if (INTERSECTION_COUNT > 1)
RayShapeIntersection nextIntersection(inout Intersections ix) {
    vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);
    RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);

    const int passCount = INTERSECTION_COUNT * 2;

    if (ix.index == passCount) {
        return shapeIntersection;
    }

    for (int i = 0; i < passCount; ++i) {
        // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot
        // loop with non-constant condition, so it has to continue instead.
        if (i < ix.index) {
            continue;
        }

        ix.index = i + 1;

        surfaceIntersection = ix.intersections[i];
        int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
        bool currShapeIsPositive = intersectionType < 2;
        bool enter = intersectionType % 2 == 0;

        ix.surroundCount += enter ? +1 : -1;
        ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;

        // entering positive or exiting negative
        if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
            shapeIntersection.entry = surfaceIntersection;
        }

        // exiting positive or entering negative after being inside positive
        bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
        bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
        if (exitPositive || enterNegativeFromPositive) {
            shapeIntersection.exit = surfaceIntersection;

            // entry and exit have been found, so the loop can stop
            if (exitPositive) {
                // After exiting positive shape there is nothing left to intersect, so jump to the end index.
                ix.index = passCount;
            }
            break;
        }
    }

    return shapeIntersection;
}
#endif

// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1
`;var vno=y(x(),1),OP=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
// setIntersectionPair, INF_HIT, NO_HIT

/* intersectDepth defines (set in Scene/VoxelRenderResources.js)
#define DEPTH_INTERSECTION_INDEX ###
*/

void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
    float entry;
    float exit;
    if (logDepthOrDepth != 0.0) {
        // Calculate how far the ray must travel before it hits the depth buffer.
        vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
        eyeCoordinateDepth /= eyeCoordinateDepth.w;
        entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir);
        exit = +INF_HIT;
    } else {
        // There's no depth at this location.
        entry = NO_HIT;
        exit = NO_HIT;
    }
    ix.distanceToDepthBuffer = entry;
#if defined(DEPTH_TEST)
    setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit));
#endif
}
`;var Qno=y(x(),1),zP=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,
// NO_HIT, setShapeIntersection

/* Clipping plane defines (set in Scene/VoxelRenderResources.js)
#define CLIPPING_PLANES_UNION
#define CLIPPING_PLANES_COUNT
#define CLIPPING_PLANES_INTERSECTION_INDEX
*/

uniform sampler2D u_clippingPlanesTexture;
uniform mat4 u_clippingPlanesMatrix;

// Plane is in Hessian Normal Form
vec4 intersectPlane(in Ray ray, in vec4 plane) {
    vec3 n = plane.xyz; // normal
    float w = plane.w; // -dot(pointOnPlane, normal)

    float a = dot(ray.pos, n);
    float b = dot(ray.dir, n);
    float t = -(w + a) / b;

    return vec4(n, t);
}

#ifdef CLIPPING_PLANES
void intersectClippingPlanes(in Ray ray, inout Intersections ix) {
    vec4 backSide = vec4(-ray.dir, -INF_HIT);
    vec4 farSide = vec4(ray.dir, +INF_HIT);
    RayShapeIntersection clippingVolume;

    #if (CLIPPING_PLANES_COUNT == 1)
        // Union and intersection are the same when there's one clipping plane, and the code
        // is more simplified.
        vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0);
        vec4 intersection = intersectPlane(ray, planeUv);
        bool reflects = dot(ray.dir, intersection.xyz) < 0.0;
        clippingVolume.entry = reflects ? backSide : intersection;
        clippingVolume.exit = reflects ? intersection : farSide;
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
    #elif defined(CLIPPING_PLANES_UNION)
        vec4 firstTransmission = vec4(ray.dir, +INF_HIT);
        vec4 lastReflection = vec4(-ray.dir, -INF_HIT);
        for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
            vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i);
            vec4 intersection = intersectPlane(ray, planeUv);
            if (dot(ray.dir, planeUv.xyz) > 0.0) {
                firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;
            } else {
                lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;
            }
        }
        clippingVolume.entry = backSide;
        clippingVolume.exit = lastReflection;
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);
        clippingVolume.entry = firstTransmission;
        clippingVolume.exit = farSide;
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);
    #else // intersection
        vec4 lastTransmission = vec4(ray.dir, -INF_HIT);
        vec4 firstReflection = vec4(-ray.dir, +INF_HIT);
        for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
            vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i);
            vec4 intersection = intersectPlane(ray, planeUv);
            if (dot(ray.dir, planeUv.xyz) > 0.0) {
                lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;
            } else {
                firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;
            }
        }
        if (lastTransmission.w < firstReflection.w) {
            clippingVolume.entry = lastTransmission;
            clippingVolume.exit = firstReflection;
        } else {
            clippingVolume.entry = vec4(-ray.dir, NO_HIT);
            clippingVolume.exit = vec4(ray.dir, NO_HIT);
        }
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
    #endif
}
#endif
`;var zno=y(x(),1),BZ=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,
// RayShapeIntersection

vec4 transformNormalToEC(in vec4 intersection) {
    return vec4(normalize(czm_normal * intersection.xyz), intersection.w);
}

RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) {
    return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit));
}

vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {
    float normalSign = positiveNormal ? 1.0 : -1.0;
    vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;

    vec2 position = ray.pos.xy;
    vec2 direction = ray.dir.xy;
    float approachRate = dot(direction, planeNormal);
    float distance = -dot(position, planeNormal);

    float t = (approachRate == 0.0)
        ? NO_HIT
        : distance / approachRate;

    return vec4(planeNormal, 0.0, t);
}

RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal)
{
    vec4 intersection = intersectLongitude(ray, angle, positiveNormal);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0);
    if (!hitFront) {
        return RayShapeIntersection(intersection, farSide);
    } else {
        return RayShapeIntersection(-1.0 * farSide, intersection);
    }
}

void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])
{
    intersections[0] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false));
    intersections[1] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.y, true));
}

bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {
    float normalSign = positiveNormal ? 1.0 : -1.0;
    vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign;
    vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy;
    return dot(hit, planeDirection) > 0.0;
}

void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {
    vec4 intersection = intersectLongitude(ray, angle, true);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
    bool hitPositiveSide = hitPositiveHalfPlane(ray, intersection, true);

    farSide = transformNormalToEC(farSide);

    if (hitPositiveSide) {
        intersection = transformNormalToEC(intersection);
        intersections[0].entry = -1.0 * farSide;
        intersections[0].exit = vec4(-1.0 * intersection.xyz, intersection.w);
        intersections[1].entry = intersection;
        intersections[1].exit = farSide;
    } else {
        vec4 miss = vec4(normalize(czm_normal * ray.dir), NO_HIT);
        intersections[0].entry = -1.0 * farSide;
        intersections[0].exit = farSide;
        intersections[1].entry = miss;
        intersections[1].exit = miss;
    }
}

RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)
{
    // Note: works for maxAngle > minAngle + pi, where the "regular wedge"
    // is actually a negative volume.
    // Compute intersections with the two planes.
    // Normals will point toward the "outside" (negative space)
    vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);
    vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);

    // Choose intersection with smallest T as the "first", the other as "last"
    // Note: first or last could be in the "shadow" wedge, beyond the tip
    bool inOrder = intersect1.w <= intersect2.w;
    vec4 first = inOrder ? intersect1 : intersect2;
    vec4 last = inOrder ? intersect2 : intersect1;

    bool firstIsAhead = first.w >= 0.0;
    bool startedInsideFirst = dot(ray.pos.xy, first.xy) < 0.0;
    bool exitFromInside = firstIsAhead == startedInsideFirst;
    bool lastIsAhead = last.w > 0.0;
    bool startedOutsideLast = dot(ray.pos.xy, last.xy) >= 0.0;
    bool enterFromOutside = lastIsAhead == startedOutsideLast;

    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
    vec4 miss = vec4(normalize(ray.dir), NO_HIT);

    if (exitFromInside && enterFromOutside) {
        // Ray crosses both faces of negative wedge, exiting then entering the positive shape
        return transformNormalsToEC(RayShapeIntersection(first, last));
    } else if (!exitFromInside && enterFromOutside) {
        // Ray starts inside wedge. last is in shadow wedge, and first is actually the entry
        return transformNormalsToEC(RayShapeIntersection(-1.0 * farSide, first));
    } else if (exitFromInside && !enterFromOutside) {
        // First intersection was in the shadow wedge, so last is actually the exit
        return transformNormalsToEC(RayShapeIntersection(last, farSide));
    } else { // !exitFromInside && !enterFromOutside
        // Both intersections were in the shadow wedge
        return transformNormalsToEC(RayShapeIntersection(miss, miss));
    }
}
`;var Kno=y(x(),1),HP=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection,
// NO_HIT, Intersections

/* Box defines (set in Scene/VoxelBoxShape.js)
#define BOX_INTERSECTION_INDEX ### // always 0
*/

uniform sampler2D u_renderBoundPlanesTexture;

RayShapeIntersection intersectBoundPlanes(in Ray ray) {
    vec4 lastEntry = vec4(ray.dir, -INF_HIT);
    vec4 firstExit = vec4(-ray.dir, +INF_HIT);
    for (int i = 0; i < 6; i++) {
        vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
        vec4 intersection = intersectPlane(ray, boundPlane);
        if (dot(ray.dir, boundPlane.xyz) < 0.0) {
            lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
        } else {
            firstExit = intersection.w < firstExit.w ? intersection: firstExit;
        }
    }

    if (lastEntry.w < firstExit.w) {
        return RayShapeIntersection(lastEntry, firstExit);
    } else {
        return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
    }
}

void intersectShape(in Ray rayUV, in  Ray rayEC, inout Intersections ix)
{
    RayShapeIntersection intersection = intersectBoundPlanes(rayEC);
    setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
}
`;var jno=y(x(),1),KP=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections,
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection,
// intersectIntersections
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
// intersectFlippedWedge, intersectRegularWedge

/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO

#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN
#define CYLINDER_INTERSECTION_INDEX_ANGLE
*/

// Cylinder uniforms
uniform vec2 u_cylinderRenderRadiusMinMax;
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
    uniform vec2 u_cylinderRenderAngleMinMax;
#endif

uniform sampler2D u_renderBoundPlanesTexture;

RayShapeIntersection intersectBoundPlanes(in Ray ray) {
    vec4 lastEntry = vec4(ray.dir, -INF_HIT);
    vec4 firstExit = vec4(-ray.dir, +INF_HIT);
    for (int i = 0; i < 2; i++) {
        vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
        vec4 intersection = intersectPlane(ray, boundPlane);
        if (dot(ray.dir, boundPlane.xyz) < 0.0) {
            lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
        } else {
            firstExit = intersection.w < firstExit.w ? intersection: firstExit;
        }
    }

    if (lastEntry.w < firstExit.w) {
        return RayShapeIntersection(lastEntry, firstExit);
    } else {
        return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
    }
}

/**
 * Find the intersection of a ray with a right cylindrical surface of a given radius
 * about the z-axis.
 */
RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex)
{
    vec2 position = ray.pos.xy;
    vec2 direction = ray.dir.xy;

    float a = dot(direction, direction);
    float b = dot(position, direction);
    float c = dot(position, position) - radius * radius;
    float determinant = b * b - a * c;

    if (determinant < 0.0) {
        vec4 miss = vec4(normalize(ray.dir), NO_HIT);
        return RayShapeIntersection(miss, miss);
    }

    determinant = sqrt(determinant);
    float t1 = (-b - determinant) / a;
    float t2 = (-b + determinant) / a;
    float signFlip = convex ? 1.0 : -1.0;
    vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0);
    vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0);
    // Return normals in eye coordinates
    vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1);
    vec4 intersect2 = vec4(normalize(czm_normal * normal2), t2);

    return RayShapeIntersection(intersect1, intersect2);
}

/**
 * Find the intersection of a ray with a right cylindrical solid of given
 * radius and height bounds. NOTE: The shape is assumed to be convex.
 */
RayShapeIntersection intersectBoundedCylinder(in Ray ray, in Ray rayEC, in float radius)
{
    RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
    RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC);
    return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
}

void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix)
{
    RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y);

    setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);

    if (outerIntersect.entry.w == NO_HIT) {
        return;
    }

    #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
        // When the cylinder is perfectly thin it's necessary to sandwich the
        // inner cylinder intersection inside the outer cylinder intersection.

        // Without this special case,
        // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
        // [outerMin, innerMin, outerMax, innerMax] which will cause the back
        // side of the cylinder to be invisible because it will think the ray
        // is still inside the inner (negative) cylinder after exiting the
        // outer (positive) cylinder.

        // With this special case,
        // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
        // [outerMin, innerMin, innerMax, outerMax] which will work correctly.

        // Note: If initializeIntersections() changes its sorting function
        // from bubble sort to something else, this code may need to change.
        RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);
        setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true);  // positive, enter
        setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
        setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
        setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);  // positive, exit
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)
        RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);
    #endif

    #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)
        RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)
        RayShapeIntersection wedgeIntersects[2];
        intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax, wedgeIntersects);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
        RayShapeIntersection wedgeIntersects[2];
        intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x, wedgeIntersects);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
    #endif
}
`;var $no=y(x(),1),JP=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections,
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
// intersectFlippedWedge, intersectRegularWedge

/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF
#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN
*/

#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
    uniform vec2 u_ellipsoidRenderLongitudeMinMax;
#endif
uniform float u_eccentricitySquared;
uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
uniform vec2 u_clipMinMaxHeight; // Values are negative: clipHeight - maxShapeHeight

RayShapeIntersection intersectZPlane(in Ray ray, in float z) {
    float t = -ray.pos.z / ray.dir.z;

    bool startsOutside = sign(ray.pos.z) == sign(z);
    bool entry = (t >= 0.0) != startsOutside;

    vec4 intersect = vec4(0.0, 0.0, z, t);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    if (entry) {
        return RayShapeIntersection(intersect, farSide);
    } else {
        return RayShapeIntersection(-1.0 * farSide, intersect);
    }
}

RayShapeIntersection intersectHeight(in Ray ray, in float height, in bool convex)
{
    // Scale the ray by the ellipsoid axes to make it a unit sphere
    // Note: approximating ellipsoid + height as an ellipsoid
    vec3 radiiCorrection = vec3(1.0) / (u_ellipsoidRadii + height);
    vec3 position = ray.pos * radiiCorrection;
    vec3 direction = ray.dir * radiiCorrection;

    float a = dot(direction, direction); // ~ 1.0 (or maybe 4.0 if ray is scaled)
    float b = dot(direction, position); // roughly inside [-1.0, 1.0] when zoomed in
    float c = dot(position, position) - 1.0; // ~ 0.0 when zoomed in.
    float determinant = b * b - a * c; // ~ b * b when zoomed in

    if (determinant < 0.0) {
        vec4 miss = vec4(normalize(direction), NO_HIT);
        return RayShapeIntersection(miss, miss);
    }

    determinant = sqrt(determinant);

    // Compute larger root using standard formula
    float signB = b < 0.0 ? -1.0 : 1.0;
    // The other root may suffer from subtractive cancellation in the standard formula.
    // Compute it from the first root instead.
    float t1 = (-b - signB * determinant) / a;
    float t2 = c / (a * t1);
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);

    float directionScale = convex ? 1.0 : -1.0;
    vec3 d1 = directionScale * (position + tmin * direction);
    vec3 d2 = directionScale * (position + tmax * direction);

    // Return normals in eye coordinates. Use spherical approximation for the normal.
    vec3 normal1 = normalize(czm_normal * d1);
    vec3 normal2 = normalize(czm_normal * d2);

    return RayShapeIntersection(vec4(normal1, tmin), vec4(normal2, tmax));
}

/**
 * Given a circular cone around the z-axis, with apex at the origin,
 * find the parametric distance(s) along a ray where that ray intersects
 * the cone.
 * The cone opening angle is described by the squared cosine of
 * its half-angle (the angle between the Z-axis and the surface)
 */
vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle)
{
    vec3 o = ray.pos;
    vec3 d = ray.dir;
    float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle;

    float aSin = d.z * d.z * sinSqrHalfAngle;
    float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle;
    float a = aSin + aCos;

    float bSin = d.z * o.z * sinSqrHalfAngle;
    float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle;
    float b = bSin + bCos;

    float cSin = o.z * o.z * sinSqrHalfAngle;
    float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle;
    float c = cSin + cCos;
    // determinant = b * b - a * c. But bSin * bSin = aSin * cSin.
    // Avoid subtractive cancellation by expanding to eliminate these terms
    float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos;

    if (determinant < 0.0) {
        return vec2(NO_HIT);
    } else if (a == 0.0) {
        // Ray is parallel to cone surface
        return (b == 0.0)
            ? vec2(NO_HIT) // Ray is on cone surface
            : vec2(-0.5 * c / b, NO_HIT);
    }

    determinant = sqrt(determinant);

    // Compute larger root using standard formula
    float signB = b < 0.0 ? -1.0 : 1.0;
    float t1 = (-b - signB * determinant) / a;
    // The other root may suffer from subtractive cancellation in the standard formula.
    // Compute it from the first root instead.
    float t2 = c / (a * t1);
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);
    return vec2(tmin, tmax);
}

/**
 * Given a point on a conical surface, find the surface normal at that point.
 */
vec3 getConeNormal(in vec3 p, in bool convex) {
    // Start with radial component pointing toward z-axis
    vec2 radial = -abs(p.z) * normalize(p.xy);
    // Z component points toward opening of cone
    float zSign = (p.z < 0.0) ? -1.0 : 1.0;
    float z = length(p.xy) * zSign;
    // Flip normal if shape is convex
    float flip = (convex) ? -1.0 : 1.0;
    return normalize(vec3(radial, z) * flip);
}

/**
 * Compute the shift between the ellipsoid origin and the apex of a cone of latitude
 */
float getLatitudeConeShift(in float sinLatitude) {
    // Find prime vertical radius of curvature: 
    // the distance along the ellipsoid normal to the intersection with the z-axis
    float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
    float primeVerticalRadius = u_ellipsoidRadii.x * inversesqrt(1.0 - x2);

    // Compute a shift from the origin to the intersection of the cone with the z-axis
    return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
}

void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
    // Shift the ray to account for the latitude cone not being centered at the Earth center
    ray.pos.z += getLatitudeConeShift(cosHalfAngle);

    float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);

    vec4 miss = vec4(normalize(ray.dir), NO_HIT);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    // Initialize output with no intersections
    intersections[0].entry = -1.0 * farSide;
    intersections[0].exit = farSide;
    intersections[1].entry = miss;
    intersections[1].exit = miss;

    if (intersect.x == NO_HIT) {
        return;
    }

    // Find the points of intersection
    float tmin = intersect.x;
    float tmax = intersect.y;
    vec3 p0 = ray.pos + tmin * ray.dir;
    vec3 p1 = ray.pos + tmax * ray.dir;

    vec4 intersect0 = vec4(getConeNormal(p0, true), tmin);
    vec4 intersect1 = vec4(getConeNormal(p1, true), tmax);

    bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
    bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);

    if (p0InShadowCone && p1InShadowCone) {
        // no valid intersections
    } else if (p0InShadowCone) {
        intersections[0].exit = intersect1;
    } else if (p1InShadowCone) {
        intersections[0].entry = intersect0;
    } else {
        intersections[0].exit = intersect0;
        intersections[1].entry = intersect1;
        intersections[1].exit = farSide;
    }
}

RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {
    // Shift the ray to account for the latitude cone not being centered at the Earth center
    ray.pos.z += getLatitudeConeShift(cosHalfAngle);

    float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);

    vec4 miss = vec4(normalize(ray.dir), NO_HIT);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    if (intersect.x == NO_HIT) {
        return RayShapeIntersection(miss, miss);
    }

    // Find the points of intersection
    float tmin = intersect.x;
    float tmax = intersect.y;
    vec3 p0 = ray.pos + tmin * ray.dir;
    vec3 p1 = ray.pos + tmax * ray.dir;

    vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin);
    vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax);

    bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
    bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);

    if (p0InShadowCone && p1InShadowCone) {
        return RayShapeIntersection(miss, miss);
    } else if (p0InShadowCone) {
        return RayShapeIntersection(intersect1, farSide);
    } else if (p1InShadowCone) {
        return RayShapeIntersection(-1.0 * farSide, intersect0);
    } else {
        return RayShapeIntersection(intersect0, intersect1);
    }
}

void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) {    // Outer ellipsoid
    RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
    setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);

    // Exit early if the outer ellipsoid was missed.
    if (outerIntersect.entry.w == NO_HIT) {
        return;
    }

    // Inner ellipsoid
    RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);

    if (innerIntersect.entry.w == NO_HIT) {
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
    } else {
        // When the ellipsoid is large and thin it's possible for floating point math
        // to cause the ray to intersect the inner ellipsoid before the outer ellipsoid. 
        // To prevent this from happening, clamp innerIntersect to outerIntersect and
        // sandwich the inner ellipsoid intersection inside the outer ellipsoid intersection.

        // Without this special case,
        // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
        // [outerMin, innerMin, outerMax, innerMax] which will cause the back
        // side of the ellipsoid to be invisible because it will think the ray
        // is still inside the inner (negative) ellipsoid after exiting the
        // outer (positive) ellipsoid.

        // With this special case,
        // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
        // [outerMin, innerMin, innerMax, outerMax] which will work correctly.

        // Note: If initializeIntersections() changes its sorting function
        // from bubble sort to something else, this code may need to change.
        innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w);
        innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w);
        setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true);  // positive, enter
        setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
        setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
        setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);  // positive, exit
    }

    // Bottom cone
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
        RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
        RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
        RayShapeIntersection bottomConeIntersections[2];
        intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]);
    #endif

    // Top cone
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
        RayShapeIntersection topConeIntersections[2];
        intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
        RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
        RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
    #endif

    // Wedge
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
        RayShapeIntersection wedgeIntersects[2];
        intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
        RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
        RayShapeIntersection wedgeIntersects[2];
        intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
    #endif
}
`;var tio=y(x(),1),fT=`// Main intersection function for Voxel scenes.
// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl
// for the definition of intersectShape. The appropriate function is selected
// based on the VoxelPrimitive shape type, and added to the shader in
// Scene/VoxelRenderResources.js.
// See also IntersectClippingPlane.glsl and IntersectDepth.glsl.
// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,
// getFirstIntersection, initializeIntersections, nextIntersection.

/* Intersection defines (set in Scene/VoxelRenderResources.js)
#define INTERSECTION_COUNT ###
*/

RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) {
    // Do a ray-shape intersection to find the exact starting and ending points.
    intersectShape(ray, rayEC, ix);

    // Exit early if the positive shape was completely missed or behind the ray.
    RayShapeIntersection intersection = getFirstIntersection(ix);
    if (intersection.entry.w == NO_HIT) {
        // Positive shape was completely missed - so exit early.
        return intersection;
    }

    // Clipping planes
    #if defined(CLIPPING_PLANES)
        intersectClippingPlanes(ray, ix);
    #endif

    // Depth
    intersectDepth(screenCoord, rayEC, ix);

    // Find the first intersection that's in front of the ray
    #if (INTERSECTION_COUNT > 1)
        initializeIntersections(ix);
        for (int i = 0; i < INTERSECTION_COUNT; ++i) {
            intersection = nextIntersection(ix);
            if (intersection.exit.w > 0.0) {
                // Set start to 0.0 when ray is inside the shape.
                intersection.entry.w = max(intersection.entry.w, 0.0);
                break;
            }
        }
    #else
        // Set start to 0.0 when ray is inside the shape.
        intersection.entry.w = max(intersection.entry.w, 0.0);
    #endif

    return intersection;
}
`;var iio=y(x(),1),jP=`uniform vec3 u_boxLocalToShapeUvScale;
uniform vec3 u_boxLocalToShapeUvTranslate;

uniform ivec4 u_cameraTileCoordinates;
uniform vec3 u_cameraTileUv;
uniform mat3 u_boxEcToXyz;

mat3 convertLocalToShapeSpaceDerivative(in vec3 positionLocal) {
    // For BOX, local space = shape space, so the Jacobian is the identity matrix.
    return mat3(1.0);
}

vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
    return shapeUv / u_boxLocalToShapeUvScale;
}

vec3 convertEcToDeltaTile(in vec3 positionEC) {
    vec3 dPosition = u_boxEcToXyz * positionEC;
    return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w);
}

TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
    vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
    vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
    ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
    tileCoordinate = min(max(ivec3(0), tileCoordinate), ivec3((1 << u_cameraTileCoordinates.w) - 1));
    ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
    vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0);
    return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
}
`;var rio=y(x(),1),qP=`uniform vec2 u_cylinderLocalToShapeUvRadius; // x = scale, y = offset
uniform vec2 u_cylinderLocalToShapeUvHeight; // x = scale, y = offset
uniform vec2 u_cylinderLocalToShapeUvAngle; // x = scale, y = offset
uniform float u_cylinderShapeUvAngleRangeOrigin;
uniform mat3 u_cylinderEcToRadialTangentUp;
uniform ivec4 u_cameraTileCoordinates;
uniform vec3 u_cameraTileUv;
uniform vec3 u_cameraShapePosition; // (radial distance, angle, height) of camera in shape space

mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
    vec3 radial = normalize(vec3(position.xy, 0.0));
    vec3 z = vec3(0.0, 0.0, 1.0);
    vec3 east = normalize(vec3(-position.y, position.x, 0.0));
    return mat3(radial, east / length(position.xy), z);
}

vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
    float radius = shapeUv.x / u_cylinderLocalToShapeUvRadius.x;
    float angle = shapeUv.y * czm_twoPi / u_cylinderLocalToShapeUvAngle.x;
    float height = shapeUv.z / u_cylinderLocalToShapeUvHeight.x;

    return vec3(radius, angle, height);
}

/**
 * Computes the change in polar coordinates given a change in position.
 * @param {vec2} dPosition The change in position in Cartesian coordinates.
 * @param {float} cameraRadialDistance The radial distance of the camera from the origin.
 * @return {vec2} The change in polar coordinates (radial distance, angle).
 */
vec2 computePolarChange(in vec2 dPosition, in float cameraRadialDistance) {
    float dAngle = atan(dPosition.y, cameraRadialDistance + dPosition.x);
    // Find the direction of the radial axis at the output angle, in Cartesian coordinates
    vec2 outputRadialAxis = vec2(cos(dAngle), sin(dAngle));
    float sinHalfAngle = sin(dAngle / 2.0);
    float versine = 2.0 * sinHalfAngle * sinHalfAngle;
    float dRadial = dot(dPosition, outputRadialAxis) - cameraRadialDistance * versine;
    return vec2(dRadial, dAngle);
}

vec3 convertEcToDeltaShape(in vec3 positionEC) {
    // 1. Rotate to radial, tangent, and up coordinates
    vec3 rtu = u_cylinderEcToRadialTangentUp * positionEC;
    // 2. Compute change in angular and radial coordinates.
    vec2 dPolar = computePolarChange(rtu.xy, u_cameraShapePosition.x);
    return vec3(dPolar.xy, rtu.z);
}

vec3 convertEcToDeltaTile(in vec3 positionEC) {
    vec3 deltaShape = convertEcToDeltaShape(positionEC);
    // Convert to tileset coordinates in [0, 1]
    float dx = u_cylinderLocalToShapeUvRadius.x * deltaShape.x;
    float dy = deltaShape.y / czm_twoPi;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
    // Wrap to ensure dy is not crossing through the unoccupied angle range, where
    // angle to tile coordinate conversions would be more complicated
    float cameraUvAngle = (u_cameraShapePosition.y + czm_pi) / czm_twoPi;
    float cameraUvAngleShift = fract(cameraUvAngle - u_cylinderShapeUvAngleRangeOrigin);
    float rawOutputUvAngle = cameraUvAngleShift + dy;
    float rotation = floor(rawOutputUvAngle);
    dy -= rotation;
#endif
    dy *= u_cylinderLocalToShapeUvAngle.x;
    float dz = u_cylinderLocalToShapeUvHeight.x * deltaShape.z;
    // Convert to tile coordinate changes
    return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
}

TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
    vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
    vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
    ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
    int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
    tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
    tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
    ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
    if (tileCoordinate.y < 0) {
        tileCoordinate.y += (maxTileCoordinate + 1);
    } else if (tileCoordinate.y > maxTileCoordinate) {
        tileCoordinate.y -= (maxTileCoordinate + 1);
    }
#else
    tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
    ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
#endif
    vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
    tileUv.x = clamp(tileUv.x, 0.0, 1.0);
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
    // If there is only one tile spanning 2*PI angle, the coordinate wraps around
    tileUv.y = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.y) : clamp(tileUv.y, 0.0, 1.0);
#else
    tileUv.y = clamp(tileUv.y, 0.0, 1.0);
#endif
    tileUv.z = clamp(tileUv.z, 0.0, 1.0);
    return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
}
`;var aio=y(x(),1),$P=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
*/

uniform vec3 u_cameraPositionCartographic; // (longitude, latitude, height) in radians and meters
uniform vec2 u_ellipsoidCurvatureAtLatitude;
uniform mat3 u_ellipsoidEcToEastNorthUp;
uniform vec3 u_ellipsoidRadii;
uniform vec2 u_evoluteScale; // (radii.x ^ 2 - radii.z ^ 2) * vec2(1.0, -1.0) / radii;
uniform vec3 u_ellipsoidInverseRadiiSquared;
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
    uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
    uniform vec2 u_ellipsoidLocalToShapeUvLongitude; // x = scale, y = offset
    uniform float u_ellipsoidShapeUvLongitudeRangeOrigin;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
    uniform vec2 u_ellipsoidLocalToShapeUvLatitude; // x = scale, y = offset
#endif
uniform float u_ellipsoidInverseHeightDifference;

uniform ivec4 u_cameraTileCoordinates;
uniform vec3 u_cameraTileUv;

// robust iterative solution without trig functions
// https://github.com/0xfaded/ellipse_demo/issues/1
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
// Extended to return radius of curvature along with the point
vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {
    vec2 p = abs(pos);
    vec2 inverseRadii = 1.0 / radii;

    // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
    // but store the cos and sin of t in a vec2 for efficiency.
    // Initial guess: t = pi/4
    vec2 tTrigs = vec2(0.7071067811865476);
    // Initial guess of point on ellipsoid
    vec2 v = radii * tTrigs;
    // Center of curvature of the ellipse at v
    vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;

    const int iterations = 3;
    for (int i = 0; i < iterations; ++i) {
        // Find the (approximate) intersection of p - evolute with the ellipsoid.
        vec2 q = normalize(p - evolute) * length(v - evolute);
        // Update the estimate of t.
        tTrigs = (q + evolute) * inverseRadii;
        tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
        v = radii * tTrigs;
        evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
    }

    return vec3(v * sign(pos), length(v - evolute));
}

mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
    vec3 east = normalize(vec3(-position.y, position.x, 0.0));

    // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z)
    // (assume radii.y == radii.x) and find the nearest point on the ellipse and its normal
    float distanceFromZAxis = length(position.xy);
    vec2 posEllipse = vec2(distanceFromZAxis, position.z);
    vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadii.xz);
    vec2 surfacePoint = surfacePointAndRadius.xy;

    vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquared.xz);
    vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x));

    float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0;
    float height = heightSign * length(posEllipse - surfacePoint);
    vec3 up = normalize(cross(east, north));

    return mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
}

vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
    // Convert from [0, 1] to radians [-pi, pi]
    float longitude = shapeUv.x * czm_twoPi;
    #if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
        longitude /= u_ellipsoidLocalToShapeUvLongitude.x;
    #endif

    // Convert from [0, 1] to radians [-pi/2, pi/2]
    float latitude = shapeUv.y * czm_pi;
    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
        latitude /= u_ellipsoidLocalToShapeUvLatitude.x;
    #endif

    float height = shapeUv.z / u_ellipsoidInverseHeightDifference;

    return vec3(longitude, latitude, height);
}

vec3 convertEcToDeltaShape(in vec3 positionEC) {
    vec3 enu = u_ellipsoidEcToEastNorthUp * positionEC;

    // 1. Compute the change in longitude from the camera to the ENU point
    // First project the camera and ENU positions to the equatorial XY plane,
    // positioning the camera on the +x axis, so that enu.x projects along the +y axis
    float cosLatitude = cos(u_cameraPositionCartographic.y);
    float sinLatitude = sin(u_cameraPositionCartographic.y);
    float primeVerticalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.x;
    vec2 cameraXY = vec2((primeVerticalRadius + u_cameraPositionCartographic.z) * cosLatitude, 0.0);
    // Note precision loss in positionXY.x if length(enu) << length(cameraXY)
    vec2 positionXY = cameraXY + vec2(-enu.y * sinLatitude + enu.z * cosLatitude, enu.x);
    float dLongitude = atan(positionXY.y, positionXY.x);

    // 2. Find the longitude component of positionXY, by rotating about Z until the y component is zero.
    // Use the versine  to compute the change in x directly from the change in angle:
    //   versine(angle) = 2 * sin^2(angle/2)
    float sinHalfLongitude = sin(dLongitude / 2.0);
    float dx = length(positionXY) * 2.0 * sinHalfLongitude * sinHalfLongitude;
    // Rotate longitude component back to ENU North and Up, and remove from enu
    enu += vec3(-enu.x, -dx * sinLatitude, dx * cosLatitude);

    // 3. Compute the change in latitude from the camera to the ENU point.
    // First project the camera and ENU positions to the meridional ZX plane,
    // positioning the camera on the +Z axis, so that enu.y maps to the +X axis.
    float meridionalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.y;
    vec2 cameraZX = vec2(meridionalRadius + u_cameraPositionCartographic.z, 0.0);
    vec2 positionZX = cameraZX + vec2(enu.z, enu.y);
    float dLatitude = atan(positionZX.y, positionZX.x);

    // 4. Compute the change in height above the ellipsoid
    // Find the change in enu.z associated with rotating the point to the latitude of the camera
    float sinHalfLatitude = sin(dLatitude / 2.0);
    float dz = length(positionZX) * 2.0 * sinHalfLatitude * sinHalfLatitude;
    // The remaining change in enu.z is the change in height above the ellipsoid
    float dHeight = enu.z + dz;

    return vec3(dLongitude, dLatitude, dHeight);
}

vec3 convertEcToDeltaTile(in vec3 positionEC) {
    vec3 deltaShape = convertEcToDeltaShape(positionEC);
    // Convert to tileset coordinates in [0, 1]
    float dx = deltaShape.x / czm_twoPi;

#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
    // Wrap to ensure dx is not crossing through the unoccupied angle range, where
    // angle to tile coordinate conversions would be more complicated
    float cameraUvLongitude = (u_cameraPositionCartographic.x + czm_pi) / czm_twoPi;
    float cameraUvLongitudeShift = fract(cameraUvLongitude - u_ellipsoidShapeUvLongitudeRangeOrigin);
    float rawOutputUvLongitude = cameraUvLongitudeShift + dx;
    float rotation = floor(rawOutputUvLongitude);
    dx -= rotation;
    dx *= u_ellipsoidLocalToShapeUvLongitude.x;
#endif

    float dy = deltaShape.y / czm_pi;
#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE))
    dy *= u_ellipsoidLocalToShapeUvLatitude.x;
#endif

    float dz = u_ellipsoidInverseHeightDifference * deltaShape.z;
    // Convert to tile coordinate changes
    return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
}

TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
    vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
    vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
    ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
    int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
    tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
    tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
    ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
    if (tileCoordinate.x < 0) {
        tileCoordinate.x += (maxTileCoordinate + 1);
    } else if (tileCoordinate.x > maxTileCoordinate) {
        tileCoordinate.x -= (maxTileCoordinate + 1);
    }
#else
    tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
    ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
#endif
    vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
    // If there is only one tile spanning 2*PI angle, the coordinate wraps around
    tileUv.x = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.x) : clamp(tileUv.x, 0.0, 1.0);
#else
    tileUv.x = clamp(tileUv.x, 0.0, 1.0);
#endif
    tileUv.y = clamp(tileUv.y, 0.0, 1.0);
    tileUv.z = clamp(tileUv.z, 0.0, 1.0);
    return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
}
`;var lio=y(x(),1),eM=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js
#define OCTREE_FLAG_INTERNAL 0
#define OCTREE_FLAG_LEAF 1
#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2

#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops

uniform sampler2D u_octreeInternalNodeTexture;
uniform vec2 u_octreeInternalNodeTexelSizeUv;
uniform int u_octreeInternalNodeTilesPerRow;
#if (SAMPLE_COUNT > 1)
uniform sampler2D u_octreeLeafNodeTexture;
uniform vec2 u_octreeLeafNodeTexelSizeUv;
uniform int u_octreeLeafNodeTilesPerRow;
#endif
uniform ivec3 u_dimensions; // does not include padding, and is in the z-up orientation
uniform ivec3 u_inputDimensions; // includes padding, and is in the orientation of the input data
#if defined(PADDING)
    uniform ivec3 u_paddingBefore;
#endif

struct OctreeNodeData {
    int data;
    int flag;
};

struct TraversalData {
    ivec4 octreeCoords;
    int parentOctreeIndex;
};

struct TileAndUvCoordinate {
    ivec4 tileCoords;
    vec3 tileUv;
};

struct SampleData {
    int megatextureIndex;
    ivec4 tileCoords;
    vec3 tileUv;
    vec3 inputCoordinate;
    #if (SAMPLE_COUNT > 1)
        float weight;
    #endif
};

int normU8_toInt(in float value) {
    return int(value * 255.0);
}
int normU8x2_toInt(in vec2 value) {
    return int(value.x * 255.0) + 256 * int(value.y * 255.0);
}
float normU8x2_toFloat(in vec2 value) {
    return float(normU8x2_toInt(value)) / 65535.0;
}

OctreeNodeData getOctreeNodeData(in vec2 octreeUv) {
    vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);

    OctreeNodeData data;
    data.data = normU8x2_toInt(texData.xy);
    data.flag = normU8x2_toInt(texData.zw);
    return data;
}

OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {
    int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;
    int octreeCoordX = (parentOctreeIndex % u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;
    int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;
    vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
    return getOctreeNodeData(octreeUv);
}

int getOctreeParentIndex(in int octreeIndex) {
    int octreeCoordX = (octreeIndex % u_octreeInternalNodeTilesPerRow) * 9;
    int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;
    vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
    vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);
    int parentOctreeIndex = normU8x2_toInt(parentData.xy);
    return parentOctreeIndex;
}

vec3 getTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
    int levelDifference = tileAndUv.tileCoords.w - octreeCoords.w;
    float scalar = exp2(-1.0 * float(levelDifference));
    vec3 originShift = vec3(tileAndUv.tileCoords.xyz - (octreeCoords.xyz << levelDifference)) * scalar;
    return tileAndUv.tileUv * scalar + originShift;
}

vec3 getClampedTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
    vec3 tileUv = getTileUv(tileAndUv, octreeCoords);
    return clamp(tileUv, vec3(0.0), vec3(1.0));
}

void addSampleCoordinates(in TileAndUvCoordinate tileAndUv, inout SampleData sampleData) {
    vec3 tileUv = getClampedTileUv(tileAndUv, sampleData.tileCoords);

    vec3 inputCoordinate = tileUv * vec3(u_dimensions);
#if defined(PADDING)
    inputCoordinate += vec3(u_paddingBefore);
#endif
#if defined(Y_UP_METADATA_ORDER)
#if defined(SHAPE_BOX)
    float inputY = inputCoordinate.y;
    inputCoordinate.y = inputCoordinate.z;
    // u_inputDimensions.z is the y-up dimension along the 3D Tiles y-axis.
    inputCoordinate.z = float(u_inputDimensions.z) - inputY;
#elif defined(SHAPE_CYLINDER)
    float angle = inputCoordinate.y;
    float height = inputCoordinate.z;
    #if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
    // Account for the different 0-angle convention in glTF vs 3DTiles
    if (sampleData.tileCoords.w == 0) {
        float angleCount = float(u_inputDimensions.z);
        angle = mod(angle + angleCount / 2.0, angleCount);
    }
    #endif
    inputCoordinate.y = height;
    inputCoordinate.z = angle;
#endif
#endif

    sampleData.tileUv = tileUv;
    sampleData.inputCoordinate = inputCoordinate;
}

void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {
    sampleData.megatextureIndex = data.data;
    sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)
        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
        : octreeCoords;
}

#if (SAMPLE_COUNT > 1)
void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {
    int leafIndex = data.data;
    int leafNodeTexelCount = 2;
    // Adding 0.5 moves to the center of the texel
    float leafCoordXStart = float((leafIndex % u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
    float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;

    // Get an interpolation weight and a flag to determine whether to read the parent texture
    vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);
    vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);
    float lerp = normU8x2_toFloat(leafData0.xy);
    sampleDatas[0].weight = 1.0 - lerp;
    sampleDatas[1].weight = lerp;
    // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT
    sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)
        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
        : octreeCoords;
    sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)
        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
        : octreeCoords;

    // Get megatexture indices for both samples
    vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);
    vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);
    sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);
    sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);
}
#endif

OctreeNodeData traverseOctreeDownwards(in ivec4 tileCoordinate, inout TraversalData traversalData) {
    OctreeNodeData childData;

    for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
        // tileCoordinate.xyz is defined at the level of detail tileCoordinate.w.
        // Find the corresponding coordinate at the level traversalData.octreeCoords.w
        int level = traversalData.octreeCoords.w + 1;
        int levelDifference = tileCoordinate.w - level;
        ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
        traversalData.octreeCoords = ivec4(coordinateAtLevel, level);

        ivec3 childCoordinate = coordinateAtLevel & 1;
        childData = getOctreeChildData(traversalData.parentOctreeIndex, childCoordinate);

        if (childData.flag != OCTREE_FLAG_INTERNAL) {
            // leaf tile - stop traversing
            break;
        }

        traversalData.parentOctreeIndex = childData.data;
    }

    return childData;
}

/**
* Transform a given position to an octree tile coordinate and a position within that tile,
* and find the corresponding megatexture index and texture coordinates
*/
void traverseOctreeFromBeginning(in TileAndUvCoordinate tileAndUv, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {
    traversalData.octreeCoords = ivec4(0);
    traversalData.parentOctreeIndex = 0;

    OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));
    if (nodeData.flag != OCTREE_FLAG_LEAF) {
        nodeData = traverseOctreeDownwards(tileAndUv.tileCoords, traversalData);
    }

    #if (SAMPLE_COUNT == 1)
        getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
        addSampleCoordinates(tileAndUv, sampleDatas[0]);
    #else
        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
        addSampleCoordinates(tileAndUv, sampleDatas[0]);
        addSampleCoordinates(tileAndUv, sampleDatas[1]);
    #endif
}

bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) {
    int levelDifference = tileCoordinate.w - octreeCoords.w;
    if (levelDifference < 0) {
        return false;
    }
    ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
    return coordinateAtLevel == octreeCoords.xyz;
}

void traverseOctreeFromExisting(in TileAndUvCoordinate tileAndUv, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
    ivec4 tileCoords = tileAndUv.tileCoords;
    if (insideTile(tileCoords, traversalData.octreeCoords)) {
        for (int i = 0; i < SAMPLE_COUNT; i++) {
            addSampleCoordinates(tileAndUv, sampleDatas[i]);
        }
        return;
    }

    // Go up tree until we find a parent tile containing tileCoords.
    // Assumes all parents are available all they way up to the root.
    for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
        traversalData.octreeCoords.xyz /= 2;
        traversalData.octreeCoords.w -= 1;

        if (insideTile(tileCoords, traversalData.octreeCoords)) {
            break;
        }

        traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
    }

    // Go down tree
    OctreeNodeData nodeData = traverseOctreeDownwards(tileCoords, traversalData);

    #if (SAMPLE_COUNT == 1)
        getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
        addSampleCoordinates(tileAndUv, sampleDatas[0]);
    #else
        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
        addSampleCoordinates(tileAndUv, sampleDatas[0]);
        addSampleCoordinates(tileAndUv, sampleDatas[1]);
    #endif
}
`;var uio=y(x(),1),tM=`// See Octree.glsl for the definitions of SampleData

/* Megatexture defines (set in Scene/VoxelRenderResources.js)
#define SAMPLE_COUNT ###
#define PADDING
*/

uniform ivec3 u_megatextureTileCounts; // number of tiles in the megatexture, along each axis

vec3 index1DTo3DTexCoord(int index)
{
    int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y;
    int iz = index / tilesPerZ;
    int remainder = index - iz * tilesPerZ;
    int iy = remainder / u_megatextureTileCounts.x;
    int ix = remainder - iy * u_megatextureTileCounts.x;
    return vec3(ix, iy, iz) / vec3(u_megatextureTileCounts);
}

Properties getPropertiesFromMegatexture(in SampleData sampleData) {
    int tileIndex = sampleData.megatextureIndex;

    vec3 voxelCoord = sampleData.inputCoordinate;

    // UV coordinate of the lower corner of the tile in the megatexture
    vec3 tileUvOffset = index1DTo3DTexCoord(tileIndex);

    // Voxel location
    vec3 tileDimensions = vec3(u_inputDimensions);
    vec3 clampedVoxelCoord = clamp(voxelCoord, vec3(0.5), tileDimensions - vec3(0.5));
    vec3 voxelUv = clampedVoxelCoord / tileDimensions / vec3(u_megatextureTileCounts);

    return getPropertiesFromMegatextureAtUv(tileUvOffset + voxelUv);
}

// Convert an array of sample datas to a final weighted properties.
Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
    #if (SAMPLE_COUNT == 1)
        return getPropertiesFromMegatexture(sampleDatas[0]);
    #else
        // When more than one sample is taken the accumulator needs to start at 0
        Properties properties = clearProperties();
        for (int i = 0; i < SAMPLE_COUNT; ++i) {
            float weight = sampleDatas[i].weight;

            // Avoid reading the megatexture when the weight is 0 as it can be costly.
            if (weight > 0.0) {
                Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
                tempProperties = scaleProperties(tempProperties, weight);
                properties = sumProperties(properties, tempProperties);
            }
        }
        return properties;
    #endif
}
`;var hio=y(x(),1),m_t={Z_UP:0,Y_UP:1},nA=Object.freeze(m_t);function h_t(e){let t=new EA;this.shaderBuilder=t;let n=e._customShader,i=Rt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let f in o)if(o.hasOwnProperty(f)){let b=o[f];t.addUniform(b.type,f,be.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",be.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([kP]),e.provider.metadataOrder===nA.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,be.FRAGMENT);let d=e._provider.shape;d==="BOX"?t.addDefine("SHAPE_BOX",void 0,be.FRAGMENT):d==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,be.FRAGMENT):d==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,be.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",eM,DP,tM,QP,zP,OP]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,be.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,be.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,be.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,be.FRAGMENT),d==="BOX"?t.addFragmentLines([jP,HP,fT]):d==="CYLINDER"?t.addFragmentLines([qP,BZ,KP,fT]):d==="ELLIPSOID"&&t.addFragmentLines([$P,BZ,JP,fT]),t.addFragmentLines([vP]);let u=e._shape,h=u.shaderDefines;for(let f in h)if(h.hasOwnProperty(f)){let b=h[f];l(b)&&(b=b===!0?void 0:b,t.addDefine(f,b,be.FRAGMENT))}let p=u.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,be.FRAGMENT),s===1?p+=1:r.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,be.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,be.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,be.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,be.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,be.FRAGMENT)}var nM=h_t;var QIe=new M;function f_t(e,t){let n=new nM(e);UP(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(r>0){let S="getClippingPlane",_=`vec4 ${S}(highp sampler2D packedPlanes, int planeNumber)`,R=ss.getTextureResolution(o,t,QIe),L=OIe(R);i.addFunction(S,_,be.FRAGMENT),i.addFunctionLines(S,[L])}if(a>0){let S="getBoundPlane",_=`vec4 ${S}(highp sampler2D packedPlanes, int planeNumber)`,R=yb.getTextureResolution(s,t,QIe),L=OIe(R);i.addFunction(S,_,be.FRAGMENT),i.addFunctionLines(S,[L])}let c=i.clone();c.addDefine("PICKING",void 0,be.FRAGMENT);let d=i.clone();d.addDefine("PICKING_VOXEL",void 0,be.FRAGMENT);let u=i.buildShaderProgram(t),h=c.buildShaderProgram(t),p=d.buildShaderProgram(t),g=ke.fromCache({cull:{enabled:!0,face:wi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),b=e._depthTest,C=new nt({vertexArray:f,primitiveType:Be.TRIANGLES,renderState:g,shaderProgram:u,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ve.VOXELS,executeInClosestFrustum:!0,owner:this,cull:b,occlude:b}),E=nt.shallowClone(C,new nt);E.shaderProgram=h,E.pickOnly=!0;let T=nt.shallowClone(C,new nt);if(T.shaderProgram=p,T.pickOnly=!0,l(e._drawCommand)){let S=e._drawCommand;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}if(l(e._drawCommandPick)){let S=e._drawCommandPick;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let S=e._drawCommandPickVoxel;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}e._drawCommand=C,e._drawCommandPick=E,e._drawCommandPickVoxel=T}function OIe(e){let t=e.x,n=e.y,i=1/t,o=1/n,r=`${i}`;r.indexOf(".")===-1&&(r+=".0");let s=`${o}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t};
    int pixX = planeNumber - (pixY * ${t});
    // Sample from center of pixel
    float u = (float(pixX) + 0.5) * ${r};
    float v = (float(pixY) + 0.5) * ${s};
    return texture(packedPlanes, vec2(u, v));`}var iM=f_t;var Coo=y(x(),1);var eoo=y(x(),1),p_t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},wZ=Object.freeze(p_t);var uoo=y(x(),1);function YZ(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}YZ.prototype.getTexture=function(e){return this._textures[e]};function A_t(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}YZ.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):A_t(this,e,t)};function g_t(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?mO(o,r,n):b_t(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function mO(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?HIe(e,n):new Wt({context:n,source:t,sampler:o});return zIe(o)&&r.generateMipmap(),r}function b_t(e,t,n){let{typedArray:i,sampler:o}=e,r=zIe(o),s=o.wrapS===bn.REPEAT||o.wrapS===bn.MIRRORED_REPEAT||o.wrapT===bn.REPEAT||o.wrapT===bn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,d=[a,c].every(V.isPowerOfTwo);if((r||s)&&!d)if(l(i)){if(e.pixelDatatype===ve.UNSIGNED_BYTE){let h=oX(i,a,c),p=d0(h);return mO({sampler:o},p,n)}}else{let h=d0(t);return mO(e,h,n)}else return mO(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),HIe(e,n)}function zIe(e){return[zt.NEAREST_MIPMAP_NEAREST,zt.NEAREST_MIPMAP_LINEAR,zt.LINEAR_MIPMAP_NEAREST,zt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function HIe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Wt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}YZ.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];g_t(this,o,t)}n.length=0};YZ.prototype.isDestroyed=function(){return!1};YZ.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return fe(this)};var oM=YZ;function rM(e){e=e??Q.EMPTY_OBJECT,this.mode=e.mode??lg.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??Q.EMPTY_OBJECT,this.varyings=e.varyings??Q.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??L0.INHERIT,this._textureManager=new oM,this._defaultTexture=void 0,this.uniformMap=y_t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},E_t(this),T_t(this)}function y_t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===wZ.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=x_t(e,i)):n[i]=C_t(e,i)}return n}function x_t(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function C_t(e,t){return function(){return e.uniforms[t].value}}function pT(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function E_t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,pT(r,t,o),o=e.usedVariablesVertex.featureIdSet,pT(r,n,o),o=e.usedVariablesVertex.metadataSet,pT(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,pT(s,t,o),o=e.usedVariablesFragment.featureIdSet,pT(s,n,o),o=e.usedVariablesFragment.metadataSet,pT(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;pT(s,a,c)}}function KIe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function il(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${KIe(t)} is not available in the ${i} shader. Did you mean ${KIe(n)} instead?`;throw new Ae(o)}}function T_t(e){let t=e.usedVariablesVertex.attributeSet;il(t,"position","positionMC","vertex"),il(t,"normal","normalMC","vertex"),il(t,"tangent","tangentMC","vertex"),il(t,"bitangent","bitangentMC","vertex"),il(t,"positionWC","positionMC","vertex"),il(t,"positionEC","positionMC","vertex"),il(t,"normalEC","normalMC","vertex"),il(t,"tangentEC","tangentMC","vertex"),il(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;il(n,"position","positionEC","fragment"),il(n,"normal","normalEC","fragment"),il(n,"tangent","tangentEC","fragment"),il(n,"bitangent","bitangentEC","fragment"),il(n,"normalMC","normalEC","fragment"),il(n,"tangentMC","tangentEC","fragment"),il(n,"bitangentMC","bitangentEC","fragment")}rM.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===wZ.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};rM.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};rM.prototype.isDestroyed=function(){return!1};rM.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),fe(this)};var AT=rM;var Goo=y(x(),1);function xb(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(xb.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});xb.fromMetadataArray=function(e){return new xb({metadata:e})};xb.fromGltf=async function(e){let t=new eu({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new xb({loader:t})};xb.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=S_t(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function S_t(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(u=>u.class.id===i),{properties:c}=a,d=new Array(o.length);for(let u=0;u<e.length;u++){let h=c[o[u]].attribute,p=e.find(C=>C.name===h);if(!l(p))continue;let g=jt.toComponentDatatype(s[u]),f=Et.getComponentCount(r[u]),b=p.count*f;d[u]=J.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,b)}return d}xb.prototype.isDestroyed=function(){return!1};xb.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),fe(this)};var gT=xb;var Aro=y(x(),1);var Poo=y(x(),1);function ol(){this._orientedBoundingBox=new tn,this._boundingSphere=new ue,this._boundTransform=new F,this._shapeTransform=new F,this._minBounds=ol.DefaultMinBounds.clone(),this._maxBounds=ol.DefaultMaxBounds.clone(),this._renderMinBounds=ol.DefaultMinBounds.clone(),this._renderMaxBounds=ol.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=ol,n=[new Us(m.negate(m.UNIT_X,new m),e.x),new Us(m.negate(m.UNIT_Y,new m),e.y),new Us(m.negate(m.UNIT_Z,new m),e.z),new Us(m.UNIT_X,-t.x),new Us(m.UNIT_Y,-t.y),new Us(m.UNIT_Z,-t.z)];this._renderBoundPlanes=new yb({planes:n}),this._shaderUniforms={boxEcToXyz:new $,boxLocalToShapeUvScale:new m,boxLocalToShapeUvTranslate:new m},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(ol.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var I_t=new m,__t=new m,Z_t=new $,R_t=new m,G_t=new m;ol.prototype.update=function(e,t,n,i,o){i=i??t.clone(R_t),o=o??n.clone(G_t),t=m.clone(t,this._minBounds),n=m.clone(n,this._maxBounds);let r=m.clamp(t,i,o,this._renderMinBounds),s=m.clamp(n,i,o,this._renderMaxBounds),a=F.getScale(e,__t);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=r.x,c.get(1).distance=r.y,c.get(2).distance=r.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=F.clone(e,this._shapeTransform),this._orientedBoundingBox=x$(r,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=F.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let d=this._shaderUniforms,u=this._shaderDefines;for(let b in u)u.hasOwnProperty(b)&&(u[b]=void 0);let h=0;u.BOX_INTERSECTION_INDEX=h,h+=1;let p=t,g=n,f=m.fromElements(b$(p.x,g.x),b$(p.y,g.y),b$(p.z,g.z),d.boxLocalToShapeUvScale);return d.boxLocalToShapeUvTranslate=m.negate(m.multiplyComponents(f,p,d.boxLocalToShapeUvTranslate),d.boxLocalToShapeUvTranslate),this._shaderMaximumIntersectionsLength=h,!0};function b$(e,t){return V.equalsEpsilon(e,t,V.EPSILON7)?1:1/(t-e)}var V_t=new F;ol.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=F.inverse(this._shapeTransform,V_t),i=F.getMatrix3(n,t.boxEcToXyz),o=e.context.uniformState.inverseViewRotation;$.multiply(i,o,t.boxEcToXyz)};ol.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n,boxLocalToShapeUvTranslate:i}=this._shaderUniforms;return m.add(m.multiplyComponents(e,n,t),i,t)};var hO=new m,y$=new m;ol.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(V.lerp(r.x,s.x,a*t),V.lerp(r.y,s.y,a*n),V.lerp(r.z,s.z,a*i),hO),d=m.fromElements(V.lerp(r.x,s.x,a*(t+1)),V.lerp(r.y,s.y,a*(n+1)),V.lerp(r.z,s.z,a*(i+1)),y$);return x$(c,d,this._shapeTransform,o)};var JIe=new m;ol.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,JIe),s=m.multiplyByScalar(r,o,JIe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,hO),o,hO),c=m.add(a,s,y$),d=this._minBounds,u=this._maxBounds,h=m.fromElements(V.lerp(d.x,u.x,a.x),V.lerp(d.y,u.y,a.y),V.lerp(d.z,u.z,a.z),hO),p=m.fromElements(V.lerp(d.x,u.x,c.x),V.lerp(d.y,u.y,c.y),V.lerp(d.z,u.z,c.z),y$);return x$(h,p,this._shapeTransform,i)};ol.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));ol.DefaultMaxBounds=Object.freeze(new m(1,1,1));var jIe=new m;function x$(e,t,n,i){let o=ol.DefaultMinBounds,r=ol.DefaultMaxBounds;if(m.equals(e,o)&&m.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,jIe),c=m.midpoint(e,t,I_t);i.center=F.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),jIe);let d=F.getRotation(n,Z_t);i.halfAxes=$.setScale(d,a,i.halfAxes)}return i}var bT=ol;var joo=y(x(),1);function Nu(){this._orientedBoundingBox=new tn,this._boundingSphere=new ue,this._boundTransform=new F,this._shapeTransform=new F,this._minBounds=Nu.DefaultMinBounds.clone(),this._maxBounds=Nu.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Nu,n=[new Us(m.negate(m.UNIT_Z,new m),e.z),new Us(m.UNIT_Z,-t.z)];this._renderBoundPlanes=new yb({planes:n}),this._shaderUniforms={cameraShapePosition:new m,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new M,cylinderRenderAngleMinMax:new M,cylinderLocalToShapeUvRadius:new M,cylinderLocalToShapeUvAngle:new M,cylinderLocalToShapeUvHeight:new M,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Nu.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var L_t=new m,W_t=new m,F_t=new m,B_t=new m,w_t=new m,Y_t=new F,N_t=new m,qIe=new M;Nu.prototype.update=function(e,t,n,i,o){i=i??t.clone(W_t),o=o??n.clone(F_t),t=m.clone(t,this._minBounds),n=m.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=Nu,a=s.y-r.y,c=.5*a,d=V.EPSILON10,u=V.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=V.negativePiToPi(t.y),n.y=V.negativePiToPi(n.y),i.y=V.negativePiToPi(i.y),o.y=V.negativePiToPi(o.y);let h=m.maximumByComponent(t,i,B_t),p=m.minimumByComponent(n,o,w_t),g=F.getScale(e,L_t);if(p.x===0||h.x>p.x||h.z>p.z||V.equalsEpsilon(g.x,0,void 0,d)||V.equalsEpsilon(g.y,0,void 0,d)||V.equalsEpsilon(g.z,0,void 0,d))return!1;let f=this._renderBoundPlanes;f.get(0).distance=h.z,f.get(1).distance=-p.z,this._shapeTransform=F.clone(e,this._shapeTransform),this._orientedBoundingBox=T$(h,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=F.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let b=n.y<t.y,C=n.y-t.y+b*a,E=p.y<h.y,T=p.y-h.y+E*a,S=T>=c-u&&T<a-u,_=T>u&&T<c-u,R=T<=u,L=S||_||R,W=this._shaderUniforms,B=this._shaderDefines;for(let P in B)B.hasOwnProperty(P)&&(B[P]=void 0);let Y=0;B.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Y,Y+=1,C<a-u&&(B.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),h.x!==r.x&&(B.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,B.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Y,Y+=1),W.cylinderRenderRadiusMinMax=M.fromElements(h.x,p.x,W.cylinderRenderRadiusMinMax),h.x===p.x&&(B.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let N=n.x-t.x,A=0,I=1;N!==0&&(A=1/N,I=-t.x*A),W.cylinderLocalToShapeUvRadius=M.fromElements(A,I,W.cylinderLocalToShapeUvRadius);let Z=n.z-t.z,G=0,w=1;Z!==0&&(G=1/Z,w=-t.z*G),W.cylinderLocalToShapeUvHeight=M.fromElements(G,w,W.cylinderLocalToShapeUvHeight),L&&(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,B.CYLINDER_INTERSECTION_INDEX_ANGLE=Y,S?(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Y+=1):_?(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Y+=2):R&&(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Y+=2),W.cylinderRenderAngleMinMax=M.fromElements(h.y,p.y,W.cylinderRenderAngleMinMax));let X=(t.y-r.y)/a,v=(n.y-r.y)/a,U=1-C/a,k=(v+.5*U)%1;if(W.cylinderShapeUvAngleRangeOrigin=k,C<=u)W.cylinderLocalToShapeUvAngle=M.fromElements(0,1,W.cylinderLocalToShapeUvAngle);else{let P=a/C,O=X-k,H=-P*(O-Math.floor(O));W.cylinderLocalToShapeUvAngle=M.fromElements(P,H,W.cylinderLocalToShapeUvAngle)}return this._shaderMaximumIntersectionsLength=Y,!0};var X_t=new $,P_t=new $,M_t=new F;Nu.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=F.inverse(this._shapeTransform,Y_t),i=F.multiplyByPoint(n,e.camera.positionWC,N_t);t.cameraShapePosition=m.fromElements(M.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=M.normalize(M.fromCartesian3(i,qIe),qIe),r=$.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],X_t),s=e.context.uniformState.inverseView,a=F.multiplyTransformation(n,s,M_t),c=F.getMatrix3(a,P_t);t.cylinderEcToRadialTangentUp=$.multiply(r,c,t.cylinderEcToRadialTangentUp)};Nu.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),o=e.z,{cylinderLocalToShapeUvRadius:r,cylinderLocalToShapeUvAngle:s,cylinderShapeUvAngleRangeOrigin:a,cylinderLocalToShapeUvHeight:c}=this._shaderUniforms;return n=n*r.x+r.y,i=(i+Math.PI)/(2*Math.PI),i-=a,i=i-Math.floor(i),i=i*s.x+s.y,o=o*c.x+c.y,m.fromElements(n,i,o,t)};var fO=new m,E$=new m;Nu.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(V.lerp(r.x,s.x,t*a),V.lerp(r.y,s.y,n*a),V.lerp(r.z,s.z,i*a),fO),d=m.fromElements(V.lerp(r.x,s.x,(t+1)*a),V.lerp(r.y,s.y,(n+1)*a),V.lerp(r.z,s.z,(i+1)*a),E$);return T$(c,d,this._shapeTransform,o)};var $Ie=new m;Nu.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,$Ie),s=m.multiplyByScalar(r,o,$Ie),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,fO),o,fO),c=m.add(a,s,E$),d=this._minBounds,u=this._maxBounds,h=m.fromElements(V.lerp(d.x,u.x,a.x),V.lerp(d.y,u.y,a.y),V.lerp(d.z,u.z,a.z),fO),p=m.fromElements(V.lerp(d.x,u.x,c.x),V.lerp(d.y,u.y,c.y),V.lerp(d.z,u.z,c.z),E$);return T$(h,p,this._shapeTransform,i)};Nu.DefaultMinBounds=Object.freeze(new m(0,-V.PI,-1));Nu.DefaultMaxBounds=Object.freeze(new m(1,+V.PI,1));var U_t=5,D_t=new Array(U_t),v_t=new m,k_t=new $,Q_t=new F,O_t=new F,z_t=new F,C$=new F,H_t=new m,K_t=new m,J_t=new m,t_e=new Array(8);for(let e=0;e<8;e++)t_e[e]=new m;function e_e(e,t,n){return Math.abs(ce.dot(e,t))<n}function j_t(e){let t=F.getColumn(e,0,H_t),n=F.getColumn(e,1,K_t),i=F.getColumn(e,2,J_t),o=V.EPSILON4;return e_e(t,n,o)&&e_e(n,i,o)}function q_t(e,t){let n=t_e;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return tn.fromPoints(n,t)}var $_t=new m;function T$(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+V.TWO_PI:t.y,c=e.z,d=t.z,u=a-s,h=s+u*.5,p=D_t,g=0;p[g++]=s,p[g++]=a,p[g++]=h,u>V.PI&&(p[g++]=h-V.PI_OVER_TWO,p[g++]=h+V.PI_OVER_TWO);let f=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let X=0;X<g;++X){let v=p[X]-h,U=Math.cos(v),k=Math.sin(v),P=U*o,O=k*o,H=U*r,ee=k*r;f=Math.min(f,P,H),b=Math.min(b,O,ee),C=Math.max(C,P,H),E=Math.max(E,O,ee)}let T=C-f,S=E-b,_=d-c,R=(f+C)*.5,L=(b+E)*.5,W=(c+d)*.5,B=m.fromElements(R,L,W,v_t),Y=$.fromRotationZ(h,k_t),N=m.fromElements(T,S,_,$_t),A=F.fromScale(N,z_t),I=F.fromRotation(Y,O_t),Z=F.fromTranslation(B,Q_t),G=F.multiplyTransformation(I,F.multiplyTransformation(Z,A,C$),C$),w=F.multiplyTransformation(n,G,C$);return j_t(w)?tn.fromTransformation(w,i):q_t(w,i)}var yT=Nu;var uro=y(x(),1);function qm(){this._orientedBoundingBox=new tn,this._boundingSphere=new ue,this._boundTransform=new F,this._shapeTransform=new F,this._rectangle=new de,this._minimumHeight=qm.DefaultMinBounds.z,this._maximumHeight=qm.DefaultMaxBounds.z,this._ellipsoid=new ie,this._translation=new m,this._rotation=new $,this._shaderUniforms={cameraPositionCartographic:new m,ellipsoidEcToEastNorthUp:new $,ellipsoidRadii:new m,eccentricitySquared:0,evoluteScale:new M,ellipsoidCurvatureAtLatitude:new M,ellipsoidInverseRadiiSquared:new m,ellipsoidRenderLongitudeMinMax:new M,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidLocalToShapeUvLongitude:new M,ellipsoidLocalToShapeUvLatitude:new M,ellipsoidRenderLatitudeSinMinMax:new M,ellipsoidInverseHeightDifference:0,clipMinMaxHeight:new M},this._shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(qm.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var eZt=new m,tZt=new m,nZt=new m,iZt=new m,oZt=new m,rZt=new m,sZt=new m,aZt=new m,n_e=new m,i_e=new m,cZt=new de;qm.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=qm;i=i??r,o=o??s;let a=V.EPSILON10,c=V.EPSILON3,d=V.EPSILON10,u=V.EPSILON10,h=V.EPSILON3,p=F.getScale(e,aZt),g=m.clone(r,eZt);g.z=-m.minimumComponent(p);let f=m.clamp(t,g,s,tZt),b=m.clamp(n,g,s,nZt),C=m.clamp(i,g,s,iZt),E=m.clamp(o,g,s,oZt),T=m.maximumByComponent(f,C,rZt),S=m.minimumByComponent(b,E,sZt),_=m.add(p,m.fromElements(b.z,b.z,b.z,n_e),n_e),R=m.add(p,m.fromElements(S.z,S.z,S.z,i_e),i_e);if(T.y>S.y||T.y===s.y||S.y===r.y||T.z>S.z||V.equalsEpsilon(R,m.ZERO,void 0,a))return!1;this._rectangle=de.fromRadians(f.x,f.y,b.x,b.y),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=ie.fromCartesian3(p,this._ellipsoid),this._minimumHeight=f.z,this._maximumHeight=b.z;let L=de.fromRadians(T.x,T.y,S.x,S.y,cZt);this._orientedBoundingBox=S$(L,T.z,S.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=F.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=F.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let W=s.x-r.x,B=.5*W,Y=S.x<T.x,N=S.x-T.x+Y*W,A=N<=d,I=N>=B-d&&N<W-d,Z=N>d&&N<B-d,G=A||I||Z,w=b.x<f.x,X=b.x-f.x+w*W,v=X>B+d&&X<W-d,U=X>=B-d&&X<=B+d,k=X<B-d,P=v||U||k,O=S.y<-h,H=S.y>=-h&&S.y<=+h,ee=S.y>+h&&S.y<s.y-u,z=O||H||ee,te=T.y>r.y+u&&T.y<-h,q=T.y>=-h&&T.y<=+h,me=T.y>+h,ye=te||q||me,oe=z||ye,xe=b.y-f.y,Ee=b.y<-h,Le=b.y>=-h&&b.y<=+h,Se=b.y>+h&&b.y<s.y-u,Fe=Ee||Le||Se,Ue=f.y>r.y+u&&f.y<-h,De=f.y>=-h&&f.y<=+h,Je=f.y>+h,Oe=Fe||(Ue||De||Je),it=this._shaderUniforms,yt=this._shaderDefines;for(let In in yt)yt.hasOwnProperty(In)&&(yt[In]=void 0);it.ellipsoidRadii=m.clone(_,it.ellipsoidRadii);let{x:Ot,z:Mn}=it.ellipsoidRadii,sn=Mn/Ot;it.eccentricitySquared=1-sn*sn,it.evoluteScale=M.fromElements((Ot*Ot-Mn*Mn)/Ot,(Mn*Mn-Ot*Ot)/Mn,it.evoluteScale),it.ellipsoidInverseRadiiSquared=m.divideComponents(m.ONE,m.multiplyComponents(it.ellipsoidRadii,it.ellipsoidRadii,it.ellipsoidInverseRadiiSquared),it.ellipsoidInverseRadiiSquared);let ut=0;yt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=ut,ut+=1,yt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=ut,ut+=1,it.clipMinMaxHeight=M.fromElements(T.z-b.z,S.z-b.z,it.clipMinMaxHeight);let Nt=b.z-f.z;if(it.ellipsoidInverseHeightDifference=1/Nt,f.z===b.z&&(it.ellipsoidInverseHeightDifference=0),G&&(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,yt.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=ut,I?(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,ut+=1):Z?(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,ut+=2):A&&(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,ut+=2),it.ellipsoidRenderLongitudeMinMax=M.fromElements(T.x,S.x,it.ellipsoidRenderLongitudeMinMax)),P){yt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let In=(f.x-r.x)/W,lt=(b.x-r.x)/W,fi=1-X/W,ao=(lt+.5*fi)%1;if(it.ellipsoidShapeUvLongitudeRangeOrigin=ao,b.x<f.x&&(yt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),X<=d)it.ellipsoidLocalToShapeUvLongitude=M.fromElements(0,1,it.ellipsoidLocalToShapeUvLongitude);else{let ri=W/X,co=In-ao,lo=-ri*(co-Math.floor(co));it.ellipsoidLocalToShapeUvLongitude=M.fromElements(ri,lo,it.ellipsoidLocalToShapeUvLongitude)}}if(G){let In=V.equalsEpsilon(T.x,r.x,void 0,c),lt=V.equalsEpsilon(S.x,s.x,void 0,c);In&&(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),lt&&(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let fi=(f.x-r.x)/W,ao=(b.x-r.x)/W,po=(S.x-r.x)/W,ri=1-N/W,co=(po+.5*ri)%1;it.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(fi,ao,co,it.ellipsoidShapeUvLongitudeMinMaxMid)}if(oe&&(ye&&(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,yt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=ut,te?(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,ut+=1):q?(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,ut+=1):me&&(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,ut+=2)),z&&(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,yt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=ut,O?(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,ut+=2):H?(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,ut+=1):ee&&(yt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,ut+=1)),it.ellipsoidRenderLatitudeSinMinMax=M.fromElements(Math.sin(T.y),Math.sin(S.y),it.ellipsoidRenderLatitudeSinMinMax)),Oe)if(yt.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,xe<u)it.ellipsoidLocalToShapeUvLatitude=M.fromElements(0,1,it.ellipsoidLocalToShapeUvLatitude);else{let lt=(s.y-r.y)/xe,fi=(r.y-f.y)/xe;it.ellipsoidLocalToShapeUvLatitude=M.fromElements(lt,fi,it.ellipsoidLocalToShapeUvLatitude)}return this._shaderMaximumIntersectionsLength=ut,!0};var lZt=new pe,dZt=new m,uZt=new F,o_e=new $;qm.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,lZt);m.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=m.fromRadians(o.longitude,o.latitude,0,n,dZt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let s=Tt.eastNorthUpToFixedFrame(r,n,uZt),a=F.getRotation(s,o_e),c=e.context.uniformState.viewRotation,d=$.multiply(c,a,o_e);t.ellipsoidEcToEastNorthUp=$.transpose(d,t.ellipsoidEcToEastNorthUp)};var u_e=new de;qm.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,d=(n+1)*r,u=i*r,h=(i+1)*r,p=de.subsection(this._rectangle,s,c,a,d,u_e),g=V.lerp(this._minimumHeight,this._maximumHeight,u),f=V.lerp(this._minimumHeight,this._maximumHeight,h);return S$(p,g,f,this._ellipsoid,this._translation,this._rotation,o)};var mZt=new M,hZt=new M,sM=new M,r_e=new M,s_e=new M,aM=new M;function fZt(e,t,n,i){let o=M.abs(e,mZt),r=M.fromElements(1/t.x,1/t.y,hZt),s=M.fromElements(Math.SQRT1_2,Math.SQRT1_2,sM),a=M.multiplyComponents(t,s,r_e),c=M.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,s_e);for(let d=0;d<3;++d){let u=M.magnitude(M.subtract(a,c,aM)),h=M.normalize(M.subtract(o,c,aM),aM),p=M.multiplyByScalar(h,u,aM);s=M.multiplyComponents(M.add(p,c,sM),r,sM),s=M.normalize(M.clamp(s,M.ZERO,M.ONE,sM),sM),a=M.multiplyComponents(t,s,r_e),c=M.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,s_e)}return m.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,M.magnitude(M.subtract(a,c,aM)),i)}var pZt=new M,a_e=new M,AZt=new m,c_e=new M;qm.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:o,ellipsoidInverseRadiiSquared:r,ellipsoidInverseHeightDifference:s,ellipsoidShapeUvLongitudeRangeOrigin:a,ellipsoidLocalToShapeUvLongitude:c,ellipsoidLocalToShapeUvLatitude:d}=this._shaderUniforms,u=Math.hypot(e.x,e.y),h=M.fromElements(u,e.z,a_e),p=fZt(h,M.fromElements(i.x,i.z,pZt),o,AZt),g=M.normalize(M.fromElements(p.x*r.x,p.y*r.z,c_e),c_e),f=Math.atan2(g.y,g.x),b=M.magnitude(h)<M.magnitude(p)?-1:1,C=M.subtract(h,p,a_e),E=b*M.magnitude(C),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:T,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:S}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(T)&&(n-=a,n=n-Math.floor(n),n=n*c.x+c.y),f=(f+Math.PI/2)/Math.PI,l(S)&&(f=f*d.x+d.y),E=1+E*s,m.fromElements(n,f,E,t)};var l_e=new m,d_e=new m,gZt=new m;qm.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,l_e),s=m.multiplyByScalar(r,o,l_e),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,d_e),o,d_e),c=m.add(a,s,gZt),d=de.subsection(this._rectangle,a.x,a.y,c.x,c.y,u_e),u=V.lerp(this._minimumHeight,this._maximumHeight,a.z),h=V.lerp(this._minimumHeight,this._maximumHeight,c.z);return S$(d,u,h,this._ellipsoid,this._translation,this._rotation,i)};function S$(e,t,n,i,o,r,s){return s=tn.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}qm.DefaultMinBounds=Object.freeze(new m(-V.PI,-V.PI_OVER_TWO,-ie.WGS84.minimumRadius));qm.DefaultMaxBounds=Object.freeze(new m(V.PI,V.PI_OVER_TWO,10*ie.WGS84.maximumRadius));var xT=qm;var Xu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Xu.getMinBounds=function(e){switch(e){case Xu.BOX:return bT.DefaultMinBounds;case Xu.ELLIPSOID:return xT.DefaultMinBounds;case Xu.CYLINDER:return yT.DefaultMinBounds}};Xu.getMaxBounds=function(e){switch(e){case Xu.BOX:return bT.DefaultMaxBounds;case Xu.ELLIPSOID:return xT.DefaultMaxBounds;case Xu.CYLINDER:return yT.DefaultMaxBounds}};Xu.getShapeConstructor=function(e){switch(e){case Xu.BOX:return bT;case Xu.ELLIPSOID:return xT;case Xu.CYLINDER:return yT}};var ac=Object.freeze(Xu);var lso=y(x(),1);var bro=y(x(),1),I$=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function cM(e,t){this.spatialNode=e,this.keyframe=t,this.state=I$.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}cM.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=I$.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};cM.priorityComparator=function(e,t){return e.priority-t.priority};cM.searchComparator=function(e,t){return e.keyframe-t.keyframe};cM.LoadState=I$;var No=cM;var Bro=y(x(),1);function iA(e,t,n,i,o=134217728,r){let s=bZt(i),a=yZt(n),c=n*jt.getSizeInBytes(i),d=iA.get3DTextureDimension(t,c,o,r),u=m.divideComponents(d,t,new m);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*d.x*d.y*d.z,this.tileCounts=m.clone(u,new m),this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=u.x*u.y*u.z,this.texture=new _1({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:d.x,height:d.y,depth:d.z,sampler:new Ht({wrapR:bn.CLAMP_TO_EDGE,wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:zt.LINEAR,magnificationFilter:ui.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let h=0;h<this.maximumTileCount;h++)this.nodes[h]=new xZt(h);for(let h=0;h<this.maximumTileCount;h++){let p=this.nodes[h];p.previousNode=h>0?this.nodes[h-1]:void 0,p.nextNode=h<this.maximumTileCount-1?this.nodes[h+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(iA.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=Ht.NEAREST:this.texture.sampler=new Ht({wrapR:bn.CLAMP_TO_EDGE,wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:zt.LINEAR,magnificationFilter:ui.LINEAR}),this._nearestSampling=e)}}});function bZt(e){if(e===jt.FLOAT32||e===jt.FLOAT64)return ve.FLOAT;if(e===jt.UINT8)return ve.UNSIGNED_BYTE}function yZt(e){switch(e){case 1:return je.RED;case 2:return je.RG;case 3:return je.RGB;case 4:return je.RGBA}}function xZt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}iA.prototype.add=function(e){if(this.isFull())throw new Ae("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};iA.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new Ae("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};iA.prototype.isFull=function(){return this.emptyList===void 0};iA.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:o}=Yt;if(m.maximumComponent(e)>o)throw new he("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let r=t*e.x*e.y*e.z,s=Math.floor(n/r);if(s<1)throw new he("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((u,h)=>h[1]-u[1]),c=a.map(([u,h])=>Math.floor(o/h));for(let u=0;u<3;u++){let h=m_e(c);if(h<i)break;let p=c.slice();p.splice(u,1);let g=p[0]*p[1],f=h-i,b=Math.floor(f/g);c[u]-=b}m_e(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let d=new m;for(let u=0;u<3;u++){let[h,p]=a[u];d[h]=c[u]*p}return d};function m_e(e){return e.reduce((t,n)=>t*n)}iA.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,o={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},r=n.x*n.y,s=Math.floor(e/r),a=e-s*r,c=Math.floor(a/n.x),d=a-c*n.x,u={source:o,xOffset:d*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(u)};iA.prototype.isDestroyed=function(){return!1};iA.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),fe(this)};var lM=iA;var kro=y(x(),1);function $m(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=m.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new tn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var CZt=new m;$m.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,CZt),n=2*m.maximumComponent(t);this.approximateVoxelSize=n/m.minimumComponent(this.dimensions)};$m.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,d=r+1,u=a+1,h=t+1,p=[[h,r,s,a],[h,d,s,a],[h,r,c,a],[h,d,c,a],[h,r,s,u],[h,d,s,u],[h,r,c,u],[h,d,c,u]];this.children=p.map(([g,f,b,C])=>new $m(g,f,b,C,this,e,this.dimensions))};$m.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};$m.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,V.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var h_e={keyframe:0};function dM(e,t){return h_e.keyframe=e,bo(t,h_e,No.searchComparator)}$m.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=EZt(i,h),g=h[p],f=o===i||i<g.keyframe?p:Math.min(p+1,h.length-1),b=h[f],C=i-g.keyframe,E=f_e(n-t.level,C);E<a&&(a=E,r=g);let T=b.keyframe-o,S=f_e(n-t.level,T);if(S<c&&(c=S,s=b),C===0&&T===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:V.clamp((e-d)/(u-d),0,1)};function EZt(e,t){let n=dM(e,t);return n<0?V.clamp(~n-1,0,t.length-1):n}function f_e(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}$m.prototype.isVisited=function(e){return this.visitedFrameNumber===e};$m.prototype.createKeyframeNode=function(e){let t=dM(e,this.keyframeNodes);if(t<0){t=~t;let n=new No(this,e);this.keyframeNodes.splice(t,0,n)}};$m.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=dM(n,this.keyframeNodes);if(i<0)throw new Ae("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=dM(n,this.renderableKeyframeNodes);if(o<0)throw new Ae("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};$m.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new Ae("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let s=t[r];e.megatextureIndex=s.add(n[r])}let i=this.renderableKeyframeNodes,o=dM(e.keyframe,i);if(o>=0)throw new Ae("Keyframe already renderable");o=~o,i.splice(o,0,e)};$m.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var uM=$m;function Qy(e,t,n,i){let{provider:o,dimensions:r,inputDimensions:s}=e,{types:a,componentTypes:c}=o;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let d=l(o.maximumTileCount)?o.maximumTileCount:l(o.availableLevels)?(8**o.availableLevels-1)/7:void 0;for(let E=0;E<a.length;E++){let T=a[E],S=Et.getComponentCount(T),_=c[E];this.megatextures[E]=new lM(t,s,S,_,i,d),this.textureMemoryByteLength+=this.megatextures[E].textureMemoryByteLength}let u=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let h=e._shape;this.rootNode=new uM(0,0,0,0,void 0,h,r),this._priorityQueue=new sb({maximumLength:u,comparator:No.priorityComparator}),this._highPriorityKeyframeNodes=new Array(u),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(u),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,_$(p,1,n-2,0);let g=9,f=2048,b=Math.floor(f/g),C=Math.ceil(u/b);this.internalNodeTexture=new Wt({context:t,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,flipY:!1,width:f,height:C,sampler:new Ht({minificationFilter:zt.NEAREST,magnificationFilter:ui.NEAREST})}),this.internalNodeTilesPerRow=b,this.internalNodeTexelSizeUv=new M(1/f,1/C),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new M}Qy.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function _$(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,_$(e,t,o-1,i+1),_$(e,o+1,n,i+1)}Qy.simultaneousRequestCountMaximum=50;Qy.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,d=c>0,u=a>1,h=(d?2:1)*(u?2:1);this._sampleCount=h;let p=h>=2;if(p&&!l(this.leafNodeTexture)){let S=Math.floor(512),_=Math.ceil(s/S);this.leafNodeTexture=new Wt({context:r,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,flipY:!1,width:1024,height:_,sampler:new Ht({minificationFilter:zt.NEAREST,magnificationFilter:ui.NEAREST})}),this.leafNodeTexelSizeUv=M.fromElements(1/1024,1/_,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=S}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=V.clamp(t,0,a-1),n&&p_e(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ni();IZt(this,e),_Zt(this,e);let f=Ni();LZt(this,h,c);let b=Ni(),C=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||C){let E=f-g,T=b-f,S=b-g;VZt(this,e,E,T,S)}};Qy.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Qy.prototype.isDestroyed=function(){return!1};Qy.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),fe(this)};function p_e(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];p_e(e,i)}}function TZt(e,t){if(e._simultaneousRequestCount>=Qy.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function s(u){e._simultaneousRequestCount--,t.content=u,t.state=l(u)?No.LoadState.PROCESSING:No.LoadState.UNAVAILABLE}function a(u){e._simultaneousRequestCount--,t.state=No.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},d=i.requestData(c);l(d)&&(e._simultaneousRequestCount++,t.state=No.LoadState.RECEIVING,d.then(s).catch(a))}function SZt(e){return e/(1+e)}function IZt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),A_e(e.rootNode,Ps.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,o[r]=s,r++;e._highPriorityKeyframeNodeCount=r}function _Zt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(ZZt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let d=0;d<s;d++){let u=r[d];if(!(u.state===No.LoadState.LOADED||u.spatialNode===void 0)&&(u.state===No.LoadState.UNLOADED&&TZt(e,u),u.state===No.LoadState.PROCESSING)){let{content:h}=u;if(h.update(e._primitive,t),!h.ready)continue;if(!RZt(h.metadata,e)){u.content=void 0,u.state=No.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-a,a++;let g=o[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;u.spatialNode.addKeyframeNodeToMegatextures(u,e.megatextures),u.state=No.LoadState.LOADED,o[p]=u,e._primitive.tileLoad.raiseEvent()}}}function ZZt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function RZt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:s}=i[o],{x:a,y:c,z:d}=r,u=a*c*d,h=e[o],p=u*s;if(h.length!==p)return!1}return!0}function A_e(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:d}=o,h=r.drawingBufferHeight/s/d.sseDenominator;if(e.computeScreenSpaceError(c,h),t=e.visibility(i,t),t===Ps.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,f=p.screenSpaceError,b=n._priorityQueue,C=n._keyframeCount,E=V.clamp(Math.floor(n._keyframeLocation),0,C-2),T=E+1;if(C===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==C)for(let W=0;W<C;W++)e.createKeyframeNode(W);let{screenSpaceError:S,keyframeNodes:_}=e,R=SZt(S),L=!1;for(let W=0;W<_.length;W++){let B=_[W];B.priority=10*R+GZt(E,B.keyframe,T,n),B.state!==No.LoadState.UNAVAILABLE&&B.state!==No.LoadState.FAILED&&B.priority!==-Number.MAX_VALUE&&b.insert(B),B.state===No.LoadState.LOADED&&(L=!0)}if(S<f||!L){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let W=0;W<8;W++){let B=e.children[W];A_e(B,t,n,i)}}function GZt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return V.lerp(a,s,.15+.85*s)}function VZt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(No.LoadState).length,c=new Array(a),d=new Array(a),u=0;for(let L=0;L<a;L++){let W=new Array(r).fill(0);c[L]=W,d[L]=0}function h(L){let W=L.keyframeNodes;for(let B=0;B<W.length;B++){let Y=W[B],N=Y.keyframe,A=Y.state;c[A][N]+=1,d[A]+=1,u++}if(l(L.children))for(let B=0;B<8;B++){let Y=L.children[B];h(Y)}}h(s),e._primitive.statistics.numberOfTilesWithContentReady=d[No.LoadState.LOADED],e._primitive.statistics.visited=u;let p=d[No.LoadState.RECEIVING],g=d[No.LoadState.PROCESSING],f=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(f&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,f&&(p===0&&g===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let C=`KEYFRAMES: ${c[No.LoadState.LOADED]}`,E=`UNLOADED: ${d[No.LoadState.UNLOADED]} | RECEIVING: ${d[No.LoadState.RECEIVING]} | PROCESSING: ${d[No.LoadState.PROCESSING]} | LOADED: ${d[No.LoadState.LOADED]} | FAILED: ${d[No.LoadState.FAILED]} | UNAVAILABLE: ${d[No.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,T=Math.round(n*100)/100,S=Math.round(i*100)/100,_=Math.round(o*100)/100,R=`LOAD: ${T} | OCT: ${S} | ALL: ${_}`;console.log(`${C} || ${E} || ${R}`)}var pO={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function LZt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function h(g,f,b,C,E){let T=!1;if(l(g.children))for(let S=0;S<8;S++){let _=g.children[S];_.computeSurroundingRenderableKeyframeNodes(o),_.isRenderable(r)&&(T=!0)}if(T){d[E]=pO.INTERNAL<<16|f,d[b]=C,a++,C=f,E=C*9+1;for(let S=0;S<8;S++){let _=g.children[S];f=a,b=f*9+0,h(_,f,b,C,E+S)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let S=c*5,_=g.renderableKeyframeNodePrevious,R=g.level-_.spatialNode.level,L=_.spatialNode.parent,W=l(L)?L.renderableKeyframeNodePrevious:_,B=WZt(g,i,n),Y=R,N=1,A=_.megatextureIndex,I=W.megatextureIndex;u[S+0]=B,u[S+1]=Y,u[S+2]=N,u[S+3]=A,u[S+4]=I,d[E]=pO.LEAF<<16|c}else{let S=g.renderableKeyframeNodePrevious,R=g.level-S.spatialNode.level===0?pO.LEAF:pO.PACKED_LEAF_FROM_PARENT;d[E]=R<<16|S.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),FZt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&BZt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function WZt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return V.clamp(s,0,1)}function FZt(e,t,n,i){let o=je.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],g=h*o;for(let f=0;f<o;f++)c[g+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function BZt(e,t,n,i){let o=je.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],f=e[p*r+1],b=e[p*r+2],C=e[p*r+3],E=e[p*r+4],T=V.clamp(Math.floor(65536*g),0,65535);d[p*8+0]=T>>>0&255,d[p*8+1]=T>>>8&255,d[p*8+2]=f&255,d[p*8+3]=b&255,d[p*8+4]=C>>>0&255,d[p*8+5]=C>>>8&255,d[p*8+6]=E>>>0&255,d[p*8+7]=E>>>8&255}let h={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}var mM=Qy;function oA(e){e=e??Q.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??oA.DefaultProvider,this._traversal=void 0,this._statistics=new jh,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new m,this._inputDimensions=new m,this._paddingBefore=new m,this._paddingAfter=new m,this._availableLevels=1,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrixOld=F.clone(this._modelMatrix),this._customShader=e.customShader??oA.DefaultCustomShader,this._customShaderCompilationEvent=new Ce,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionLocalToWorld=new F,this._transformPositionWorldToLocal=new F,this._transformPlaneLocalToView=new F,this._transformDirectionWorldToLocal=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Oh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new M,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new M,megatextureTextures:[],megatextureTileCounts:new m,dimensions:new m,inputDimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToLocal:new F,transformDirectionViewToLocal:new $,cameraPositionLocal:new m,cameraDirectionLocal:new m,cameraTileCoordinates:new ce,cameraTileUv:new m,ndcSpaceAxisAlignedBoundingBox:new ce,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,renderBoundPlanesTexture:void 0,stepSize:0,pickColor:new D},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}this.tileLoad=new Ce,this.tileVisible=new Ce,this.tileFailed=new Ce,this.tileUnload=new Ce,this.loadProgress=new Ce,this.allTilesLoaded=new Ce,this.initialTilesLoaded=new Ce;let i=this._provider;wZt(this,i)}function wZt(e,t){let{shape:n,minBounds:i=ac.getMinBounds(n),maxBounds:o=ac.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),b_e(e);let r=ac.getShapeConstructor(n);e._shape=new r,e._shapeVisible=y_e(e)}Object.defineProperties(oA.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling=e}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=V.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=oA.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var YZt=new ce,NZt=new ce,XZt=new F,PZt=new F,MZt=new m,UZt=new ce;oA.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){HZt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=b_e(this),r=zZt(this,e);if((o||r)&&(this._shapeVisible=y_e(this),oRt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=rRt(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,o,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&hRt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),sRt(this,e)&&(this._shaderDirty=!0);let u=a.leafNodeTexture;l(u)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=M.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(iM(this,i),this._shaderDirty=!1);let h=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=lRt(p,h,NZt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=ce.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let b=i.uniformState.inverseView,C=F.multiplyTransformation(this._transformPositionWorldToLocal,b,n.transformPositionViewToLocal);this._transformPlaneLocalToView=F.transpose(C,this._transformPlaneLocalToView);let E=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,E,n.transformDirectionViewToLocal),n.cameraPositionLocal=F.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let T=kZt(this,n.cameraPositionLocal,UZt);n.cameraTileCoordinates=ce.fromElements(Math.floor(T.x),Math.floor(T.y),Math.floor(T.z),T.w,n.cameraTileCoordinates),n.cameraTileUv=m.fromElements(T.x-Math.floor(T.x),T.y-Math.floor(T.y),T.z-Math.floor(T.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,DZt(this),vZt(this,e);let S=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;S.boundingVolume=this._shape.boundingSphere,e.commandList.push(S)};function DZt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function vZt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function kZt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,MZt),o=e._availableLevels,r=2**(o-1);return ce.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var QZt=new m,Z$=new m,OZt=new pe;function zZt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function HZt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=D.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Qe(o,!0);let s=e._uniformMap;for(let c in r)if(r.hasOwnProperty(c)){let d=`u_${c}`;s[d]=function(){return r[c]}}if(e._dimensions=m.clone(t.dimensions,e._dimensions),i.dimensions=m.clone(e._dimensions,i.dimensions),e._paddingBefore=m.clone(t.paddingBefore??m.ZERO,e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(t.paddingAfter??m.ZERO,e._paddingAfter),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=m.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=m.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===nA.Y_UP){let c=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=c}i.inputDimensions=m.clone(e._inputDimensions,i.inputDimensions),e._availableLevels=t.availableLevels??1;let a=t.keyframeCount??1;e._traversal=new mM(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,iRt(e._traversal,i)}function b_e(e){return hM(e,"_modelMatrix","_modelMatrixOld")+hM(e,"_minBounds","_minBoundsOld")+hM(e,"_maxBounds","_maxBoundsOld")+hM(e,"_minClippingBounds","_minClippingBoundsOld")+hM(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function hM(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var KZt=new m,JZt=new m,jZt=new m,qZt=new m,$Zt=new F,eRt=new F;function y_e(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=m.clone(e._minBounds,KZt),o=m.clone(e._maxBounds,JZt),r=m.clone(e._minClippingBounds,jZt),s=m.clone(e._maxClippingBounds,qZt),a=F.clone(e._modelMatrix,$Zt);if(e.shape===ac.ELLIPSOID)i.z=Eo.getHeight(e._minBounds.z,t,n),o.z=Eo.getHeight(e._maxBounds.z,t,n),r.z=Eo.getHeight(e._minClippingBounds.z,t,n),s.z=Eo.getHeight(e._maxClippingBounds.z,t,n);else{let f=m.fromElements(1,1,t,QZt);F.multiplyByScale(a,f,a),F.multiplyByTranslation(a,nRt(e),a)}let c=e._provider,d=c.shapeTransform??F.IDENTITY,u=c.globalTransform??F.IDENTITY,h=F.multiplyTransformation(u,a,eRt);F.multiplyTransformation(h,d,h);let p=e._shape;return p.update(h,i,o,r,s)?(e._transformPositionLocalToWorld=F.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=F.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=F.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var tRt=new m;function nRt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=F.IDENTITY,globalTransform:o=F.IDENTITY}=e._provider,r=F.getTranslation(i,Z$),s=F.multiplyByPoint(e._modelMatrix,r,Z$),a=F.multiplyByPoint(o,s,Z$),d=ie.WGS84.cartesianToCartographic(a,OZt),u=0;l(d)&&(u=d.height);let h=Eo.getHeight(u,t,n);return m.fromElements(0,0,(h-u)/t,tRt)}function iRt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=M.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let o=0;o<n.length;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureTileCounts=m.clone(i.tileCounts,t.megatextureTileCounts)}function oRt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Qe(t,!0)),n}function rRt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=j.secondsDifference(i.stop,i.start),a=j.secondsDifference(n,i.start)/r;return o+a}function sRt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionLocalToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}oA.prototype.isDestroyed=function(){return!1};oA.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),fe(this)};var g_e=new Array(new ce(-1,-1,-1,1),new ce(1,-1,-1,1),new ce(-1,1,-1,1),new ce(1,1,-1,1),new ce(-1,-1,1,1),new ce(1,-1,1,1),new ce(-1,1,1,1),new ce(1,1,1,1)),aRt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),cRt=new Array(new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce);function lRt(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,XZt),o=F.multiply(t,i,PZt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=cRt,h=g_e.length;for(d=0;d<h;d++)F.multiplyByVector(o,g_e[d],u[d]);for(d=0;d<h;d++){let p=u[d];if(p.z>=-p.w){let g=p.x/p.w,f=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,f),c=Math.max(c,f)}else for(let g=0;g<3;g++){let f=aRt[d*3+g],b=u[f];if(b.z>=-b.w){let C=p.z+p.w,E=b.z+b.w,T=C/(C-E),S=ce.lerp(p,b,T,YZt),_=S.x/S.w,R=S.y/S.w;r=Math.min(r,_),s=Math.max(s,_),a=Math.min(a,R),c=Math.max(c,R)}}}return r=V.clamp(r,-1,1),a=V.clamp(a,-1,1),s=V.clamp(s,-1,1),c=V.clamp(c,-1,1),n=ce.fromElements(r,a,s,c,n),n}var R$=3e7,dRt=new m(R$,0,0),uRt=new m(0,R$,0),mRt=new m(0,0,R$);function hRt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,h){i.add({positions:[c,d],width:h,material:ho.fromType("Color",{color:u})})}function r(c,d,u){let h=c.computeCorners();o(h[0],h[1],d,u),o(h[2],h[3],d,u),o(h[4],h[5],d,u),o(h[6],h[7],d,u),o(h[0],h[2],d,u),o(h[4],h[6],d,u),o(h[1],h[3],d,u),o(h[5],h[7],d,u),o(h[0],h[4],d,u),o(h[2],h[6],d,u),o(h[1],h[5],d,u),o(h[3],h[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,h=Math.max(1,5/Math.pow(2,d)),g=[D.RED,D.LIME,D.BLUE][d%3];if(r(c.orientedBoundingBox,g,h),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,D.WHITE,5),s(n.rootNode);let a=10;o(m.ZERO,dRt,D.RED,a),o(m.ZERO,uRt,D.LIME,a),o(m.ZERO,mRt,D.BLUE,a),i.update(t)}oA.DefaultCustomShader=new AT({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
{
    material.diffuse = vec3(1.0);
    material.alpha = 1.0;
}`});function x_e(){this.ready=!0,this.shape=ac.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[Et.SCALAR],this.componentTypes=[jt.FLOAT32],this.maximumTileCount=1}x_e.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new gT({metadata:[new Float32Array(1)]});return Promise.resolve(n)};oA.DefaultProvider=new x_e;var Oy=oA;var Dso=y(x(),1);function fRt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var fM=fRt;var kso=y(x(),1);function pRt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var pM=pRt;var zso=y(x(),1);function ARt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var AM=ARt;var gO=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function yi(e){e=e??Q.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof S1;if(o)this._context=e.contextOptions.createSceneContext(t);else{let d=Qe(e.contextOptions);this._context=new xx(t,d)}let r=this._context,s=l(n);s||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Kn(),this._jobScheduler=new DX,this._frameState=new MX(r,new WX(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new IR(r),this._ellipsoid=e.ellipsoid??ie.default,this._globe=void 0,this._globeTranslucencyState=new UX,this._primitives=new Ml({countReferences:o}),this._groundPrimitives=new Ml({countReferences:o}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=yi.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new uT,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new NX(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new li({color:new D,stencil:0,owner:this}),this._depthClearCommand=new li({depth:1,owner:this}),this._stencilClearCommand=new li({stencil:0}),this._classificationStencilClearCommand=new li({stencil:0,renderState:ke.fromCache({stencilMask:Qt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new VP(this),this._preUpdate=new Ce,this._postUpdate=new Ce,this._renderError=new Ce,this._preRender=new Ce,this._postRender=new Ce,this._minimumDisableDepthTestDistance=0,this._debugInspector=new PP,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new Ce,this.morphComplete=new Ce,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=D.clone(D.BLACK),this._mode=se.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new vi(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new AC,this.fog=new PX,this.fog.enabled=ie.WGS84.equals(this._ellipsoid),ie.WGS84.equals(this._ellipsoid)||(So.DEFAULT_VIEW_RECTANGLE=de.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new So(this),this.shadowMap=new fb({context:r,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=D.clone(D.WHITE),this._actualInvertClassificationColor=D.clone(this._invertClassificationColor),this._invertClassification=new GZ,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new RP,this._brdfLutGenerator=new _X,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new BP(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Ql.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,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Lc.requestCompletedEvent.addEventListener(gO(this)),this._removeTaskProcessorListenerCallback=Jn.taskCompletedEvent.addEventListener(gO(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new $e(0,0,r.drawingBufferWidth,r.drawingBufferHeight),c=new So(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new So(this),this.preloadFlightCullingVolume=void 0,this._picking=new rP(this),this._defaultView=new oT(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new CA,this._enableEdgeVisibility=!1,__e(this,0,j.now()),this.updateFrameState(),this.initializeFrame()}yi.defaultLogDepthBuffer=!0;function gRt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(gO(e))),n.push(t.terrainProviderChanged.addEventListener(gO(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(yi.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Yt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Yt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Ih.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,gRt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===se.SCENE2D?this.morphTo2D(0):e===se.SCENE3D?this.morphTo3D(0):e===se.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new So(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new XX(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}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Yt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});yi.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function bRt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function C_e(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=Kp.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Kp.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=Kp.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Kp.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=fb.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ve.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}yi.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,d=l(t.logDepth),u=l(t.hdr),h=l(t.originalCommand),p=o&&!d,g=c&&!u,f=(!o||!c)&&!h,b=n.pickingMetadata&&bRt(e,n);if(e.dirty=e.dirty||p||g||f||b,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:C,shadowMaps:E}=i;C&&e.castShadows&&(t.shadows=fb.createCastDerivedCommand(E,e,s,r,t.shadows)),(d||p)&&(t.logDepth=Kp.createLogDepthCommand(e,r,t.logDepth),C_e(this,t.logDepth.command,s)),(h||f)&&C_e(this,e,s)};var yRt=new Hm({pass:nr.RENDER}),G$=new Hm({pass:nr.PRELOAD}),V$=new Hm({pass:nr.PRELOAD_FLIGHT}),xRt=new Hm({pass:nr.REQUEST_RENDER_MODE_DEFER_CHECK}),E_e=new ue,L$;function CRt(e){if(!(e._mode!==se.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return E_e.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,L$=$N.fromBoundingSphere(E_e,e.camera.positionWC,L$),L$}yi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function __e(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=j.clone(n,i.time)}yi.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=CRt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof hn||this.camera.frustum instanceof is),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=D.clone(this.invertClassificationColor,this._actualInvertClassificationColor),GZ.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};yi.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Jt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var AO=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);AO=F.inverseTransformation(AO,AO);function ERt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=m.clone(s.center);if(o.mode!==se.SCENE3D){a=F.multiplyByPoint(AO,a,a);let f=o.mapProjection,b=f.unproject(a);a=f.ellipsoid.cartographicToCartesian(b)}let c,d,{radius:u}=s;l(u)?(c=Va.createGeometry(new Va({radii:new m(u,u,u),vertexFormat:pn.FLAT_VERTEX_FORMAT})),d=F.fromTranslation(a)):(c=hc.createGeometry(hc.fromDimensions({dimensions:new m(2,2,2),vertexFormat:pn.FLAT_VERTEX_FORMAT})),d=F.fromRotationTranslation(s.halfAxes,a,new F)),t._debugVolume=new Nn({geometryInstances:new Bt({geometry:Dn.toWireframe(c),modelMatrix:d,attributes:{color:new qt(1,0,0,1)}}),appearance:new pn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=Kp.createLogDepthCommand(e,r).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(g)&&(n.framebuffer=g),o.commandList=h}function eh(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof li){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&ERt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function T_e(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function Z_e(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var TRt=new m;function S_e(e,t){let n=m.subtract(e,t,TRt),i=Math.max(0,m.magnitude(n));return i*i}function SRt(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return S_e(o.center,n)-S_e(i.center,n)}function IRt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+V.EPSILON12}function _Rt(e,t,n,i,o){zp(i,Z_e,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function ZRt(e,t,n,i,o){zp(i,IRt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function RRt(e,t,n){e.context.uniformState.updatePass(Ve.VOXELS);let i=n.commands[Ve.VOXELS];i.length=n.indices[Ve.VOXELS],zp(i,Z_e,e.camera.positionWC);for(let o=0;o<i.length;++o)eh(i[o],e,t)}function GRt(e,t,n){e.context.uniformState.updatePass(Ve.GAUSSIAN_SPLATS);let i=n.commands[Ve.GAUSSIAN_SPLATS];i.length=n.indices[Ve.GAUSSIAN_SPLATS],zp(i,SRt,e.camera.positionWC);for(let o=0;o<i.length;++o)eh(i[o],e,t)}var VRt=new Ui,LRt=new kl,WRt=new hn,FRt=new is;function BRt(e){let{frustum:t}=e;return l(t.fov)?t.clone(VRt):l(t.infiniteProjectionMatrix)?t.clone(LRt):l(t.width)?t.clone(WRt):t.clone(FRt)}function wRt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?_Rt:ZRt}function YRt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let d=wRt(e);o.uniformState.updatePass(Ve.TRANSLUCENT);let u=n.commands[Ve.TRANSLUCENT];u.length=n.indices[Ve.TRANSLUCENT],d(e,eh,t,u,c)}function NRt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Ve.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ve.TRANSLUCENT];i.executeTranslucentCommands(e,eh,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,eh,t,n)}function XRt(e,t,n){e.context.uniformState.updatePass(Ve.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let o=n.commands[Ve.CESIUM_3D_TILE_EDGES],r=n.indices[Ve.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new D(0,0,0,0)).execute(e.context,t);for(let s=0;s<r;++s)eh(o[s],e,t);t.framebuffer=i}function F$(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=BRt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||PRt(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:f}=e._environmentState,{globeDepth:b,globeTranslucencyFramebuffer:C,sceneFramebuffer:E,frustumCommandsList:T}=e._view,S=T.length,_=e._globeTranslucencyState,R=e._depthClearCommand,L=e._stencilClearCommand,W=e._classificationStencilClearCommand,B=e._depthPlane,Y=n.position.z;function N(I,Z){r.updatePass(Z);let G=I.commands[Z],w=I.indices[Z];for(let X=0;X<w;++X)eh(G[X],e,t);return w}function A(I,Z){r.updatePass(Z);let G=I.commands[Z],w=I.indices[Z];for(let X=0;X<w;++X)T_e(G[X],e,t)}for(let I=0;I<S;++I){let Z=S-I-1,G=T[Z];e.mode===se.SCENE2D?(n.position.z=Y-G.near+1,s.far=Math.max(1,G.far-G.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=Z!==0?G.near*e.opaqueFrustumNearOffset:G.near,s.far=G.far,r.updateFrustum(s)),R.execute(i,t),i.stencilBuffer&&L.execute(i,t),_.translucent?(r.updatePass(Ve.GLOBE),_.executeGlobeCommands(G,eh,C,e,t)):N(G,Ve.GLOBE),p&&b.executeCopyDepth(i,t),u||(_.translucent?(r.updatePass(Ve.TERRAIN_CLASSIFICATION),_.executeGlobeClassificationCommands(G,eh,C,e,t)):N(G,Ve.TERRAIN_CLASSIFICATION)),d&&(R.execute(i,t),h&&B.execute(i,t));let w;if(XRt(e,t,G),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let v=e._view.edgeFramebuffer.colorTexture;l(v)?e.context.uniformState.edgeColorTexture=v:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let U=e._view.edgeFramebuffer.idTexture;l(U)?e.context.uniformState.edgeIdTexture=U:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let k=e._view.edgeFramebuffer.depthTexture;l(k)?e.context.uniformState.edgeDepthTexture=k:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(!g||c||u)w=N(G,Ve.CESIUM_3D_TILE),w>0&&(p&&(b.prepareColorTextures(i,d),b.executeUpdateDepth(i,t,b.depthStencilTexture)),u||(w=N(G,Ve.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let v=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,w=N(G,Ve.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),b.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),w=N(G,Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=v,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),w>0&&i.stencilBuffer&&W.execute(i,t),w=N(G,Ve.CESIUM_3D_TILE_CLASSIFICATION)}if(w>0&&i.stencilBuffer&&L.execute(i,t),RRt(e,t,G),N(G,Ve.OPAQUE),GRt(e,t,G),Z!==0&&e.mode!==se.SCENE2D&&(s.near=G.near,r.updateFrustum(s)),YRt(e,t,G),NRt(e,t,G),i.depthTexture&&e.useDepthPicking&&(p||u)){let v=e._picking.getPickDepth(e,Z);v.update(i,b.depthStencilTexture),v.executeCopyDepth(i,t)}if(c||!f)continue;let X=t.framebuffer;t.framebuffer=E.getIdFramebuffer(),s.near=Z!==0?G.near*e.opaqueFrustumNearOffset:G.near,s.far=G.far,r.updateFrustum(s),_.translucent?(r.updatePass(Ve.GLOBE),_.executeGlobeCommands(G,T_e,C,e,t)):A(G,Ve.GLOBE),d&&(R.framebuffer=t.framebuffer,R.execute(i,t),R.framebuffer=void 0),d&&h&&B.execute(i,t),A(G,Ve.CESIUM_3D_TILE),A(G,Ve.OPAQUE),A(G,Ve.TRANSLUCENT),t.framebuffer=X}}function PRt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Ve.ENVIRONMENT),l(i.skyBoxCommand)&&eh(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&eh(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function R_e(e){e.context.uniformState.updatePass(Ve.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function MRt(e,t){e.context.uniformState.updatePass(Ve.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function URt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Ve.GLOBE,Ve.CESIUM_3D_TILE,Ve.OPAQUE,Ve.TRANSLUCENT];for(let c=0;c<t.length;++c){let d=t[c];if(e.updateDerivedCommands(d),!(!d.castShadows||a.indexOf(d.pass)<0||!e.isVisible(i,d)))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,d))r[h].commandList.push(d),u=!0;else if(u)break}}}}function G_e(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:d}=c;for(let u=0;u<d.length;++u)d[u].commandList.length=0;URt(e,n,c);for(let u=0;u<d.length;++u){let h=c.passes[u],{camera:p,commandList:g}=h;s.updateCamera(p),c.updatePass(r,u);for(let f=0;f<g.length;++f){let b=g[f];s.updatePass(b.pass);let C=b.derivedCommands.shadows.castCommands[a];eh(C,e,h.passState)}}}}var DRt=new m;yi.prototype.updateAndExecuteCommands=function(e,t){tGt(this,e,t),this._environmentState.useWebVR?vRt(this,e,t):this._frameState.mode!==se.SCENE2D||this._mapMode2D===Ql.ROTATE?zy(!0,this,e):qRt(this,e)};function vRt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;V_e(e),n.createPotentiallyVisibleSet(e),R_e(e),r||G_e(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=So.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,d=c*(e.focalLength??5),u=e.eyeSeparation??d/30,h=m.multiplyByScalar(a.right,u*.5,DRt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;m.add(a.position,h,i.position),i.frustum.xOffset=p,F$(e,t),s.x=s.width,m.subtract(a.position,h,i.position),i.frustum.xOffset=-p,F$(e,t),So.clone(a,i)}var kRt=new pe(Math.PI,V.PI_OVER_TWO),QRt=new m,ORt=new m,zRt=new F,HRt=new F,KRt=new m,JRt=new m,jRt=new $e;function qRt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=$e.clone(r,jRt);t.viewport=s;let a=kRt,c=QRt;e.mapProjection.project(a,c);let u=m.clone(i.position,ORt),h=F.clone(i.transform,HRt),p=i.frustum.clone();i._setTransform(F.IDENTITY);let g=F.computeViewportTransformation(s,0,1,zRt),f=i.frustum.projectionMatrix,b=i.positionWC.y,C=m.fromElements(V.sign(b)*c.x-b,0,-i.positionWC.x,KRt),E=Tt.pointToGLWindowCoordinates(f,g,C,JRt);E.x=Math.floor(E.x);let T=s.x,S=s.width;if(b===0||E.x<=T||E.x>=T+S)zy(!0,e,t);else if(Math.abs(T+S*.5-E.x)<1)s.width=E.x-s.x,i.position.x*=V.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!0,e,t),s.x=E.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!1,e,t);else if(E.x>T+S*.5){s.width=E.x-T;let _=i.frustum.right;i.frustum.right=c.x-b,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!0,e,t),s.x=E.x,s.width=T+S-E.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=_-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!1,e,t)}else{s.x=E.x,s.width=T+S-E.x;let _=i.frustum.left;i.frustum.left=-c.x-b,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!0,e,t),s.x=T,s.width=E.x-T,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=_-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!1,e,t)}i._setTransform(h),m.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function zy(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),V_e(t),i.createPotentiallyVisibleSet(t),e&&(R_e(t),o||G_e(t)),F$(t,n)}var I_e=new Ps;yi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==se.SCENE2D&&t.camera.frustum instanceof hn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(qA.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let E=r.dynamicLighting;s.setDynamicLighting(E),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let C=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(C)?C.drawCommand:void 0,n.sunComputeCommand=l(C)?C.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===se.SCENE2D);(n.useDepthPlane=d&&this.mode===se.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==se.SCENE2D&&!o;let h=e.mode===se.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=I_e.planes;for(let C=0;C<5;++C)g[C]=p.planes[C];p=I_e,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let f=this.specularEnvironmentMaps,b=this._specularEnvironmentCubeMap;l(f)&&b?.url!==f?(b=b&&b.destroy(),this._specularEnvironmentCubeMap=new Ih(f)):!l(f)&&l(b)&&(b.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function $Rt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Hp({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function eGt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===se.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function V_e(e){let t=e._frameState;t.edgeVisibilityRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),$Rt(e),eGt(e),e._globe&&e._globe.render(t)}function tGt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new NP:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;D.clone(n,u.color),u.execute(i,t);let h=r.useGlobeDepthFramebuffer=l(s.globeDepth);h&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,b=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);r.usePostProcessSelected=!1,b&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),b=r.usePostProcess=f.ready,r.usePostProcessSelected=b&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:b&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t);let C=r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),C){let T;if(o.invertClassificationColor.alpha===1&&h&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let S=e._invertClassification.unclassifiedCommand,_=S.derivedCommands;_.oit=p.createDerivedCommands(S,i,_.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}yi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?h.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=u);let f=this.postProcessStages,b=g.getColorTexture(0),C=p.getColorTexture(0),E=(u??h).getDepthStencilTexture();f.execute(t,b,E,C),f.copy(t,d)}!s&&!c&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function nGt(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function iGt(e){if(e.mode===se.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function L_e(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Ml){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=L_e(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(l(o)&&o>i)return o}return i}yi.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===tt.CLAMP_TO_TERRAIN||t===tt.RELATIVE_TO_TERRAIN,i=t===tt.CLAMP_TO_3D_TILE||t===tt.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=L_e(this.primitives,e,this);l(s)&&s>o&&(o=s)}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var W$=new pe;yi.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=g=>{pe.clone(e,W$);let f;l(g)&&(f=g.height),l(f)||(f=this.getHeight(e,n)),l(f)&&(W$.height=f,t(W$))},r=n===tt.CLAMP_TO_TERRAIN||n===tt.RELATIVE_TO_TERRAIN,s=n===tt.CLAMP_TO_3D_TILE||n===tt.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let c={},d=g=>{if(r||g.isDestroyed()||!g.isCesium3DTileset)return;let f=g.updateHeight(e,o,i);c[g.id]=f};if(!r){let g=this.primitives.length;for(let f=0;f<g;++f){let b=this.primitives.get(f);d(b)}}let u=this.primitives.primitiveAdded.addEventListener(d),h=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{a=a&&a(),Object.values(c).forEach(g=>g()),c={},u(),h()}};function oGt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===se.SCENE2D||n===se.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}yi.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=iGt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=oGt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function rGt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new ub({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function sGt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function aGt(e){e.primitives.postPassesUpdate(e._frameState),Lc.update()}var cGt=new D;function lGt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=yRt;let r=e.backgroundColor??D.BLACK;e._hdr&&(r=D.clone(r,cGt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof CA?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=$e.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,MRt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function CT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function dGt(e){return e._picking.updateMostDetailedRayPicks(e)}yi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=j.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===se.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(j.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=j.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=V.incrementWrap(t.frameNumber,15e6,1);__e(this,o,e),t.newFrame=!0}CT(this,sGt),this.primitives.show&&(CT(this,dGt),CT(this,uGt),CT(this,mGt),i||CT(this,hGt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),CT(this,lGt)),rGt(this,i),CT(this,aGt),nGt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};yi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};yi.prototype.requestRender=function(){this._renderRequested=!0};yi.prototype.clampLineWidth=function(e){return Math.max(Yt.minimumAliasedLineWidth,Math.min(e,Yt.maximumAliasedLineWidth))};yi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};yi.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};yi.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof Oy))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return MP.fromKeyframeNode(o,s,c,a)};yi.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=fM(s,t,n,i);if(!l(a))return;let c=AM(r,n,i);if(!l(c))return;let d=new pM(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};yi.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};yi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};yi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};yi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function uGt(e){let t=e._frameState;G$.camera=t.camera,G$.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,G$)}function mGt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;V$.camera=e.preloadFlightCamera,V$.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,V$)}function hGt(e){e.primitives.updateForPass(e._frameState,xRt)}yi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};yi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};yi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};yi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};yi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};yi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};yi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};yi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};yi.prototype.cartesianToCanvasCoordinates=function(e,t){return no.worldToWindowCoordinates(this,e,t)};yi.prototype.completeMorph=function(){this._transitioner.completeMorph()};yi.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};yi.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};yi.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function fGt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}yi.prototype.setTerrain=function(e){return fGt(this,e),e};yi.prototype.isDestroyed=function(){return!1};yi.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),fe(this)};var gM=yi;var $co=y(x(),1);var Sco=y(x(),1),NZ=`float interpolateByDistance(vec4 nearFarScalar, float distance)
{
    float startDistance = nearFarScalar.x;
    float startValue = nearFarScalar.y;
    float endDistance = nearFarScalar.z;
    float endValue = nearFarScalar.w;
    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
    return mix(startValue, endValue, t);
}

void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)
{
    float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;

    // Adjustment to the atmosphere radius applied based on the camera height.
    float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;
    float distanceAdjustMax = czm_ellipsoidRadii.x;
    float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;
    float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);

    // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit
    // for the position on the ellipsoid.
    float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
    float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;

    // Setup the primary ray: from the camera position to the vertex position.
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);

    underTranslucentGlobe = 0.0;

    // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.
    #if defined(GLOBE_TRANSLUCENT)

        // Check for intersection with the inner radius of the atmopshere.
        czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
        if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {

            // Compute position on globe.
            vec3 direction = normalize(positionWC);
            czm_ray ellipsoidRay = czm_ray(positionWC, -direction);
            czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);
            vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);

            // Control the color using the camera angle.
            float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));

            // Control the opacity using the distance from Earth.
            opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));
            vec3 horizonColor = vec3(0.1, 0.2, 0.3);
            vec3 nearColor = vec3(0.0);

            rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);

            // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.
            underTranslucentGlobe = 1.0;
            return;
        }
    #endif

    computeScattering(
        primaryRay,
        length(cameraToPositionWC),
        lightDirection,
        atmosphereInnerRadius,
        rayleighColor,
        mieColor,
        opacity
    );

    // Alter the opacity based on how close the viewer is to the ground.
    // (0.0 = At edge of atmosphere, 1.0 = On ground)
    float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
    opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);

    // Alter alpha based on time of day (0.0 = night , 1.0 = day)
    float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
    opacity *= pow(nightAlpha, 0.5);
}
`;var _co=y(x(),1),bM=`in vec3 v_outerPositionWC;

uniform vec3 u_hsbShift;

#ifndef PER_FRAGMENT_ATMOSPHERE
in vec3 v_mieColor;
in vec3 v_rayleighColor;
in float v_opacity;
in float v_translucent;
#endif

void main (void)
{
    float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
    vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum);

    vec3 mieColor;
    vec3 rayleighColor;
    float opacity;
    float translucent;

    #ifdef PER_FRAGMENT_ATMOSPHERE
        computeAtmosphereScattering(
            v_outerPositionWC,
            lightDirection,
            rayleighColor,
            mieColor,
            opacity,
            translucent
        );
    #else
        mieColor = v_mieColor;
        rayleighColor = v_rayleighColor;
        opacity = v_opacity;
        translucent = v_translucent;
    #endif

    vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);

    #ifndef HDR
        color.rgb = czm_pbrNeutralTonemapping(color.rgb);
        color.rgb = czm_inverseGamma(color.rgb);
    #endif

    #ifdef COLOR_CORRECT
        const bool ignoreBlackPixels = true;
        color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);
    #endif

    // For the parts of the sky atmosphere that are not behind a translucent globe,
    // we mix in the default opacity so that the sky atmosphere still appears at distance.
    // This is needed because the opacity in the sky atmosphere is initially adjusted based
    // on the camera height.
    if (translucent == 0.0) {
        color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
    }

    out_FragColor = color;
}
`;var Rco=y(x(),1),yM=`in vec4 position;

out vec3 v_outerPositionWC;

#ifndef PER_FRAGMENT_ATMOSPHERE
out vec3 v_mieColor;
out vec3 v_rayleighColor;
out float v_opacity;
out float v_translucent;
#endif

void main(void)
{
    vec4 positionWC = czm_model * position;
    float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
    vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum);

    #ifndef PER_FRAGMENT_ATMOSPHERE
        computeAtmosphereScattering(
            positionWC.xyz,
            lightDirection,
            v_rayleighColor,
            v_mieColor,
            v_opacity,
            v_translucent
        );
    #endif

    v_outerPositionWC = positionWC.xyz;
    vec4 positionEC = czm_modelView * position;
    gl_Position = czm_projection * positionEC;
}
`;function XZ(e){e=e??ie.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new nt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(XZ.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});XZ.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var B$=new F;XZ.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==se.SCENE3D&&n!==se.MORPHING||!e.passes.render)return;let i=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,B$),o=F.multiplyTransformation(i,to.Y_UP_TO_Z_UP,B$),r=F.multiply(this._scaleMatrix,o,B$);F.clone(r,this._modelMatrix);let s=e.context,a=pGt(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Va.createGeometry(new Va({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:we.POSITION_ONLY}));u.vertexArray=si.fromGeometry({context:s,geometry:p,attributeLocations:Dn.createAttributeLocations(p),bufferUsage:Xe.STATIC_DRAW}),u.renderState=ke.fromCache({cull:{enabled:!0,face:wi.FRONT},blending:fn.ALPHA_BLEND,depthMask:!1})}let h=a|d<<2|c<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new ze({defines:p,sources:[Fh,NZ,yM]}),f=new ze({defines:p,sources:[Fh,NZ,bM]});this._spSkyAtmosphere=cn.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function pGt(e){return!(V.equalsEpsilon(e.hueShift,0,V.EPSILON7)&&V.equalsEpsilon(e.saturationShift,0,V.EPSILON7)&&V.equalsEpsilon(e.brightnessShift,0,V.EPSILON7))}XZ.prototype.isDestroyed=function(){return!1};XZ.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),fe(this)};var xM=XZ;var Ilo=y(x(),1);var tlo=y(x(),1),CM=`uniform samplerCube u_cubeMap;

in vec3 v_texCoord;

void main()
{
    vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));
    out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
}
`;var ilo=y(x(),1),EM=`in vec3 position;
out vec3 v_texCoord;

void main()
{
    vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
    gl_Position = czm_projection * vec4(p, 1.0);
    v_texCoord = position.xyz;
}
`;function MZ(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new nt({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}MZ.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==se.SCENE3D&&i!==se.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?R1(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}).catch(c=>{this._hasError=!0,this._error=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new zr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=hc.createGeometry(hc.fromDimensions({dimensions:new m(2,2,2),vertexFormat:we.POSITION_ONLY})),c=this._attributeLocations=Dn.createAttributeLocations(a);s.vertexArray=si.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Xe.STATIC_DRAW}),s.renderState=ke.fromCache({blending:fn.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new ze({defines:[t?"HDR":""],sources:[CM]});s.shaderProgram=cn.fromCache({context:r,vertexShaderSource:EM,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};MZ.prototype.isDestroyed=function(){return!1};MZ.prototype.destroy=function(){let 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(),fe(this)};function PZ(e){return en(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}MZ.createEarthSkyBox=function(){return new MZ({sources:{positiveX:PZ("px"),negativeX:PZ("mx"),positiveY:PZ("py"),negativeY:PZ("my"),positiveZ:PZ("pz"),negativeZ:PZ("mz")}})};var TM=MZ;var sdo=y(x(),1);var Zlo=y(x(),1),SM=`uniform sampler2D u_texture;

in vec2 v_textureCoordinates;

void main()
{
    vec4 color = texture(u_texture, v_textureCoordinates);
    out_FragColor = czm_gammaCorrect(color);
}
`;var Glo=y(x(),1),IM=`uniform float u_radiusTS;

in vec2 v_textureCoordinates;

vec2 rotate(vec2 p, vec2 direction)
{
    return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);
}

vec4 addBurst(vec2 position, vec2 direction, float lengthScalar)
{
    vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);
    float radius = length(rotatedPosition) * lengthScalar;
    float burst = 1.0 - smoothstep(0.0, 0.55, radius);
    return vec4(burst);
}

void main()
{
    float lengthScalar = 2.0 / sqrt(2.0);
    vec2 position = v_textureCoordinates - vec2(0.5);
    float radius = length(position) * lengthScalar;
    float surface = step(radius, u_radiusTS);
    vec4 color = vec4(vec2(1.0), surface + 0.2, surface);

    float glow = 1.0 - smoothstep(0.0, 0.55, radius);
    color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;

    vec4 burst = vec4(0.0);

    // The following loop has been manually unrolled for speed, to
    // avoid sin() and cos().
    //
    //for (float i = 0.4; i < 3.2; i += 1.047) {
    //    vec2 direction = vec2(sin(i), cos(i));
    //    burst += 0.4 * addBurst(position, direction, lengthScalar);
    //
    //    direction = vec2(sin(i - 0.08), cos(i - 0.08));
    //    burst += 0.3 * addBurst(position, direction, lengthScalar);
    //}

    burst += 0.4 * addBurst(position, vec2(0.38942,  0.92106), lengthScalar);  // angle == 0.4
    burst += 0.4 * addBurst(position, vec2(0.99235,  0.12348), lengthScalar);  // angle == 0.4 + 1.047
    burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);  // angle == 0.4 + 1.047 * 2.0

    burst += 0.3 * addBurst(position, vec2(0.31457,  0.94924), lengthScalar);  // angle == 0.4 - 0.08
    burst += 0.3 * addBurst(position, vec2(0.97931,  0.20239), lengthScalar);  // angle == 0.4 + 1.047 - 0.08
    burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);  // angle == 0.4 + 1.047 * 2.0 - 0.08

    // End of manual loop unrolling.

    color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;

    out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
}
`;var Llo=y(x(),1),_M=`in vec2 direction;

uniform float u_size;

out vec2 v_textureCoordinates;

void main() 
{
    vec4 position;
    if (czm_morphTime == 1.0)
    {
        position = vec4(czm_sunPositionWC, 1.0);
    }
    else
    {
        position = vec4(czm_sunPositionColumbusView.zxy, 1.0);
    }
    
    vec4 positionEC = czm_view * position;
    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
    
    vec2 halfSize = vec2(u_size * 0.5);
    halfSize *= ((direction * 2.0) - 1.0);
    
    gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);
    
    v_textureCoordinates = direction;
}
`;function RM(){this.show=!0,this._drawCommand=new nt({primitiveType:Be.TRIANGLES,boundingVolume:new ue,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ue,this._boundingVolume2D=new ue,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;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(RM.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var AGt=new M,gGt=new M,bGt=new ce,ZM=new ce;RM.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===se.SCENE2D||i===se.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let _=Math.max(r,s);_=Math.pow(2,Math.ceil(Math.log(_)/Math.log(2))-2),_=Math.max(1,_);let R=n?o.halfFloatingPointTexture?ve.HALF_FLOAT:ve.FLOAT:ve.UNSIGNED_BYTE;this._texture=new Wt({context:o,width:_,height:_,pixelFormat:je.RGBA,pixelDatatype:R}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let L=this,W={u_radiusTS:function(){return L._radiusTS}};this._commands.computeCommand=new ll({fragmentShaderSource:IM,outputTexture:this._texture,uniformMap:W,persists:!1,owner:this,postExecute:function(){L._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let _={direction:0},R=new Uint8Array(8);R[0]=0,R[1]=0,R[2]=255,R[3]=0,R[4]=255,R[5]=255,R[6]=0,R[7]=255;let L=mt.createVertexBuffer({context:o,typedArray:R,usage:Xe.STATIC_DRAW}),W=[{index:_.direction,vertexBuffer:L,componentsPerAttribute:2,normalize:!0,componentDatatype:J.UNSIGNED_BYTE}],B=mt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Xe.STATIC_DRAW,indexDatatype:Pe.UNSIGNED_SHORT});a.vertexArray=new si({context:o,attributes:W,indexBuffer:B}),a.shaderProgram=cn.fromCache({context:o,vertexShaderSource:_M,fragmentShaderSource:SM,attributeLocations:_}),a.renderState=ke.fromCache({blending:fn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,h=this._boundingVolume2D;m.clone(c,u.center),h.center.x=d.z,h.center.y=d.x,h.center.z=d.y,u.radius=V.SOLAR_RADIUS+V.SOLAR_RADIUS*this._glowLengthTS,h.radius=u.radius,i===se.SCENE3D?ue.clone(u,a.boundingVolume):i===se.COLUMBUS_VIEW&&ue.clone(h,a.boundingVolume);let p=no.computeActualEllipsoidPosition(e,c,ZM),g=m.magnitude(m.subtract(p,e.camera.position,ZM)),f=o.uniformState.projection,b=bGt;b.x=0,b.y=0,b.z=-g,b.w=1;let C=F.multiplyByVector(f,b,ZM),E=no.clipToGLWindowCoordinates(t.viewport,C,AGt);b.x=V.SOLAR_RADIUS;let T=F.multiplyByVector(f,b,ZM),S=no.clipToGLWindowCoordinates(t.viewport,T,gGt);return this._size=M.magnitude(M.subtract(S,E,ZM)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};RM.prototype.isDestroyed=function(){return!1};RM.prototype.destroy=function(){let 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(),fe(this)};var GM=RM;var uuo=y(x(),1);var zdo=y(x(),1);var B_e=y(cD(),1);var cdo=y(x(),1);function yGt(e,t,n){return`    float clipDistance = clip(gl_FragCoord, ${e}, ${t}); 
    vec4 clippingPlanesEdgeColor = vec4(1.0); 
    clippingPlanesEdgeColor.rgb = ${n}.rgb; 
    float clippingPlanesEdgeWidth = ${n}.a; 
    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) 
    { 
        out_FragColor = clippingPlanesEdgeColor;
    } 
`}var VM=yGt;var udo=y(x(),1);var xGt={modifyFragmentShader:function(t){return t=ze.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; 
void main() 
{ 
#ifndef SHADOW_MAP
    if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; 
    if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; 
#endif
    czm_splitter_main(); 
} 
`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},UZ=xGt;var ET={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function LM(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=D.clone(D.DARKGRAY),this._highlightColor=D.clone(D.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=ET.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._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=e.opaquePass??Ve.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=Rn.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,this.splitDirection=e.splitDirection??Br.NONE,this._splittingEnabled=!1,this._error=void 0,CGt(this,e)}Object.defineProperties(LM.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return D.clone(this._highlightColor)},set:function(e){this._highlightColor=D.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ue.clone(e,this._boundingSphere)}}});function CGt(e,t){let n=WC.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=Rh.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=ET.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=D.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var EGt=new m,TGt=new m,SGt=new m,W_e,bO;function IGt(e){if(!l(bO)){W_e=new B_e.default(0),bO=new Array(e);for(let t=0;t<e;++t)bO[t]=W_e.random()}return bO}function _Gt(e){let n=e.length/3,i=Math.min(n,20),o=IGt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(r,r,r,EGt),c=m.fromElements(s,s,s,TGt);for(let u=0;u<i;++u){let h=Math.floor(o[u]*n),p=m.unpack(e,h*3,SGt);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let d=ue.fromCornerPoints(a,c);return d.radius+=V.EPSILON2,d}function F_e(e,t){let n=J.fromTypedArray(e);return n===J.INT||n===J.UNSIGNED_INT||n===J.DOUBLE?(At("Cast pnts property to floats",`Point cloud property "${t}" will be cast 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 ZGt=new ce,RGt=new ce,GGt=new D,w_e=0,yO=1,P$=2,Y_e=3,VGt=4,w$=new F,LGt=new F;function WGt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,d=i.styleableProperties,u=l(d),h=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,f=e._isOctEncodedDraco,b=e._quantizedRange,C=e._octEncodedRange,E=e._isRGB565,T=e._isTranslucent,S=e._hasColors,_=e._hasNormals,R=e._hasBatchIds,L,W,B=[],Y={};if(e._styleableShaderAttributes=Y,u){let U=VGt;for(let k in d)if(d.hasOwnProperty(k)){let P=d[k],O=F_e(P.typedArray,k);L=P.componentCount,W=J.fromTypedArray(O);let H=mt.createVertexBuffer({context:n,typedArray:O,usage:Xe.STATIC_DRAW});e._geometryByteLength+=H.sizeInBytes;let ee={index:U,vertexBuffer:H,componentsPerAttribute:L,componentDatatype:W,normalize:!1,offsetInBytes:0,strideInBytes:0};B.push(ee),Y[k]={location:U,componentCount:L},++U}}let N=mt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Xe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let A;S&&(A=mt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Xe.STATIC_DRAW}),e._geometryByteLength+=A.sizeInBytes);let I;_&&(I=mt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Xe.STATIC_DRAW}),e._geometryByteLength+=I.sizeInBytes);let Z;R&&(c.typedArray=F_e(c.typedArray,"batchIds"),Z=mt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Xe.STATIC_DRAW}),e._geometryByteLength+=Z.sizeInBytes);let G=[];if(h?W=J.UNSIGNED_SHORT:p?W=b<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT:W=J.FLOAT,G.push({index:w_e,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:W,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=ue.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=_Gt(r.typedArray)),S)if(E)G.push({index:yO,vertexBuffer:A,componentsPerAttribute:1,componentDatatype:J.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let U=T?4:3;G.push({index:yO,vertexBuffer:A,componentsPerAttribute:U,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}_&&(g?(L=2,W=J.UNSIGNED_BYTE):f?(L=2,W=C<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT):(L=3,W=J.FLOAT),G.push({index:P$,vertexBuffer:I,componentsPerAttribute:L,componentDatatype:W,normalize:!1,offsetInBytes:0,strideInBytes:0})),R&&G.push({index:Y_e,vertexBuffer:Z,componentsPerAttribute:1,componentDatatype:J.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(G=G.concat(B));let w=new si({context:n,attributes:G}),X={depthTest:{enabled:!0}},v={depthTest:{enabled:!0},depthMask:!1,blending:fn.ALPHA_BLEND};e._opaquePass===Ve.CESIUM_3D_TILE&&(X.stencilTest=Qt.setCesium3DTileBit(),X.stencilMask=Qt.CESIUM_3D_TILE_MASK,v.stencilTest=Qt.setCesium3DTileBit(),v.stencilMask=Qt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ke.fromCache(X),e._translucentRenderState=ke.fromCache(v),e._drawCommand=new nt({boundingVolume:new ue,cull:e._cull,modelMatrix:new F,primitiveType:Be.POINTS,vertexArray:w,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?Ve.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function FGt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=ZGt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,d;t.mode===se.SCENE2D||c instanceof hn?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return D.TRANSPARENT;let c=D.clone(a.edgeColor,GGt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return F.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;F.multiply(n.uniformState.view3D,c,w$);let d=F.multiply(w$,a.modelMatrix,w$);return F.inverseTranspose(d,LGt)}};UZ.addUniforms(e,s),(i||o||r)&&(s=Rt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=RGt;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function Y$(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function N$(e,t){e=e.slice(e.indexOf(`
`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function X$(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var BGt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function wGt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,f=e._hasColors,b=e._hasNormals,C=e._hasBatchIds,E=e._backFaceCulling,T=e._normalShading,S=e._drawCommand.vertexArray,_=e.clippingPlanes,R=e._attenuation,L,W,B,Y=g,N=Qe(BGt),A={},I=e._styleableShaderAttributes;for(o in I)I.hasOwnProperty(o)&&(r=I[o],N[o]=`czm_3dtiles_property_${r.location}`,A[r.location]=r);if(a){let oe={translucent:!1},xe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";L=n.getColorShaderFunction(`getColorFromStyle${xe}`,N,oe),W=n.getShowShaderFunction(`getShowFromStyle${xe}`,N,oe),B=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,N,oe),l(L)&&oe.translucent&&(Y=!0)}e._styleTranslucent=Y;let Z=l(L),G=l(W),w=l(B),X=e.isClipped,v=[],U=[];Z&&(Y$(L,v),N$(L,U)),G&&(Y$(W,v),N$(W,U)),w&&(Y$(B,v),N$(B,U));let k=U.indexOf("COLOR")>=0,P=U.indexOf("NORMAL")>=0;if(P&&!b)throw new he("Style references the NORMAL semantic but the point cloud does not have normals");for(o in I)if(I.hasOwnProperty(o)){r=I[o];let oe=v.indexOf(r.location)>=0,xe=X$(S,r.location);xe.enabled=oe}let O=f&&(!Z||k);if(f){let oe=X$(S,yO);oe.enabled=O}let H=b&&(T||E||P);if(b){let oe=X$(S,P$);oe.enabled=H}let ee={a_position:w_e};O&&(ee.a_color=yO),H&&(ee.a_normal=P$),C&&(ee.a_batchId=Y_e);let z="",te=v.length;for(i=0;i<te;++i){let oe=v[i];r=A[oe];let xe=r.componentCount,Ee=`czm_3dtiles_property_${oe}`,Le;xe===1?Le="float":Le=`vec${xe}`,z+=`in ${Le} ${Ee}; 
`,ee[Ee]=r.location}FGt(e,t);let q=`in vec3 a_position; 
out vec4 v_color; 
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; 
uniform vec4 u_constantColor; 
uniform vec4 u_highlightColor; 
`;q+=`float u_pointSize; 
float tiles3d_tileset_time; 
`,R&&(q+=`float u_geometricError; 
float u_depthMultiplier; 
`),q+=z,O&&(g?q+=`in vec4 a_color; 
`:p?q+=`in float a_color; 
const float SHIFT_RIGHT_11 = 1.0 / 2048.0; 
const float SHIFT_RIGHT_5 = 1.0 / 32.0; 
const float SHIFT_LEFT_11 = 2048.0; 
const float SHIFT_LEFT_5 = 32.0; 
const float NORMALIZE_6 = 1.0 / 64.0; 
const float NORMALIZE_5 = 1.0 / 32.0; 
`:q+=`in vec3 a_color; 
`),H&&(u||h?q+=`in vec2 a_normal; 
`:q+=`in vec3 a_normal; 
`),C&&(q+=`in float a_batchId; 
`),(c||d||h)&&(q+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; 
`),Z&&(q+=L),G&&(q+=W),w&&(q+=B),q+=`void main() 
{ 
    u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; 
    tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; 
`,R&&(q+=`    u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; 
    u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; 
`),O?g?q+=`    vec4 color = a_color; 
`:p?q+=`    float compressed = a_color; 
    float r = floor(compressed * SHIFT_RIGHT_11); 
    compressed -= r * SHIFT_LEFT_11; 
    float g = floor(compressed * SHIFT_RIGHT_5); 
    compressed -= g * SHIFT_LEFT_5; 
    float b = compressed; 
    vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); 
    vec4 color = vec4(rgb, 1.0); 
`:q+=`    vec4 color = vec4(a_color, 1.0); 
`:q+=`    vec4 color = u_constantColor; 
`,c||d?q+=`    vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; 
`:q+=`    vec3 position = a_position; 
`,q+=`    vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); 
`,H?(u?q+=`    vec3 normal = czm_octDecode(a_normal); 
`:h?q+=`    vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; 
`:q+=`    vec3 normal = a_normal; 
`,q+=`    vec3 normalEC = czm_normal * normal; 
`):q+=`    vec3 normal = vec3(1.0); 
`,Z&&(q+=`    color = getColorFromStyle(position, position_absolute, color, normal); 
`),G&&(q+=`    float show = float(getShowFromStyle(position, position_absolute, color, normal)); 
`),w?q+=`    gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; 
`:R?q+=`    vec4 positionEC = czm_modelView * vec4(position, 1.0); 
    float depth = -positionEC.z; 
    gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); 
`:q+=`    gl_PointSize = u_pointSize; 
`,q+=`    color = color * u_highlightColor; 
`,H&&T&&(q+=`    float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); 
    diffuseStrength = max(diffuseStrength, 0.4); 
    color.xyz *= diffuseStrength * czm_lightColor; 
`),q+=`    v_color = color; 
    gl_Position = czm_modelViewProjection * vec4(position, 1.0); 
`,H&&E&&(q+=`    float visible = step(-normalEC.z, 0.0); 
    gl_Position *= visible; 
    gl_PointSize *= visible; 
`),G&&(q+=`    gl_Position.w *= float(show); 
    gl_PointSize *= float(show); 
`),q+=`} 
`;let me=`in vec4 v_color; 
`;X&&(me+=`uniform highp sampler2D u_clippingPlanes; 
uniform mat4 u_clippingPlanesMatrix; 
uniform vec4 u_clippingPlanesEdgeStyle; 
`,me+=`
`,me+=HE(_,s),me+=`
`),me+=`void main() 
{ 
    out_FragColor = czm_gammaCorrect(v_color); 
`,X&&(me+=VM("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),me+=`} 
`,e.splitDirection!==Br.NONE&&(me=UZ.modifyFragmentShader(me)),l(e._vertexShaderLoaded)&&(q=e._vertexShaderLoaded(q)),l(e._fragmentShaderLoaded)&&(me=e._fragmentShaderLoaded(me));let ye=e._drawCommand;l(ye.shaderProgram)&&ye.shaderProgram.destroy(),ye.shaderProgram=cn.fromCache({context:s,vertexShaderSource:q,fragmentShaderSource:me,attributeLocations:ee});try{ye.shaderProgram._bind()}catch{throw new he("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function YGt(e,t){if(e._decodingState===ET.READY)return!1;if(e._decodingState===ET.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=QA.decodePointCloud(i,t);l(o)&&(e._decodingState=ET.DECODING,o.then(function(r){e._decodingState=ET.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,d=l(r.NORMAL)?r.NORMAL.array:void 0,u=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(h){let C=r.POSITION.data.quantization,E=C.range;e._quantizedVolumeScale=m.fromElements(E,E,E),e._quantizedVolumeOffset=m.unpack(C.minValues),e._quantizedRange=(1<<C.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,f=i.batchTableProperties;for(let C in f)if(f.hasOwnProperty(C)){let E=r[C];l(g)||(g={}),g[C]={typedArray:E.array,componentCount:E.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let b=c??a;l(b)&&(n.colors={typedArray:b}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=g}).catch(function(r){e._decodingState=ET.FAILED,e._error=r}))}return!0}var NGt=new ce,XGt=new m;LM.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(YGt(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(WGt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,d),l(this._rtcCenter)&&F.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&F.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==se.SCENE3D){let h=e.mapProjection,p=F.getColumn(d,3,NGt);ce.equals(p,ce.UNIT_W)||Tt.basisTo2D(h,d,d)}let u=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,u),this._cull){let h=u.center;F.multiplyByPoint(d,h,h);let p=F.getScale(d,XGt);u.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Br.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&wGt(this,e,this._style),this._drawCommand.castShadows=Rn.castShadows(this.shadows),this._drawCommand.receiveShadows=Rn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ve.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};LM.prototype.isDestroyed=function(){return!1};LM.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),fe(this)};var WM=LM;function ST(e){e=e??Q.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.shadows=e.shadows??Rn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new sp(e.shading),this.style=e.style,this.frameFailed=new Ce,this.frameChanged=new Ce,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new ng,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._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(ST.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function PGt(e){return`uniform vec4 czm_pickColor;
${e}`}function MGt(e){return function(t){return Rt(t,{czm_pickColor:function(){return e._pickId.color}})}}function UGt(){return"czm_pickColor"}ST.prototype.makeStyleDirty=function(){this._styleDirty=!0};ST.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var DGt=new j;function U$(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function TT(e,t){return e._intervals.indexOf(t.start)}function vGt(e,t){let n=e._intervals,i=e._clock,o=U$(e);if(o===0)return;let r=e._getAverageLoadTime(),s=j.addSeconds(i.currentTime,r*o,DGt),a=n.indexOf(s),c=TT(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function kGt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function QGt(e,t,n){let i=U$(e),o=TT(e,t),r=TT(e,n);return i>=0?o>=r:o<=r}function X_e(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function OGt(e,t,n){let i=TT(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?F.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ni(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Ge.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new WM({arrayBuffer:d,cull:!0,fragmentShaderLoaded:PGt,uniformMapLoaded:MGt(e),pickIdLoaded:UGt})}).catch(X_e(e,c))}return r}function zGt(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 HGt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(P_e(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ni()-t.timestamp)/1e3;zGt(e,a)}}t.touchedFrameNumber=i.frameNumber}var KGt=new F;function JGt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?V.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function jGt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var qGt=new sp;function P_e(e,t,n,i){let o=e.shading??qGt,r=t.pointCloud,s=t.transform??F.IDENTITY;r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,KGt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=JGt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=jGt(e);try{r.update(i)}catch(a){X_e(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function M$(e,t,n,i){let o=OGt(e,t,i);HGt(e,o,n,i)}function $Gt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function M_e(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function eVt(e,t){let n=TT(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function N_e(e,t,n,i,o){return l(n)?n.ready?!0:(M$(e,t,i,o),n.ready):!1}function tVt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=TT(e,n),h=TT(e,t);if(u>=h){for(r=u;r>=h;--r)if(s=c.get(r),a=d[r],N_e(e,s,a,i,o))return s}else for(r=u;r<=h;++r)if(s=c.get(r),a=d[r],N_e(e,s,a,i,o))return s;return t}function nVt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var DZ={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};ST.prototype.update=function(e){if(e.mode===se.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=j.clone(e.time));let t=Math.max(j.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&nVt(this,o,s),DZ.timeSinceLoad=t,DZ.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,h=this._previousInterval,p=this._nextInterval,g=kGt(this);if(!l(g))return;let f=!1,b=U$(this),C=b===0;b!==this._clockMultiplier&&(f=!0,this._clockMultiplier=b),(!l(h)||C)&&(h=g),(!l(p)||f||QGt(this,g,p))&&(p=vGt(this,g)),h=tVt(this,h,g,DZ,e);let E=eVt(this,h);l(E)||(M$(this,h,DZ,e),E=this._lastRenderedFrame),l(E)&&P_e(this,E,DZ,e),l(p)&&M$(this,p,DZ,e);let T=this;l(E)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(E)&&E!==this._lastRenderedFrame&&T.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return T.frameChanged.raiseEvent(T),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=E;let S=this._totalMemoryUsageInBytes,_=this.maximumMemoryUsage*1024*1024;S>_&&M_e(this,$Gt(e));let L=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&L>0&&c.update(e,u,a,this.boundingSphere)};ST.prototype.isDestroyed=function(){return!1};ST.prototype.destroy=function(){return M_e(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),fe(this)};var vZ=ST;function v_e(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function iVt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering.  Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function k_e(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function Q_e(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=k_e(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function O_e(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function qo(e,t){e=Xn(e),t=t??Q.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=rn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=rn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Xn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Xn(t.creditViewport):n,u=t.showRenderLoopErrors??!0,h=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new Ce,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new of,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),Q_e(this);try{let p=t.ellipsoid??ie.default,g=new gM({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=m.UNIT_Z,k_e(this),O_e(this);let f=t.globe;l(f)||(f=new xX(p)),f!==!1&&(g.globe=f,g.globe.shadows=t.terrainShadows??Rn.RECEIVE_ONLY);let b=t.skyBox;!l(b)&&ie.WGS84.equals(p)&&(b=TM.createEarthSkyBox()),b!==!1&&(g.skyBox=b,g.sun=new GM,ie.WGS84.equals(p)&&(g.moon=new TX));let C=t.skyAtmosphere;!l(C)&&ie.WGS84.equals(p)&&(C=new xM(p),C.show=t.globe!==!1&&f.show),C!==!1&&(g.skyAtmosphere=C);let E=t.baseLayer;t.globe!==!1&&E!==!1&&(l(E)||(E=ds.fromWorldImagery()),g.imageryLayers.add(E)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new Lu(i),l(t.sceneMode)&&(t.sceneMode===se.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===se.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let T=this;this._onRenderError=function(B,Y){T._useDefaultRenderLoop=!1,T._renderLoopRunning=!1,T._showRenderLoopErrors&&T.showErrorPanel("An error occurred while rendering.  Rendering has stopped.",void 0,Y)},g.renderError.addEventListener(this._onRenderError);let S=t.dataSources,_=!1;l(S)||(S=new jw,_=!0);let R=new PY({scene:g,dataSourceCollection:S}),L=new Xr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=S,this._destroyDataSourceCollection=_,this._dataSourceDisplay=R,this._eventHelper=L,this._canAnimateUpdateCallback=this._updateCanAnimate,L.add(this._clock.onTick,qo.prototype._onTick,this),L.add(g.morphStart,qo.prototype._clearTrackedObject,this),L.add(S.dataSourceAdded,qo.prototype._onDataSourceAdded,this),L.add(S.dataSourceRemoved,qo.prototype._onDataSourceRemoved,this),L.add(g.postRender,qo.prototype._postRender,this);let W=S.length;for(let B=0;B<W;B++)this._dataSourceAdded(S,S.get(B));this._dataSourceAdded(void 0,R.defaultDataSource),L.add(S.dataSourceAdded,qo.prototype._dataSourceAdded,this),L.add(S.dataSourceRemoved,qo.prototype._dataSourceRemoved,this)}catch(p){throw u&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:',p),p}}Object.defineProperties(qo.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}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&iVt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},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,D$(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===se.COLUMBUS_VIEW||n===se.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===se.COLUMBUS_VIEW||n===se.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(F.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,v_e(this.clock,e))}}});qo.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let d=l(t),u=l(n);if(d||u){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),u){let f=cp(n);d||(typeof n=="string"&&(n=new Error(n)),t=cp({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e}
${t}
${f}`);let b=document.createElement("div");b.className="cesium-widget-errorPanel-message-details collapsed";let C=document.createElement("span");C.className="cesium-widget-errorPanel-more-details",C.appendChild(document.createTextNode("See more...")),b.appendChild(C),b.onclick=function(E){b.removeChild(C),b.appendChild(document.createTextNode(f)),b.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",b.onclick=void 0},a.appendChild(b)}g.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};qo.prototype.isDestroyed=function(){return!1};qo.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),fe(this)};qo.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,Q_e(this),O_e(this),this._scene.requestRender())};qo.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};qo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(qo.prototype._onEntityCollectionChanged,this)};qo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(qo.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};qo.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var oVt=new ue;qo.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??oVt)===gt.DONE&&i.update(t)}};qo.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};qo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};qo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&v_e(this.clock,e)};qo.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,qo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};qo.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};qo.prototype.zoomTo=function(e,t){return z_e(this,e,{offset:t},!1)};qo.prototype.flyTo=function(e,t){return z_e(this,e,t,!0)};function z_e(e,t,n,i){D$(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof ds){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return zE(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof ks||r instanceof vZ||r instanceof Oy){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function FM(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function D$(e){let t=e._zoomPromise;l(t)&&(FM(e),e._completeZoom(!1))}qo.prototype._postRender=function(){rVt(this),sVt(this)};var U_e=new ue;function rVt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===se.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){l(o.offset)||(o.offset=new Xm(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),FM(e)}if(t instanceof vZ){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),u()});return}if(t instanceof ks||t instanceof Oy){s(t.boundingSphere);return}if(t instanceof pe){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),FM(e);return}let a=t,c=[];for(let u=0,h=a.length;u<h;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,U_e);if(p===gt.PENDING)return;p!==gt.FAILED&&c.push(ue.clone(U_e))}if(c.length===0){D$(e);return}e.trackedEntity=void 0;let d=ue.fromBoundingSpheres(c);e._zoomIsFlight?(FM(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(F.IDENTITY),FM(e),e._completeZoom(!0))}var D_e=new ue;function sVt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=K.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,D_e);if(r===gt.PENDING)return;let s=o.mode;(s===se.COLUMBUS_VIEW||s===se.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===se.COLUMBUS_VIEW||s===se.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==gt.FAILED?D_e:void 0;e._entityView=new UY(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var BM=qo;var Kuo=y(x(),1),wM=`uniform sampler2D u_noiseTexture;
uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
in vec2 v_offset;
in vec3 v_maximumSize;
in vec4 v_color;
in float v_slice;
in float v_brightness;

float wrap(float value, float rangeLength) {
    if(value < 0.0) {
        float absValue = abs(value);
        float modValue = mod(absValue, rangeLength);
        return mod(rangeLength - modValue, rangeLength);
    }
    return mod(value, rangeLength);
}

vec3 wrapVec(vec3 value, float rangeLength) {
    return vec3(wrap(value.x, rangeLength),
                wrap(value.y, rangeLength),
                wrap(value.z, rangeLength));
}

vec2 voxelToUV(vec3 voxelIndex) {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    float noiseTextureRows = u_noiseTextureDimensions.y;
    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;

    float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;
    vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,
                                            inverseNoiseTextureRows / textureSliceWidth);
    vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);
    float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);
    float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);

    float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;
    float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;
    return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;
}

// Interpolate a voxel with its neighbor (along the positive X-axis)
vec4 lerpSamplesX(vec3 voxelIndex, float x) {
    vec2 uv0 = voxelToUV(voxelIndex);
    vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));
    vec4 sample0 = texture(u_noiseTexture, uv0);
    vec4 sample1 = texture(u_noiseTexture, uv1);
    return mix(sample0, sample1, x);
}

vec4 sampleNoiseTexture(vec3 position) {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);
    vec3 lerpValue = fract(recenteredPos);
    vec3 voxelIndex = floor(recenteredPos);

    vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);
    vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);
    vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);
    vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);

    vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);
    vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);
    return mix(yLerp0, yLerp1, lerpValue.z);
}

// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).
bool intersectSphere(vec3 origin, vec3 dir, float slice,
                     out vec3 point, out vec3 normal) {
    float A = dot(dir, dir);
    float B = dot(origin, dir);
    float C = dot(origin, origin) - 0.25;
    float discriminant = (B * B) - (A * C);
    if(discriminant < 0.0) {
        return false;
    }
    float root = sqrt(discriminant);
    float t = (-B - root) / A;
    if(t < 0.0) {
        t = (-B + root) / A;
    }
    point = origin + t * dir;

    if(slice >= 0.0) {
        point.z = (slice / 2.0) - 0.5;
        if(length(point) > 0.5) {
            return false;
        }
    }

    normal = normalize(point);
    point -= czm_epsilon2 * normal;
    return true;
}

// Transforms the ray origin and direction into unit sphere space,
// then transforms the result back into the ellipsoid's space.
bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,
                        out vec3 point, out vec3 normal) {
    if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {
        return false;
    }

    vec3 o = (origin - center) / scale;
    vec3 d = dir / scale;
    vec3 p, n;
    bool intersected = intersectSphere(o, d, slice, p, n);
    if(intersected) {
        point = (p * scale) + center;
        normal = n;
    }
    return intersected;
}

// Assume that if phase shift is being called for octave i,
// the frequency is of i - 1. This saves us from doing extra
// division / multiplication operations.
vec2 phaseShift2D(vec2 p, vec2 freq) {
    return (czm_pi / 2.0) * sin(freq.yx * p.yx);
}

vec2 phaseShift3D(vec3 p, vec2 freq) {
    return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));
}

// The cloud texture function derived from Gardner's 1985 paper,
// "Visual Simulation of Clouds."
// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf
const float T0    = 0.6;  // contrast of the texture pattern
const float k     = 0.1;  // computed to produce a maximum value of 1
const float C0    = 0.8;  // coefficient
const float FX0   = 0.6;  // frequency X
const float FY0   = 0.6;  // frequency Y
const int octaves = 5;

float T(vec3 point) {
    vec2 sum = vec2(0.0);
    float Ci = C0;
    vec2 FXY = vec2(FX0, FY0);
    vec2 PXY = vec2(0.0);
    for(int i = 1; i <= octaves; i++) {
        PXY = phaseShift3D(point, FXY);
        Ci *= 0.707;
        FXY *= 2.0;
        vec2 sinTerm = sin(FXY * point.xy + PXY);
        sum += Ci * sinTerm + vec2(T0);
    }
    return k * sum.x * sum.y;
}

const float a = 0.5;  // fraction of surface reflection due to ambient or scattered light,
const float t = 0.4;  // fraction of texture shading
const float s = 0.25; // fraction of specular reflection

float I(float Id, float Is, float It) {
    return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;
}

const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));

vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,
               float brightness) {
    vec3 cloudPoint, cloudNormal;
    if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,
                            cloudPoint, cloudNormal)) {
        return vec4(0.0);
    }

    float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0);  // diffuse reflection
    float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0);   // specular reflection
    float It = T(cloudPoint);                                 // texture function
    float intensity = I(Id, Is, It);
    vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));

    vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);
    float W = noise.x;
    float W2 = noise.y;
    float W3 = noise.z;

    // The dot product between the cloud's normal and the ray's direction is greatest
    // in the center of the ellipsoid's surface. It decreases towards the edge.
    // Thus, it is used to blur the areas leading to the edges of the ellipsoid,
    // so that no harsh lines appear.

    // The first (and biggest) layer of worley noise is then subtracted from this.
    // The final result is scaled up so that the base cloud is not too translucent.
    float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
    float TR = pow(ndDot, 3.0) - W; // translucency
    TR *= 1.3;

    // Subtracting the second and third layers of worley noise is more complicated.
    // If these layers of noise were simply subtracted from the current translucency,
    // the shape derived from the first layer of noise would be completely deleted.
    // The erosion of this noise should thus be constricted to the edges of the cloud.
    // However, because the edges of the ellipsoid were already blurred away, mapping
    // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.
    // The value of (0.5 - ndDot) provides the best compromise.
    float minusDot = 0.5 - ndDot;

    // Even with the previous calculation, subtracting the second layer of wnoise
    // erode too much of the cloud. The addition of it, however, will detailed
    // volume to the cloud. As long as the noise is only added and not subtracted,
    // the results are aesthetically pleasing.

    // The minusDot product is mapped in a way that it is larger at the edges of
    // the ellipsoid, so a subtraction and min operation are used instead of
    // an addition and max one.
    TR -= min(minusDot * W2, 0.0);

    // The third level of worley noise is subtracted from the result, with some
    // modifications. First, a scalar is added to minusDot so that the noise
    // starts affecting the shape farther away from the center of the ellipsoid's
    // surface. Then, it is scaled down so its impact is not too intense.
    TR -= 0.8 * (minusDot + 0.25) * W3;

    // The texture function's shading does not correlate with the shape of the cloud
    // produced by the layers of noise, so an extra shading scalar is calculated.
    // The darkest areas of the cloud are assigned to be where the noise erodes
    // the cloud the most. This is then interpolated based on the translucency
    // and the diffuse shading term of that point in the cloud.
    float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);

    // To avoid values that are too dark, this scalar is increased by a small amount
    // and clamped so it never goes to zero.
    shading = clamp(shading + 0.2, 0.3, 1.0);

    // Finally, the contrast of the cloud's color is increased.
    vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);
    return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;
}

void main() {
#ifdef DEBUG_BILLBOARDS
    out_FragColor = vec4(0.0, 0.5, 0.5, 1.0);
#endif
    // To avoid calculations with high values,
    // we raycast from an arbitrarily smaller space.
    vec2 coordinate = v_maximumSize.xy * v_offset;

    vec3 ellipsoidScale = 0.82 * v_maximumSize;
    vec3 ellipsoidCenter = vec3(0.0);

    float zOffset = max(ellipsoidScale.z - 10.0, 0.0);
    vec3 eye = vec3(0, 0, -10.0 - zOffset);
    vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);
    vec3 rayOrigin = eye;
#ifdef DEBUG_ELLIPSOIDS
    vec3 point, normal;
    if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,
                          point, normal)) {
        out_FragColor = v_brightness * v_color;
    }
#else
#ifndef DEBUG_BILLBOARDS
    vec4 cloud = drawCloud(rayOrigin, rayDir,
                           ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);
    if(cloud.w < 0.01) {
        discard;
    }
    out_FragColor = cloud;
#endif
#endif
}
`;var juo=y(x(),1),YM=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScaleX;
in vec4 positionLowAndScaleY;
in vec4 packedAttribute0;
in vec4 packedAttribute1;
in vec4 color;

out vec2 v_offset;
out vec3 v_maximumSize;
out vec4 v_color;
out float v_slice;
out float v_brightness;

void main() {
    // Unpack attributes.
    vec3 positionHigh = positionHighAndScaleX.xyz;
    vec3 positionLow = positionLowAndScaleY.xyz;
    vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);

    float show = packedAttribute0.x;
    float brightness = packedAttribute0.y;
    vec2 coordinates = packedAttribute0.wz;
    vec3 maximumSize = packedAttribute1.xyz;
    float slice = packedAttribute1.w;

#ifdef INSTANCED
    vec2 dir = direction;
#else
    vec2 dir = coordinates;
#endif

    vec2 offset = dir - vec2(0.5, 0.5);
    vec2 scaledOffset = scale * offset;
    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
    vec4 positionEC = czm_modelViewRelativeToEye * p;
    positionEC.xy += scaledOffset;
    
    positionEC.xyz *= show;
    gl_Position = czm_projection * positionEC;

    v_offset = offset;
    v_maximumSize = maximumSize;
    v_color = color;
    v_slice = slice;
    v_brightness = brightness;
}
`;var $uo=y(x(),1),NM=`uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
uniform vec3 u_noiseOffset;
in vec2 v_position;

float wrap(float value, float rangeLength) {
    if(value < 0.0) {
        float absValue = abs(value);
        float modValue = mod(absValue, rangeLength);
        return mod(rangeLength - modValue, rangeLength);
    }
    return mod(value, rangeLength);
}

vec3 wrapVec(vec3 value, float rangeLength) {
    return vec3(wrap(value.x, rangeLength),
                wrap(value.y, rangeLength),
                wrap(value.z, rangeLength));
}

vec3 random3(vec3 p) {
    float dot1 = dot(p, vec3(127.1, 311.7, 932.8));
    float dot2 = dot(p, vec3(269.5, 183.3, 421.4));
    return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));
}

// Frequency corresponds to cell size.
// The higher the frequency, the smaller the cell size.
vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    vec3 cell = centerCell + offset;
    cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);
    cell += floor(u_noiseOffset / u_noiseDetail);
    vec3 p = offset + random3(cell);
    return p;
}

float worleyNoise(vec3 p, float freq) {
    vec3 centerCell = floor(p * freq);
    vec3 pointInCell = fract(p * freq);
    float shortestDistance = 1000.0;

    for(float z = -1.0; z <= 1.0; z++) {
        for(float y = -1.0; y <= 1.0; y++) {
            for(float x = -1.0; x <= 1.0; x++) {
                vec3 offset = vec3(x, y, z);
                vec3 point = getWorleyCellPoint(centerCell, offset, freq);

                float distance = length(pointInCell - point);
                if(distance < shortestDistance) {
                    shortestDistance = distance;
                }
            }
        }
    }

    return shortestDistance;
}

const float MAX_FBM_ITERATIONS = 10.0;

float worleyFBMNoise(vec3 p, float octaves, float scale) {
    float noise = 0.0;
    float freq = 1.0;
    float persistence = 0.625;
    for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {
        if(i >= octaves) {
            break;
        }

        noise += worleyNoise(p * scale, freq * scale) * persistence;
        persistence *= 0.5;
        freq *= 2.0;
    }
    return noise;
}

void main() {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
    float x = mod(v_position.x, textureSliceWidth);
    float y = mod(v_position.y, textureSliceWidth);
    float sliceRow = floor(v_position.y / textureSliceWidth);
    float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;

    vec3 position = vec3(x, y, z);
    position /= u_noiseDetail;
    float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);
    float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);
    float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);
    out_FragColor = vec4(worley0, worley1, worley2, 1.0);
}
`;var tmo=y(x(),1),XM=`uniform vec3 u_noiseTextureDimensions;
in vec2 position;

out vec2 v_position;

void main()
{
    gl_Position = vec4(position, 0.1, 1.0);

    float textureSliceWidth = u_noiseTextureDimensions.x;
    float noiseTextureRows = u_noiseTextureDimensions.y;
    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
    vec2 transformedPos = (position * 0.5) + vec2(0.5);
    transformedPos *= textureSliceWidth;
    transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;
    transformedPos.y *= noiseTextureRows;
    v_position = transformedPos;
}
`;var imo=y(x(),1),PM=`
in vec2 v_textureCoordinates;

void main()
{
    czm_materialInput materialInput;
    
    materialInput.s = v_textureCoordinates.s;
    materialInput.st = v_textureCoordinates;
    materialInput.str = vec3(v_textureCoordinates, 0.0);
    materialInput.normalEC = vec3(0.0, 0.0, -1.0);
    
    czm_material material = czm_getMaterial(materialInput);

    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
}
`;var amo=y(x(),1);var aVt=new m(1,1,1);function v$(e){e=e??aVt,this._dimensions=m.clone(e)}Object.defineProperties(v$.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var cVt=new m;v$.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,cVt),i=V.randomBetween(-n.x,n.x),o=V.randomBetween(-n.y,n.y),r=V.randomBetween(-n.z,n.z);e.position=m.fromElements(i,o,r,e.position),e.velocity=m.normalize(e.position,e.velocity)};var k$=v$;var dmo=y(x(),1);function rA(){this.featurePropertiesDirty=!1}Object.defineProperties(rA.prototype,{featuresLength:{get:function(){Ae.throwInstantiationError()}},pointsLength:{get:function(){Ae.throwInstantiationError()}},trianglesLength:{get:function(){Ae.throwInstantiationError()}},geometryByteLength:{get:function(){Ae.throwInstantiationError()}},texturesByteLength:{get:function(){Ae.throwInstantiationError()}},batchTableByteLength:{get:function(){Ae.throwInstantiationError()}},innerContents:{get:function(){Ae.throwInstantiationError()}},ready:{get:function(){Ae.throwInstantiationError()}},tileset:{get:function(){Ae.throwInstantiationError()}},tile:{get:function(){Ae.throwInstantiationError()}},url:{get:function(){Ae.throwInstantiationError()}},batchTable:{get:function(){Ae.throwInstantiationError()}},metadata:{get:function(){Ae.throwInstantiationError()},set:function(e){Ae.throwInstantiationError()}},group:{get:function(){Ae.throwInstantiationError()},set:function(e){Ae.throwInstantiationError()}}});rA.prototype.hasProperty=function(e,t){Ae.throwInstantiationError()};rA.prototype.getFeature=function(e){Ae.throwInstantiationError()};rA.prototype.applyDebugSettings=function(e,t){Ae.throwInstantiationError()};rA.prototype.applyStyle=function(e){Ae.throwInstantiationError()};rA.prototype.update=function(e,t){Ae.throwInstantiationError()};rA.prototype.pick=function(e,t,n){Ae.throwInstantiationError()};rA.prototype.isDestroyed=function(){Ae.throwInstantiationError()};rA.prototype.destroy=function(){Ae.throwInstantiationError()};var Q$=rA;var Imo=y(x(),1);var Amo=y(x(),1);function kZ(e,t){this._conditionsExpression=Qe(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,dVt(this,t)}Object.defineProperties(kZ.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function lVt(e,t){this.condition=e,this.expression=t}function dVt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new lVt(new am(a,t),new am(c,t)))}e._runtimeConditions=n}kZ.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};kZ.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};kZ.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],d=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=`    ${a===0?"if":"else if"} (${d})
    {
        return ${u};
    }
`}return r=`${i} ${e}
{
${r}    return ${i}(1.0);
}
`,r};kZ.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];ni(e,o.condition.getVariables()),ni(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var MM=kZ;function Hy(e){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._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,uVt(this,e)}function uVt(e,t){t=Qe(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;let n={};if(l(t.meta)){let i=t.defines,o=t.meta??Q.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new am(o[r],i))}e._meta=n,e._ready=!0}function Rr(e,t){let n=(e._style??Q.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new am(String(t));if(typeof t=="string")return new am(t,n);if(l(t.conditions))return new MM(t,n)}else return;return t}function Gr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Qe(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Hy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=Rr(this,e),this._style.show=Gr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=Rr(this,e),this._style.color=Gr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=Rr(this,e),this._style.pointSize=Gr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Rr(this,e),this._style.pointOutlineColor=Gr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=Rr(this,e),this._style.pointOutlineWidth=Gr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=Rr(this,e),this._style.labelColor=Gr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=Rr(this,e),this._style.labelOutlineColor=Gr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=Rr(this,e),this._style.labelOutlineWidth=Gr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=Rr(this,e),this._style.font=Gr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=Rr(this,e),this._style.labelStyle=Gr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=Rr(this,e),this._style.labelText=Gr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=Rr(this,e),this._style.backgroundColor=Gr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=Rr(this,e),this._style.backgroundPadding=Gr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=Rr(this,e),this._style.backgroundEnabled=Gr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=Rr(this,e),this._style.scaleByDistance=Gr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=Rr(this,e),this._style.translucencyByDistance=Gr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Rr(this,e),this._style.distanceDisplayCondition=Gr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=Rr(this,e),this._style.heightOffset=Gr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=Rr(this,e),this._style.anchorLineEnabled=Gr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=Rr(this,e),this._style.anchorLineColor=Gr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=Rr(this,e),this._style.image=Gr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=Rr(this,e),this._style.disableDepthTestDistance=Gr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=Rr(this,e),this._style.horizontalOrigin=Gr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=Rr(this,e),this._style.verticalOrigin=Gr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=Rr(this,e),this._style.labelHorizontalOrigin=Gr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=Rr(this,e),this._style.labelVerticalOrigin=Gr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Hy.fromUrl=function(e){return Ge.createIfNeeded(e).fetchJson(e).then(function(n){return new Hy(n)})};Hy.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Hy.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Hy.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Hy.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&ni(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&ni(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&ni(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var IT=Hy;var tho=y(x(),1);var Gmo=y(x(),1);function UM(e){e=e??Q.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new sb({comparator:UM.comparator})}UM.prototype.addSubtree=function(e){let t=new mVt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};UM.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};UM.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function mVt(e,t){this.subtree=e,this.stamp=t}var DM=UM;function vM(e){e=e??Q.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=m.ZERO.clone(),paddingAfter:c=m.ZERO.clone(),globalTransform:d=F.IDENTITY.clone(),shapeTransform:u=F.IDENTITY.clone(),minBounds:h,maxBounds:p,minimumValues:g,maximumValues:f,maximumTileCount:b}=e;this._shapeTransform=u,this._globalTransform=d,this._shape=r,this._minBounds=h,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===ac.ELLIPSOID?nA.Z_UP:nA.Y_UP,this._minimumValues=g,this._maximumValues=f,this._maximumTileCount=b,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new DM}Object.defineProperties(vM.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});vM.fromUrl=async function(e){let t=Ge.createIfNeeded(e),n=await t.fetchJson();fVt(n);let i=CVt(n,t);await i.load();let{root:o}=n,r=Ti(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new KC({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,d=EVt(s,c);Object.assign(d,pVt(o)),l(o.transform)?d.globalTransform=F.unpack(o.transform):d.globalTransform=F.clone(F.IDENTITY),d.dimensions=m.unpack(a.dimensions),d.maximumTileCount=hVt(s),l(a.padding)&&(d.paddingBefore=m.unpack(a.padding.before),d.paddingAfter=m.unpack(a.padding.after));let u=new vM(d),h=new bp(t,o,i.schema);return u._implicitTileset=h,u._availableLevels=h.availableLevels,Li.unload(i),u};function hVt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(um.TILESET_TILE_COUNT)}function fVt(e){let t=e.root;if(!l(t.content))throw new he("Root must have content");if(!Ti(t.content,"3DTILES_content_voxels"))throw new he("Root tile content must have 3DTILES_content_voxels extension");if(!Ti(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new he("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!Ti(e,"3DTILES_metadata"))throw new he("Tileset must have a metadata schema")}function pVt(e){let t=e.boundingVolume;if(l(t.box))return yVt(t.box);if(l(t.region))return AVt(t.region);if(Ti(t,"3DTILES_bounding_volume_cylinder"))return xVt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new he("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function AVt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(ie.WGS84.radii),c=new m(t,n,r),d=new m(i,o,s);return{shape:ac.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a}}var gVt=new m,bVt=new $;function yVt(e){let t=tn.unpack(e),n=$.getScale(t.halfAxes,gVt),i=$.getRotation(t.halfAxes,bVt);return{shape:ac.BOX,minBounds:m.negate(n,new m),maxBounds:m.clone(n),shapeTransform:F.fromRotationTranslation(i,t.center)}}function xVt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-V.PI,maxAngle:r=V.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],d=.5*i+s[2],u=F.fromTranslationQuaternionRotationScale(m.unpack(s),Me.unpack(a),m.ONE);return{shape:ac.CYLINDER,minBounds:m.fromElements(t,o,c),maxBounds:m.fromElements(n,r,d),shapeTransform:u}}function CVt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Li.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Li.getSchemaLoader({schema:i})}function EVt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([g,f])=>{let{type:b,componentType:C}=f,E=o?.properties[g].min,T=o?.properties[g].max,S=Et.getComponentCount(b),_=H_e(E,S),R=H_e(T,S);return{id:g,type:b,componentType:C,minValue:_,maxValue:R}}),a=s.map(g=>g.id),c=s.map(g=>g.type),d=s.map(g=>g.componentType),u=s.map(g=>g.minValue),h=s.map(g=>g.maxValue),p=u.some(l);return{className:t,names:a,types:c,componentTypes:d,minimumValues:p?u:void 0,maximumValues:p?h:void 0}}function H_e(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function TVt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=Sg(a);return o=await KA.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}vM.prototype.requestData=async function(e){e=e??Q.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:o=0,keyframe:r=0}=e;if(r!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new yp({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),c=a.isSubtreeRoot()&&a.level>0,d=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),h=await TVt(this,d);if(!(c?h.childSubtreeIsAvailableAtCoordinates:h.tileIsAvailableAtCoordinates).call(h,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:f,baseResource:b}=s,C=f[0].getDerivedResource({templateValues:a.getTemplateValues()}),E=b.getDerivedResource({url:C.url});return gT.fromGltf(E)};var O$=vM;var rho=y(x(),1);function z$(e){e=e??1,this._radius=e??1}Object.defineProperties(z$.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});z$.prototype.emit=function(e){let t=V.randomBetween(0,V.TWO_PI),n=V.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=m.fromElements(i,o,r,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var kM=z$;var Kho=y(x(),1);var aho=y(x(),1),H$={CUMULUS:0};H$.validate=function(e){return e===H$.CUMULUS};var QZ=Object.freeze(H$);var fho=y(x(),1);function Lf(e,t){if(e=e??Q.EMPTY_OBJECT,this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new M(this._maximumSize.x,this._maximumSize.y);else{this._scale=M.clone(e.scale??new M(20,12));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=D.clone(e.color??D.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var SVt=Lf.SHOW_INDEX=0,IVt=Lf.POSITION_INDEX=1,_Vt=Lf.SCALE_INDEX=2,ZVt=Lf.MAXIMUM_SIZE_INDEX=3,RVt=Lf.SLICE_INDEX=4,GVt=Lf.BRIGHTNESS_INDEX=5,VVt=Lf.COLOR_INDEX=6;Lf.NUMBER_OF_PROPERTIES=7;function _T(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Lf.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,_T(this,SVt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),_T(this,IVt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;M.equals(t,e)||(M.clone(e,t),_T(this,_Vt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),_T(this,ZVt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;D.equals(t,e)||(D.clone(e,t),_T(this,VVt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,_T(this,RVt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,_T(this,GVt))}}});Lf.prototype._destroy=function(){this._cloudCollection=void 0};var Pu=Lf;var Mu,xO=new m,LVt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},WVt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},FVt=Pu.SHOW_INDEX,BVt=Pu.POSITION_INDEX,wVt=Pu.SCALE_INDEX,YVt=Pu.MAXIMUM_SIZE_INDEX,NVt=Pu.SLICE_INDEX,XVt=Pu.BRIGHTNESS_INDEX,PVt=Pu.NUMBER_OF_PROPERTIES,MVt=Pu.COLOR_INDEX;function Wf(e){e=e??Q.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(PVt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=m.clone(e.noiseOffset??m.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:K_e(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function K_e(e){return function(){return xO.x=e._textureSliceWidth,xO.y=e._noiseTextureRows,xO.z=1/e._noiseTextureRows,xO}}Object.defineProperties(Wf.prototype,{length:{get:function(){return J$(this),this._clouds.length}}});function J_e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Wf.prototype.add=function(e){e=e??Q.EMPTY_OBJECT;let t=e.cloudType??QZ.CUMULUS,n;return t===QZ.CUMULUS&&(n=new Pu(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Wf.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Wf.prototype.removeAll=function(){J_e(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function J$(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Wf.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Wf.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Wf.prototype.get=function(e){return J$(this),this._clouds[e]};var UVt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),DVt=new Uint16Array([0,1,2,0,2,3]);function vVt(e){let t=mt.createVertexBuffer({context:e,typedArray:UVt,usage:Xe.STATIC_DRAW}),n=mt.createIndexBuffer({context:e,typedArray:DVt,usage:Xe.STATIC_DRAW,indexDatatype:Pe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:J.FLOAT}];return new si({context:e,attributes:i,indexBuffer:n})}var j$;function kVt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=mt.createIndexBuffer({context:e,typedArray:o,usage:Xe.STATIC_DRAW,indexDatatype:Pe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function QVt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=mt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Xe.STATIC_DRAW,indexDatatype:Pe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function OVt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=mt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Xe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function zVt(e,t,n){let i=[{index:Mu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Xe.STATIC_DRAW},{index:Mu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Xe.STATIC_DRAW},{index:Mu.packedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Xe.STATIC_DRAW},{index:Mu.packedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Xe.STATIC_DRAW},{index:Mu.color,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,usage:Xe.STATIC_DRAW}];n&&i.push({index:Mu.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:OVt(e)});let o=n?t:4*t;return new TA(e,i,o,n)}var K$=new ti;function j_e(e,t,n,i){let o,r=n[Mu.positionHighAndScaleX],s=n[Mu.positionLowAndScaleY],a=i.position;ti.fromCartesian(a,K$);let c=i.scale,d=K$.high,u=K$.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,c.x),r(o+1,d.x,d.y,d.z,c.x),r(o+2,d.x,d.y,d.z,c.x),r(o+3,d.x,d.y,d.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function q_e(e,t,n,i){let o,r=n[Mu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function $_e(e,t,n,i){let o,r=n[Mu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function eZe(e,t,n,i){let o,r=n[Mu.color],s=i.color,a=D.floatToByte(s.red),c=D.floatToByte(s.green),d=D.floatToByte(s.blue),u=D.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,d,u)):(o=i._index*4,r(o+0,a,c,d,u),r(o+1,a,c,d,u),r(o+2,a,c,d,u),r(o+3,a,c,d,u))}function HVt(e,t,n,i){j_e(e,t,n,i),q_e(e,t,n,i),$_e(e,t,n,i),eZe(e,t,n,i)}function KVt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=vVt(a),o._spNoise=cn.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new Wt({context:a,width:r*r/s,height:r*s,pixelDatatype:ve.UNSIGNED_BYTE,pixelFormat:je.RGBA,sampler:new Ht({wrapS:bn.REPEAT,wrapT:bn.REPEAT,minificationFilter:zt.NEAREST,magnificationFilter:ui.NEAREST})});let u=new ll({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:K_e(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function JVt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=zVt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];HVt(e,t,s,c)}n._vaf.commit(j$(i))}}var jVt=[];function qVt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=jVt;d.length=0,(c[BVt]||c[wVt])&&d.push(j_e),(c[FVt]||c[XVt])&&d.push(q_e),(c[YVt]||c[NVt])&&d.push($_e),c[MVt]&&d.push(eZe);let u=d.length,h=i._vaf.writers,p,g,f;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._vaf.commit(j$(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function $Vt(e,t,n,i){let o=t.context,r=e,s=new ze({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new ze({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=cn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Mu}),r._rs=ke.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!1,blending:fn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function e1t(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let d=0;d<c;d++){let u=s[d];l(u)||(u=s[d]=new nt),u.pass=Ve.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}Wf.prototype.update=function(e){if(J$(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&KVt(this,e,XM,NM),this._instanced=e.context.instancedArrays,Mu=this._instanced?WVt:LVt,j$=this._instanced?QVt:kVt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?JVt(this,e):r>0&&qVt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&$Vt(this,e,YM,wM),e1t(this,e))};Wf.prototype.isDestroyed=function(){return!1};Wf.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),J_e(this._clouds),fe(this)};var q$=Wf;var $ho=y(x(),1);var t1t=V.toRadians(30);function $$(e){this._angle=e??t1t}Object.defineProperties($$.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});$$.prototype.emit=function(e){let t=Math.tan(this._angle),n=V.randomBetween(0,V.TWO_PI),i=V.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=m.fromElements(o,r,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var eee=$$;var ofo=y(x(),1);function QM(e){e=e??Q.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); }
`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); }
`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); }
`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); }
`;break;case"vec4":r=`vec4 getColor() { return ${o}; }
`;break}let s=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;
${n?"":`in ${i} ${t};
`}out ${i} ${o};
void main()
{
vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
${n?`${o} = czm_batchTable_${t}(batchId);
`:`${o} = ${t};
`}gl_Position = czm_modelViewProjectionRelativeToEye * p;
}`,a=`in ${i} ${o};
${r}
void main()
{
out_FragColor = getColor();
}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=Co.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(QM.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}}});QM.prototype.getFragmentShaderSource=Co.prototype.getFragmentShaderSource;QM.prototype.isTranslucent=Co.prototype.isTranslucent;QM.prototype.getRenderState=Co.prototype.getRenderState;var tee=QM;var gfo=y(x(),1);function CO(e){e=e??Q.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}CO.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Bt({geometry:new Kg({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:Is.VERTEX_FORMAT,colors:[D.RED,D.RED],arcType:ln.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new Bt({geometry:new Kg({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:Is.VERTEX_FORMAT,colors:[D.GREEN,D.GREEN],arcType:ln.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new Bt({geometry:new Kg({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:Is.VERTEX_FORMAT,colors:[D.BLUE,D.BLUE],arcType:ln.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new Nn({geometryInstances:[t,n,i],appearance:new Is,asynchronous:!1})}this._primitive.update(e)}};CO.prototype.isDestroyed=function(){return!1};CO.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var OM=CO;var Cfo=y(x(),1);function n1t(e){this.direction=m.clone(e.direction),this.color=D.clone(e.color??D.WHITE),this.intensity=e.intensity??1}var nee=n1t;var Bfo=y(x(),1);var Tfo=y(x(),1),zM=`in vec3 v_positionMC;
in vec3 v_positionEC;
in vec2 v_st;

void main()
{
    czm_materialInput materialInput;

    vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    materialInput.s = v_st.s;
    materialInput.st = v_st;
    materialInput.str = vec3(v_st, 0.0);

    // Convert tangent space material normal to eye space
    materialInput.normalEC = normalEC;
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);

    // Convert view vector to world space
    vec3 positionToEyeEC = -v_positionEC;
    materialInput.positionToEyeEC = positionToEyeEC;

    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var Ifo=y(x(),1),HM=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec2 st;
in float batchId;

out vec3 v_positionMC;
out vec3 v_positionEC;
out vec2 v_st;

void main()
{
    vec4 p = czm_computePosition();

    v_positionMC = position3DHigh + position3DLow;           // position in model coordinates
    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;     // position in eye coordinates
    v_st = st;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function ZT(e){e=e??Q.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:ho.fromType(ho.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??HM,this._fragmentShaderSource=e.fragmentShaderSource??zM,this._renderState=Co.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(ZT.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 ZT.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});ZT.VERTEX_FORMAT=we.POSITION_AND_ST;ZT.prototype.getFragmentShaderSource=Co.prototype.getFragmentShaderSource;ZT.prototype.isTranslucent=Co.prototype.isTranslucent;ZT.prototype.getRenderState=Co.prototype.getRenderState;var iee=ZT;var Ufo=y(x(),1);function Fd(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??Fd.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??Fd.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??Fd.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??Fd.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??Fd.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new Ce,this._nominalFrameRate=new Ce,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){i1t(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){o1t(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Fd.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Fd.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Fd({scene:e})),e._frameRateMonitor};Object.defineProperties(Fd.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}}});Fd.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Fd.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Fd.prototype.isDestroyed=function(){return!1};Fd.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),fe(this)};function i1t(e,t){if(e._pauseCount>0)return;let n=Ni();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/ai.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/ai.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/ai.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?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 o1t(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var KM=Fd;var tpo=y(x(),1);var tZe=y(y6(),1);function oee(){this._image=new Image}oee.prototype.isReady=function(){return!0};oee.prototype.shouldDiscardImage=function(e){return e===this._image};function RT(e){e=e??Q.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-V.PI,-V.PI,V.PI,V.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new bt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new oee),this._errorEvent=new Ce}Object.defineProperties(RT.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});RT.fromMetadata=function(e,t){if(!e.imageryPresent)throw new he(`The server ${e.url} doesn't have imagery`);let n=new RT(t);return n._metadata=e,n};RT.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};RT.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=cb.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new pr({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=r1t(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){iX(r.key,d);let u=new Uint8Array(d),h,p=r.protoImagery;if((!l(p)||!p)&&(h=s1t(u)),!l(h)&&(!l(p)||p)){let g=a1t(u);h=g.imageType,u=g.imageData}return!l(h)||!l(u)?o:OA({uint8Array:u,format:h,flipY:!0})})};RT.prototype.pickFeatures=function(e,t,n,i,o){};function r1t(e,t,n,i,o,r){let s=cb.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function s1t(e){let 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";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function a1t(e){let t=tZe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new he("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var ree=RT;var cpo=y(x(),1);var c1t=new D(1,1,1,.4),l1t=new D(0,1,0,.05),d1t=new D(0,.5,0,.2);function GT(e){e=e??Q.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Qi({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??c1t,this._glowColor=e.glowColor??l1t,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??d1t,this._errorEvent=new Ce,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(GT.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}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});GT.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};GT.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};GT.prototype.getTileCredits=function(e,t,n){};GT.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};GT.prototype.pickFeatures=function(e,t,n,i,o){};var see=GT;var UAo=y(x(),1);var hAo=y(x(),1);var Jpo=y(x(),1);var bpo=y(x(),1);function Ff(){}Ff._maxDecodingConcurrency=Math.max(rn.hardwareConcurrency-1,1);Ff._decodeTaskProcessor=new Jn("decodeI3S",Ff._maxDecodingConcurrency);Ff._promise=void 0;async function u1t(){if(await Ff._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Ff._decodeTaskProcessor;throw new he("I3S decoder could not be initialized.")}Ff.decode=async function(e,t,n,i,o){return l(Ff._promise)||(Ff._promise=u1t()),Ff._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,d=0,u=0;l(s.obb)?(c=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let h=$.fromRotationX(-V.PI_OVER_TWO),p=new $;$.multiply(h,a,p);let g=pe.fromDegrees(c,d,u),f=ie.WGS84.cartographicToCartesian(g),b={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ie.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(b)})};var JM=Ff;var Epo=y(x(),1);function aee(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(aee.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});aee.prototype.load=async function(){return this._data=await Bf.loadJson(this._resource),this._data};var jM=aee;var _po=y(x(),1);function Cb(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(Cb.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function EO(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function m1t(e){return e==="String"?1:EO(e)}async function h1t(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}Cb.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=h1t(this).catch(function(e){console.error(e)}),this._loadPromise)};Cb.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};Cb.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};Cb.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(c+=u.value),t=u.offset}this._values[o].push(c)}}}};Cb.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=EO(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=EO(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Cb.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=m1t(i.valueType)}if(e.byteLength<t)throw new he(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Cb.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new he(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=EO(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new he(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new he(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new he(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var qM=Cb;var Fpo=y(x(),1);function $M(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties($M.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});$M.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var f1t=new m,p1t=new m,A1t=new m,g1t=new m,b1t=new m;function cee(e,t,n,i){let o=m.subtract(i,n,f1t),r=m.cross(o,m.subtract(e,n,p1t),g1t),s=m.cross(o,m.subtract(t,n,A1t),b1t);return m.dot(r,s)>=0}var y1t=new m,x1t=new m,C1t=new m,E1t=new m,T1t=new m,S1t=new m,I1t=new m,_1t=new m,Z1t=new m,R1t=new m;$M.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,h;l(u)?h=u.length:h=d.length/3;for(let p=0;p<h;p++){let g,f,b;l(u)?(g=u[p],f=u[p+1],b=u[p+2]):(g=p*3,f=p*3+1,b=p*3+2);let C=m.fromElements(d[g*3],d[g*3+1],d[g*3+2],y1t),E=m.fromElements(d[f*3],d[f*3+1],d[f*3+2],x1t),T=new m(d[b*3],d[b*3+1],d[b*3+2],C1t);if(!cee(i,C,E,T)||!cee(i,E,C,T)||!cee(i,T,C,E))continue;let S=m.subtract(E,C,E1t),_=m.subtract(T,C,T1t),R=m.cross(S,_,S1t);if(m.magnitude(R)===0)continue;let L=m.normalize(R,I1t),W=m.subtract(i,C,_1t),B=Math.abs(m.dot(W,L));if(B<o){o=B,r=p;let Y=m.magnitudeSquared(m.subtract(i,C,W)),N=m.magnitudeSquared(m.subtract(i,E,Z1t)),A=m.magnitudeSquared(m.subtract(i,T,R1t));Y<N&&Y<A?(a=g,c=C,s=Y):N<A?(a=f,c=E,s=N):(a=b,c=T,s=A)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function nZe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(OE(e[i])):t.push(e[i]);return t}$M.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let S=this._parent._data.mesh.material.definition;if(S>=0&&S<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[S],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let _="0";if(l(this._layer._data.textureSetDefinitions))for(let R=0;R<this._layer._data.textureSetDefinitions.length;R++){let L=this._layer._data.textureSetDefinitions[R];for(let W=0;W<L.formats.length;W++){let B=L.formats[W];if(B.format==="jpg"){_=B.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(h=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${_}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=nZe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=nZe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],f=[];d&&(p=[{sampler:0,source:0}],g=[{uri:h}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let b=[],C=n.length;for(let T=0;T<C;T++){let S=n[T].primitives,_=S.length;for(let R=0;R<_;R++){let L=S[R];if(l(L.material)){for(;L.material>=b.length;){let B=Qe(c,!0);b.push(B)}let W=b[L.material];l(L.extra)&&L.extra.isTransparent?l(W.alphaMode)||(W.alphaMode="BLEND"):W.alphaMode==="BLEND"&&(W.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:b,textures:p,images:g,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var OZ=$M;function rl(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(rl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});rl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Rm(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Bf.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function iZe(e,t){let n=new qM(e,t);return e._fields[t.name]=n,n.load()}rl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(iZe(this,i))}return Promise.all(t)};rl.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return iZe(this,o)}return Promise.resolve()};rl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};rl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};rl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new rl(e,i.href??i,!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};rl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new OZ(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new OZ(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};rl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new jM(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};rl.prototype._clearGeometryData=function(){this._geometryData=[]};rl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=pe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=pe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let E=0;E<this._dataProvider._geoidDataList.length;E++){let T=this._dataProvider._geoidDataList[E],S=T.projection.project(n);if(S.x>T.nativeExtent.west&&S.x<T.nativeExtent.east&&S.y>T.nativeExtent.south&&S.y<T.nativeExtent.north){n.height+=W1t(S.x,S.y,T);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ie.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ie.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let E=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/E}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let E=this._data.lodThreshold;s=r/E}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let E=0;E<this._data.lodSelection.length;E++)this._data.lodSelection[E].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[E].maxError);s===1/0&&(s=1e5);let a=s*16,c=new uc(0,0,0),d=Tt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new Me(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=$.fromQuaternion(d),h=$.inverse(u,new $),p=new F(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),g=F.inverse(p,new F),f=F.clone(p);l(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let b=[];for(let E=0;E<this._children.length;E++)b.push(this._children[E]._create3DTileDefinition());return{children:b,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};rl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};rl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await JM.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function G1t(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function V1t(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function oZe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await G1t(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!V1t(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}rl.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=oZe(this,t);e.push(n)}return Promise.all(e)};Rm.prototype._hookedRequestContent=Rm.prototype.requestContent;Rm.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Ge({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{oZe(e._i3sNode,n)})),e._isLoading=!1,t})}};function L1t(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function TO(e,t,n,i){let o=e+t*n;return i[o]}function W1t(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=TO(s,a,n.width,n.buffer),h=TO(c,a,n.width,n.buffer),p=TO(s,d,n.width,n.buffer),g=TO(c,d,n.width,n.buffer),f=L1t(o,r,u,h,p,g);return f=f*n.scale+n.offset,f}Object.defineProperties(Rm.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var zZ=rl;var tAo=y(x(),1);function SO(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(SO.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function lee(e,t){let n=[];for(let i=0;i<e.length;i++){let o=D.byteToFloat(e[i]);i<3?n.push(OE(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function HZ(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=lee(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=lee(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=lee(a.color,a.transparency)))}break}}return n}function F1t(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=HZ(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let h=0;h<d.length;h++){let p=d[h];h===d.length-1?u[p]=s:(l(u[p])||(u[p]={}),u=u[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=HZ(o.symbol,t)}return n}}function B1t(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=r.classMaxValue??r.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(HZ(r.symbol,t)))}return i.symbols.push(void 0),i}}SO.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=HZ(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=HZ(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=F1t(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=HZ(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=B1t(i,n))}};function rZe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?rZe(s,t,n,i):s}}function w1t(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function Y1t(e,t,n){let i=t[n],o=w1t(e.ranges,i);return e.symbols[o]}SO.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>rZe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>Y1t(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var eU=SO;function Bd(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Ge({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Bd.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Bd.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new he(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new eU(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Bd.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let d=0;d<c.length;d++)s.push(c[d])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};Bd.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Bd.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new zZ(this,t,!0)}else this._rootNode=new zZ(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Bd.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};Bd._fetchJson=function(e){return e.fetchJson()};Bd.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Bd._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Bd.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=de.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=de.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Bd.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Qe(e):{},e.outlineColor=D.fromCartesian4(ce.fromArray(o))),this._tileset=await ks.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};Bd.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Bd.prototype.filterByAttributes=function(e){this._filters=l(e)?Qe(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var VT=Bd;var bAo=y(x(),1);function IO(e,t){this._dataProvider=e,this._resource=new Ge({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(IO.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});IO.prototype.load=async function(){return this._data=await Bf.loadJson(this._resource),this._data};IO.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var tU=IO;var SAo=y(x(),1);function nU(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(nU.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});nU._fromData=async function(e,t,n,i){let o=new nU(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let d=nU._fromData(e,t,r[c],o);s.push(d)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let d=a[c];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Ge({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Bf.loadJson(o._resource),c=new VT(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var iU=nU;var cZe=y(sZe(),1);function js(e){e=e??Q.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??Q.EMPTY_OBJECT,this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(js.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});js.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return fe(this)};js.prototype.isDestroyed=function(){return!1};js.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};js.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};js.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};js.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function N1t(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function aZe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=N1t(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=iU._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new tU(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=de.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new VT(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}js.fromUrl=async function(e,t){t=t??Q.EMPTY_OBJECT;let n=Ge.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await js.loadJson(n),o=new js(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=aZe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await aZe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};js._fetchJson=function(e){return e.fetchJson()};js.loadJson=async function(e){let t=await js._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new he(t.error)}return t};js.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new he(`Failed to load binary: ${e.url}`);return t};js.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var X1t=new M;function P1t(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=pe.fromRadians(t.west,t.north),a=pe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let h=c.x;h<=d.x;h++)for(let p=c.y;p<=d.y;p++){let g=M.fromElements(h,p,X1t),f=g.toString();if(!o.hasOwnProperty(f)){let b={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=b,i.push(b)}}let u=[];for(let h=0;h<i.length;++h){let p=i[h],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(g)}return Promise.all(u).then(function(h){let p=[];for(let g=0;g<h.length;g++){let f={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},b=h[g],C="Geographic";n._projection instanceof hi&&(C="WebMercator");let E={projectionType:C,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:b._height,width:b._width,scale:b._structure.heightScale,offset:b._structure.heightOffset};if(b._encoding===vm.LERC){let T=cZe.default.decode(b._buffer);E.buffer=T.pixels[0]}else E.buffer=b._buffer;p.push(E)}return p})}async function M1t(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await P1t(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}js.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=M1t(this),this._geoidDataPromise)};js.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?de.union(e,n,e):e=de.clone(n)}this._extent=e};js.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};js.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};js.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Bf=js;var JAo=y(x(),1);var oU={};oU.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await ma.getExports(e,t);if(i.length>0&&i.every(c=>c.status===ma.ExportStatus.Invalid))throw new he(`All exports for this iModel are Invalid: ${e}`);let o=i.find(c=>c.status===ma.ExportStatus.Complete);if(!l(o))return;let r=new URL(o._links.mesh.href);r.pathname=`${r.pathname}/tileset.json`;let s=r.toString(),a=new Ge({url:s});return ks.fromUrl(a,n)};oU.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:o}){if(!l(n)||!l(i)){let c=await ma.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![ma.RealityDataType.Cesium3DTiles,ma.RealityDataType.PNTS,ma.RealityDataType.RealityMesh3DTiles,ma.RealityDataType.Terrain3DTiles].includes(n))throw new he(`Reality data type is not a mesh type: ${n}`);let s=await ma.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...o};return ks.fromUrl(s,a)};oU.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await ma.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ma.RealityDataType.KML,ma.RealityDataType.GeoJSON].includes(n))throw new he(`Reality data type is not a data source type: ${n}`);let r=await ma.getRealityDataURL(e,t,i);return n===ma.RealityDataType.GeoJSON?hy.load(r):VE.load(r)};oU.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,o=`${ma.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new Ge({url:o,headers:{Authorization:ma._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return hy.load(r)};var dee=oU;var $Ao=y(x(),1);function lZe(){}Object.defineProperties(lZe.prototype,{color:{get:Ae.throwInstantiationError},intensity:{get:Ae.throwInstantiationError}});var uee=lZe;var sgo=y(x(),1);var U1t=/\/$/,dZe=new bt('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function KZ(e){e=e??Q.EMPTY_OBJECT;let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ge.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();U1t.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new bt(c))):c=dZe,this._resource=i,this._imageryProvider=new Ds({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(KZ.prototype,{url:{get:function(){return this._imageryProvider.url}},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}}});KZ.prototype.getTileCredits=function(e,t,n){};KZ.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};KZ.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};KZ._defaultCredit=dZe;var mee=KZ;var cgo=y(x(),1);function hee(e){}hee.prototype.isReady=function(){return!0};hee.prototype.shouldDiscardImage=function(e){return!1};var fee=hee;var ggo=y(x(),1);var D1t=new bt("MapQuest, Open Street Map and contributors, CC-BY-SA");function ZO(e){e=e??Q.EMPTY_OBJECT;let t=Ge.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Vs({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(de.southwest(a),r),d=n.positionToTileXY(de.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),h=e.credit??D1t;typeof h=="string"&&(h=new bt(h)),Ds.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(ZO.prototype=Object.create(Ds.prototype),ZO.prototype.constructor=ZO);var Eb=ZO;var Sgo=y(x(),1);var v1t=new M(1,1);function pee(e){e=e??Q.EMPTY_OBJECT,this.mass=e.mass??1,this.position=m.clone(e.position??m.ZERO),this.velocity=m.clone(e.velocity??m.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=D.clone(e.startColor??D.WHITE),this.endColor=D.clone(e.endColor??D.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=M.clone(e.imageSize??v1t),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(pee.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var uZe=new m;pee.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,uZe),m.add(this.position,uZe,this.position),l(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};var JZ=pee;var Zgo=y(x(),1);function mZe(e){e=e??Q.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(mZe.prototype,{complete:{get:function(){return this._complete}}});var Aee=mZe;var Vgo=y(x(),1);function hZe(e){}hZe.prototype.emit=function(e){Ae.throwInstantiationError()};var gee=hZe;var Qgo=y(x(),1);var fZe=new M(1,1);function rU(e){e=e??Q.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new kM(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._emitterModelMatrix=F.clone(e.emitterModelMatrix??F.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=D.clone(e.color??e.startColor??D.WHITE),this._endColor=D.clone(e.color??e.endColor??D.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=M.clone(e.imageSize??e.minimumImageSize??fZe),this._maximumImageSize=M.clone(e.imageSize??e.maximumImageSize??fZe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=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 Ce,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(rU.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){D.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){D.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function k1t(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,d=e._particlePool,u=Math.max(a-c.length-d.length,0);for(let h=0;h<u;++h){let p=new JZ;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function Q1t(e){let t=e._particlePool.pop();return l(t)||(t=new JZ),t}function O1t(e,t){e._particlePool.push(t)}function z1t(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let d=n[c];i.remove(d._billboard)}n.length=a}function H1t(e){l(e._billboard)&&(e._billboard.show=!1)}function pZe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=V.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=V.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=V.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=V.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new D(i,o,r,s),n.scale=V.lerp(t.startScale,t.endScale,t.normalizedAge)}function K1t(e,t){t.startColor=D.clone(e._startColor,t.startColor),t.endColor=D.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=V.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=V.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=V.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=V.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=V.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function J1t(e,t){if(e._isComplete)return 0;t=V.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=V.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var RO=new m;rU.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new ru),this._updateParticlePool&&(k1t(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=j.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?pZe(this,s):(H1t(s),O1t(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=J1t(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=Q1t(this),this._emitter.emit(s),m.add(s.position,s.velocity,RO),F.multiplyByPoint(d,RO,RO),s.position=F.multiplyByPoint(d,s.position,s.position),m.subtract(RO,s.position,s.velocity),m.normalize(s.velocity,s.velocity),K1t(this,s),pZe(this,s)}if(this._billboardCollection.update(e),this._previousTime=j.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=V.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&z1t(this)};rU.prototype.isDestroyed=function(){return!1};rU.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),fe(this)};var bee=rU;var Hgo=y(x(),1);function Uu(){Ae.throwInstantiationError()}Uu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Uu.prototype,{quadtree:{get:Ae.throwInstantiationError,set:Ae.throwInstantiationError},tilingScheme:{get:Ae.throwInstantiationError},errorEvent:{get:Ae.throwInstantiationError}});Uu.prototype.update=Ae.throwInstantiationError;Uu.prototype.beginUpdate=Ae.throwInstantiationError;Uu.prototype.endUpdate=Ae.throwInstantiationError;Uu.prototype.getLevelMaximumGeometricError=Ae.throwInstantiationError;Uu.prototype.loadTile=Ae.throwInstantiationError;Uu.prototype.computeTileVisibility=Ae.throwInstantiationError;Uu.prototype.showTileThisFrame=Ae.throwInstantiationError;Uu.prototype.computeDistanceToTile=Ae.throwInstantiationError;Uu.prototype.isDestroyed=Ae.throwInstantiationError;Uu.prototype.destroy=Ae.throwInstantiationError;var yee=Uu;var qgo=y(x(),1);function xee(e){e=e??1,this._radius=e??1}Object.defineProperties(xee.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});xee.prototype.emit=function(e){let t=V.randomBetween(0,V.TWO_PI),n=V.randomBetween(0,V.PI),i=V.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(o,r,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var Cee=xee;var tbo=y(x(),1);function sU(){}sU.prototype.evaluate=function(e,t){Ae.throwInstantiationError()};sU.prototype.evaluateColor=function(e,t){Ae.throwInstantiationError()};sU.prototype.getShaderFunction=function(e,t,n,i){Ae.throwInstantiationError()};sU.prototype.getVariables=function(){Ae.throwInstantiationError()};var Eee=sU;var sbo=y(x(),1);function jZ(e){this._ready=!1,this._provider=void 0,this._errorEvent=new Ce,this._readyEvent=new Ce,q1t(this,e)}Object.defineProperties(jZ.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});jZ.fromWorldTerrain=function(e){return new jZ(kE(e))};jZ.fromWorldBathymetry=function(e){return new jZ(nX(e))};function j1t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function q1t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){j1t(e._errorEvent,i)}}var aU=jZ;var lbo=y(x(),1);function qZ(){}qZ.prototype.boundingVolume=void 0;qZ.prototype.boundingSphere=void 0;qZ.prototype.distanceToCamera=function(e){Ae.throwInstantiationError()};qZ.prototype.intersectPlane=function(e){Ae.throwInstantiationError()};qZ.prototype.createDebugVolume=function(e){Ae.throwInstantiationError()};var Tee=qZ;var Abo=y(x(),1);function cU(e){e=e??Q.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Qi({ellipsoid:e.ellipsoid}),this._color=e.color??D.YELLOW,this._errorEvent=new Ce,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(cU.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}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});cU.prototype.getTileCredits=function(e,t,n){};cU.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};cU.prototype.pickFeatures=function(e,t,n,i,o){};var lU=cU;var ybo=y(x(),1);function See(e){Ae.throwInstantiationError()}See.prototype.isReady=Ae.throwInstantiationError;See.prototype.shouldDiscardImage=Ae.throwInstantiationError;var Iee=See;var Cbo=y(x(),1),$1t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},_ee=Object.freeze($1t);var Fbo=y(x(),1);function GO(e,t){this.show=!0,l(e)||(e=new $e),this.rectangle=$e.clone(e),l(t)||(t=ho.fromType(ho.ColorType,{color:new D(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}GO.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!$e.equals(t.viewport,this.rectangle))&&(this._rs=ke.fromCache({blending:fn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new ze({sources:[this._material.shaderSource,PM]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ve.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};GO.prototype.isDestroyed=function(){return!1};GO.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),fe(this)};var Zee=GO;var Ybo=y(x(),1);function Ree(){Ae.throwInstantiationError()}Object.defineProperties(Ree.prototype,{globalTransform:{get:Ae.throwInstantiationError},shapeTransform:{get:Ae.throwInstantiationError},shape:{get:Ae.throwInstantiationError},minBounds:{get:Ae.throwInstantiationError},maxBounds:{get:Ae.throwInstantiationError},dimensions:{get:Ae.throwInstantiationError},paddingBefore:{get:Ae.throwInstantiationError},paddingAfter:{get:Ae.throwInstantiationError},names:{get:Ae.throwInstantiationError},types:{get:Ae.throwInstantiationError},componentTypes:{get:Ae.throwInstantiationError},minimumValues:{get:Ae.throwInstantiationError},maximumValues:{get:Ae.throwInstantiationError},maximumTileCount:{get:Ae.throwInstantiationError},availableLevels:{get:Ae.throwInstantiationError},keyframeCount:{get:Ae.throwInstantiationError},timeIntervalCollection:{get:Ae.throwInstantiationError}});Ree.prototype.requestData=function(e){Ae.throwInstantiationError()};var Gee=Ree;var Pbo=y(x(),1);function Tb(){Ae.throwInstantiationError()}Object.defineProperties(Tb.prototype,{orientedBoundingBox:{get:Ae.throwInstantiationError},boundingSphere:{get:Ae.throwInstantiationError},boundTransform:{get:Ae.throwInstantiationError},shapeTransform:{get:Ae.throwInstantiationError},shaderUniforms:{get:Ae.throwInstantiationError},shaderDefines:{get:Ae.throwInstantiationError},shaderMaximumIntersectionsLength:{get:Ae.throwInstantiationError}});Tb.prototype.update=Ae.throwInstantiationError;Tb.prototype.updateViewTransforms=Ae.throwInstantiationError;Tb.prototype.convertLocalToShapeUvSpace=Ae.throwInstantiationError;Tb.prototype.computeOrientedBoundingBoxForTile=Ae.throwInstantiationError;Tb.prototype.computeOrientedBoundingBoxForSample=Ae.throwInstantiationError;Tb.DefaultMinBounds=Ae.throwInstantiationError;Tb.DefaultMaxBounds=Ae.throwInstantiationError;var Vee=Tb;var t0o=y(x(),1);var eLt=new D,tLt=new D,nLt=new D,iLt=new D,AZe=new ce,dU=new Uint8Array(4);function gZe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return D.lerp(t.color,n.color,o,i)}function VO(e,t){return{height:e,color:D.clone(t)}}function bZe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?D.equals(t.color,i[n-1].color):!1,a=r?D.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?D.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function oLt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],f=V.clamp(g.height,wd._minimumHeight,wd._maximumHeight),b=D.clone(g.color,eLt);b.red*=b.alpha,b.green*=b.alpha,b.blue*=b.alpha,c.push(VO(f,b))}let d=!0,u=!0;for(n=0;n<a-1;n++){let g=c[n+0],f=c[n+1];d=d&&g.height<=f.height,u=u&&g.height>=f.height}u?c=c.reverse():d||zp(c,function(g,f){return V.sign(g.height-f.height)});let h=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!h&&!p&&(h=!0,p=!0),h&&c.splice(0,0,VO(wd._minimumHeight,c[0].color)),p&&c.splice(c.length,0,VO(wd._maximumHeight,c[c.length-1].color)),c=bZe(c),i.push(c)}return i}function rLt(e){let t=oLt(e),n=[],i=[],o;function r(d,u){n.push(VO(d,u))}function s(d,u,h){let p=D.multiplyByScalar(h,1-u.alpha,iLt);p=D.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,h=0;i=n,n=[];let p=d.length,g=i.length;for(;u<p||h<g;){let f=u<p?d[u]:void 0,b=u>0?d[u-1]:void 0,C=u<p-1?d[u+1]:void 0,E=h<g?i[h]:void 0,T=h>0?i[h-1]:void 0,S=h<g-1?i[h+1]:void 0;if(l(f)&&l(E)&&f.height===E.height){let _=l(S)&&E.height===S.height,R=!l(T),L=!l(S),W=l(C)&&f.height===C.height,B=!l(b),Y=!l(C);_?W?(s(f.height,f.color,E.color),s(f.height,C.color,S.color)):B?(r(f.height,E.color),s(f.height,f.color,S.color)):Y?(s(f.height,f.color,E.color),r(f.height,S.color)):(s(f.height,f.color,E.color),s(f.height,f.color,S.color)):R?W?(r(f.height,f.color),s(f.height,C.color,E.color)):Y?(r(f.height,f.color),r(f.height,E.color)):(B||r(f.height,f.color),s(f.height,f.color,E.color)):L?W?(s(f.height,f.color,E.color),r(f.height,C.color)):B?(r(f.height,E.color),r(f.height,f.color)):Y?s(f.height,f.color,E.color):(s(f.height,f.color,E.color),r(f.height,f.color)):W?(s(f.height,f.color,E.color),s(f.height,C.color,E.color)):B?(r(f.height,E.color),s(f.height,f.color,E.color)):Y?(s(f.height,f.color,E.color),r(f.height,E.color)):s(f.height,f.color,E.color),u+=W?2:1,h+=_?2:1}else if(l(f)&&l(E)&&l(T)&&f.height<E.height){let _=gZe(f.height,T,E,nLt);l(b)?l(C)?s(f.height,f.color,_):(s(f.height,f.color,_),r(f.height,_)):(r(f.height,_),s(f.height,f.color,_)),u++}else if(l(E)&&l(f)&&l(b)&&E.height<f.height){let _=gZe(E.height,b,f,tLt);l(T)?l(S)?s(E.height,_,E.color):(s(E.height,_,E.color),r(E.height,_)):(r(E.height,_),s(E.height,_,E.color)),h++}else l(f)&&(!l(E)||f.height<E.height)?(l(E)&&!l(T)&&!l(C)?(r(f.height,f.color),r(f.height,wd._emptyColor),r(E.height,wd._emptyColor)):(!l(E)&&l(T)&&!l(b)&&(r(T.height,wd._emptyColor),r(f.height,wd._emptyColor)),r(f.height,f.color)),u++):l(E)&&(!l(f)||E.height<f.height)&&(r(E.height,E.color),h++)}}return bZe(n)}function wd(e){let{scene:t,layers:n}=e??Q.EMPTY_OBJECT,{context:i}=t,o=rLt(n),r=o.length,s,a,c;if(!wd._useFloatTexture(i)){a=ve.UNSIGNED_BYTE,c=je.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)ce.packFloat(o[g].height,AZe),ce.pack(AZe,s,g*4)}else{a=ve.FLOAT,c=i.webgl2?je.RED:je.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let u=Wt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Ht({wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:zt.NEAREST,magnificationFilter:ui.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(dU),h[g*4+0]=dU[0],h[g*4+1]=dU[1],h[g*4+2]=dU[2],h[g*4+3]=dU[3];let p=Wt.create({context:i,pixelFormat:je.RGBA,pixelDatatype:ve.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new Ht({wrapS:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,minificationFilter:zt.LINEAR,magnificationFilter:ui.LINEAR})});return ho.fromType("ElevationBand",{heights:u,colors:p})}wd._useFloatTexture=function(e){return e.floatingPointTexture};wd._maximumHeight=5906376425472;wd._minimumHeight=-5906376425472;wd._emptyColor=new D(0,0,0,0);var Lee=wd;var d0o=y(x(),1);async function sLt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??Q.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||At("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles.  Set the `geocode` property of Viewer constructor options.  You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??Am.defaultApiKey;if(!l(n))return aLt(t);let i,o=Am.getDefaultCredit();l(o)&&(i=[o]);let r=new Ge({url:`${Am.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return ks.fromUrl(r,t)}var yZe={};async function aLt(e){let i=yZe[2275207];l(i)||(i=os.fromAssetId(2275207),yZe[2275207]=i);let o=await i;return ks.fromUrl(o,e)}var Wee=sLt;var g0o=y(x(),1);async function cLt(e){let t=await ks.fromIonAssetId(96188,e);e=e??Q.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??D.WHITE).toCssColorString();n=new IT({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Fee=cLt;var Z0o=y(x(),1);function lLt(e){e=e??Q.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(e.modelMatrix??F.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Bt({geometry:Dn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new qt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Bt({geometry:Dn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new qt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Bt({geometry:Dn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new qt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Nn({asynchronous:!1,geometryInstances:t,appearance:new pn({flat:!0,translucent:!1})})}var Bee=lLt;var G0o=y(x(),1),wee=`uniform sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
    z_window = czm_reverseLogDepth(z_window);
    float n_range = czm_depthRange.near;
    float f_range = czm_depthRange.far;
    float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
    float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
    out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
}
`;var N0o=y(x(),1);function dLt(e){e=e??Q.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??je.RGBA,this.pixelDatatype=e.pixelDatatype??ve.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=Ge.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?bn.REPEAT:bn.CLAMP_TO_EDGE;this.sampler=new Ht({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Yee=dLt;var P0o=y(x(),1),uLt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},Nee=Object.freeze(uLt);var U0o=y(x(),1),mLt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},Xee=Object.freeze(mLt);var k0o=y(x(),1);function hLt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${cp(s)}
  with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var Pee=hLt;globalThis.CESIUM_VERSION="1.138.0";var m9o=y(x(),1);var vPo=y(x(),1);var PPo=y(x(),1);var VPo=y(x(),1),uU;typeof ko<"u"&&(uU=ko);(function(){/*!
 * Knockout JavaScript library v3.5.1
 * (c) The Knockout.js team - http://knockoutjs.com/
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),(function(s){s(t.ko={})})(function(s,a){function c(A,I){return A===null||typeof A in b?A===I:!1}function d(A,I){var Z;return function(){Z||(Z=f.a.setTimeout(function(){Z=e,A()},I))}}function u(A,I){var Z;return function(){clearTimeout(Z),Z=f.a.setTimeout(A,I)}}function h(A,I){I&&I!=="change"?I==="beforeChange"?this.pc(A):this.gb(A,I):this.qc(A)}function p(A,I){I!==null&&I.s&&I.s()}function g(A,I){var Z=this.qd,G=Z[_];G.ra||(this.Qb&&this.mb[I]?(Z.uc(I,A,this.mb[I]),this.mb[I]=null,--this.Qb):G.I[I]||Z.uc(I,A,G.J?{da:A}:Z.$c(A)),A.Ja&&A.gd())}var f=typeof s<"u"?s:{};f.b=function(A,I){for(var Z=A.split("."),G=f,w=0;w<Z.length-1;w++)G=G[Z[w]];G[Z[Z.length-1]]=I},f.L=function(A,I,Z){A[I]=Z},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=(function(){function A(z,te){for(var q in z)w.call(z,q)&&te(q,z[q])}function I(z,te){if(te)for(var q in te)w.call(te,q)&&(z[q]=te[q]);return z}function Z(z,te){return z.__proto__=te,z}function G(z,te,q,me){var ye=z[te].match(H)||[];f.a.D(q.match(H),function(oe){f.a.Na(ye,oe,me)}),z[te]=ye.join(" ")}var w=Object.prototype.hasOwnProperty,X={__proto__:[]}instanceof Array,v=typeof Symbol=="function",U={},k={};U[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],U.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),A(U,function(z,te){if(te.length)for(var q=0,me=te.length;q<me;q++)k[te[q]]=z});var P={propertychange:!0},O=n&&(function(){for(var z=3,te=n.createElement("div"),q=te.getElementsByTagName("i");te.innerHTML="<!--[if gt IE "+ ++z+"]><i></i><![endif]-->",q[0];);return 4<z?z:e})(),H=/\S+/g,ee;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(z,te,q){for(var me=0,ye=z.length;me<ye;me++)te.call(q,z[me],me,z)},A:typeof Array.prototype.indexOf=="function"?function(z,te){return Array.prototype.indexOf.call(z,te)}:function(z,te){for(var q=0,me=z.length;q<me;q++)if(z[q]===te)return q;return-1},Lb:function(z,te,q){for(var me=0,ye=z.length;me<ye;me++)if(te.call(q,z[me],me,z))return z[me];return e},Pa:function(z,te){var q=f.a.A(z,te);0<q?z.splice(q,1):q===0&&z.shift()},wc:function(z){var te=[];return z&&f.a.D(z,function(q){0>f.a.A(te,q)&&te.push(q)}),te},Mb:function(z,te,q){var me=[];if(z)for(var ye=0,oe=z.length;ye<oe;ye++)me.push(te.call(q,z[ye],ye));return me},jb:function(z,te,q){var me=[];if(z)for(var ye=0,oe=z.length;ye<oe;ye++)te.call(q,z[ye],ye)&&me.push(z[ye]);return me},Nb:function(z,te){if(te instanceof Array)z.push.apply(z,te);else for(var q=0,me=te.length;q<me;q++)z.push(te[q]);return z},Na:function(z,te,q){var me=f.a.A(f.a.bc(z),te);0>me?q&&z.push(te):q||z.splice(me,1)},Ba:X,extend:I,setPrototypeOf:Z,Ab:X?Z:I,P:A,Ga:function(z,te,q){if(!z)return z;var me={},ye;for(ye in z)w.call(z,ye)&&(me[ye]=te.call(q,z[ye],ye,z));return me},Tb:function(z){for(;z.firstChild;)f.removeNode(z.firstChild)},Yb:function(z){z=f.a.la(z);for(var te=(z[0]&&z[0].ownerDocument||n).createElement("div"),q=0,me=z.length;q<me;q++)te.appendChild(f.oa(z[q]));return te},Ca:function(z,te){for(var q=0,me=z.length,ye=[];q<me;q++){var oe=z[q].cloneNode(!0);ye.push(te?f.oa(oe):oe)}return ye},va:function(z,te){if(f.a.Tb(z),te)for(var q=0,me=te.length;q<me;q++)z.appendChild(te[q])},Xc:function(z,te){var q=z.nodeType?[z]:z;if(0<q.length){for(var me=q[0],ye=me.parentNode,oe=0,xe=te.length;oe<xe;oe++)ye.insertBefore(te[oe],me);for(oe=0,xe=q.length;oe<xe;oe++)f.removeNode(q[oe])}},Ua:function(z,te){if(z.length){for(te=te.nodeType===8&&te.parentNode||te;z.length&&z[0].parentNode!==te;)z.splice(0,1);for(;1<z.length&&z[z.length-1].parentNode!==te;)z.length--;if(1<z.length){var q=z[0],me=z[z.length-1];for(z.length=0;q!==me;)z.push(q),q=q.nextSibling;z.push(me)}}return z},Zc:function(z,te){7>O?z.setAttribute("selected",te):z.selected=te},Db:function(z){return z===null||z===e?"":z.trim?z.trim():z.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(z,te){return z=z||"",te.length>z.length?!1:z.substring(0,te.length)===te},vd:function(z,te){if(z===te)return!0;if(z.nodeType===11)return!1;if(te.contains)return te.contains(z.nodeType!==1?z.parentNode:z);if(te.compareDocumentPosition)return(te.compareDocumentPosition(z)&16)==16;for(;z&&z!=te;)z=z.parentNode;return!!z},Sb:function(z){return f.a.vd(z,z.ownerDocument.documentElement)},kd:function(z){return!!f.a.Lb(z,f.a.Sb)},R:function(z){return z&&z.tagName&&z.tagName.toLowerCase()},Ac:function(z){return f.onError?function(){try{return z.apply(this,arguments)}catch(te){throw f.onError&&f.onError(te),te}}:z},setTimeout:function(z,te){return setTimeout(f.a.Ac(z),te)},Gc:function(z){setTimeout(function(){throw f.onError&&f.onError(z),z},0)},B:function(z,te,q){var me=f.a.Ac(q);if(q=P[te],f.options.useOnlyNativeEvents||q||!o)if(q||typeof z.addEventListener!="function")if(typeof z.attachEvent<"u"){var ye=function(xe){me.call(z,xe)},oe="on"+te;z.attachEvent(oe,ye),f.a.K.za(z,function(){z.detachEvent(oe,ye)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else z.addEventListener(te,me,!1);else ee||(ee=typeof o(z).on=="function"?"on":"bind"),o(z)[ee](te,me)},Fb:function(z,te){if(!z||!z.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var q;if(f.a.R(z)==="input"&&z.type&&te.toLowerCase()=="click"?(q=z.type,q=q=="checkbox"||q=="radio"):q=!1,f.options.useOnlyNativeEvents||!o||q)if(typeof n.createEvent=="function")if(typeof z.dispatchEvent=="function")q=n.createEvent(k[te]||"HTMLEvents"),q.initEvent(te,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,z),z.dispatchEvent(q);else throw Error("The supplied element doesn't support dispatchEvent");else if(q&&z.click)z.click();else if(typeof z.fireEvent<"u")z.fireEvent("on"+te);else throw Error("Browser doesn't support triggering events");else o(z).trigger(te)},f:function(z){return f.O(z)?z():z},bc:function(z){return f.O(z)?z.v():z},Eb:function(z,te,q){var me;te&&(typeof z.classList=="object"?(me=z.classList[q?"add":"remove"],f.a.D(te.match(H),function(ye){me.call(z.classList,ye)})):typeof z.className.baseVal=="string"?G(z.className,"baseVal",te,q):G(z,"className",te,q))},Bb:function(z,te){var q=f.a.f(te);(q===null||q===e)&&(q="");var me=f.h.firstChild(z);!me||me.nodeType!=3||f.h.nextSibling(me)?f.h.va(z,[z.ownerDocument.createTextNode(q)]):me.data=q,f.a.Ad(z)},Yc:function(z,te){if(z.name=te,7>=O)try{var q=z.name.replace(/[&<>'"]/g,function(me){return"&#"+me.charCodeAt(0)+";"});z.mergeAttributes(n.createElement("<input name='"+q+"'/>"),!1)}catch{}},Ad:function(z){9<=O&&(z=z.nodeType==1?z:z.parentNode,z.style&&(z.style.zoom=z.style.zoom))},wd:function(z){if(O){var te=z.style.width;z.style.width=0,z.style.width=te}},Pd:function(z,te){z=f.a.f(z),te=f.a.f(te);for(var q=[],me=z;me<=te;me++)q.push(me);return q},la:function(z){for(var te=[],q=0,me=z.length;q<me;q++)te.push(z[q]);return te},Da:function(z){return v?Symbol(z):z},Zd:O===6,$d:O===7,W:O,Lc:function(z,te){for(var q=f.a.la(z.getElementsByTagName("input")).concat(f.a.la(z.getElementsByTagName("textarea"))),me=typeof te=="string"?function(xe){return xe.name===te}:function(xe){return te.test(xe.name)},ye=[],oe=q.length-1;0<=oe;oe--)me(q[oe])&&ye.push(q[oe]);return ye},Nd:function(z){return typeof z=="string"&&(z=f.a.Db(z))?r&&r.parse?r.parse(z):new Function("return "+z)():null},hc:function(z,te,q){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(f.a.f(z),te,q)},Od:function(z,te,q){q=q||{};var me=q.params||{},ye=q.includeFields||this.Jc,oe=z;if(typeof z=="object"&&f.a.R(z)==="form")for(var oe=z.action,xe=ye.length-1;0<=xe;xe--)for(var Ee=f.a.Lc(z,ye[xe]),Le=Ee.length-1;0<=Le;Le--)me[Ee[Le].name]=Ee[Le].value;te=f.a.f(te);var Se=n.createElement("form");Se.style.display="none",Se.action=oe,Se.method="post";for(var Fe in te)z=n.createElement("input"),z.type="hidden",z.name=Fe,z.value=f.a.hc(f.a.f(te[Fe])),Se.appendChild(z);A(me,function(Ue,De){var Je=n.createElement("input");Je.type="hidden",Je.name=Ue,Je.value=De,Se.appendChild(Je)}),n.body.appendChild(Se),q.submitter?q.submitter(Se):Se.submit(),setTimeout(function(){Se.parentNode.removeChild(Se)},0)}}})(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.D),f.b("utils.arrayFirst",f.a.Lb),f.b("utils.arrayFilter",f.a.jb),f.b("utils.arrayGetDistinctValues",f.a.wc),f.b("utils.arrayIndexOf",f.a.A),f.b("utils.arrayMap",f.a.Mb),f.b("utils.arrayPushAll",f.a.Nb),f.b("utils.arrayRemoveItem",f.a.Pa),f.b("utils.cloneNodes",f.a.Ca),f.b("utils.createSymbolOrString",f.a.Da),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.Jc),f.b("utils.getFormFields",f.a.Lc),f.b("utils.objectMap",f.a.Ga),f.b("utils.peekObservable",f.a.bc),f.b("utils.postJson",f.a.Od),f.b("utils.parseJson",f.a.Nd),f.b("utils.registerEventHandler",f.a.B),f.b("utils.stringifyJson",f.a.hc),f.b("utils.range",f.a.Pd),f.b("utils.toggleDomNodeCssClass",f.a.Eb),f.b("utils.triggerEvent",f.a.Fb),f.b("utils.unwrapObservable",f.a.f),f.b("utils.objectForEach",f.a.P),f.b("utils.addOrRemoveItem",f.a.Na),f.b("utils.setTextContent",f.a.Bb),f.b("unwrap",f.a.f),Function.prototype.bind||(Function.prototype.bind=function(A){var I=this;if(arguments.length===1)return function(){return I.apply(A,arguments)};var Z=Array.prototype.slice.call(arguments,1);return function(){var G=Z.slice(0);return G.push.apply(G,arguments),I.apply(A,G)}}),f.a.g=new function(){var A=0,I="__ko__"+new Date().getTime(),Z={},G,w;return f.a.W?(G=function(X,v){var U=X[I];if(!U||U==="null"||!Z[U]){if(!v)return e;U=X[I]="ko"+A++,Z[U]={}}return Z[U]},w=function(X){var v=X[I];return v?(delete Z[v],X[I]=null,!0):!1}):(G=function(X,v){var U=X[I];return!U&&v&&(U=X[I]={}),U},w=function(X){return X[I]?(delete X[I],!0):!1}),{get:function(X,v){var U=G(X,!1);return U&&U[v]},set:function(X,v,U){(X=G(X,U!==e))&&(X[v]=U)},Ub:function(X,v,U){return X=G(X,!0),X[v]||(X[v]=U)},clear:w,Z:function(){return A+++I}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.K=new function(){function A(v,U){var k=f.a.g.get(v,G);return k===e&&U&&(k=[],f.a.g.set(v,G,k)),k}function I(v){var U=A(v,!1);if(U)for(var U=U.slice(0),k=0;k<U.length;k++)U[k](v);f.a.g.clear(v),f.a.K.cleanExternalData(v),X[v.nodeType]&&Z(v.childNodes,!0)}function Z(v,U){for(var k=[],P,O=0;O<v.length;O++)if((!U||v[O].nodeType===8)&&(I(k[k.length]=P=v[O]),v[O]!==P))for(;O--&&f.a.A(k,v[O])==-1;);}var G=f.a.g.Z(),w={1:!0,8:!0,9:!0},X={1:!0,9:!0};return{za:function(v,U){if(typeof U!="function")throw Error("Callback must be a function");A(v,!0).push(U)},yb:function(v,U){var k=A(v,!1);k&&(f.a.Pa(k,U),k.length==0&&f.a.g.set(v,G,e))},oa:function(v){return f.u.G(function(){w[v.nodeType]&&(I(v),X[v.nodeType]&&Z(v.getElementsByTagName("*")))}),v},removeNode:function(v){f.oa(v),v.parentNode&&v.parentNode.removeChild(v)},cleanExternalData:function(v){o&&typeof o.cleanData=="function"&&o.cleanData([v])}}},f.oa=f.a.K.oa,f.removeNode=f.a.K.removeNode,f.b("cleanNode",f.oa),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.K),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.K.za),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.K.yb),(function(){var A=[0,"",""],I=[1,"<table>","</table>"],Z=[3,"<table><tbody><tr>","</tr></tbody></table>"],G=[1,"<select multiple='multiple'>","</select>"],w={thead:I,tbody:I,tfoot:I,tr:[2,"<table><tbody>","</tbody></table>"],td:Z,th:Z,option:G,optgroup:G},X=8>=f.a.W;f.a.ua=function(v,U){var k;if(o){if(o.parseHTML)k=o.parseHTML(v,U)||[];else if((k=o.clean([v],U))&&k[0]){for(var P=k[0];P.parentNode&&P.parentNode.nodeType!==11;)P=P.parentNode;P.parentNode&&P.parentNode.removeChild(P)}}else{(k=U)||(k=n);var P=k.parentWindow||k.defaultView||t,O=f.a.Db(v).toLowerCase(),H=k.createElement("div"),ee;for(ee=(O=O.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&w[O[1]]||A,O=ee[0],ee="ignored<div>"+ee[1]+v+ee[2]+"</div>",typeof P.innerShiv=="function"?H.appendChild(P.innerShiv(ee)):(X&&k.body.appendChild(H),H.innerHTML=ee,X&&H.parentNode.removeChild(H));O--;)H=H.lastChild;k=f.a.la(H.lastChild.childNodes)}return k},f.a.Md=function(v,U){var k=f.a.ua(v,U);return k.length&&k[0].parentElement||f.a.Yb(k)},f.a.fc=function(v,U){if(f.a.Tb(v),U=f.a.f(U),U!==null&&U!==e)if(typeof U!="string"&&(U=U.toString()),o)o(v).html(U);else for(var k=f.a.ua(U,v.ownerDocument),P=0;P<k.length;P++)v.appendChild(k[P])}})(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=(function(){function A(Z,G){if(Z){if(Z.nodeType==8){var w=f.aa.Uc(Z.nodeValue);w!=null&&G.push({ud:Z,Kd:w})}else if(Z.nodeType==1)for(var w=0,X=Z.childNodes,v=X.length;w<v;w++)A(X[w],G)}}var I={};return{Xb:function(Z){if(typeof Z!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var G=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return I[G]=Z,"<!--[ko_memo:"+G+"]-->"},bd:function(Z,G){var w=I[Z];if(w===e)throw Error("Couldn't find any memo with ID "+Z+". Perhaps it's already been unmemoized.");try{return w.apply(null,G||[]),!0}finally{delete I[Z]}},cd:function(Z,G){var w=[];A(Z,w);for(var X=0,v=w.length;X<v;X++){var U=w[X].ud,k=[U];G&&f.a.Nb(k,G),f.aa.bd(w[X].Kd,k),U.nodeValue="",U.parentNode&&U.parentNode.removeChild(U)}},Uc:function(Z){return(Z=Z.match(/^\[ko_memo\:(.*?)\]$/))?Z[1]:null}}})(),f.b("memoization",f.aa),f.b("memoization.memoize",f.aa.Xb),f.b("memoization.unmemoize",f.aa.bd),f.b("memoization.parseMemoText",f.aa.Uc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.aa.cd),f.na=(function(){function A(){if(w){for(var U=w,k=0,P;v<w;)if(P=G[v++]){if(v>U){if(5e3<=++k){v=w,f.a.Gc(Error("'Too much recursion' after processing "+k+" task groups."));break}U=w}try{P()}catch(O){f.a.Gc(O)}}}}function I(){A(),v=w=G.length=0}var Z,G=[],w=0,X=1,v=0;return t.MutationObserver?Z=(function(U){var k=n.createElement("div");return new MutationObserver(U).observe(k,{attributes:!0}),function(){k.classList.toggle("foo")}})(I):Z=n&&"onreadystatechange"in n.createElement("script")?function(U){var k=n.createElement("script");k.onreadystatechange=function(){k.onreadystatechange=null,n.documentElement.removeChild(k),k=null,U()},n.documentElement.appendChild(k)}:function(U){setTimeout(U,0)},{scheduler:Z,zb:function(U){return w||f.na.scheduler(I),G[w++]=U,X++},cancel:function(U){U=U-(X-w),U>=v&&U<w&&(G[U]=null)},resetForTesting:function(){var U=w-v;return v=w=G.length=0,U},Sd:A}})(),f.b("tasks",f.na),f.b("tasks.schedule",f.na.zb),f.b("tasks.runEarly",f.na.Sd),f.Ta={throttle:function(A,I){A.throttleEvaluation=I;var Z=null;return f.$({read:A,write:function(G){clearTimeout(Z),Z=f.a.setTimeout(function(){A(G)},I)}})},rateLimit:function(A,I){var Z,G,w;typeof I=="number"?Z=I:(Z=I.timeout,G=I.method),A.Hb=!1,w=typeof G=="function"?G:G=="notifyWhenChangesStop"?u:d,A.ub(function(X){return w(X,Z,I)})},deferred:function(A,I){if(I!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");A.Hb||(A.Hb=!0,A.ub(function(Z){var G,w=!1;return function(){if(!w){f.na.cancel(G),G=f.na.zb(Z);try{w=!0,A.notifySubscribers(e,"dirty")}finally{w=!1}}}}))},notify:function(A,I){A.equalityComparer=I=="always"?null:c}};var b={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.ic=function(A,I,Z){this.da=A,this.lc=I,this.mc=Z,this.Ib=!1,this.fb=this.Jb=null,f.L(this,"dispose",this.s),f.L(this,"disposeWhenNodeIsRemoved",this.l)},f.ic.prototype.s=function(){this.Ib||(this.fb&&f.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},f.ic.prototype.l=function(A){this.Jb=A,f.a.K.za(A,this.fb=this.s.bind(this))},f.T=function(){f.a.Ab(this,C),C.qb(this)};var C={qb:function(A){A.U={change:[]},A.sc=1},subscribe:function(A,I,Z){var G=this;Z=Z||"change";var w=new f.ic(G,I?A.bind(I):A,function(){f.a.Pa(G.U[Z],w),G.hb&&G.hb(Z)});return G.Qa&&G.Qa(Z),G.U[Z]||(G.U[Z]=[]),G.U[Z].push(w),w},notifySubscribers:function(A,I){if(I=I||"change",I==="change"&&this.Gb(),this.Wa(I)){var Z=I==="change"&&this.ed||this.U[I].slice(0);try{f.u.xc();for(var G=0,w;w=Z[G];++G)w.Ib||w.lc(A)}finally{f.u.end()}}},ob:function(){return this.sc},Dd:function(A){return this.ob()!==A},Gb:function(){++this.sc},ub:function(A){var I=this,Z=f.O(I),G,w,X,v,U;I.gb||(I.gb=I.notifySubscribers,I.notifySubscribers=h);var k=A(function(){I.Ja=!1,Z&&v===I&&(v=I.nc?I.nc():I());var P=w||U&&I.sb(X,v);U=w=G=!1,P&&I.gb(X=v)});I.qc=function(P,O){O&&I.Ja||(U=!O),I.ed=I.U.change.slice(0),I.Ja=G=!0,v=P,k()},I.pc=function(P){G||(X=P,I.gb(P,"beforeChange"))},I.rc=function(){U=!0},I.gd=function(){I.sb(X,I.v(!0))&&(w=!0)}},Wa:function(A){return this.U[A]&&this.U[A].length},Bd:function(A){if(A)return this.U[A]&&this.U[A].length||0;var I=0;return f.a.P(this.U,function(Z,G){Z!=="dirty"&&(I+=G.length)}),I},sb:function(A,I){return!this.equalityComparer||!this.equalityComparer(A,I)},toString:function(){return"[object Object]"},extend:function(A){var I=this;return A&&f.a.P(A,function(Z,G){var w=f.Ta[Z];typeof w=="function"&&(I=w(I,G)||I)}),I}};f.L(C,"init",C.qb),f.L(C,"subscribe",C.subscribe),f.L(C,"extend",C.extend),f.L(C,"getSubscriptionsCount",C.Bd),f.a.Ba&&f.a.setPrototypeOf(C,Function.prototype),f.T.fn=C,f.Qc=function(A){return A!=null&&typeof A.subscribe=="function"&&typeof A.notifySubscribers=="function"},f.b("subscribable",f.T),f.b("isSubscribable",f.Qc),f.S=f.u=(function(){function A(X){Z.push(G),G=X}function I(){G=Z.pop()}var Z=[],G,w=0;return{xc:A,end:I,cc:function(X){if(G){if(!f.Qc(X))throw Error("Only subscribable things can act as dependencies");G.od.call(G.pd,X,X.fd||(X.fd=++w))}},G:function(X,v,U){try{return A(),X.apply(v,U||[])}finally{I()}},qa:function(){if(G)return G.o.qa()},Va:function(){if(G)return G.o.Va()},Ya:function(){if(G)return G.Ya},o:function(){if(G)return G.o}}})(),f.b("computedContext",f.S),f.b("computedContext.getDependenciesCount",f.S.qa),f.b("computedContext.getDependencies",f.S.Va),f.b("computedContext.isInitial",f.S.Ya),f.b("computedContext.registerDependency",f.S.cc),f.b("ignoreDependencies",f.Yd=f.u.G);var E=f.a.Da("_latestValue");f.ta=function(A){function I(){return 0<arguments.length?(I.sb(I[E],arguments[0])&&(I.ya(),I[E]=arguments[0],I.xa()),this):(f.u.cc(I),I[E])}return I[E]=A,f.a.Ba||f.a.extend(I,f.T.fn),f.T.fn.qb(I),f.a.Ab(I,T),f.options.deferUpdates&&f.Ta.deferred(I,!0),I};var T={equalityComparer:c,v:function(){return this[E]},xa:function(){this.notifySubscribers(this[E],"spectate"),this.notifySubscribers(this[E])},ya:function(){this.notifySubscribers(this[E],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(T,f.T.fn);var S=f.ta.Ma="__ko_proto__";T[S]=f.ta,f.O=function(A){if((A=typeof A=="function"&&A[S])&&A!==T[S]&&A!==f.o.fn[S])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!A},f.Za=function(A){return typeof A=="function"&&(A[S]===T[S]||A[S]===f.o.fn[S]&&A.Nc)},f.b("observable",f.ta),f.b("isObservable",f.O),f.b("isWriteableObservable",f.Za),f.b("isWritableObservable",f.Za),f.b("observable.fn",T),f.L(T,"peek",T.v),f.L(T,"valueHasMutated",T.xa),f.L(T,"valueWillMutate",T.ya),f.Ha=function(A){if(A=A||[],typeof A!="object"||!("length"in A))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return A=f.ta(A),f.a.Ab(A,f.Ha.fn),A.extend({trackArrayChanges:!0})},f.Ha.fn={remove:function(A){for(var I=this.v(),Z=[],G=typeof A!="function"||f.O(A)?function(v){return v===A}:A,w=0;w<I.length;w++){var X=I[w];if(G(X)){if(Z.length===0&&this.ya(),I[w]!==X)throw Error("Array modified during remove; cannot remove item");Z.push(X),I.splice(w,1),w--}}return Z.length&&this.xa(),Z},removeAll:function(A){if(A===e){var I=this.v(),Z=I.slice(0);return this.ya(),I.splice(0,I.length),this.xa(),Z}return A?this.remove(function(G){return 0<=f.a.A(A,G)}):[]},destroy:function(A){var I=this.v(),Z=typeof A!="function"||f.O(A)?function(X){return X===A}:A;this.ya();for(var G=I.length-1;0<=G;G--){var w=I[G];Z(w)&&(w._destroy=!0)}this.xa()},destroyAll:function(A){return A===e?this.destroy(function(){return!0}):A?this.destroy(function(I){return 0<=f.a.A(A,I)}):[]},indexOf:function(A){var I=this();return f.a.A(I,A)},replace:function(A,I){var Z=this.indexOf(A);0<=Z&&(this.ya(),this.v()[Z]=I,this.xa())},sorted:function(A){var I=this().slice(0);return A?I.sort(A):I.sort()},reversed:function(){return this().slice(0).reverse()}},f.a.Ba&&f.a.setPrototypeOf(f.Ha.fn,f.ta.fn),f.a.D("pop push reverse shift sort splice unshift".split(" "),function(A){f.Ha.fn[A]=function(){var I=this.v();this.ya(),this.zc(I,A,arguments);var Z=I[A].apply(I,arguments);return this.xa(),Z===I?this:Z}}),f.a.D(["slice"],function(A){f.Ha.fn[A]=function(){var I=this();return I[A].apply(I,arguments)}}),f.Pc=function(A){return f.O(A)&&typeof A.remove=="function"&&typeof A.push=="function"},f.b("observableArray",f.Ha),f.b("isObservableArray",f.Pc),f.Ta.trackArrayChanges=function(A,I){function Z(){function H(){if(U){var ee=[].concat(A.v()||[]),z;A.Wa("arrayChange")&&((!w||1<U)&&(w=f.a.Pb(k,ee,A.Ob)),z=w),k=ee,w=null,U=0,z&&z.length&&A.notifySubscribers(z,"arrayChange")}}G?H():(G=!0,v=A.subscribe(function(){++U},null,"spectate"),k=[].concat(A.v()||[]),w=null,X=A.subscribe(H))}if(A.Ob={},I&&typeof I=="object"&&f.a.extend(A.Ob,I),A.Ob.sparse=!0,!A.zc){var G=!1,w=null,X,v,U=0,k,P=A.Qa,O=A.hb;A.Qa=function(H){P&&P.call(A,H),H==="arrayChange"&&Z()},A.hb=function(H){O&&O.call(A,H),H!=="arrayChange"||A.Wa("arrayChange")||(X&&X.s(),v&&v.s(),v=X=null,G=!1,k=e)},A.zc=function(H,ee,z){function te(Se,Fe,Ue){return q[q.length]={status:Se,value:Fe,index:Ue}}if(G&&!U){var q=[],me=H.length,ye=z.length,oe=0;switch(ee){case"push":oe=me;case"unshift":for(ee=0;ee<ye;ee++)te("added",z[ee],oe+ee);break;case"pop":oe=me-1;case"shift":me&&te("deleted",H[oe],oe);break;case"splice":ee=Math.min(Math.max(0,0>z[0]?me+z[0]:z[0]),me);for(var me=ye===1?me:Math.min(ee+(z[1]||0),me),ye=ee+ye-2,oe=Math.max(me,ye),xe=[],Ee=[],Le=2;ee<oe;++ee,++Le)ee<me&&Ee.push(te("deleted",H[ee],ee)),ee<ye&&xe.push(te("added",z[Le],ee));f.a.Kc(Ee,xe);break;default:return}w=q}}}};var _=f.a.Da("_state");f.o=f.$=function(A,I,Z){function G(){if(0<arguments.length){if(typeof w=="function")w.apply(X.nb,arguments);else 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 this}return X.ra||f.u.cc(G),(X.ka||X.J&&G.Xa())&&G.ha(),X.X}if(typeof A=="object"?Z=A:(Z=Z||{},A&&(Z.read=A)),typeof Z.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var w=Z.write,X={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:Z.read,nb:I||Z.owner,l:Z.disposeWhenNodeIsRemoved||Z.l||null,Sa:Z.disposeWhen||Z.Sa,Rb:null,I:{},V:0,Ic:null};return G[_]=X,G.Nc=typeof w=="function",f.a.Ba||f.a.extend(G,f.T.fn),f.T.fn.qb(G),f.a.Ab(G,R),Z.pure?(X.wb=!0,X.J=!0,f.a.extend(G,L)):Z.deferEvaluation&&f.a.extend(G,W),f.options.deferUpdates&&f.Ta.deferred(G,!0),X.l&&(X.jc=!0,X.l.nodeType||(X.l=null)),X.J||Z.deferEvaluation||G.ha(),X.l&&G.ja()&&f.a.K.za(X.l,X.Rb=function(){G.s()}),G};var R={equalityComparer:c,qa:function(){return this[_].V},Va:function(){var A=[];return f.a.P(this[_].I,function(I,Z){A[Z.Ka]=Z.da}),A},Vb:function(A){if(!this[_].V)return!1;var I=this.Va();return f.a.A(I,A)!==-1?!0:!!f.a.Lb(I,function(Z){return Z.Vb&&Z.Vb(A)})},uc:function(A,I,Z){if(this[_].wb&&I===this)throw Error("A 'pure' computed must not be called recursively");this[_].I[A]=Z,Z.Ka=this[_].V++,Z.La=I.ob()},Xa:function(){var A,I,Z=this[_].I;for(A in Z)if(Object.prototype.hasOwnProperty.call(Z,A)&&(I=Z[A],this.Ia&&I.da.Ja||I.da.Dd(I.La)))return!0},Jd:function(){this.Ia&&!this[_].rb&&this.Ia(!1)},ja:function(){var A=this[_];return A.ka||0<A.V},Rd:function(){this.Ja?this[_].ka&&(this[_].sa=!0):this.Hc()},$c:function(A){if(A.Hb){var I=A.subscribe(this.Jd,this,"dirty"),Z=A.subscribe(this.Rd,this);return{da:A,s:function(){I.s(),Z.s()}}}return A.subscribe(this.Hc,this)},Hc:function(){var A=this,I=A.throttleEvaluation;I&&0<=I?(clearTimeout(this[_].Ic),this[_].Ic=f.a.setTimeout(function(){A.ha(!0)},I)):A.Ia?A.Ia(!0):A.ha(!0)},ha:function(A){var I=this[_],Z=I.Sa,G=!1;if(!I.rb&&!I.ra){if(I.l&&!f.a.Sb(I.l)||Z&&Z()){if(!I.jc){this.s();return}}else I.jc=!1;I.rb=!0;try{G=this.zd(A)}finally{I.rb=!1}return G}},zd:function(A){var I=this[_],G=!1,Z=I.wb?e:!I.V,G={qd:this,mb:I.I,Qb:I.V};f.u.xc({pd:G,od:g,o:this,Ya:Z}),I.I={},I.V=0;var w=this.yd(I,G);return I.V?G=this.sb(I.X,w):(this.s(),G=!0),G&&(I.J?this.Gb():this.notifySubscribers(I.X,"beforeChange"),I.X=w,this.notifySubscribers(I.X,"spectate"),!I.J&&A&&this.notifySubscribers(I.X),this.rc&&this.rc()),Z&&this.notifySubscribers(I.X,"awake"),G},yd:function(A,I){try{var Z=A.Wc;return A.nb?Z.call(A.nb):Z()}finally{f.u.end(),I.Qb&&!A.J&&f.a.P(I.mb,p),A.sa=A.ka=!1}},v:function(A){var I=this[_];return(I.ka&&(A||!I.V)||I.J&&this.Xa())&&this.ha(),I.X},ub:function(A){f.T.fn.ub.call(this,A),this.nc=function(){return this[_].J||(this[_].sa?this.ha():this[_].ka=!1),this[_].X},this.Ia=function(I){this.pc(this[_].X),this[_].ka=!0,I&&(this[_].sa=!0),this.qc(this,!I)}},s:function(){var A=this[_];!A.J&&A.I&&f.a.P(A.I,function(I,Z){Z.s&&Z.s()}),A.l&&A.Rb&&f.a.K.yb(A.l,A.Rb),A.I=e,A.V=0,A.ra=!0,A.sa=!1,A.ka=!1,A.J=!1,A.l=e,A.Sa=e,A.Wc=e,this.Nc||(A.nb=e)}},L={Qa:function(A){var I=this,Z=I[_];if(!Z.ra&&Z.J&&A=="change"){if(Z.J=!1,Z.sa||I.Xa())Z.I=null,Z.V=0,I.ha()&&I.Gb();else{var G=[];f.a.P(Z.I,function(w,X){G[X.Ka]=w}),f.a.D(G,function(w,X){var v=Z.I[w],U=I.$c(v.da);U.Ka=X,U.La=v.La,Z.I[w]=U}),I.Xa()&&I.ha()&&I.Gb()}Z.ra||I.notifySubscribers(Z.X,"awake")}},hb:function(A){var I=this[_];I.ra||A!="change"||this.Wa("change")||(f.a.P(I.I,function(Z,G){G.s&&(I.I[Z]={da:G.da,Ka:G.Ka,La:G.La},G.s())}),I.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var A=this[_];return A.J&&(A.sa||this.Xa())&&this.ha(),f.T.fn.ob.call(this)}},W={Qa:function(A){A!="change"&&A!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(R,f.T.fn);var B=f.ta.Ma;R[B]=f.o,f.Oc=function(A){return typeof A=="function"&&A[B]===R[B]},f.Fd=function(A){return f.Oc(A)&&A[_]&&A[_].wb},f.b("computed",f.o),f.b("dependentObservable",f.o),f.b("isComputed",f.Oc),f.b("isPureComputed",f.Fd),f.b("computed.fn",R),f.L(R,"peek",R.v),f.L(R,"dispose",R.s),f.L(R,"isActive",R.ja),f.L(R,"getDependenciesCount",R.qa),f.L(R,"getDependencies",R.Va),f.xb=function(A,I){return typeof A=="function"?f.o(A,I,{pure:!0}):(A=f.a.extend({},A),A.pure=!0,f.o(A,I))},f.b("pureComputed",f.xb),(function(){function A(G,w,X){if(X=X||new Z,G=w(G),typeof G!="object"||G===null||G===e||G instanceof RegExp||G instanceof Date||G instanceof String||G instanceof Number||G instanceof Boolean)return G;var v=G instanceof Array?[]:{};return X.save(G,v),I(G,function(U){var k=w(G[U]);switch(typeof k){case"boolean":case"number":case"string":case"function":v[U]=k;break;case"object":case"undefined":var P=X.get(k);v[U]=P!==e?P:A(k,w,X)}}),v}function I(G,w){if(G instanceof Array){for(var X=0;X<G.length;X++)w(X);typeof G.toJSON=="function"&&w("toJSON")}else for(X in G)w(X)}function Z(){this.keys=[],this.values=[]}f.ad=function(G){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return A(G,function(w){for(var X=0;f.O(w)&&10>X;X++)w=w();return w})},f.toJSON=function(G,w,X){return G=f.ad(G),f.a.hc(G,w,X)},Z.prototype={constructor:Z,save:function(G,w){var X=f.a.A(this.keys,G);0<=X?this.values[X]=w:(this.keys.push(G),this.values.push(w))},get:function(G){return G=f.a.A(this.keys,G),0<=G?this.values[G]:e}}})(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(A,I,Z){function G(w){var X=f.xb(A,Z).extend({ma:"always"}),v=X.subscribe(function(U){U&&(v.s(),w(U))});return X.notifySubscribers(X.v()),v}return typeof Promise!="function"||I?G(I.bind(Z)):new Promise(G)},f.b("when",f.Wd),(function(){f.w={M:function(A){switch(f.a.R(A)){case"option":return A.__ko__hasDomDataOptionValue__===!0?f.a.g.get(A,f.c.options.$b):7>=f.a.W?A.getAttributeNode("value")&&A.getAttributeNode("value").specified?A.value:A.text:A.value;case"select":return 0<=A.selectedIndex?f.w.M(A.options[A.selectedIndex]):e;default:return A.value}},cb:function(A,I,Z){switch(f.a.R(A)){case"option":typeof I=="string"?(f.a.g.set(A,f.c.options.$b,e),"__ko__hasDomDataOptionValue__"in A&&delete A.__ko__hasDomDataOptionValue__,A.value=I):(f.a.g.set(A,f.c.options.$b,I),A.__ko__hasDomDataOptionValue__=!0,A.value=typeof I=="number"?I:"");break;case"select":(I===""||I===null)&&(I=e);for(var G=-1,w=0,X=A.options.length,v;w<X;++w)if(v=f.w.M(A.options[w]),v==I||v===""&&I===e){G=w;break}(Z||0<=G||I===e&&1<A.size)&&(A.selectedIndex=G,f.a.W===6&&f.a.setTimeout(function(){A.selectedIndex=G},0));break;default:(I===null||I===e)&&(I=""),A.value=I}}}})(),f.b("selectExtensions",f.w),f.b("selectExtensions.readValue",f.w.M),f.b("selectExtensions.writeValue",f.w.cb),f.m=(function(){function A(U){U=f.a.Db(U),U.charCodeAt(0)===123&&(U=U.slice(1,-1)),U+=`
,`;var k=[],P=U.match(G),O,H=[],ee=0;if(1<P.length){for(var z=0,te;te=P[z];++z){var q=te.charCodeAt(0);if(q===44){if(0>=ee){k.push(O&&H.length?{key:O,value:H.join("")}:{unknown:O||H.join("")}),O=ee=0,H=[];continue}}else if(q===58){if(!ee&&!O&&H.length===1){O=H.pop();continue}}else{if(q===47&&1<te.length&&(te.charCodeAt(1)===47||te.charCodeAt(1)===42))continue;q===47&&z&&1<te.length?(q=P[z-1].match(w))&&!X[q[0]]&&(U=U.substr(U.indexOf(te)+1),P=U.match(G),z=-1,te="/"):q===40||q===123||q===91?++ee:q===41||q===125||q===93?--ee:O||H.length||q!==34&&q!==39||(te=te.slice(1,-1))}H.push(te)}if(0<ee)throw Error("Unbalanced parentheses, braces, or brackets")}return k}var I=["true","false","null","undefined"],Z=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,G=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),w=/[\])"'A-Za-z0-9_$]+$/,X={in:1,return:1,typeof:1},v={};return{Ra:[],wa:v,ac:A,vb:function(U,k){function P(q,me){var ye;if(!z){var oe=f.getBindingHandler(q);if(oe&&oe.preprocess&&!(me=oe.preprocess(me,q,P)))return;(oe=v[q])&&(ye=me,0<=f.a.A(I,ye)?ye=!1:(oe=ye.match(Z),ye=oe===null?!1:oe[1]?"Object("+oe[1]+")"+oe[2]:ye),oe=ye),oe&&H.push("'"+(typeof v[q]=="string"?v[q]:q)+"':function(_z){"+ye+"=_z}")}ee&&(me="function(){return "+me+" }"),O.push("'"+q+"':"+me)}k=k||{};var O=[],H=[],ee=k.valueAccessors,z=k.bindingParams,te=typeof U=="string"?A(U):U;return f.a.D(te,function(q){P(q.key||q.unknown,q.value)}),H.length&&P("_ko_property_writers","{"+H.join(",")+" }"),O.join(",")},Id:function(U,k){for(var P=0;P<U.length;P++)if(U[P].key==k)return!0;return!1},eb:function(U,k,P,O,H){U&&f.O(U)?!f.Za(U)||H&&U.v()===O||U(O):(U=k.get("_ko_property_writers"))&&U[P]&&U[P](O)}}})(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.ac),f.b("expressionRewriting.preProcessBindings",f.m.vb),f.b("expressionRewriting._twoWayBindings",f.m.wa),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.vb),(function(){function A(P){return P.nodeType==8&&X.test(w?P.text:P.nodeValue)}function I(P){return P.nodeType==8&&v.test(w?P.text:P.nodeValue)}function Z(P,O){for(var H=P,ee=1,z=[];H=H.nextSibling;){if(I(H)&&(f.a.g.set(H,k,!0),ee--,ee===0))return z;z.push(H),A(H)&&ee++}if(!O)throw Error("Cannot find closing comment tag to match: "+P.nodeValue);return null}function G(P,O){var H=Z(P,O);return H?0<H.length?H[H.length-1].nextSibling:P.nextSibling:null}var w=n&&n.createComment("test").text==="<!--test-->",X=w?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,v=w?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,U={ul:!0,ol:!0},k="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(P){return A(P)?Z(P):P.childNodes},Ea:function(P){if(A(P)){P=f.h.childNodes(P);for(var O=0,H=P.length;O<H;O++)f.removeNode(P[O])}else f.a.Tb(P)},va:function(P,O){if(A(P)){f.h.Ea(P);for(var H=P.nextSibling,ee=0,z=O.length;ee<z;ee++)H.parentNode.insertBefore(O[ee],H)}else f.a.va(P,O)},Vc:function(P,O){var H;A(P)?(H=P.nextSibling,P=P.parentNode):H=P.firstChild,H?O!==H&&P.insertBefore(O,H):P.appendChild(O)},Wb:function(P,O,H){H?(H=H.nextSibling,A(P)&&(P=P.parentNode),H?O!==H&&P.insertBefore(O,H):P.appendChild(O)):f.h.Vc(P,O)},firstChild:function(P){if(A(P))return!P.nextSibling||I(P.nextSibling)?null:P.nextSibling;if(P.firstChild&&I(P.firstChild))throw Error("Found invalid end comment, as the first child of "+P);return P.firstChild},nextSibling:function(P){if(A(P)&&(P=G(P)),P.nextSibling&&I(P.nextSibling)){var O=P.nextSibling;if(I(O)&&!f.a.g.get(O,k))throw Error("Found end comment without a matching opening comment, as child of "+P);return null}return P.nextSibling},Cd:A,Vd:function(P){return(P=(w?P.text:P.nodeValue).match(X))?P[1]:null},Sc:function(P){if(U[f.a.R(P)]){var O=P.firstChild;if(O)do if(O.nodeType===1){var H;H=O.firstChild;var ee=null;if(H)do if(ee)ee.push(H);else if(A(H)){var z=G(H,!0);z?H=z:ee=[H]}else I(H)&&(ee=[H]);while(H=H.nextSibling);if(H=ee)for(ee=O.nextSibling,z=0;z<H.length;z++)ee?P.insertBefore(H[z],ee):P.appendChild(H[z])}while(O=O.nextSibling)}}}})(),f.b("virtualElements",f.h),f.b("virtualElements.allowedBindings",f.h.ea),f.b("virtualElements.emptyNode",f.h.Ea),f.b("virtualElements.insertAfter",f.h.Wb),f.b("virtualElements.prepend",f.h.Vc),f.b("virtualElements.setDomNodeChildren",f.h.va),(function(){f.ga=function(){this.nd={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(A){switch(A.nodeType){case 1:return A.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(A);case 8:return f.h.Cd(A);default:return!1}},getBindings:function(A,I){var Z=this.getBindingsString(A,I),Z=Z?this.parseBindingsString(Z,I,A):null;return f.j.tc(Z,A,I,!1)},getBindingAccessors:function(A,I){var Z=this.getBindingsString(A,I),Z=Z?this.parseBindingsString(Z,I,A,{valueAccessors:!0}):null;return f.j.tc(Z,A,I,!0)},getBindingsString:function(A){switch(A.nodeType){case 1:return A.getAttribute("data-bind");case 8:return f.h.Vd(A);default:return null}},parseBindingsString:function(A,I,Z,G){try{var w=this.nd,X=A+(G&&G.valueAccessors||""),v;if(!(v=w[X])){var U,k="with($context){with($data||{}){return{"+f.m.vb(A,G)+"}}}";U=new Function("$context","$element",k),v=w[X]=U}return v(I,Z)}catch(P){throw P.message=`Unable to parse bindings.
Bindings value: `+A+`
Message: `+P.message,P}}}),f.ga.instance=new f.ga})(),f.b("bindingProvider",f.ga),(function(){function A(oe){var xe=(oe=f.a.g.get(oe,ye))&&oe.N;xe&&(oe.N=null,xe.Tc())}function I(oe,xe,Ee){this.node=oe,this.yc=xe,this.kb=[],this.H=!1,xe.N||f.a.K.za(oe,A),Ee&&Ee.N&&(Ee.N.kb.push(oe),this.Kb=Ee)}function Z(oe){return function(){return oe}}function G(oe){return oe()}function w(oe){return f.a.Ga(f.u.G(oe),function(xe,Ee){return function(){return oe()[Ee]}})}function X(oe,xe,Ee){return typeof oe=="function"?w(oe.bind(null,xe,Ee)):f.a.Ga(oe,Z)}function v(oe,xe){return w(this.getBindings.bind(this,oe,xe))}function U(oe,xe){var Ee=f.h.firstChild(xe);if(Ee){var Le,Se=f.ga.instance,Fe=Se.preprocessNode;if(Fe){for(;Le=Ee;)Ee=f.h.nextSibling(Le),Fe.call(Se,Le);Ee=f.h.firstChild(xe)}for(;Le=Ee;)Ee=f.h.nextSibling(Le),k(oe,Le)}f.i.ma(xe,f.i.H)}function k(oe,xe){var Ee=oe,Le=xe.nodeType===1;Le&&f.h.Sc(xe),(Le||f.ga.instance.nodeHasBindings(xe))&&(Ee=O(xe,null,oe).bindingContextForDescendants),Ee&&!q[f.a.R(xe)]&&U(Ee,xe)}function P(oe){var xe=[],Ee={},Le=[];return f.a.P(oe,function Se(Fe){if(!Ee[Fe]){var Ue=f.getBindingHandler(Fe);Ue&&(Ue.after&&(Le.push(Fe),f.a.D(Ue.after,function(De){if(oe[De]){if(f.a.A(Le,De)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Le.join(", "));Se(De)}}),Le.length--),xe.push({key:Fe,Mc:Ue})),Ee[Fe]=!0}}),xe}function O(oe,xe,Ee){var Le=f.a.g.Ub(oe,ye,{}),Se=Le.hd;if(!xe){if(Se)throw Error("You cannot apply bindings multiple times to the same element.");Le.hd=!0}Se||(Le.context=Ee),Le.Zb||(Le.Zb={});var Fe;if(xe&&typeof xe!="function")Fe=xe;else{var Ue=f.ga.instance,De=Ue.getBindingAccessors||v,Je=f.$(function(){return(Fe=xe?xe(Ee,oe):De.call(Ue,oe,Ee))&&(Ee[ee]&&Ee[ee](),Ee[te]&&Ee[te]()),Fe},null,{l:oe});Fe&&Je.ja()||(Je=null)}var St=Ee,Oe;if(Fe){var it=function(){return f.a.Ga(Je?Je():Fe,G)},yt=Je?function(Ot){return function(){return G(Je()[Ot])}}:function(Ot){return Fe[Ot]};it.get=function(Ot){return Fe[Ot]&&G(yt(Ot))},it.has=function(Ot){return Ot in Fe},f.i.H in Fe&&f.i.subscribe(oe,f.i.H,function(){var Ot=(0,Fe[f.i.H])();if(Ot){var Mn=f.h.childNodes(oe);Mn.length&&Ot(Mn,f.Ec(Mn[0]))}}),f.i.pa in Fe&&(St=f.i.Cb(oe,Ee),f.i.subscribe(oe,f.i.pa,function(){var Ot=(0,Fe[f.i.pa])();Ot&&f.h.firstChild(oe)&&Ot(oe)})),Le=P(Fe),f.a.D(Le,function(Ot){var Mn=Ot.Mc.init,sn=Ot.Mc.update,ut=Ot.key;if(oe.nodeType===8&&!f.h.ea[ut])throw Error("The binding '"+ut+"' cannot be used with virtual elements");try{typeof Mn=="function"&&f.u.G(function(){var Nt=Mn(oe,yt(ut),it,St.$data,St);if(Nt&&Nt.controlsDescendantBindings){if(Oe!==e)throw Error("Multiple bindings ("+Oe+" and "+ut+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Oe=ut}}),typeof sn=="function"&&f.$(function(){sn(oe,yt(ut),it,St.$data,St)},null,{l:oe})}catch(Nt){throw Nt.message='Unable to process binding "'+ut+": "+Fe[ut]+`"
Message: `+Nt.message,Nt}})}return Le=Oe===e,{shouldBindDescendants:Le,bindingContextForDescendants:Le&&St}}function H(oe,xe){return oe&&oe instanceof f.fa?oe:new f.fa(oe,e,e,xe)}var ee=f.a.Da("_subscribable"),z=f.a.Da("_ancestorBindingInfo"),te=f.a.Da("_dataDependency");f.c={};var q={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(oe){return f.c[oe]};var me={};f.fa=function(oe,xe,Ee,Le,Se){function Fe(){var yt=St?Je():Je,Ot=f.a.f(yt);return xe?(f.a.extend(Ue,xe),z in xe&&(Ue[z]=xe[z])):(Ue.$parents=[],Ue.$root=Ot,Ue.ko=f),Ue[ee]=Oe,De?Ot=Ue.$data:(Ue.$rawData=yt,Ue.$data=Ot),Ee&&(Ue[Ee]=Ot),Le&&Le(Ue,xe,Ot),xe&&xe[ee]&&!f.S.o().Vb(xe[ee])&&xe[ee](),it&&(Ue[te]=it),Ue.$data}var Ue=this,De=oe===me,Je=De?e:oe,St=typeof Je=="function"&&!f.O(Je),Oe,it=Se&&Se.dataDependency;Se&&Se.exportDependencies?Fe():(Oe=f.xb(Fe),Oe.v(),Oe.ja()?Oe.equalityComparer=null:Ue[ee]=e)},f.fa.prototype.createChildContext=function(oe,xe,Ee,Le){if(!Le&&xe&&typeof xe=="object"&&(Le=xe,xe=Le.as,Ee=Le.extend),xe&&Le&&Le.noChildContext){var Se=typeof oe=="function"&&!f.O(oe);return new f.fa(me,this,null,function(Fe){Ee&&Ee(Fe),Fe[xe]=Se?oe():oe},Le)}return new f.fa(oe,this,xe,function(Fe,Ue){Fe.$parentContext=Ue,Fe.$parent=Ue.$data,Fe.$parents=(Ue.$parents||[]).slice(0),Fe.$parents.unshift(Fe.$parent),Ee&&Ee(Fe)},Le)},f.fa.prototype.extend=function(oe,xe){return new f.fa(me,this,null,function(Ee){f.a.extend(Ee,typeof oe=="function"?oe(Ee):oe)},xe)};var ye=f.a.g.Z();I.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},I.prototype.sd=function(oe){f.a.Pa(this.kb,oe),!this.kb.length&&this.H&&this.Cc()},I.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,A),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(oe,xe,Ee,Le,Se){var Fe=f.a.g.Ub(oe,ye,{});return Fe.Fa||(Fe.Fa=new f.T),Se&&Se.notifyImmediately&&Fe.Zb[xe]&&f.u.G(Ee,Le,[oe]),Fe.Fa.subscribe(Ee,Le,xe)},ma:function(oe,xe){var Ee=f.a.g.get(oe,ye);if(Ee&&(Ee.Zb[xe]=!0,Ee.Fa&&Ee.Fa.notifySubscribers(oe,xe),xe==f.i.H)){if(Ee.N)Ee.N.Cc();else if(Ee.N===e&&Ee.Fa&&Ee.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(oe,xe){var Ee=f.a.g.Ub(oe,ye,{});return Ee.N||(Ee.N=new I(oe,Ee,xe[z])),xe[z]==Ee?xe:xe.extend(function(Le){Le[z]=Ee})}},f.Td=function(oe){return(oe=f.a.g.get(oe,ye))&&oe.context},f.ib=function(oe,xe,Ee){return oe.nodeType===1&&f.h.Sc(oe),O(oe,xe,H(Ee))},f.ld=function(oe,xe,Ee){return Ee=H(Ee),f.ib(oe,X(xe,Ee,oe),Ee)},f.Oa=function(oe,xe){xe.nodeType!==1&&xe.nodeType!==8||U(H(oe),xe)},f.vc=function(oe,xe,Ee){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(xe=n.body,!xe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!xe||xe.nodeType!==1&&xe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");k(H(oe,Ee),xe)},f.Dc=function(oe){return!oe||oe.nodeType!==1&&oe.nodeType!==8?e:f.Td(oe)},f.Ec=function(oe){return(oe=f.Dc(oe))?oe.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)})(),(function(A){function I(v,U){var k=Object.prototype.hasOwnProperty.call(w,v)?w[v]:A,P;k?k.subscribe(U):(k=w[v]=new f.T,k.subscribe(U),Z(v,function(O,H){var ee=!(!H||!H.synchronous);X[v]={definition:O,Gd:ee},delete w[v],P||ee?k.notifySubscribers(O):f.na.zb(function(){k.notifySubscribers(O)})}),P=!0)}function Z(v,U){G("getConfig",[v],function(k){k?G("loadComponent",[v,k],function(P){U(P,k)}):U(null,null)})}function G(v,U,k,P){P||(P=f.j.loaders.slice(0));var O=P.shift();if(O){var H=O[v];if(H){var ee=!1;if(H.apply(O,U.concat(function(z){ee?k(null):z!==null?k(z):G(v,U,k,P)}))!==A&&(ee=!0,!O.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else G(v,U,k,P)}else k(null)}var w={},X={};f.j={get:function(v,U){var k=Object.prototype.hasOwnProperty.call(X,v)?X[v]:A;k?k.Gd?f.u.G(function(){U(k.definition)}):f.na.zb(function(){U(k.definition)}):I(v,U)},Bc:function(v){delete X[v]},oc:G},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)})(),(function(){function A(k,P,O,H){function ee(){--te===0&&H(z)}var z={},te=2,q=O.template;O=O.viewModel,q?w(P,q,function(me){f.j.oc("loadTemplate",[k,me],function(ye){z.template=ye,ee()})}):ee(),O?w(P,O,function(me){f.j.oc("loadViewModel",[k,me],function(ye){z[U]=ye,ee()})}):ee()}function I(k,P,O){if(typeof P=="function")O(function(ee){return new P(ee)});else if(typeof P[U]=="function")O(P[U]);else if("instance"in P){var H=P.instance;O(function(){return H})}else"viewModel"in P?I(k,P.viewModel,O):k("Unknown viewModel value: "+P)}function Z(k){switch(f.a.R(k)){case"script":return f.a.ua(k.text);case"textarea":return f.a.ua(k.value);case"template":if(G(k.content))return f.a.Ca(k.content.childNodes)}return f.a.Ca(k.childNodes)}function G(k){return t.DocumentFragment?k instanceof DocumentFragment:k&&k.nodeType===11}function w(k,P,O){typeof P.require=="string"?a||t.require?(a||t.require)([P.require],function(H){H&&typeof H=="object"&&H.Xd&&H.default&&(H=H.default),O(H)}):k("Uses require, but no AMD loader is present"):O(P)}function X(k){return function(P){throw Error("Component '"+k+"': "+P)}}var v={};f.j.register=function(k,P){if(!P)throw Error("Invalid configuration for "+k);if(f.j.tb(k))throw Error("Component "+k+" is already registered");v[k]=P},f.j.tb=function(k){return Object.prototype.hasOwnProperty.call(v,k)},f.j.unregister=function(k){delete v[k],f.j.Bc(k)},f.j.Fc={getConfig:function(k,P){P(f.j.tb(k)?v[k]:null)},loadComponent:function(k,P,O){var H=X(k);w(H,P,function(ee){A(k,H,ee,O)})},loadTemplate:function(k,P,O){if(k=X(k),typeof P=="string")O(f.a.ua(P));else if(P instanceof Array)O(P);else if(G(P))O(f.a.la(P.childNodes));else if(P.element)if(P=P.element,t.HTMLElement?P instanceof HTMLElement:P&&P.tagName&&P.nodeType===1)O(Z(P));else if(typeof P=="string"){var H=n.getElementById(P);H?O(Z(H)):k("Cannot find element with ID "+P)}else k("Unknown element type: "+P);else k("Unknown template value: "+P)},loadViewModel:function(k,P,O){I(X(k),P,O)}};var U="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=v})(),(function(){function A(Z,G){var w=Z.getAttribute("params");if(w){var w=I.parseBindingsString(w,G,Z,{valueAccessors:!0,bindingParams:!0}),w=f.a.Ga(w,function(U){return f.o(U,null,{l:Z})}),X=f.a.Ga(w,function(U){var k=U.v();return U.ja()?f.o({read:function(){return f.a.f(U())},write:f.Za(k)&&function(P){U()(P)},l:Z}):k});return Object.prototype.hasOwnProperty.call(X,"$raw")||(X.$raw=w),X}return{$raw:{}}}f.j.getComponentNameForNode=function(Z){var G=f.a.R(Z);if(f.j.tb(G)&&(G.indexOf("-")!=-1||""+Z=="[object HTMLUnknownElement]"||8>=f.a.W&&Z.tagName===G))return G},f.j.tc=function(Z,G,w,X){if(G.nodeType===1){var v=f.j.getComponentNameForNode(G);if(v){if(Z=Z||{},Z.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var U={name:v,params:A(G,w)};Z.component=X?function(){return U}:U}}return Z};var I=new f.ga;9>f.a.W&&(f.j.register=(function(Z){return function(G){return Z.apply(this,arguments)}})(f.j.register),n.createDocumentFragment=(function(Z){return function(){var G=Z(),w=f.j.dd,X;for(X in w);return G}})(n.createDocumentFragment))})(),(function(){function A(G,w,X){if(w=w.template,!w)throw Error("Component '"+G+"' has no template");G=f.a.Ca(w),f.h.va(X,G)}function I(G,w,X){var v=G.createViewModel;return v?v.call(G,w,X):w}var Z=0;f.c.component={init:function(G,w,X,v,U){function k(){var z=P&&P.dispose;typeof z=="function"&&z.call(P),H&&H.s(),O=P=H=null}var P,O,H,ee=f.a.la(f.h.childNodes(G));return f.h.Ea(G),f.a.K.za(G,k),f.o(function(){var z=f.a.f(w()),te,q;if(typeof z=="string"?te=z:(te=f.a.f(z.name),q=f.a.f(z.params)),!te)throw Error("No component name specified");var me=f.i.Cb(G,U),ye=O=++Z;f.j.get(te,function(oe){if(O===ye){if(k(),!oe)throw Error("Unknown component '"+te+"'");A(te,oe,G);var xe=I(oe,q,{element:G,templateNodes:ee});oe=me.createChildContext(xe,{extend:function(Ee){Ee.$component=xe,Ee.$componentTemplateNodes=ee}}),xe&&xe.koDescendantsComplete&&(H=f.i.subscribe(G,f.i.pa,xe.koDescendantsComplete,xe)),P=xe,f.Oa(oe,G)}})},null,{l:G}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0})();var Y={class:"className",for:"htmlFor"};f.c.attr={update:function(A,I){var Z=f.a.f(I())||{};f.a.P(Z,function(G,w){w=f.a.f(w);var X=G.indexOf(":"),X="lookupNamespaceURI"in A&&0<X&&A.lookupNamespaceURI(G.substr(0,X)),v=w===!1||w===null||w===e;v?X?A.removeAttributeNS(X,G):A.removeAttribute(G):w=w.toString(),8>=f.a.W&&G in Y?(G=Y[G],v?A.removeAttribute(G):A[G]=w):v||(X?A.setAttributeNS(X,G,w):A.setAttribute(G,w)),G==="name"&&f.a.Yc(A,v?"":w)})}},(function(){f.c.checked={after:["value","attr"],init:function(A,I,Z){function G(){var z=A.checked,te=X();if(!f.S.Ya()&&(z||!U&&!f.S.qa())){var q=f.u.G(I);if(P){var me=O?q.v():q,ye=ee;ee=te,ye!==te?z&&(f.a.Na(me,te,!0),f.a.Na(me,ye,!1)):f.a.Na(me,te,z),O&&f.Za(q)&&q(me)}else v&&(te===e?te=z:z||(te=e)),f.m.eb(q,Z,"checked",te,!0)}}function w(){var z=f.a.f(I()),te=X();P?(A.checked=0<=f.a.A(z,te),ee=te):A.checked=v&&te===e?!!z:X()===z}var X=f.xb(function(){if(Z.has("checkedValue"))return f.a.f(Z.get("checkedValue"));if(H)return Z.has("value")?f.a.f(Z.get("value")):A.value}),v=A.type=="checkbox",U=A.type=="radio";if(v||U){var k=I(),P=v&&f.a.f(k)instanceof Array,O=!(P&&k.push&&k.splice),H=U||P,ee=P?X():e;U&&!A.name&&f.c.uniqueName.init(A,function(){return!0}),f.o(G,null,{l:A}),f.a.B(A,"click",G),f.o(w,null,{l:A}),k=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(A,I){A.value=f.a.f(I())}}})(),f.c.class={update:function(A,I){var Z=f.a.Db(f.a.f(I()));f.a.Eb(A,A.__ko__cssValue,!1),A.__ko__cssValue=Z,f.a.Eb(A,Z,!0)}},f.c.css={update:function(A,I){var Z=f.a.f(I());Z!==null&&typeof Z=="object"?f.a.P(Z,function(G,w){w=f.a.f(w),f.a.Eb(A,G,w)}):f.c.class.update(A,I)}},f.c.enable={update:function(A,I){var Z=f.a.f(I());Z&&A.disabled?A.removeAttribute("disabled"):Z||A.disabled||(A.disabled=!0)}},f.c.disable={update:function(A,I){f.c.enable.update(A,function(){return!f.a.f(I())})}},f.c.event={init:function(A,I,Z,G,w){var X=I()||{};f.a.P(X,function(v){typeof v=="string"&&f.a.B(A,v,function(U){var k,P=I()[v];if(P){try{var O=f.a.la(arguments);G=w.$data,O.unshift(G),k=P.apply(G,O)}finally{k!==!0&&(U.preventDefault?U.preventDefault():U.returnValue=!1)}Z.get(v+"Bubble")===!1&&(U.cancelBubble=!0,U.stopPropagation&&U.stopPropagation())}})})}},f.c.foreach={Rc:function(A){return function(){var I=A(),Z=f.a.bc(I);return!Z||typeof Z.length=="number"?{foreach:I,templateEngine:f.ba.Ma}:(f.a.f(I),{foreach:Z.data,as:Z.as,noChildContext:Z.noChildContext,includeDestroyed:Z.includeDestroyed,afterAdd:Z.afterAdd,beforeRemove:Z.beforeRemove,afterRender:Z.afterRender,beforeMove:Z.beforeMove,afterMove:Z.afterMove,templateEngine:f.ba.Ma})}},init:function(A,I){return f.c.template.init(A,f.c.foreach.Rc(I))},update:function(A,I,Z,G,w){return f.c.template.update(A,f.c.foreach.Rc(I),Z,G,w)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(A,I,Z){function G(v){A.__ko_hasfocusUpdating=!0;var U=A.ownerDocument;if("activeElement"in U){var k;try{k=U.activeElement}catch{k=U.body}v=k===A}U=I(),f.m.eb(U,Z,"hasfocus",v,!0),A.__ko_hasfocusLastValue=v,A.__ko_hasfocusUpdating=!1}var w=G.bind(null,!0),X=G.bind(null,!1);f.a.B(A,"focus",w),f.a.B(A,"focusin",w),f.a.B(A,"blur",X),f.a.B(A,"focusout",X),A.__ko_hasfocusLastValue=!1},update:function(A,I){var Z=!!f.a.f(I());A.__ko_hasfocusUpdating||A.__ko_hasfocusLastValue===Z||(Z?A.focus():A.blur(),!Z&&A.__ko_hasfocusLastValue&&A.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[A,Z?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(A,I){f.a.fc(A,I())}},(function(){function A(I,Z,G){f.c[I]={init:function(w,X,v,U,k){var P,O,H={},ee,z,te;if(Z){U=v.get("as");var q=v.get("noChildContext");te=!(U&&q),H={as:U,noChildContext:q,exportDependencies:te}}return z=(ee=v.get("completeOn")=="render")||v.has(f.i.pa),f.o(function(){var me=f.a.f(X()),ye=!G!=!me,oe=!O,xe;(te||ye!==P)&&(z&&(k=f.i.Cb(w,k)),ye&&((!Z||te)&&(H.dataDependency=f.S.o()),xe=Z?k.createChildContext(typeof me=="function"?me:X,H):f.S.qa()?k.extend(null,H):k),oe&&f.S.qa()&&(O=f.a.Ca(f.h.childNodes(w),!0)),ye?(oe||f.h.va(w,f.a.Ca(O)),f.Oa(xe,w)):(f.h.Ea(w),ee||f.i.ma(w,f.i.H)),P=ye)},null,{l:w}),{controlsDescendantBindings:!0}}},f.m.Ra[I]=!1,f.h.ea[I]=!0}A("if"),A("ifnot",!1,!0),A("with",!0)})(),f.c.let={init:function(A,I,Z,G,w){return I=w.extend(I),f.Oa(I,A),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var N={};f.c.options={init:function(A){if(f.a.R(A)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<A.length;)A.remove(0);return{controlsDescendantBindings:!0}},update:function(A,I,Z){function G(){return f.a.jb(A.options,function(q){return q.selected})}function w(q,me,ye){var oe=typeof me;return oe=="function"?me(q):oe=="string"?q[me]:ye}function X(q,me){if(z&&P)f.i.ma(A,f.i.H);else if(ee.length){var ye=0<=f.a.A(ee,f.w.M(me[0]));f.a.Zc(me[0],ye),z&&!ye&&f.u.G(f.a.Fb,null,[A,"change"])}}var v=A.multiple,U=A.length!=0&&v?A.scrollTop:null,k=f.a.f(I()),P=Z.get("valueAllowUnset")&&Z.has("value"),O=Z.get("optionsIncludeDestroyed");I={};var H,ee=[];P||(v?ee=f.a.Mb(G(),f.w.M):0<=A.selectedIndex&&ee.push(f.w.M(A.options[A.selectedIndex]))),k&&(typeof k.length>"u"&&(k=[k]),H=f.a.jb(k,function(q){return O||q===e||q===null||!f.a.f(q._destroy)}),Z.has("optionsCaption")&&(k=f.a.f(Z.get("optionsCaption")),k!==null&&k!==e&&H.unshift(N)));var z=!1;if(I.beforeRemove=function(q){A.removeChild(q)},k=X,Z.has("optionsAfterRender")&&typeof Z.get("optionsAfterRender")=="function"&&(k=function(q,me){X(0,me),f.u.G(Z.get("optionsAfterRender"),null,[me[0],q!==N?q:e])}),f.a.ec(A,H,function(q,me,ye){return ye.length&&(ee=!P&&ye[0].selected?[f.w.M(ye[0])]:[],z=!0),me=A.ownerDocument.createElement("option"),q===N?(f.a.Bb(me,Z.get("optionsCaption")),f.w.cb(me,e)):(ye=w(q,Z.get("optionsValue"),q),f.w.cb(me,f.a.f(ye)),q=w(q,Z.get("optionsText"),ye),f.a.Bb(me,q)),[me]},I,k),!P){var te;v?te=ee.length&&G().length<ee.length:te=ee.length&&0<=A.selectedIndex?f.w.M(A.options[A.selectedIndex])!==ee[0]:ee.length||0<=A.selectedIndex,te&&f.u.G(f.a.Fb,null,[A,"change"])}(P||f.S.Ya())&&f.i.ma(A,f.i.H),f.a.wd(A),U&&20<Math.abs(U-A.scrollTop)&&(A.scrollTop=U)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(A,I,Z){function G(){var v=I(),U=[];f.a.D(A.getElementsByTagName("option"),function(k){k.selected&&U.push(f.w.M(k))}),f.m.eb(v,Z,"selectedOptions",U)}function w(){var v=f.a.f(I()),U=A.scrollTop;v&&typeof v.length=="number"&&f.a.D(A.getElementsByTagName("option"),function(k){var P=0<=f.a.A(v,f.w.M(k));k.selected!=P&&f.a.Zc(k,P)}),A.scrollTop=U}if(f.a.R(A)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var X;f.i.subscribe(A,f.i.H,function(){X?G():(f.a.B(A,"change",G),X=f.o(w,null,{l:A}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(A,I){var Z=f.a.f(I()||{});f.a.P(Z,function(G,w){if(w=f.a.f(w),(w===null||w===e||w===!1)&&(w=""),o)o(A).css(G,w);else if(/^--/.test(G))A.style.setProperty(G,w);else{G=G.replace(/-(\w)/g,function(v,U){return U.toUpperCase()});var X=A.style[G];A.style[G]=w,w===X||A.style[G]!=X||isNaN(w)||(A.style[G]=w+"px")}})}},f.c.submit={init:function(A,I,Z,G,w){if(typeof I()!="function")throw Error("The value for a submit binding must be a function");f.a.B(A,"submit",function(X){var v,U=I();try{v=U.call(w.$data,A)}finally{v!==!0&&(X.preventDefault?X.preventDefault():X.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(A,I){f.a.Bb(A,I())}},f.h.ea.text=!0,(function(){if(t&&t.navigator){var A=function(H){if(H)return parseFloat(H[1])},I=t.navigator.userAgent,Z,G,w,X,v;(Z=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(v=A(I.match(/Edge\/([^ ]+)$/)))||A(I.match(/Chrome\/([^ ]+)/))||(G=A(I.match(/Version\/([^ ]+) Safari/)))||(w=A(I.match(/Firefox\/([^ ]+)/)))||(X=f.a.W||A(I.match(/MSIE ([^ ]+)/)))||(X=A(I.match(/rv:([^ )]+)/)))}if(8<=X&&10>X)var U=f.a.g.Z(),k=f.a.g.Z(),P=function(H){var ee=this.activeElement;(ee=ee&&f.a.g.get(ee,k))&&ee(H)},O=function(H,ee){var z=H.ownerDocument;f.a.g.get(z,U)||(f.a.g.set(z,U,!0),f.a.B(z,"selectionchange",P)),f.a.g.set(H,k,ee)};f.c.textInput={init:function(H,ee,z){function te(Fe,Ue){f.a.B(H,Fe,Ue)}function q(){var Fe=f.a.f(ee());(Fe===null||Fe===e)&&(Fe=""),Ee!==e&&Fe===Ee?f.a.setTimeout(q,4):H.value!==Fe&&(Se=!0,H.value=Fe,Se=!1,oe=H.value)}function me(){xe||(Ee=H.value,xe=f.a.setTimeout(ye,4))}function ye(){clearTimeout(xe),Ee=xe=e;var Fe=H.value;oe!==Fe&&(oe=Fe,f.m.eb(ee(),z,"textInput",Fe))}var oe=H.value,xe,Ee,Le=f.a.W==9?me:ye,Se=!1;X&&te("keypress",ye),11>X&&te("propertychange",function(Fe){Se||Fe.propertyName!=="value"||Le(Fe)}),X==8&&(te("keyup",ye),te("keydown",ye)),O&&(O(H,Le),te("dragend",me)),(!X||9<=X)&&te("input",Le),5>G&&f.a.R(H)==="textarea"?(te("keydown",me),te("paste",me),te("cut",me)):11>Z?te("keydown",me):4>w?(te("DOMAutoComplete",ye),te("dragdrop",ye),te("drop",ye)):v&&H.type==="number"&&te("keydown",me),te("change",ye),te("blur",ye),f.o(q,null,{l:H})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(H,ee,z){z("textInput",H)}}})(),f.c.uniqueName={init:function(A,I){if(I()){var Z="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(A,Z)}}},f.c.uniqueName.rd=0,f.c.using={init:function(A,I,Z,G,w){var X;return Z.has("as")&&(X={as:Z.get("as"),noChildContext:Z.get("noChildContext")}),I=w.createChildContext(I,X),f.Oa(I,A),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(A,I,Z){var G=f.a.R(A),w=G=="input";if(!w||A.type!="checkbox"&&A.type!="radio"){var X=[],v=Z.get("valueUpdate"),U=!1,k=null;v&&(typeof v=="string"?X=[v]:X=f.a.wc(v),f.a.Pa(X,"change"));var P=function(){k=null,U=!1;var ee=I(),z=f.w.M(A);f.m.eb(ee,Z,"value",z)};!f.a.W||!w||A.type!="text"||A.autocomplete=="off"||A.form&&A.form.autocomplete=="off"||f.a.A(X,"propertychange")!=-1||(f.a.B(A,"propertychange",function(){U=!0}),f.a.B(A,"focus",function(){U=!1}),f.a.B(A,"blur",function(){U&&P()})),f.a.D(X,function(ee){var z=P;f.a.Ud(ee,"after")&&(z=function(){k=f.w.M(A),f.a.setTimeout(P,0)},ee=ee.substring(5)),f.a.B(A,ee,z)});var O;if(O=w&&A.type=="file"?function(){var ee=f.a.f(I());ee===null||ee===e||ee===""?A.value="":f.u.G(P)}:function(){var ee=f.a.f(I()),z=f.w.M(A);k!==null&&ee===k?f.a.setTimeout(O,0):(ee!==z||z===e)&&(G==="select"?(z=Z.get("valueAllowUnset"),f.w.cb(A,ee,z),z||ee===f.w.M(A)||f.u.G(P)):f.w.cb(A,ee))},G==="select"){var H;f.i.subscribe(A,f.i.H,function(){H?Z.get("valueAllowUnset")?O():P():(f.a.B(A,"change",P),H=f.o(O,null,{l:A}))},null,{notifyImmediately:!0})}else f.a.B(A,"change",P),f.o(O,null,{l:A})}else f.ib(A,{checkedValue:I})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(A,I){var Z=f.a.f(I()),G=A.style.display!="none";Z&&!G?A.style.display="":!Z&&G&&(A.style.display="none")}},f.c.hidden={update:function(A,I){f.c.visible.update(A,function(){return!f.a.f(I())})}},(function(A){f.c[A]={init:function(I,Z,G,w,X){return f.c.event.init.call(this,I,function(){var v={};return v[A]=Z(),v},G,w,X)}}})("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.prototype.makeTemplateSource=function(A,I){if(typeof A=="string"){I=I||n;var Z=I.getElementById(A);if(!Z)throw Error("Cannot find template with ID "+A);return new f.C.F(Z)}if(A.nodeType==1||A.nodeType==8)return new f.C.ia(A);throw Error("Unknown template type: "+A)},f.ca.prototype.renderTemplate=function(A,I,Z,G){return A=this.makeTemplateSource(A,G),this.renderTemplateSource(A,I,Z,G)},f.ca.prototype.isTemplateRewritten=function(A,I){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(A,I).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(A,I,Z){A=this.makeTemplateSource(A,Z),I=I(A.text()),A.text(I),A.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=(function(){function A(G,w,X,v){G=f.m.ac(G);for(var U=f.m.Ra,k=0;k<G.length;k++){var P=G[k].key;if(Object.prototype.hasOwnProperty.call(U,P)){var O=U[P];if(typeof O=="function"){if(P=O(G[k].value))throw Error(P)}else if(!O)throw Error("This template engine does not support the '"+P+"' binding within its templates")}}return X="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(G,{valueAccessors:!0})+" } })()},'"+X.toLowerCase()+"')",v.createJavaScriptEvaluatorBlock(X)+w}var I=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,Z=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(G,w,X){w.isTemplateRewritten(G,X)||w.rewriteTemplate(G,function(v){return f.kc.Ld(v,w)},X)},Ld:function(G,w){return G.replace(I,function(X,v,U,k,P){return A(P,v,U,w)}).replace(Z,function(X,v){return A(v,"<!-- ko -->","#comment",w)})},md:function(G,w){return f.aa.Xb(function(X,v){var U=X.nextSibling;U&&U.nodeName.toLowerCase()===w&&f.ib(U,G,v)})}}})(),f.b("__tr_ambtns",f.kc.md),(function(){f.C={},f.C.F=function(Z){if(this.F=Z){var G=f.a.R(Z);this.ab=G==="script"?1:G==="textarea"?2:G=="template"&&Z.content&&Z.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var Z=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[Z];var G=arguments[0];Z==="innerHTML"?f.a.fc(this.F,G):this.F[Z]=G};var A=f.a.g.Z()+"_";f.C.F.prototype.data=function(Z){if(arguments.length===1)return f.a.g.get(this.F,A+Z);f.a.g.set(this.F,A+Z,arguments[1])};var I=f.a.g.Z();f.C.F.prototype.nodes=function(){var Z=this.F;if(arguments.length==0){var G=f.a.g.get(Z,I)||{},w=G.lb||(this.ab===3?Z.content:this.ab===4?Z:e);if(!w||G.jd){var X=this.text();X&&X!==G.bb&&(w=f.a.Md(X,Z.ownerDocument),f.a.g.set(Z,I,{lb:w,bb:X,jd:!0}))}return w}G=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(Z,I,{lb:G})},f.C.ia=function(Z){this.F=Z},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var Z=f.a.g.get(this.F,I)||{};return Z.bb===e&&Z.lb&&(Z.bb=Z.lb.innerHTML),Z.bb}f.a.g.set(this.F,I,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)})(),(function(){function A(k,P,O){var H;for(P=f.h.nextSibling(P);k&&(H=k)!==P;)k=f.h.nextSibling(H),O(H,k)}function I(k,P){if(k.length){var O=k[0],H=k[k.length-1],ee=O.parentNode,z=f.ga.instance,te=z.preprocessNode;if(te){if(A(O,H,function(q,me){var ye=q.previousSibling,oe=te.call(z,q);oe&&(q===O&&(O=oe[0]||me),q===H&&(H=oe[oe.length-1]||ye))}),k.length=0,!O)return;O===H?k.push(O):(k.push(O,H),f.a.Ua(k,ee))}A(O,H,function(q){q.nodeType!==1&&q.nodeType!==8||f.vc(P,q)}),A(O,H,function(q){q.nodeType!==1&&q.nodeType!==8||f.aa.cd(q,[P])}),f.a.Ua(k,ee)}}function Z(k){return k.nodeType?k:0<k.length?k[0]:null}function G(k,P,O,H,ee){ee=ee||{};var z=(k&&Z(k)||O||{}).ownerDocument,te=ee.templateEngine||X;if(f.kc.xd(O,te,z),O=te.renderTemplate(O,H,ee,z),typeof O.length!="number"||0<O.length&&typeof O[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(z=!1,P){case"replaceChildren":f.h.va(k,O),z=!0;break;case"replaceNode":f.a.Xc(k,O),z=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+P)}return z&&(I(O,H),ee.afterRender&&f.u.G(ee.afterRender,null,[O,H[ee.as||"$data"]]),P=="replaceChildren"&&f.i.ma(k,f.i.H)),O}function w(k,P,O){return f.O(k)?k():typeof k=="function"?k(P,O):k}var X;f.gc=function(k){if(k!=e&&!(k instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");X=k},f.dc=function(k,P,O,H,ee){if(O=O||{},(O.templateEngine||X)==e)throw Error("Set a template engine before calling renderTemplate");if(ee=ee||"replaceChildren",H){var z=Z(H);return f.$(function(){var q=P&&P instanceof f.fa?P:new f.fa(P,null,null,null,{exportDependencies:!0}),te=w(k,q.$data,q),q=G(H,ee,te,q,O);ee=="replaceNode"&&(H=q,z=Z(H))},null,{Sa:function(){return!z||!f.a.Sb(z)},l:z&&ee=="replaceNode"?z.parentNode:z})}return f.aa.Xb(function(te){f.dc(k,P,O,te,"replaceNode")})},f.Qd=function(k,P,O,H,ee){function z(Ee,Le){f.u.G(f.a.ec,null,[H,Ee,q,O,te,Le]),f.i.ma(H,f.i.H)}function te(Ee,Le){I(Le,me),O.afterRender&&O.afterRender(Le,Ee),me=null}function q(Ee,Le){me=ee.createChildContext(Ee,{as:ye,noChildContext:O.noChildContext,extend:function(Fe){Fe.$index=Le,ye&&(Fe[ye+"Index"]=Le)}});var Se=w(k,Ee,me);return G(H,"ignoreTargetNode",Se,me,O)}var me,ye=O.as,oe=O.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!O.includeDestroyed;if(oe||O.beforeRemove||!f.Pc(P))return f.$(function(){var Ee=f.a.f(P)||[];typeof Ee.length>"u"&&(Ee=[Ee]),oe&&(Ee=f.a.jb(Ee,function(Le){return Le===e||Le===null||!f.a.f(Le._destroy)})),z(Ee)},null,{l:H});z(P.v());var xe=P.subscribe(function(Ee){z(P(),Ee)},null,"arrayChange");return xe.l(H),xe};var v=f.a.g.Z(),U=f.a.g.Z();f.c.template={init:function(k,P){var O=f.a.f(P());if(typeof O=="string"||"name"in O)f.h.Ea(k);else if("nodes"in O){if(O=O.nodes||[],f.O(O))throw Error('The "nodes" option must be a plain, non-observable array.');var H=O[0]&&O[0].parentNode;H&&f.a.g.get(H,U)||(H=f.a.Yb(O),f.a.g.set(H,U,!0)),new f.C.ia(k).nodes(H)}else if(O=f.h.childNodes(k),0<O.length)H=f.a.Yb(O),new f.C.ia(k).nodes(H);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(k,P,O,H,ee){var z=P();P=f.a.f(z),O=!0,H=null,typeof P=="string"?P={}:(z="name"in P?P.name:k,"if"in P&&(O=f.a.f(P.if)),O&&"ifnot"in P&&(O=!f.a.f(P.ifnot)),O&&!z&&(O=!1)),"foreach"in P?H=f.Qd(z,O&&P.foreach||[],P,k,ee):O?(O=ee,"data"in P&&(O=ee.createChildContext(P.data,{as:P.as,noChildContext:P.noChildContext,exportDependencies:!0})),H=f.dc(z,O,P,k)):f.h.Ea(k),ee=H,(P=f.a.g.get(k,v))&&typeof P.s=="function"&&P.s(),f.a.g.set(k,v,!ee||ee.ja&&!ee.ja()?e:ee)}},f.m.Ra.template=function(k){return k=f.m.ac(k),k.length==1&&k[0].unknown||f.m.Id(k,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0})(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(A,I,Z){if(A.length&&I.length){var G,w,X,v,U;for(G=w=0;(!Z||G<Z)&&(v=A[w]);++w){for(X=0;U=I[X];++X)if(v.value===U.value){v.moved=U.index,U.moved=v.index,I.splice(X,1),G=X=0;break}G+=X}}},f.a.Pb=(function(){function A(I,Z,G,w,X){var v=Math.min,U=Math.max,k=[],P,O=I.length,H,ee=Z.length,z=ee-O||1,te=O+ee+1,q,me,ye;for(P=0;P<=O;P++)for(me=q,k.push(q=[]),ye=v(ee,P+z),H=U(0,P-1);H<=ye;H++)q[H]=H?P?I[P-1]===Z[H-1]?me[H-1]:v(me[H]||te,q[H-1]||te)+1:H+1:P+1;for(v=[],U=[],z=[],P=O,H=ee;P||H;)ee=k[P][H]-1,H&&ee===k[P][H-1]?U.push(v[v.length]={status:G,value:Z[--H],index:H}):P&&ee===k[P-1][H]?z.push(v[v.length]={status:w,value:I[--P],index:P}):(--H,--P,X.sparse||v.push({status:"retained",value:Z[H]}));return f.a.Kc(z,U,!X.dontLimitMoves&&10*O),v.reverse()}return function(I,Z,G){return G=typeof G=="boolean"?{dontLimitMoves:G}:G||{},I=I||[],Z=Z||[],I.length<Z.length?A(I,Z,"added","deleted",G):A(Z,I,"deleted","added",G)}})(),f.b("utils.compareArrays",f.a.Pb),(function(){function A(G,w,X,v,U){var k=[],P=f.$(function(){var O=w(X,U,f.a.Ua(k,G))||[];0<k.length&&(f.a.Xc(k,O),v&&f.u.G(v,null,[X,O,U])),k.length=0,f.a.Nb(k,O)},null,{l:G,Sa:function(){return!f.a.kd(k)}});return{Y:k,$:P.ja()?P:e}}var I=f.a.g.Z(),Z=f.a.g.Z();f.a.ec=function(G,w,X,v,U,k){function P(Ot){Se={Aa:Ot,pb:f.ta(me++)},te.push(Se),z||Le.push(Se)}function O(Ot){Se=ee[Ot],me!==Se.pb.v()&&Ee.push(Se),Se.pb(me++),f.a.Ua(Se.Y,G),te.push(Se)}function H(Ot,Mn){if(Ot)for(var sn=0,ut=Mn.length;sn<ut;sn++)f.a.D(Mn[sn].Y,function(Nt){Ot(Nt,sn,Mn[sn].Aa)})}w=w||[],typeof w.length>"u"&&(w=[w]),v=v||{};var ee=f.a.g.get(G,I),z=!ee,te=[],q=0,me=0,ye=[],oe=[],xe=[],Ee=[],Le=[],Se,Fe=0;if(z)f.a.D(w,P);else{if(!k||ee&&ee._countWaitingForRemove){var Ue=f.a.Mb(ee,function(Ot){return Ot.Aa});k=f.a.Pb(Ue,w,{dontLimitMoves:v.dontLimitMoves,sparse:!0})}for(var Ue=0,De,Je,St;De=k[Ue];Ue++)switch(Je=De.moved,St=De.index,De.status){case"deleted":for(;q<St;)O(q++);Je===e&&(Se=ee[q],Se.$&&(Se.$.s(),Se.$=e),f.a.Ua(Se.Y,G).length&&(v.beforeRemove&&(te.push(Se),Fe++,Se.Aa===Z?Se=null:xe.push(Se)),Se&&ye.push.apply(ye,Se.Y))),q++;break;case"added":for(;me<St;)O(q++);Je!==e?(oe.push(te.length),O(Je)):P(De.value)}for(;me<w.length;)O(q++);te._countWaitingForRemove=Fe}f.a.g.set(G,I,te),H(v.beforeMove,Ee),f.a.D(ye,v.beforeRemove?f.oa:f.removeNode);var Oe,it,yt;try{yt=G.ownerDocument.activeElement}catch{}if(oe.length)for(;(Ue=oe.shift())!=e;){for(Se=te[Ue],Oe=e;Ue;)if((it=te[--Ue].Y)&&it.length){Oe=it[it.length-1];break}for(w=0;q=Se.Y[w];Oe=q,w++)f.h.Wb(G,q,Oe)}for(Ue=0;Se=te[Ue];Ue++){for(Se.Y||f.a.extend(Se,A(G,X,Se.Aa,U,Se.pb)),w=0;q=Se.Y[w];Oe=q,w++)f.h.Wb(G,q,Oe);!Se.Ed&&U&&(U(Se.Aa,Se.Y,Se.pb),Se.Ed=!0,Oe=Se.Y[Se.Y.length-1])}for(yt&&G.ownerDocument.activeElement!=yt&&yt.focus(),H(v.beforeRemove,xe),Ue=0;Ue<xe.length;++Ue)xe[Ue].Aa=Z;H(v.afterMove,Ee),H(v.afterAdd,Le)}})(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(A,I,Z,G){return(I=!(9>f.a.W)&&A.nodes?A.nodes():null)?f.a.la(I.cloneNode(!0).childNodes):(A=A.text(),f.a.ua(A,G))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),(function(){f.$a=function(){var I=this.Hd=(function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(Z,G,w,X){if(X=X||n,w=w||{},2>I)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var v=Z.data("precompiled");return v||(v=Z.text()||"",v=o.template(null,"{{ko_with $item.koBindingContext}}"+v+"{{/ko_with}}"),Z.data("precompiled",v)),Z=[G.$data],G=o.extend({koBindingContext:G},w.templateOptions),G=o.tmpl(v,Z,G),G.appendTo(X.createElement("div")),o.fragments={},G},this.createJavaScriptEvaluatorBlock=function(Z){return"{{ko_code ((function() { return "+Z+" })()) }}"},this.addTemplate=function(Z,G){n.write("<script type='text/html' id='"+Z+"'>"+G+"<\/script>")},0<I&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var A=new f.$a;0<A.Hd&&f.gc(A),f.b("jqueryTmplTemplateEngine",f.$a)})()})})()})()})();var fLt=ko;typeof window<"u"?(ko=window.ko,typeof uU<"u"?window.ko=uU:delete window.ko):(ko=global.ko,typeof uU<"u"?global.ko=uU:delete global.ko);var LT=fLt;var WPo=y(x(),1);/**
 * @license
 * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
 * Copyright (c) Steve Sanderson
 * MIT license
 */var Mee="__knockoutObservables",Uee="__knockoutSubscribable";function xZe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=CZe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Mee||o===Uee)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&ALt(n,a)}}),e}function CZe(e,t){var n=e[Mee];return!n&&t&&(n={},Object.defineProperty(e,Mee,{value:n})),n}function pLt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),xZe.call(i,e,[t]),e}function ALt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=gLt(e,t,i))})}function gLt(e,t,n){var i=bLt(e,n);return i.subscribe(t)}function bLt(e,t){var n=t[Uee];if(!n){n=new e.subscribable,Object.defineProperty(t,Uee,{value:n});var i={};yLt(t,n,i),xLt(e,t,n,i)}return n}function yLt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function xLt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function EZe(e,t){if(!e)return null;var n=CZe(e,!1);return n&&n[t]||null}function CLt(e,t){var n=EZe(e,t);n&&n.valueHasMutated()}function ELt(e){e.track=xZe,e.getObservable=EZe,e.valueHasMutated=CLt,e.defineProperty=pLt}var mU={attachToKo:ELt};var BPo=y(x(),1),TZe="http://www.w3.org/2000/svg",SZe="cesium-svgPath-svg",TLt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(TZe,"svg:svg");i.setAttribute("class",SZe);let o=document.createElementNS(TZe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${SZe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},hU=TLt;mU.attachToKo(LT);hU.register(LT);var _e=LT;function fU(e){l(e)||(e=new of),this._clock=e,this._eventHelper=new Xr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=_e.observable(j.now()),this.systemTime.equalityComparer=j.equals,this.startTime=_e.observable(e.startTime),this.startTime.equalityComparer=j.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=_e.observable(e.stopTime),this.stopTime.equalityComparer=j.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=_e.observable(e.currentTime),this.currentTime.equalityComparer=j.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=_e.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=_e.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=_e.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=_e.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=_e.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),_e.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(fU.prototype,{clock:{get:function(){return this._clock}}});fU.prototype.synchronize=function(){let e=this._clock;this.systemTime=j.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};fU.prototype.isDestroyed=function(){return!1};fU.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var pU=fU;var OPo=y(x(),1);function SLt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,Ae.throwInstantiationError()}var Dee=SLt;var JPo=y(x(),1);var $Z={};$Z.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};$Z.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};$Z.createRangeInput=function(e,t,n,i,o,r){r=r??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(c),d};$Z.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};$Z.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Yd=$Z;var nMo=y(x(),1);function IZe(e,t){this._command=e,t=t??Q.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",_e.track(this,["toggled","tooltip"])}Object.defineProperties(IZe.prototype,{command:{get:function(){return this._command}}});var Ky=IZe;var cMo=y(x(),1);function ILt(e,t){t=t??!0;let n=new Ce,i=new Ce;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,_e.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Fn=ILt;var uMo=y(x(),1);function _Lt(e,t,n,i,o){return n.call(i,e[t]),_e.getObservable(e,t).subscribe(n,i,o)}var cc=_Lt;var SMo=y(x(),1);var gMo=y(x(),1);function _Ze(e){e=e??Q.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??Q.EMPTY_ARRAY,i=e.terrainProviderViewModels??Q.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,_e.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=_e.getObservable(this,"imageryProviderViewModels"),r=_e.pureComputed(function(){let h=o(),p={},g;for(g=0;g<h.length;g++){let C=h[g],E=C.category;l(p[E])?p[E].push(C):p[E]=[C]}let f=Object.keys(p),b=[];for(g=0;g<f.length;g++){let C=f[g];b.push({name:C,providers:p[C]})}return b});this._imageryProviders=r;let s=_e.getObservable(this,"terrainProviderViewModels"),a=_e.pureComputed(function(){let h=s(),p={},g;for(g=0;g<h.length;g++){let C=h[g],E=C.category;l(p[E])?p[E].push(C):p[E]=[C]}let f=Object.keys(p),b=[];for(g=0;g<f.length;g++){let C=f[g];b.push({name:C,providers:p[C]})}return b});this._terrainProviders=a,this.buttonTooltip=void 0,_e.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,g=l(h)?h.name:void 0,f=l(p)?p.name:void 0;return l(g)&&l(f)?`${g}
${f}`:l(g)?g:f}),this.buttonImageUrl=void 0,_e.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=_e.observable();this._currentImageryLayers=[],_e.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,f=g.length,b=this._globe.imageryLayers,C=!1;for(p=0;p<f;p++){let E=b.length;for(let T=0;T<E;T++){let S=b.get(T);if(S===g[p]){b.remove(S),C=!0;break}}}if(l(h)){let E=h.creationCommand();if(Array.isArray(E)){let T=E.length;for(this._currentImageryLayers=[],p=T-1;p>=0;p--){let S=ds.fromProviderAsync(E[p]);b.add(S,0),this._currentImageryLayers.push(S)}}else{this._currentImageryLayers=[];let T=ds.fromProviderAsync(E);if(T.name=h.name,C)b.add(T,0);else{let S=b.get(0);l(S)&&b.remove(S),b.add(T,0)}this._currentImageryLayers.push(T)}}c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=_e.observable();_e.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(h){if(d()===h){this.dropDownVisible=!1;return}let p;if(l(h)&&(p=h.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof kp),this._globe.terrainProvider=p;else if(l(p)){let g=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,f()}),C=new aU(p).readyEvent.addEventListener(E=>{g||(this._globe.depthTestAgainstTerrain=!(E instanceof kp),this._globe.terrainProvider=E,C())})}d(h),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Fn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(_Ze.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var AU=_Ze;function LO(e,t){e=Xn(e);let n=new AU(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),c.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let 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; }'),u.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),h.appendChild(g);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let b=document.createElement("div");b.className="cesium-baseLayerPicker-section",b.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(b);let C=document.createElement("div");C.className="cesium-baseLayerPicker-category",b.appendChild(C);let E=document.createElement("div");E.className="cesium-baseLayerPicker-categoryTitle",E.setAttribute("data-bind","text: name"),C.appendChild(E);let T=document.createElement("div");T.className="cesium-baseLayerPicker-choices",T.setAttribute("data-bind","foreach: providers"),C.appendChild(T);let S=document.createElement("div");S.className="cesium-baseLayerPicker-item",S.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),T.appendChild(S);let _=document.createElement("img");_.className="cesium-baseLayerPicker-itemIcon",_.setAttribute("data-bind","attr: { src: iconUrl }"),_.setAttribute("draggable","false"),S.appendChild(_);let R=document.createElement("div");R.className="cesium-baseLayerPicker-itemLabel",R.setAttribute("data-bind","text: name"),S.appendChild(R),_e.applyBindings(n,i),_e.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(L){i.contains(L.target)||r.contains(L.target)||(n.dropDownVisible=!1)},rn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(LO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});LO.prototype.isDestroyed=function(){return!1};LO.prototype.destroy=function(){return rn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),_e.cleanNode(this._element),_e.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),fe(this)};var gU=LO;var VMo=y(x(),1);function ZZe(e){let t=e.creationFunction;l(t.canExecute)||(t=Fn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",_e.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(ZZe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var or=ZZe;var BMo=y(x(),1);function ZLt(){let e=[],t=devicePixelRatio>=2;return e.push(new or({name:"Bing Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return fg({style:hg.AERIAL})}})),e.push(new or({name:"Bing Maps Aerial with Labels",iconUrl:en("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return fg({style:hg.AERIAL_WITH_LABELS})}})),e.push(new or({name:"Bing Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return fg({style:hg.ROAD})}})),e.push(new or({name:"ArcGIS World Imagery",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS 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 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at 
https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return ug.fromBasemapType(Mh.SATELLITE,{enablePickFeatures:!1})}})),e.push(new or({name:"ArcGIS World Hillshade",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at 
https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return ug.fromBasemapType(Mh.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new or({name:"Esri World Ocean",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data.  The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at 
https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return ug.fromBasemapType(Mh.OCEANS,{enablePickFeatures:!1})}})),e.push(new or({name:"Open\xADStreet\xADMap",iconUrl:en("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new Eb({url:"https://tile.openstreetmap.org/"})}})),e.push(new or({name:"Stadia x Stamen Watercolor",iconUrl:en("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.
https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new Eb({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
           &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
           &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
           &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new or({name:"Stadia x Stamen Toner",iconUrl:en("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays.
https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new Eb({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
            &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
            &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
            &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new or({name:"Stadia Alidade Smooth",iconUrl:en("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new Eb({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
            &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
            &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new or({name:"Stadia Alidade Smooth Dark",iconUrl:en("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new Eb({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
            &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
            &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new or({name:"Sentinel-2",iconUrl:en("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 Fl.fromAssetId(3954)}})),e.push(new or({name:"Blue Marble",iconUrl:en("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Fl.fromAssetId(3845)}})),e.push(new or({name:"Earth at night",iconUrl:en("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 Fl.fromAssetId(3812)}})),e.push(new or({name:"Natural Earth\xA0II",iconUrl:en("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return B0.fromUrl(en("Assets/Textures/NaturalEarthII"))}})),e.push(new or({name:"Google Maps Satellite",iconUrl:en("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return Fl.fromAssetId(3830182)}})),e.push(new or({name:"Google Maps Satellite with Labels",iconUrl:en("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return Fl.fromAssetId(3830183)}})),e.push(new or({name:"Google Maps Roadmap",iconUrl:en("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return Fl.fromAssetId(3830184)}})),e.push(new or({name:"Google Maps Contour",iconUrl:en("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return Fl.fromAssetId(3830186)}})),e.push(new or({name:"Azure Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return Fl.fromAssetId(3891168)}})),e.push(new or({name:"Azure Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return Fl.fromAssetId(3891169)}})),e}var bU=ZLt;var XMo=y(x(),1);function RLt(){let e=[];return e.push(new or({name:"WGS84 Ellipsoid",iconUrl:en("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new kp({ellipsoid:ie.WGS84})}})),e.push(new or({name:"Cesium World Terrain",iconUrl:en("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 kE({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var yU=RLt;var vMo=y(x(),1);var WT="http://www.w3.org/2000/svg",VZe="http://www.w3.org/1999/xlink",WO,xU=D.fromCssColorString("rgba(247,250,255,0.384)"),FO=D.fromCssColorString("rgba(143,191,255,0.216)"),vee=D.fromCssColorString("rgba(153,197,255,0.098)"),BO=D.fromCssColorString("rgba(255,255,255,0.086)"),GLt=D.fromCssColorString("rgba(255,255,255,0.267)"),VLt=D.fromCssColorString("rgba(255,255,255,0)"),RZe=D.fromCssColorString("rgba(66,67,68,0.3)"),GZe=D.fromCssColorString("rgba(0,0,0,0.5)");function Jy(e){return D.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var CU={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function wf(e){let t=document.createElementNS(WT,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(wf(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(VZe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function kee(e,t,n){let i=document.createElementNS(WT,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(WT,"tspan");return o.textContent=n,i.appendChild(o),i}function LLt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var wO=new D;function Bs(e,t){let n=t.alpha,i=1-n;return wO.red=e.red*i+t.red*n,wO.green=e.green*i+t.green*n,wO.blue=e.blue*i+t.blue*n,wO.toCssColorString()}function Qee(e,t,n){let i=CU[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return wf(o)}function WLt(e,t,n){let i=CU[n],o=CU.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return wf(r)}function FLt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&WO!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,d;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,d=t.touches[0].clientY):(c=t.clientX,d=t.clientY),!i&&(c>a.right||c<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-a.left,p=d-r-a.top,g=Math.atan2(p,h)*180/Math.PI+90;g>180&&(g-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(WO=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<f?n.slower():g>f&&n.faster(),t.preventDefault()}else e===WO&&(WO=void 0),n.shuttleRingDragging=!1}function Sb(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[cc(t,"toggled",this.setToggled,this),cc(t,"tooltip",this.setTooltip,this),cc(t.command,"canExecute",this.setEnabled,this)]}Sb.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();fe(this)};Sb.prototype.isDestroyed=function(){return!1};Sb.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Sb.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")))};Sb.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function eR(e,t){e=Xn(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;let n=e.ownerDocument,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); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.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=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(WT,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",VZe);let s=document.createElementNS(WT,"g");this._topG=s,this._realtimeSVG=new Sb(WLt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Sb(Qee(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Sb(Qee(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Sb(Qee(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(WT,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=wf({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=CU.animation_pathSwooshFX,u=CU.animation_pathPointer,h=wf({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=wf({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=wf({tagName:"g",transform:"translate(100,100)"});this._knobOuter=wf({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,f=wf({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=kee(0,-24,""),this._knobTime=kee(0,-7,""),this._knobStatus=kee(0,-41,"");let b=wf({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),C=document.createElementNS(WT,"g");C.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(C),s.appendChild(p),s.appendChild(a),C.appendChild(c),C.appendChild(h),C.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(b),r.appendChild(s),e.appendChild(r);let E=this;function T(W){FLt(E,W)}this._mouseCallback=T,c.addEventListener("mousedown",T,!0),c.addEventListener("touchstart",T,!0),h.addEventListener("mousedown",T,!0),h.addEventListener("touchstart",T,!0),n.addEventListener("mousemove",T,!0),n.addEventListener("touchmove",T,!0),n.addEventListener("mouseup",T,!0),n.addEventListener("touchend",T,!0),n.addEventListener("touchcancel",T,!0),this._shuttleRingPointer.addEventListener("mousedown",T,!0),this._shuttleRingPointer.addEventListener("touchstart",T,!0),this._knobOuter.addEventListener("mousedown",T,!0),this._knobOuter.addEventListener("touchstart",T,!0);let S=this._knobTime.childNodes[0],_=this._knobDate.childNodes[0],R=this._knobStatus.childNodes[0],L;this._subscriptions=[cc(t.pauseViewModel,"toggled",function(W){L!==W&&(L=W,L?E._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):E._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),cc(t,"shuttleRingAngle",function(W){LLt(E._shuttleRingPointer,E._knobOuter,W)}),cc(t,"dateLabel",function(W){_.textContent!==W&&(_.textContent=W)}),cc(t,"timeLabel",function(W){S.textContent!==W&&(S.textContent=W)}),cc(t,"multiplierLabel",function(W){R.textContent!==W&&(R.textContent=W)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(eR.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});eR.prototype.isDestroyed=function(){return!1};eR.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return fe(this)};eR.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};eR.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=Jy(this._themeNormal),n=Jy(this._themeHover),i=Jy(this._themeSelect),o=Jy(this._themeDisabled),r=Jy(this._themeKnob),s=Jy(this._themePointer),a=Jy(this._themeSwoosh),c=Jy(this._themeSwooshHover),d=wf({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Bs(t,xU)},{tagName:"stop",offset:"12%","stop-color":Bs(t,FO)},{tagName:"stop",offset:"46%","stop-color":Bs(t,vee)},{tagName:"stop",offset:"81%","stop-color":Bs(t,BO)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Bs(n,xU)},{tagName:"stop",offset:"12%","stop-color":Bs(n,FO)},{tagName:"stop",offset:"46%","stop-color":Bs(n,vee)},{tagName:"stop",offset:"81%","stop-color":Bs(n,BO)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Bs(i,xU)},{tagName:"stop",offset:"12%","stop-color":Bs(i,FO)},{tagName:"stop",offset:"46%","stop-color":Bs(i,vee)},{tagName:"stop",offset:"81%","stop-color":Bs(i,BO)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Bs(o,GLt)},{tagName:"stop",offset:"75%","stop-color":Bs(o,VLt)}]},{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":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Bs(s,GZe)},{tagName:"stop",offset:"100%","stop-color":Bs(s,GZe)}]},{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":Bs(r,xU)},{tagName:"stop",offset:"60%","stop-color":Bs(r,RZe)},{tagName:"stop",offset:"85%","stop-color":Bs(r,FO)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Bs(r,RZe)},{tagName:"stop",offset:"60%","stop-color":Bs(r,xU)},{tagName:"stop",offset:"85%","stop-color":Bs(r,BO)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var EU=eR;var jMo=y(x(),1);var BLt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],jy=15,tR=105;function LZe(e,t){return e-t}function Oee(e,t){let n=bo(t,e,LZe);return n<0?~n:n}function wLt(e,t){if(Math.abs(e)<=jy)return e/jy;let n=jy,i=tR,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function YLt(e,t,n){if(n.clockStep===wo.SYSTEM_CLOCK)return jy;if(Math.abs(e)<=1)return e*jy;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=jy,r=tR,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function th(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=th.defaultDateFormatter,this._timeFormatter=th.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,_e.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(th.defaultTicks),this.timeLabel=void 0,_e.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,_e.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,_e.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===wo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,_e.defineProperty(this,"shuttleRingAngle",{get:function(){return YLt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,tR),-tR);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=wo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===tR){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=wLt(s,a);if(t.snapToTicks)d=a[Oee(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let h=u.toFixed(0).length-2,p=Math.pow(10,h);d=Math.round(d/p)*p|0}else u>jy?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,_e.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===As.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,h=!1;if(a===As.LOOP_STOP)h=j.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;h=j.greaterThan(d,u)&&j.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,_e.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===As.UNBOUNDED)return!0;let c=s.systemTime;return j.greaterThanOrEquals(c,s.startTime)&&j.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,_e.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Fn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Ky(n,{toggled:_e.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Fn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Ky(i,{toggled:_e.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Fn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Ky(o,{toggled:_e.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==wo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Fn(function(){t._clockViewModel.clockStep=wo.SYSTEM_CLOCK},_e.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Ky(r,{toggled:_e.computed(function(){return e.clockStep===wo.SYSTEM_CLOCK}),tooltip:_e.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=Oee(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=Oee(c,a)+1;d<a.length&&(s.multiplier=a[d])})}th.defaultDateFormatter=function(e,t){let n=j.toGregorianDate(e);return`${BLt[n.month-1]} ${n.day} ${n.year}`};th.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];th.defaultTimeFormatter=function(e,t){let n=j.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};th.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};th.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(LZe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);ni(s,r),this._allShuttleRingTicks=s};Object.defineProperties(th.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});th._maxShuttleRingAngle=tR;th._realtimeShuttleRingAngle=jy;var TU=th;var lUo=y(x(),1);var nUo=y(x(),1);function NLt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof ks&&(e.tileset=n.primitive),e.pickActive=!1}}function FZe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof ks&&(e.tileset=i.primitive)},Gn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Gn.MOUSE_MOVE),e.picking=e.picking)}var XLt={maximumFractionDigits:3};function SU(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,XLt):Math.round(t).toLocaleString()}function IU(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[nr.PICK]:e._statisticsPerPass[nr.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${SU(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${SU(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${SU(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function BZe(){let e=Li.statistics;return`
  <ul class="cesium-cesiumInspector-statistics">
    <li><strong>Geometry Memory (MB): </strong>${SU(e.geometryByteLength)}</li>
    <li><strong>Texture Memory (MB): </strong>${SU(e.texturesByteLength)}</li>
  </ul>
  `}var PLt=[{text:"Highlight",value:ld.HIGHLIGHT},{text:"Replace",value:ld.REPLACE},{text:"Mix",value:ld.MIX}],WZe=new D(1,1,0,.4),MLt=new D,YO=new D;function lc(e,t){let n=this,i=e.canvas;this._eventHandler=new Lu(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new ub({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,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.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,_e.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=_e.observable({}),this.properties=[],_e.defineProperty(this,"properties",function(){let P=[],O=n._properties();for(let H in O)O.hasOwnProperty(H)&&P.push(H);return P});let o=_e.observable();_e.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(P){o(P),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=P)}}),this.dynamicScreenSpaceError=!1;let r=_e.observable();_e.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(P){r(P),l(n._tileset)&&(n._tileset.colorBlendMode=P,n._scene.requestRender())}}),this.colorBlendMode=ld.HIGHLIGHT;let s=_e.observable(),a=_e.observable();_e.defineProperty(this,"picking",{get:function(){return a()},set:function(P){a(P),P?n._eventHandler.setInputAction(function(O){let H=e.pick(O.endPosition);if(H instanceof Ea?(n.feature=H,n.tile=H.content.tile):l(H)&&l(H.content)?(n.feature=void 0,n.tile=H.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(H)&&l(H.content)){let ee;e.pickPositionSupported&&(ee=e.pickPosition(O.endPosition),l(ee)&&(n._tileset.debugPickPosition=ee)),n._tileset.debugPickedTile=H.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Gn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Gn.MOUSE_MOVE))}}),this.picking=!0;let c=_e.observable();_e.defineProperty(this,"colorize",{get:function(){return c()},set:function(P){c(P),l(n._tileset)&&(n._tileset.debugColorizeTiles=P,n._scene.requestRender())}}),this.colorize=!1;let d=_e.observable();_e.defineProperty(this,"wireframe",{get:function(){return d()},set:function(P){d(P),l(n._tileset)&&(n._tileset.debugWireframe=P,n._scene.requestRender())}}),this.wireframe=!1;let u=_e.observable();_e.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(P){u(P),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=P,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=_e.observable();_e.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(P){h(P),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=P,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=_e.observable();_e.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(P){p(P),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=P,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=_e.observable();_e.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(P){g(P),l(n._tileset)&&(n._tileset.debugFreezeFrame=P,n._scene.debugShowFrustumPlanes=P,n._scene.requestRender())}}),this.freezeFrame=!1,_e.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(P){s(P),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=P,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=_e.observable();_e.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(P){f(P),l(n._tileset)&&(n._tileset.debugShowGeometricError=P,n._scene.requestRender())}}),this.showGeometricError=!1;let b=_e.observable();_e.defineProperty(this,"showRenderingStatistics",{get:function(){return b()},set:function(P){b(P),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=P,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let C=_e.observable();_e.defineProperty(this,"showMemoryUsage",{get:function(){return C()},set:function(P){C(P),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=P,n._scene.requestRender())}}),this.showMemoryUsage=!1;let E=_e.observable();_e.defineProperty(this,"showUrl",{get:function(){return E()},set:function(P){E(P),l(n._tileset)&&(n._tileset.debugShowUrl=P,n._scene.requestRender())}}),this.showUrl=!1;let T=_e.observable();_e.defineProperty(this,"maximumScreenSpaceError",{get:function(){return T()},set:function(P){P=Number(P),isNaN(P)||(T(P),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=P))}}),this.maximumScreenSpaceError=16;let S=_e.observable();_e.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return S()},set:function(P){P=Number(P),isNaN(P)||(S(P),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=P))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,_e.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(S(),1/6)},set:function(P){let O=Math.pow(P,6);S(O),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=O)}});let _=_e.observable();_e.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return _()},set:function(P){P=Number(P),isNaN(P)||(_(P),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=P))}}),this.dynamicScreenSpaceErrorFactor=24;let R=NLt(this),L=_e.observable();_e.defineProperty(this,"pickActive",{get:function(){return L()},set:function(P){L(P),P?n._eventHandler.setInputAction(R,Gn.LEFT_CLICK):n._eventHandler.removeInputAction(Gn.LEFT_CLICK)}});let W=_e.observable();_e.defineProperty(this,"pointCloudShading",{get:function(){return W()},set:function(P){W(P),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=P)}}),this.pointCloudShading=!1;let B=_e.observable();_e.defineProperty(this,"geometricErrorScale",{get:function(){return B()},set:function(P){P=Number(P),isNaN(P)||(B(P),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=P))}}),this.geometricErrorScale=1;let Y=_e.observable();_e.defineProperty(this,"maximumAttenuation",{get:function(){return Y()},set:function(P){P=Number(P),isNaN(P)||(Y(P),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=P===0?void 0:P))}}),this.maximumAttenuation=0;let N=_e.observable();_e.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(P){P=Number(P),isNaN(P)||(N(P),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=P===0?void 0:P))}}),this.baseResolution=0;let A=_e.observable();_e.defineProperty(this,"eyeDomeLighting",{get:function(){return A()},set:function(P){A(P),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=P)}}),this.eyeDomeLighting=!1;let I=_e.observable();_e.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return I()},set:function(P){P=Number(P),isNaN(P)||(I(P),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=P))}}),this.eyeDomeLightingStrength=1;let Z=_e.observable();_e.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return Z()},set:function(P){P=Number(P),isNaN(P)||(Z(P),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=P))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let G=_e.observable();_e.defineProperty(this,"skipLevelOfDetail",{get:function(){return G()},set:function(P){G(P),l(n._tileset)&&(n._tileset.skipLevelOfDetail=P)}}),this.skipLevelOfDetail=!0;let w=_e.observable();_e.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return w()},set:function(P){P=Number(P),isNaN(P)||(w(P),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=P))}}),this.skipScreenSpaceErrorFactor=16;let X=_e.observable();_e.defineProperty(this,"baseScreenSpaceError",{get:function(){return X()},set:function(P){P=Number(P),isNaN(P)||(X(P),l(n._tileset)&&(n._tileset.baseScreenSpaceError=P))}}),this.baseScreenSpaceError=1024;let v=_e.observable();_e.defineProperty(this,"skipLevels",{get:function(){return v()},set:function(P){P=Number(P),isNaN(P)||(v(P),l(n._tileset)&&(n._tileset.skipLevels=P))}}),this.skipLevels=1;let U=_e.observable();_e.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return U()},set:function(P){U(P),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=P)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let k=_e.observable();_e.defineProperty(this,"loadSiblings",{get:function(){return k()},set:function(P){k(P),l(n._tileset)&&(n._tileset.loadSiblings=P)}}),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(){n._update()}),l(this._tileset)||FZe(this,!0)}Object.defineProperties(lc.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}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return PLt}},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,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}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,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=IU(e,!1),this._pickStatisticsText=IU(e,!0),this._resourceCacheStatisticsText=BZe(),FZe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,MLt):D.WHITE:t.color=YO,this._scene.requestRender()),l(e)&&(D.clone(e.color,YO),e.color=WZe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!zee(t.content)&&(t.color=YO,this._scene.requestRender()),l(e)&&!zee(e.content)&&(D.clone(e.color,YO),e.color=WZe,this._scene.requestRender()),this._tile=e}}});function zee(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!zee(t[i]))return!1;return!0}return!1}lc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};lc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};lc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};lc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};lc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};lc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};lc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};lc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};lc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};lc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};lc.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new IT(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};lc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=`  ${a[d]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};lc.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let 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=IU(e,!1),this._pickStatisticsText=IU(e,!0),this._resourceCacheStatisticsText=BZe())};lc.prototype.isDestroyed=function(){return!1};lc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){_e.getObservable(e,t).dispose()}),fe(this)};lc.getStatistics=IU;var _U=lc;function NO(e,t){e=Xn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new _U(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Yd.createSection,c=Yd.createCheckbox,d=Yd.createRangeInput,u=Yd.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),b=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),C=a(s,"Style","styleVisible","toggleStyle"),E=a(s,"Optimization","optimizationVisible","toggleOptimization"),T=document.createElement("div");T.className="field-group";let S=document.createElement("label");S.className="field-label",S.appendChild(document.createTextNode("Properties: "));let _=document.createElement("div");_.setAttribute("data-bind","text: properties"),T.appendChild(S),T.appendChild(_),h.appendChild(T),h.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(u("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let R=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),L=document.createElement("p");L.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),L.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),L.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",R.appendChild(L),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let W=document.createElement("div");W.setAttribute("data-bind","visible: pointCloudShading"),W.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),W.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),W.appendChild(d("Base Resolution","baseResolution",0,1,.01)),W.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(W);let B=document.createElement("div");B.setAttribute("data-bind","visible: eyeDomeLighting"),B.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),B.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),W.appendChild(B),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let Y=document.createElement("div");Y.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(Y);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(N),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let A=document.createElement("div");A.className="cesium-3dTilesInspector-statistics",A.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(A),f.appendChild(c("Pick Statistics","showPickStatistics"));let I=document.createElement("div");I.className="cesium-3dTilesInspector-statistics",I.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(I),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let Z=document.createElement("div");Z.className="cesium-3dTilesInspector-statistics",Z.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(Z);let G=document.createElement("div");C.appendChild(G),G.appendChild(document.createTextNode("Color Blend Mode: "));let w=document.createElement("select");w.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),G.appendChild(w);let X=document.createElement("textarea");X.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),G.className="cesium-cesiumInspector-styleEditor",G.appendChild(X);let v=u("Compile (Ctrl+Enter)","compileStyle");G.appendChild(v);let U=document.createElement("div");U.className="cesium-cesiumInspector-error",U.setAttribute("data-bind","text: editorError"),G.appendChild(U),b.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),b.appendChild(c("Geometric Error","showGeometricError")),b.appendChild(c("Rendering Statistics","showRenderingStatistics")),b.appendChild(c("Memory Usage (MB)","showMemoryUsage")),b.appendChild(c("Url","showUrl")),E.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let k=document.createElement("div");k.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),E.appendChild(k);let P=document.createElement("div");P.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),E.appendChild(P);let O=document.createElement("div");O.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),E.appendChild(O),E.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),E.appendChild(c("Load siblings of visible tiles","loadSiblings")),_e.applyBindings(o,n)}Object.defineProperties(NO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NO.prototype.isDestroyed=function(){return!1};NO.prototype.destroy=function(){return _e.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};var ZU=NO;var TUo=y(x(),1);var pUo=y(x(),1);function ULt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Hee(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var DLt=new xn,vLt=new m;function RU(e,t){let n=this,i=e.canvas,o=new Lu(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.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.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="",_e.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Fn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Fn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Fn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Fn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=_e.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=_e.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=_e.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new ub({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Fn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=_e.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Fn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new OM({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=_e.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Fn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return l(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=_e.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=_e.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=_e.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Fn(function(){let d=n.depthFrustum+1;return n.depthFrustum=Hee(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Fn(function(){let d=n.depthFrustum-1;return n.depthFrustum=Hee(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=_e.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Fn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new lU({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=_e.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=_e.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Fn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Fn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=_e.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});l(u)&&(n.primitive=l(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Fn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=_e.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,Gn.LEFT_CLICK):o.removeInputAction(Gn.LEFT_CLICK)});function c(d){let u,h=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,DLt),g=r.pick(p,n._scene,vLt);if(l(g)){let f=h.cartesianToCartographic(g),b=r._surface.tileProvider._tilesToRenderByTextureCount;for(let C=0;!u&&C<b.length;++C){let E=b[C];if(l(E))for(let T=0;!u&&T<E.length;++T){let S=E[T];de.contains(S.rectangle,f)&&(u=S)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Fn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=_e.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,Gn.LEFT_CLICK):o.removeInputAction(Gn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(RU.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(){let e=this;return Fn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(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(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){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}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});RU.prototype._update=function(){this.frustums&&(this.frustumStatisticText=ULt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Hee(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}`};RU.prototype.isDestroyed=function(){return!1};RU.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._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),fe(this)};var GU=RU;function XO(e,t){e=Xn(e);let n=document.createElement("div"),i=new GU(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=Yd.createSection,c=Yd.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(h),d.appendChild(u),d.appendChild(c("Show Frustum Planes","frustumPlanes")),d.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let g=document.createElement("div");d.appendChild(g);let f=document.createElement("span");f.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),g.appendChild(f);let b=document.createElement("span");b.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(b);let C=document.createElement("input");C.type="button",C.value="-",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(C);let E=document.createElement("input");E.type="button",E.value="+",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(E);let T=a(s,"Primitives","primitivesVisible","togglePrimitives"),S=document.createElement("div");S.className="cesium-cesiumInspector-pickSection",T.appendChild(S);let _=document.createElement("input");_.type="button",_.value="Pick a primitive",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let R=document.createElement("div");R.className="cesium-cesiumInspector-center",R.appendChild(_),S.appendChild(R),S.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),S.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),S.appendChild(this._primitiveOnly);let L=a(s,"Terrain","terrainVisible","toggleTerrain"),W=document.createElement("div");W.className="cesium-cesiumInspector-pickSection",L.appendChild(W);let B=document.createElement("input");B.type="button",B.value="Pick a tile",B.className="cesium-cesiumInspector-pickButton",B.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),R=document.createElement("div"),R.appendChild(B),R.className="cesium-cesiumInspector-center",W.appendChild(R);let Y=document.createElement("div");W.appendChild(Y);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let A=document.createElement("input");A.type="button",A.value="NW",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: selectNW");let I=document.createElement("input");I.type="button",I.value="NE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectNE");let Z=document.createElement("input");Z.type="button",Z.value="SW",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectSW");let G=document.createElement("input");G.type="button",G.value="SE",G.className="cesium-cesiumInspector-pickButton",G.setAttribute("data-bind","click: selectSE");let w=document.createElement("div");w.className="cesium-cesiumInspector-tileText",Y.className="cesium-cesiumInspector-frustumStatistics",Y.appendChild(w),Y.setAttribute("data-bind","visible: hasPickedTile"),w.setAttribute("data-bind","html: tileText");let X=document.createElement("div");X.className="cesium-cesiumInspector-relativeText",X.textContent="Select relative:",Y.appendChild(X);let v=document.createElement("table"),U=document.createElement("tr"),k=document.createElement("tr"),P=document.createElement("td");P.appendChild(N);let O=document.createElement("td");O.appendChild(A);let H=document.createElement("td");H.appendChild(I),U.appendChild(P),U.appendChild(O),U.appendChild(H);let ee=document.createElement("td"),z=document.createElement("td");z.appendChild(Z);let te=document.createElement("td");te.appendChild(G),k.appendChild(ee),k.appendChild(z),k.appendChild(te),v.appendChild(U),v.appendChild(k),Y.appendChild(v),W.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),W.appendChild(c("Show only selected","filterTile","hasPickedTile")),L.appendChild(c("Wireframe","wireframe")),L.appendChild(c("Suspend LOD update","suspendUpdates")),L.appendChild(c("Show tile coordinates","tileCoordinates")),_e.applyBindings(i,this._element)}Object.defineProperties(XO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});XO.prototype.isDestroyed=function(){return!1};XO.prototype.destroy=function(){return _e.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};var VU=XO;var YUo=y(x(),1);var GUo=y(x(),1);function PO(e,t){l(t)||(t=document.body),t=Xn(t);let n=this,i=_e.observable(kr.fullscreen),o=_e.observable(kr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,_e.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,_e.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&kr.enabled)}}),this.tooltip=void 0,_e.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Fn(function(){kr.fullscreen?kr.exitFullscreen():kr.requestFullscreen(n._fullscreenElement)},_e.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Xn(e)??r.body,this._callback=function(){i(kr.fullscreen)},r.addEventListener(kr.changeEventName,this._callback)}Object.defineProperties(PO.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});PO.prototype.isDestroyed=function(){return!1};PO.prototype.destroy=function(){document.removeEventListener(kr.changeEventName,this._callback),fe(this)};var LU=PO;var kLt="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",QLt="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 MO(e,t){e=Xn(e);let n=new LU(t,e);n._exitFullScreenPath=QLt,n._enterFullScreenPath=kLt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),_e.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(MO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MO.prototype.isDestroyed=function(){return!1};MO.prototype.destroy=function(){return this._viewModel.destroy(),_e.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var WU=MO;var KUo=y(x(),1);var DUo=y(x(),1);var wZe=1e3;function nh(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new UE({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new Ce,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=NZe,this._handleArrowUp=YZe;let t=this;this._suggestionsVisible=_e.pureComputed(function(){let o=_e.getObservable(t,"_suggestions")().length>0,r=_e.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Fn(function(i){if(i=i??Ly.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)jLt(t);else return KLt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?YZe(t):r?NZe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;MZe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??nh.flyToDestination,this._focusTextbox=!1,_e.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=_e.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){nh._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,_e.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,_e.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,_e.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(nh.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});nh.prototype.destroy=function(){this._suggestionSubscription.dispose()};function YZe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],nh._adjustSuggestionsScroll(e,n)}function NZe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],nh._adjustSuggestionsScroll(e,i)}function OLt(e,t){let n=l(t)?t.availability:void 0;return l(n)?QE(t,[e]).then(function(i){return e=i[0],e.height+=wZe,e}):(e.height+=wZe,Promise.resolve(e))}function zLt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof de?V.equalsEpsilon(t.south,t.north,V.EPSILON7)&&V.equalsEpsilon(t.east,t.west,V.EPSILON7)?t=de.center(t):a=zE(t,n):t=i.cartesianToCartographic(t),l(a)||(a=OLt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function HLt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function KLt(e,t,n){let i=e._searchText;if(PZe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await HLt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Jee(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=XZe(e,fZ.getCreditsFromResult(s[0]));l(a)||Kee(e,t[o].credit);return}e._searchText=`${i} (not found)`}function Kee(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function XZe(e,t){return l(t)&&t.forEach(n=>Kee(e,n)),t}function Jee(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function JLt(e,t){let n=Xn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function jLt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function PZe(e){return/^\s*$/.test(e)}function MZe(e){_e.getObservable(e,"_suggestions").removeAll()}async function qLt(e){if(!e.autoComplete)return;let t=e._searchText;if(MZe(e),Jee(e),!PZe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Ly.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=fZ.getCreditsFromResult(r);o=o&&!l(s),XZe(e,s)}),o&&Kee(e,n.credit)}if(e._suggestions.length>=5)return}}nh.flyToDestination=zLt;nh._updateSearchSuggestions=qLt;nh._adjustSuggestionsScroll=JLt;nh.prototype.isDestroyed=function(){return!1};nh.prototype.destroy=function(){return Jee(this),fe(this)};var FU=nh;var $Lt="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",eWt="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 UO(e){let t=Xn(e.container),n=new FU(e);n._startSearchPath=$Lt,n._stopSearchPath=eWt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),_e.applyBindings(n,i),_e.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},rn.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(UO.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});UO.prototype.isDestroyed=function(){return!1};UO.prototype.destroy=function(){let e=this._container;return rn.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),_e.cleanNode(this._form),_e.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),fe(this)};var BU=UO;var sDo=y(x(),1);var $Uo=y(x(),1);function UZe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Fn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",_e.track(this,["tooltip"])}Object.defineProperties(UZe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var wU=UZe;function DO(e,t,n){e=Xn(e);let i=new wU(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),_e.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(DO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DO.prototype.isDestroyed=function(){return!1};DO.prototype.destroy=function(){return _e.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var YU=DO;var ADo=y(x(),1);var dDo=y(x(),1);function tWt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function vZe(e,t){_e.track(e);for(let n=0;n<e.sublayers.length;n++)vZe(e.sublayers[n],t)}function vO(e){return e.modelName==="FullModel"}function kZe(e){return e.modelName==="Overview"}function QZe(e){return kZe(e)||vO(e)}function DZe(e,t){if(QZe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:_e.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function nWt(e,t){if(QZe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");vO(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function iWt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function oWt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:_e.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:_e.observable(!0),index:-1}],currentLayer:_e.observable(),expandClickHandler:tWt,setOptionDisable:function(i,o){_e.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){nWt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){vZe(n[i],this.viewModel);let o=DZe(n[i],this.viewModel);l(o)&&(kZe(o)||!l(this.viewModel.defaultLayer)&&vO(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=DZe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=vO(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return iWt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var NU=oWt;function rWt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=`
        <h3>Building explorer</h3>
        <select
          data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer"
        ></select>
        <div id="bsl-wrapper">
          <h3>Select Level</h3>
          <select data-bind="options: levels, value: currentLevel"></select>
          <h3>Disciplines & Categories</h3>
          <ul class="layersList" data-bind="foreach: sublayers">
            <ul class="layersList" data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
              <li>
                <div class="li-wrapper">
                  <span
                    class="expandItem"
                    data-bind="click: $root.expandClickHandler"
                    >+</span
                  >
                  <input
                    type="checkbox"
                    data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
                  />
                  <label data-bind="attr: { for: name}">
                    <span data-bind="text: name"></span>
                  </label>
                </div>
                <ul class="nested" data-bind="attr: { id: name + '-expander'}">
                  <li data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
                    <div class="li-wrapper">
                      <input
                        type="checkbox"
                        data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
                      />
                      <label data-bind="attr: { for: name}">
                        <span data-bind="text: name"></span>
                      </label>
                    </div>
                  </li>
                </ul>
              </li>
            </ul>
          </ul>
        </div>`,n.appendChild(i);let o=new NU(t);_e.track(o),_e.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var jee=rWt;var ZDo=y(x(),1);var xDo=y(x(),1);var sWt="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",aWt="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 qee(){this._cameraClicked=new Ce,this._closeClicked=new Ce,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",_e.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,_e.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?aWt:sWt}}),_e.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}qee.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(qee.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var XU=qee;function kO(e){e=Xn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.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(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="&times;",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new XU;_e.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,d=c.createElement("link");d.href=en("Widgets/InfoBox/InfoBoxDescription.css"),d.rel="stylesheet",d.type="text/css";let u=c.createElement("div");u.className="cesium-infoBox-description",c.head.appendChild(d),c.body.appendChild(u),a._descriptionSubscription=cc(s,"description",function(h){r.style.height="5px",u.innerHTML=h;let p=null,g=u.firstElementChild;if(g!==null&&u.childNodes.length===1){let b=window.getComputedStyle(g);if(b!==null){let C=b["background-color"],E=D.fromCssColorString(C);l(E)&&E.alpha!==0&&(p=b["background-color"])}}t.style["background-color"]=p;let f=u.getBoundingClientRect().height;r.style.height=`${f}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(kO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});kO.prototype.isDestroyed=function(){return!1};kO.prototype.destroy=function(){let e=this._container;return _e.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),fe(this)};var PU=kO;var XDo=y(x(),1);var LDo=y(x(),1);function OZe(){this.showInstructions=!1;let e=this;this._command=Fn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Fn(function(){e._touch=!1}),this._showTouch=Fn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",_e.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(OZe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var MU=OZe;function QO(e){let t=Xn(e.container),n=new MU,i=e.instructionsInitiallyVisible??!1;n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=en("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=en("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let 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="${en("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="${en("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="${en("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>`,s.appendChild(h);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=`            <table>                <tr>                    <td><img src="${en("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="${en("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="${en("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="${en("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>`,s.appendChild(p),_e.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},rn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(QO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});QO.prototype.isDestroyed=function(){return!1};QO.prototype.destroy=function(){return rn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),_e.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var UU=QO;var qDo=y(x(),1);var QDo=y(x(),1);function $ee(e){this._scene=e.scene,this.lowFrameRateMessage=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,_e.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Fn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=KM.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties($ee.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});$ee.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),fe(this)};var DU=$ee;function OO(e){let t=Xn(e.container),n=new DU(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="&times;",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),_e.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(OO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OO.prototype.isDestroyed=function(){return!1};OO.prototype.destroy=function(){return this._viewModel.destroy(),_e.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var vU=OO;var dvo=y(x(),1);var ivo=y(x(),1);var cWt=new M,zO="-1000px";function kU(e,t,n){this._scene=e,this._screenPositionX=zO,this._screenPositionY=zO,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,_e.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,_e.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),_e.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return no.worldToWindowCoordinates(e,i,o)}}kU.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,cWt);if(!l(e))this._screenPositionX=zO,this._screenPositionY=zO;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};kU.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:bs.EXPONENTIAL_OUT})};kU.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:bs.EXPONENTIAL_OUT})};Object.defineProperties(kU.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var QU=kU;function HO(e,t){e=Xn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="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",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new QU(t,this._element,this._container);this._viewModel=c,_e.applyBindings(this._viewModel,this._element)}Object.defineProperties(HO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});HO.prototype.isDestroyed=function(){return!1};HO.prototype.destroy=function(){let e=this._container;return _e.cleanNode(this._element),e.removeChild(this._element),fe(this)};var OU=HO;var Svo=y(x(),1);var gvo=y(x(),1);function KO(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Xr,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",_e.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,_e.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===se.SCENE2D?n.tooltip2D:o===se.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Fn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Fn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Fn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Fn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=se}Object.defineProperties(KO.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});KO.prototype.isDestroyed=function(){return!1};KO.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var zU=KO;var lWt="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",dWt="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",uWt="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 JO(e,t,n){e=Xn(e);let i=new zU(t,n);i._globePath=lWt,i._flatMapPath=dWt,i._columbusViewPath=uWt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.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'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let 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.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 }'),o.appendChild(s);let 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.SCENE2D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.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 }'),o.appendChild(c),_e.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},rn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(JO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});JO.prototype.isDestroyed=function(){return!1};JO.prototype.destroy=function(){return this._viewModel.destroy(),rn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),_e.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var HU=JO;var Nvo=y(x(),1);var Vvo=y(x(),1);function jO(e){this._scene=e,this._orthographic=e.camera.frustum instanceof hn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,_e.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;_e.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Fn(function(){t.sceneMode===se.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Xr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===se.SCENE2D||t._scene.camera.frustum instanceof hn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Fn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Fn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=se}Object.defineProperties(jO.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}}});jO.prototype.isDestroyed=function(){return!1};jO.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var KU=jO;var mWt="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",hWt="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 qO(e,t){e=Xn(e);let n=new KU(t);n._perspectivePath=mWt,n._orthographicPath=hWt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.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'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic),       "cesium-projectionPicker-none" : !_orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic),       "cesium-projectionPicker-none" : _orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),_e.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},rn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(qO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});qO.prototype.isDestroyed=function(){return!1};qO.prototype.destroy=function(){return this._viewModel.destroy(),rn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),_e.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var JU=qO;var Kvo=y(x(),1);var Mvo=y(x(),1);function FT(e,t,n){this._color=e,this._height=t,this._base=n??0}FT.prototype.getHeight=function(){return this._height};FT.prototype.getBase=function(){return this._base};FT.prototype.getStartTime=function(){return this._start};FT.prototype.getStopTime=function(){return this._stop};FT.prototype.setRange=function(e,t){this._start=e,this._stop=t};FT.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=j.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=j.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var jU=FT;var vvo=y(x(),1);function zZe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new D(.5,.5,.5,1),this.backgroundColor=i||new D(0,0,0,0)}zZe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=j.addSeconds(t.startJulian,t.duration,new j);if(j.lessThan(n,o)&&j.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(j.lessThanOrEquals(n,r)&&j.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=j.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new j);!l(a)&&j.greaterThanOrEquals(d,n)?a=s:!l(c)&&j.greaterThanOrEquals(d,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var qU=zZe;var ete=1e12,ih={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Hl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},qy=[.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],fWt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Kl(e,t){e=Xn(e);let n=e.ownerDocument;this.container=e;let i=n.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=ih.none,this._touchMode=Hl.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=pWt(this),this._onMouseUp=AWt(this),this._onMouseMove=gWt(this),this._onMouseWheel=bWt(this),this._onTouchStart=yWt(this),this._onTouchMove=CWt(this),this._onTouchEnd=xWt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Kl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Kl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Kl.prototype.isDestroyed=function(){return!1};Kl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),fe(this)};Kl.prototype.addHighlightRange=function(e,t,n){let i=new jU(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Kl.prototype.addTrack=function(e,t,n,i){let o=new qU(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Kl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=j.secondsDifference(t,e),this._clock&&this._clock.clockRange!==As.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=j.secondsDifference(o,i),s=j.secondsDifference(i,this._startJulian),a=j.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=j.addSeconds(this._endJulian,s,new j),this._startJulian=i,this._timeBarSecondsSpan=j.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=j.addSeconds(this._startJulian,a,new j),this._endJulian=o,this._timeBarSecondsSpan=j.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Kl.prototype.zoomFrom=function(e){let t=j.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(j.addSeconds(this._startJulian,t-t*e,new j),j.addSeconds(this._endJulian,n*e-n,new j))};function tte(e){return e<10?`0${e.toString()}`:e.toString()}Kl.prototype.makeLabel=function(e){let t=j.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${fWt[t.month-1]} ${t.day} ${t.year} ${tte(t.hour)}:${tte(t.minute)}:${tte(t.second)}${i}`};Kl.prototype.smallestTicInPixels=7;Kl.prototype._makeTics=function(){let e=this._timeBarEle,t=j.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,d=1e-10,u=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=j.addSeconds(this._startJulian,a,new j)):h>c&&(h=c,this._timeBarSecondsSpan=c,this._endJulian=j.addSeconds(this._startJulian,c,new j));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,f=Math.min(h/p*1e-5,.4),b,C=j.toGregorianDate(g);h>31536e4?b=j.fromDate(new Date(Date.UTC(Math.floor(C.year/100)*100,0))):h>31536e3?b=j.fromDate(new Date(Date.UTC(Math.floor(C.year/10)*10,0))):h>86400?b=j.fromDate(new Date(Date.UTC(C.year,0))):b=j.fromDate(new Date(Date.UTC(C.year,C.month,C.day)));let E=j.secondsDifference(this._startJulian,j.addSeconds(b,f,new j)),T=E+h;this._epochJulian=b;function S(P){return Math.floor(E/P)*P}function _(P,O){return Math.ceil(P/O+.5)*O}function R(P){return(P-E)/h}function L(P,O){return P-O*Math.round(P/O)}this._rulerEle.innerHTML=this.makeLabel(j.addSeconds(this._endJulian,-a,new j));let W=this._rulerEle.offsetWidth+20;W<30&&(W=180);let B=u;u-=d;let Y={startTime:E,startJulian:g,epochJulian:b,duration:h,timeBarWidth:p,getAlpha:R};this._highlightRanges.forEach(function(P){s+=P.render(Y)});let N=0,A=0,I=0,Z=W/p;Z>1&&(Z=1),Z*=this._timeBarSecondsSpan;let G=-1,w=-1,X=qy.length,v;for(v=0;v<X;++v){let P=qy[v];if(++G,N=P,P>Z&&P>u)break;w<0&&p*(P/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(w=G)}if(G>0){for(;G>0;)if(--G,Math.abs(L(N,qy[G]))<1e-5){qy[G]>=u&&(A=qy[G]);break}if(w>=0)for(;w<G;){if(Math.abs(L(A,qy[w]))<1e-5&&qy[w]>=u){I=qy[w];break}++w}}u=B,u>d&&I<1e-5&&Math.abs(u-N)>d&&(I=u,u<=N+d&&(A=0));let U=-999999,k;if(p*(I/this._timeBarSecondsSpan)>=3)for(o=S(I);o<=T;o=_(o,I))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*R(o)).toString()}px;"></span>`;if(p*(A/this._timeBarSecondsSpan)>=3)for(o=S(A);o<=T;o=_(o,A))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*R(o)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,T+=N,o=S(N);let P=j.computeTaiMinusUtc(b);for(;o<=T;){let O=j.addSeconds(g,o-E,new j);if(N>2.1){let te=j.computeTaiMinusUtc(O);Math.abs(te-P)>.1&&(o+=te-P,O=j.addSeconds(g,o-E,new j))}let H=Math.round(p*R(o)),ee=this.makeLabel(O);this._rulerEle.innerHTML=ee,k=this._rulerEle.offsetWidth,k<10&&(k=W);let z=H-(k/2-1);z>U?(U=z+k+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${H.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${z.toString()}px;">${ee}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${H.toString()}px;"></span>`,o=_(o,N)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),Y.y=0,this._trackList.forEach(function(P){P.render(r._context,Y),Y.y+=P.height})};Kl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=j.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(j.addSeconds(this._startJulian,this._timelineDrag,new j),j.addSeconds(this._endJulian,this._timelineDrag,new j)))};Kl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=j.addSeconds(this._startJulian,t,new j),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function pWt(e){return function(t){e._mouseMode!==ih.touchOnly&&(t.button===0?(e._mouseMode=ih.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=ih.zoom:e._mouseMode=ih.slide)),t.preventDefault()}}function AWt(e){return function(t){e._mouseMode=ih.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function gWt(e){return function(t){let n;if(e._mouseMode===ih.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===ih.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(j.addSeconds(e._startJulian,i,new j),j.addSeconds(e._endJulian,i,new j))}}else e._mouseMode===ih.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function bWt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;ete=Math.max(Math.min(Math.abs(n),ete),1),n/=ete,e.zoomFrom(Math.pow(1.05,-n))}}function yWt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=ih.touchOnly,n===1?(i=j.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=Hl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Hl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Hl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Hl.ignore}}function xWt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Hl.singleTap?(e._touchMode=Hl.scrub,e._onTouchMove(t)):e._touchMode===Hl.scrub&&e._onTouchMove(t),e._mouseMode=ih.touchOnly,n!==1?e._touchMode=n>0?Hl.ignore:Hl.none:e._touchMode===Hl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function CWt(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===Hl.singleTap&&(e._touchMode=Hl.slideZoom),e._mouseMode=ih.touchOnly,e._touchMode===Hl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Hl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=j.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new j)):(n=e._touchState.centerX-r,a=j.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new j)),e.zoomTo(a,j.addSeconds(a,e._timeBarSecondsSpan*c,new j)),e._touchState.centerX=r,e._touchState.spanX=s))}}Kl.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var $U=Kl;var mko=y(x(),1);var rko=y(x(),1);var qZe=y(jZe(),1);function SWt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function $Ze(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function IWt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&($Ze(),e._locked=!1),e._noSleep.disable(),kr.exitFullscreen(),n(!1)):(kr.fullscreen||kr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=SWt("landscape")),t.useWebVR=!0,n(!0)))}function $O(e,t){let n=this,i=_e.observable(kr.enabled),o=_e.observable(!1);this.isVRMode=void 0,_e.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,_e.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&kr.enabled)}}),this.tooltip=void 0,_e.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=_e.observable(!1);this._isOrthographic=void 0,_e.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Xr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof hn)}),this._locked=!1,this._noSleep=new qZe.default,this._command=Fn(function(){IWt(n,e,o,r)},_e.getObservable(this,"isVREnabled")),this._vrElement=Xn(t)??document.body,this._callback=function(){!kr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&($Ze(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(kr.changeEventName,this._callback)}Object.defineProperties($O.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});$O.prototype.isDestroyed=function(){return!1};$O.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(kr.changeEventName,this._callback),fe(this)};var eD=$O;var _Wt="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",ZWt="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 e3(e,t,n){e=Xn(e);let i=new eD(t,n);i._exitVRPath=ZWt,i._enterVRPath=_Wt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.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(o),_e.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(e3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});e3.prototype.isDestroyed=function(){return!1};e3.prototype.destroy=function(){return this._viewModel.destroy(),_e.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var tD=e3;var Fko=y(x(),1);var eRe=new ue;function iRe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function RWt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function GWt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function tRe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof xr)return i;if(n instanceof Ea)return new xr({name:GWt(n),description:RWt(n),feature:n})}if(l(e.scene.globe))return WWt(e,t.position)}var VWt=new j;function rte(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;j.equals(i,o)&&(o=j.addSeconds(i,V.EPSILON2,VWt)),e.updateFromClock(),e.zoomTo(i,o)}}}var LWt=new m;function WWt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new xr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=nRe();return}let a=s[0],c=new xr({id:a.name,description:a.description});if(l(a.position)){let d=e.scene.ellipsoid.cartographicToCartesian(a.position,LWt);c.position=new gl(d)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=nRe())}),r}function nRe(){return new xr({id:"None",description:"No features found."})}function FWt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,u=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),l(u)&&(u.container.style.visibility=p),l(h)&&(h.container.style.visibility=p),e._container){let g=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function fo(e,t){e=Xn(e),t=t??Q.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=t.scene3DOnly??!1,c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new of,d=new pU(c),u=!0);let h=new BM(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,g=new Xr;g.add(c.onTick,fo.prototype._onTick,this);let f;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let O=document.createElement("div");O.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(O),f=new OU(O,p)}let b;if(!l(t.infoBox)||t.infoBox!==!1){let O=document.createElement("div");O.className="cesium-viewer-infoBoxContainer",o.appendChild(O),b=new PU(O);let H=b.viewModel;g.add(H.cameraClicked,fo.prototype._onInfoBoxCameraClicked,this),g.add(H.closeClicked,fo.prototype._onInfoBoxClockClicked,this)}let C=document.createElement("div");C.className="cesium-viewer-toolbar",o.appendChild(C);let E;if(!l(t.geocoder)||t.geocoder!==!1){let O=document.createElement("div");O.className="cesium-viewer-geocoderContainer",C.appendChild(O);let H;typeof t.geocoder=="string"?H=[new UE({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(H=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),E=new BU({container:O,geocoderServices:H,scene:p}),g.add(E.viewModel.search.beforeExecute,fo.prototype._clearObjects,this)}let T;(!l(t.homeButton)||t.homeButton!==!1)&&(T=new YU(C,p),l(E)&&g.add(T.viewModel.command.afterExecute,function(){let O=E.viewModel;O.searchText="",O.isSearchInProgress&&O.search()}),g.add(T.viewModel.command.beforeExecute,fo.prototype._clearTrackedObject,this));let S;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(S=new HU(C,p));let _;t.projectionPicker&&(_=new JU(C,p));let R,L;if(n){let O=t.imageryProviderViewModels??bU(),H=t.terrainProviderViewModels??yU();R=new gU(C,{globe:p.globe,imageryProviderViewModels:O,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:H,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),L=C.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(R.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(R.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let W;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let O=!0;try{if(l(window.localStorage)){let H=window.localStorage.getItem("cesium-hasSeenNavHelp");l(H)&&H?O=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}W=new UU({container:C,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??O})}let B;if(!l(t.animation)||t.animation!==!1){let O=document.createElement("div");O.className="cesium-viewer-animationContainer",o.appendChild(O),B=new EU(O,new TU(d))}let Y;if(!l(t.timeline)||t.timeline!==!1){let O=document.createElement("div");O.className="cesium-viewer-timelineContainer",o.appendChild(O),Y=new $U(O,c),Y.addEventListener("settime",iRe,!1),Y.zoomTo(c.startTime,c.stopTime)}let N,A,I;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(I=document.createElement("div"),I.className="cesium-viewer-fullscreenContainer",o.appendChild(I),N=new WU(I,t.fullscreenElement),A=cc(N.viewModel,"isFullscreenEnabled",function(O){I.style.display=O?"block":"none",l(Y)&&(Y.container.style.right=`${I.clientWidth}px`,Y.resize())}));let Z,G,w;if(t.vrButton){let O=document.createElement("div");O.className="cesium-viewer-vrContainer",o.appendChild(O),Z=new tD(O,p,t.fullScreenElement),G=cc(Z.viewModel,"isVREnabled",function(H){O.style.display=H?"block":"none",l(N)&&(O.style.right=`${I.clientWidth}px`),l(Y)&&(Y.container.style.right=`${O.clientWidth}px`,Y.resize())}),w=cc(Z.viewModel,"isVRMode",function(H){FWt(i,H)})}this._baseLayerPickerDropDown=L,this._fullscreenSubscription=A,this._vrSubscription=G,this._vrModeSubscription=w,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=f,this._infoBox=b,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=C,this._homeButton=T,this._sceneModePicker=S,this._projectionPicker=_,this._baseLayerPicker=R,this._navigationHelpButton=W,this._animation=B,this._timeline=Y,this._fullscreenButton=N,this._vrButton=Z,this._geocoder=E,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(b)||l(f),this._selectedEntity=void 0,this._selectedEntityChanged=new Ce;let X=this._cesiumWidget.dataSources,v=this._cesiumWidget.dataSourceDisplay;g.add(X.dataSourceAdded,fo.prototype._onDataSourceAdded,this),g.add(X.dataSourceRemoved,fo.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,fo.prototype.resize,this);let U=X.length;for(let O=0;O<U;O++)this._dataSourceAdded(X,X.get(O));this._dataSourceAdded(void 0,v.defaultDataSource),g.add(X.dataSourceAdded,fo.prototype._dataSourceAdded,this),g.add(X.dataSourceRemoved,fo.prototype._dataSourceRemoved,this);function k(O){let H=tRe(i,O);l(H)?K.getValueOrUndefined(H.position,i.clock.currentTime)?i.trackedEntity=H:i.zoomTo(H):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function P(O){i.selectedEntity=tRe(i,O)}h.screenSpaceEventHandler.setInputAction(P,Gn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(k,Gn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(fo.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this.scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,rte(this._timeline,e))}}});fo.prototype.extend=function(e,t){e(this,t)};fo.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let f=this._geocoder.searchSuggestionsContainer;f.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,h=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let f=this._lastWidth;d=this._animation.container,n>900?(u=169,f<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(f<600||f>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(f>600||f===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),h=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let f=this._fullscreenButton,b=this._vrButton,C=c.container,E=C.style;p=C.clientHeight+3,E.left=`${u}px`;let T=0;l(f)&&(T+=f.container.clientWidth),l(b)&&(T+=b.container.clientWidth),E.right=`${T}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};fo.prototype.forceResize=function(){this._lastWidth=0,this.resize()};fo.prototype.render=function(){this._cesiumWidget.render()};fo.prototype.isDestroyed=function(){return!1};fo.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Gn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Gn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",iRe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),fe(this)};fo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(fo.prototype._onEntityCollectionChanged,this)};fo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(fo.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};fo.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};fo.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,eRe)!==gt.FAILED?n=eRe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=m.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=o.name??o.id,a.description=K.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};fo.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};fo.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};fo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};fo.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};fo.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};fo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&rte(this.timeline,e)};fo.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&rte(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,fo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};fo.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};fo.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};fo.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var ste=fo;var Yko=y(x(),1);function BWt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new ZU(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var ate=BWt;var Pko=y(x(),1);function wWt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new VU(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var cte=wWt;var vko=y(x(),1);function YWt(e,t){t=t??Q.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new Ce,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=Xn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){oRe(s,d),s=u,lte(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?lte(s,d):oRe(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){BT(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=u.dataTransfer.files,p=h.length;for(let g=0;g<p;g++){let f=h[g],b=new FileReader;b.onload=NWt(e,f,c,a),b.onerror=XWt(e,f),b.readAsText(f)}}lte(s,d),e.destroy=sX(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function BT(e){e.stopPropagation(),e.preventDefault()}function oRe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",BT,!1),n.removeEventListener("dragover",BT,!1),n.removeEventListener("dragexit",BT,!1))}function lte(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",BT,!1),e.addEventListener("dragover",BT,!1),e.addEventListener("dragexit",BT,!1)}function NWt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=Jw.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=hy.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=VE.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=zY.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function XWt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var dte=YWt;var Kko=y(x(),1);function PWt(e,t){t=t??Q.EMPTY_OBJECT;let n=new vU({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var ute=PWt;var d9o=y(x(),1);var a9o=y(x(),1);var e9o=y(x(),1);function rRe(e){let t=e.split(`
`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c}
`}return i}function oh(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let d=_e.observable();return _e.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),l(a)&&l(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=rRe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===ac.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===ac.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===ac.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-V.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:V.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-V.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:V.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-V.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:V.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-V.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:V.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-V.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:V.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-V.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:V.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&sA(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&sA(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&sA(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&sA(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&sA(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&sA(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&sA(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&sA(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&sA(t)}})}var MWt=new m,UWt=new m,DWt=new uc,vWt=new $;function sA(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,MWt),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,UWt),i=DWt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,vWt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(oh.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=rRe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,sA(t)}}});oh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};oh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};oh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};oh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};oh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};oh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};oh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new AT({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};oh.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=`  ${a[d]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};oh.prototype.isDestroyed=function(){return!1};oh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){_e.getObservable(e,t).dispose()}),fe(this)};var nD=oh;function t3(e,t){e=Xn(e);let n=document.createElement("div"),i=new nD(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:d}=Yd,u=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),g=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let f=10,b=10,C=V.PI;h.appendChild(c("Translation X","translationX",-f,+f)),h.appendChild(c("Translation Y","translationY",-f,+f)),h.appendChild(c("Translation Z","translationZ",-f,+f)),h.appendChild(c("Scale X","scaleX",0,+b)),h.appendChild(c("Scale Y","scaleY",0,+b)),h.appendChild(c("Scale Z","scaleZ",0,+b)),h.appendChild(c("Heading","angleX",-C,+C)),h.appendChild(c("Pitch","angleY",-C,+C)),h.appendChild(c("Roll","angleZ",-C,+C)),mte("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),mte("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),mte("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let E=document.createElement("div");g.appendChild(E);let T=document.createElement("textarea");T.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),E.className="cesium-cesiumInspector-styleEditor",E.appendChild(T);let S=d("Compile (Ctrl+Enter)","compileShader");E.appendChild(S);let _=document.createElement("label");_.style.display="block",_.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),E.appendChild(_),_e.applyBindings(i,n)}Object.defineProperties(t3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});t3.prototype.isDestroyed=function(){return!1};t3.prototype.destroy=function(){return _e.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};function mte(e,t,n,i,o,r,s,a,c,d,u,h,p,g){let f=Yd.createRangeInputWithDynamicMinMax,b=g.appendChild(document.createElement("div"));b.setAttribute("data-bind",`if: ${p}`),b.appendChild(f(e,s)),b.appendChild(f(t,a)),b.appendChild(f(n,c)),b.appendChild(f(i,d)),b.appendChild(f(o,u)),b.appendChild(f(r,h))}var iD=t3;function kWt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new iD(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var hte=kWt;globalThis.CESIUM_VERSION="1.138.0";var QWt="1.138.0";return fRe(OWt);})();
