Files
gofly-platform-services/zlt-web/yingyan/public/cesium/index.cjs
T
2025-12-26 19:50:46 +08:00

16583 lines
4.3 MiB
Plaintext

/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.136.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 gDe=Object.create;var TG=Object.defineProperty;var _De=Object.getOwnPropertyDescriptor;var CDe=Object.getOwnPropertyNames;var yDe=Object.getPrototypeOf,EDe=Object.prototype.hasOwnProperty;var IDe=(e,t)=>()=>(e&&(t=e(e=0)),t);var di=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cne=(e,t)=>{for(var n in t)TG(e,n,{get:t[n],enumerable:!0})},lne=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of CDe(t))!EDe.call(e,o)&&o!==n&&TG(e,o,{get:()=>t[o],enumerable:!(i=_De(t,o))||i.enumerable});return e};var mr=(e,t,n)=>(n=e!=null?gDe(yDe(e)):{},lne(t||!e||!e.__esModule?TG(n,"default",{value:e,enumerable:!0}):n,e)),fh=e=>lne(TG({},"__esModule",{value:!0}),e);var SG=di((MOt,une)=>{var fp=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)};fp.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}};fp.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};fp.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};fp.prototype.random_int31=function(){return this.random_int()>>>1};fp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};fp.prototype.random=function(){return this.random_int()*(1/4294967296)};fp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};fp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};une.exports=fp});var Lne=di((Jb,Xb)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof Jb=="object"&&Jb&&!Jb.nodeType&&Jb,n=typeof Xb=="object"&&Xb&&!Xb.nodeType&&Xb,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,u=38,f=700,h=72,m=128,g="-",A=/^xn--/,_=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=s-a,I=Math.floor,x=String.fromCharCode,S;function w(k){throw new RangeError(y[k])}function v(k,z){for(var Q=k.length,H=[];Q--;)H[Q]=z(k[Q]);return H}function P(k,z){var Q=k.split("@"),H="";Q.length>1&&(H=Q[0]+"@",k=Q[1]),k=k.replace(C,".");var W=k.split("."),Z=v(W,z).join(".");return H+Z}function N(k){for(var z=[],Q=0,H=k.length,W,Z;Q<H;)W=k.charCodeAt(Q++),W>=55296&&W<=56319&&Q<H?(Z=k.charCodeAt(Q++),(Z&64512)==56320?z.push(((W&1023)<<10)+(Z&1023)+65536):(z.push(W),Q--)):z.push(W);return z}function L(k){return v(k,function(z){var Q="";return z>65535&&(z-=65536,Q+=x(z>>>10&1023|55296),z=56320|z&1023),Q+=x(z),Q}).join("")}function p(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:s}function b(k,z){return k+22+75*(k<26)-((z!=0)<<5)}function T(k,z,Q){var H=0;for(k=Q?I(k/f):k>>1,k+=I(k/z);k>E*c>>1;H+=s)k=I(k/E);return I(H+(E+1)*k/(k+u))}function B(k){var z=[],Q=k.length,H,W=0,Z=m,Y=h,$,K,fe,ge,ne,Ce,ye,De,be;for($=k.lastIndexOf(g),$<0&&($=0),K=0;K<$;++K)k.charCodeAt(K)>=128&&w("not-basic"),z.push(k.charCodeAt(K));for(fe=$>0?$+1:0;fe<Q;){for(ge=W,ne=1,Ce=s;fe>=Q&&w("invalid-input"),ye=p(k.charCodeAt(fe++)),(ye>=s||ye>I((r-W)/ne))&&w("overflow"),W+=ye*ne,De=Ce<=Y?a:Ce>=Y+c?c:Ce-Y,!(ye<De);Ce+=s)be=s-De,ne>I(r/be)&&w("overflow"),ne*=be;H=z.length+1,Y=T(W-ge,H,ge==0),I(W/H)>r-Z&&w("overflow"),Z+=I(W/H),W%=H,z.splice(W++,0,Z)}return L(z)}function R(k){var z,Q,H,W,Z,Y,$,K,fe,ge,ne,Ce=[],ye,De,be,Ne;for(k=N(k),ye=k.length,z=m,Q=0,Z=h,Y=0;Y<ye;++Y)ne=k[Y],ne<128&&Ce.push(x(ne));for(H=W=Ce.length,W&&Ce.push(g);H<ye;){for($=r,Y=0;Y<ye;++Y)ne=k[Y],ne>=z&&ne<$&&($=ne);for(De=H+1,$-z>I((r-Q)/De)&&w("overflow"),Q+=($-z)*De,z=$,Y=0;Y<ye;++Y)if(ne=k[Y],ne<z&&++Q>r&&w("overflow"),ne==z){for(K=Q,fe=s;ge=fe<=Z?a:fe>=Z+c?c:fe-Z,!(K<ge);fe+=s)Ne=K-ge,be=s-ge,Ce.push(x(b(ge+Ne%be,0))),K=I(Ne/be);Ce.push(x(b(K,0))),Z=T(Q,De,H==W),Q=0,++H}++Q,++z}return Ce.join("")}function O(k){return P(k,function(z){return A.test(z)?B(z.slice(4).toLowerCase()):z})}function U(k){return P(k,function(z){return _.test(z)?"xn--"+R(z):z})}if(o={version:"1.3.2",ucs2:{decode:N,encode:L},decode:B,encode:R,toASCII:U,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(Xb.exports==t)n.exports=o;else for(S in o)o.hasOwnProperty(S)&&(t[S]=o[S]);else e.punycode=o})(Jb)});var Fne=di((One,YG)=>{/*!
* 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 YG=="object"&&YG.exports?YG.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(One,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 u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,h=0;h<c;h++){f=s[h].split("");for(var m=0;m<3&&(f[0]==="0"&&f.length>1);m++)f.splice(0,1);s[h]=f.join("")}var g=-1,A=0,_=0,C=-1,y=!1;for(h=0;h<c;h++)y?s[h]==="0"?_+=1:(y=!1,_>A&&(g=C,A=_)):s[h]==="0"&&(y=!0,C=h,_=1);_>A&&(g=C,A=_),A>1&&s.splice(g,A,""),a=s.length;var E="";for(s[0]===""&&(E=":"),h=0;h<a&&(E+=s[h],h!==a-1);h++)E+=":";return s[a-1]===""&&(E+=":"),E}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var kne=di((Qne,WG)=>{/*!
* 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 WG=="object"&&WG.exports?WG.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Qne,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 Yu=di((Une,jG)=>{/*!
* 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 jG=="object"&&jG.exports?jG.exports=t(Lne(),Fne(),kne()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Une,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(b,T){var B=arguments.length>=1,R=arguments.length>=2;if(!(this instanceof r))return B?R?new r(b,T):new r(b):new r;if(b===void 0){if(B)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?b=location.href+"":b=""}if(b===null&&B)throw new TypeError("null is not a valid argument for URI");return this.href(b),T!==void 0?this.absoluteTo(T):this}function s(b){return/^[0-9]+$/.test(b)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(b){return b.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(b){return b===void 0?"Undefined":String(Object.prototype.toString.call(b)).slice(8,-1)}function h(b){return f(b)==="Array"}function m(b,T){var B={},R,O;if(f(T)==="RegExp")B=null;else if(h(T))for(R=0,O=T.length;R<O;R++)B[T[R]]=!0;else B[T]=!0;for(R=0,O=b.length;R<O;R++){var U=B&&B[b[R]]!==void 0||!B&&T.test(b[R]);U&&(b.splice(R,1),O--,R--)}return b}function g(b,T){var B,R;if(h(T)){for(B=0,R=T.length;B<R;B++)if(!g(b,T[B]))return!1;return!0}var O=f(T);for(B=0,R=b.length;B<R;B++)if(O==="RegExp"){if(typeof b[B]=="string"&&b[B].match(T))return!0}else if(b[B]===T)return!0;return!1}function A(b,T){if(!h(b)||!h(T)||b.length!==T.length)return!1;b.sort(),T.sort();for(var B=0,R=b.length;B<R;B++)if(b[B]!==T[B])return!1;return!0}function _(b){var T=/^\/+|\/+$/g;return b.replace(T,"")}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(b){if(!(!b||!b.nodeName)){var T=b.nodeName.toLowerCase();if(!(T==="input"&&b.type!=="image"))return r.domAttributes[T]}};function C(b){return escape(b)}function y(b){return encodeURIComponent(b).replace(/[!'()*]/g,C).replace(/\*/g,"%2A")}r.encode=y,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=y,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(b,T){var B=r.encode(b+"");return T===void 0&&(T=r.escapeQuerySpace),T?B.replace(/%20/g,"+"):B},r.decodeQuery=function(b,T){b+="",T===void 0&&(T=r.escapeQuerySpace);try{return r.decode(T?b.replace(/\+/g,"%20"):b)}catch{return b}};var E={encode:"encode",decode:"decode"},I,x=function(b,T){return function(B){try{return r[T](B+"").replace(r.characters[b][T].expression,function(R){return r.characters[b][T].map[R]})}catch{return B}}};for(I in E)r[I+"PathSegment"]=x("pathname",E[I]),r[I+"UrnPathSegment"]=x("urnpath",E[I]);var S=function(b,T,B){return function(R){var O;B?O=function(Q){return r[T](r[B](Q))}:O=r[T];for(var U=(R+"").split(b),k=0,z=U.length;k<z;k++)U[k]=O(U[k]);return U.join(b)}};r.decodePath=S("/","decodePathSegment"),r.decodeUrnPath=S(":","decodeUrnPathSegment"),r.recodePath=S("/","encodePathSegment","decode"),r.recodeUrnPath=S(":","encodeUrnPathSegment","decode"),r.encodeReserved=x("reserved","encode"),r.parse=function(b,T){var B;return T||(T={preventInvalidHostname:r.preventInvalidHostname}),b=b.replace(r.leading_whitespace_expression,""),b=b.replace(r.ascii_tab_whitespace,""),B=b.indexOf("#"),B>-1&&(T.fragment=b.substring(B+1)||null,b=b.substring(0,B)),B=b.indexOf("?"),B>-1&&(T.query=b.substring(B+1)||null,b=b.substring(0,B)),b=b.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),b=b.replace(/^[/\\]{2,}/i,"//"),b.substring(0,2)==="//"?(T.protocol=null,b=b.substring(2),b=r.parseAuthority(b,T)):(B=b.indexOf(":"),B>-1&&(T.protocol=b.substring(0,B)||null,T.protocol&&!T.protocol.match(r.protocol_expression)?T.protocol=void 0:b.substring(B+1,B+3).replace(/\\/g,"/")==="//"?(b=b.substring(B+3),b=r.parseAuthority(b,T)):(b=b.substring(B+1),T.urn=!0))),T.path=b,T},r.parseHost=function(b,T){b||(b=""),b=b.replace(/\\/g,"/");var B=b.indexOf("/"),R,O;if(B===-1&&(B=b.length),b.charAt(0)==="[")R=b.indexOf("]"),T.hostname=b.substring(1,R)||null,T.port=b.substring(R+2,B)||null,T.port==="/"&&(T.port=null);else{var U=b.indexOf(":"),k=b.indexOf("/"),z=b.indexOf(":",U+1);z!==-1&&(k===-1||z<k)?(T.hostname=b.substring(0,B)||null,T.port=null):(O=b.substring(0,B).split(":"),T.hostname=O[0]||null,T.port=O[1]||null)}return T.hostname&&b.substring(B).charAt(0)!=="/"&&(B++,b="/"+b),T.preventInvalidHostname&&r.ensureValidHostname(T.hostname,T.protocol),T.port&&r.ensureValidPort(T.port),b.substring(B)||"/"},r.parseAuthority=function(b,T){return b=r.parseUserinfo(b,T),r.parseHost(b,T)},r.parseUserinfo=function(b,T){var B=b,R=b.indexOf("\\");R!==-1&&(b=b.replace(/\\/g,"/"));var O=b.indexOf("/"),U=b.lastIndexOf("@",O>-1?O:b.length-1),k;return U>-1&&(O===-1||U<O)?(k=b.substring(0,U).split(":"),T.username=k[0]?r.decode(k[0]):null,k.shift(),T.password=k[0]?r.decode(k.join(":")):null,b=B.substring(U+1)):(T.username=null,T.password=null),b},r.parseQuery=function(b,T){if(!b)return{};if(b=b.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!b)return{};for(var B={},R=b.split("&"),O=R.length,U,k,z,Q=0;Q<O;Q++)U=R[Q].split("="),k=r.decodeQuery(U.shift(),T),z=U.length?r.decodeQuery(U.join("="),T):null,k!=="__proto__"&&(c.call(B,k)?((typeof B[k]=="string"||B[k]===null)&&(B[k]=[B[k]]),B[k].push(z)):B[k]=z);return B},r.build=function(b){var T="",B=!1;return b.protocol&&(T+=b.protocol+":"),!b.urn&&(T||b.hostname)&&(T+="//",B=!0),T+=r.buildAuthority(b)||"",typeof b.path=="string"&&(b.path.charAt(0)!=="/"&&B&&(T+="/"),T+=b.path),typeof b.query=="string"&&b.query&&(T+="?"+b.query),typeof b.fragment=="string"&&b.fragment&&(T+="#"+b.fragment),T},r.buildHost=function(b){var T="";if(b.hostname)r.ip6_expression.test(b.hostname)?T+="["+b.hostname+"]":T+=b.hostname;else return"";return b.port&&(T+=":"+b.port),T},r.buildAuthority=function(b){return r.buildUserinfo(b)+r.buildHost(b)},r.buildUserinfo=function(b){var T="";return b.username&&(T+=r.encode(b.username)),b.password&&(T+=":"+r.encode(b.password)),T&&(T+="@"),T},r.buildQuery=function(b,T,B){var R="",O,U,k,z;for(U in b)if(U!=="__proto__"&&c.call(b,U))if(h(b[U]))for(O={},k=0,z=b[U].length;k<z;k++)b[U][k]!==void 0&&O[b[U][k]+""]===void 0&&(R+="&"+r.buildQueryParameter(U,b[U][k],B),T!==!0&&(O[b[U][k]+""]=!0));else b[U]!==void 0&&(R+="&"+r.buildQueryParameter(U,b[U],B));return R.substring(1)},r.buildQueryParameter=function(b,T,B){return r.encodeQuery(b,B)+(T!==null?"="+r.encodeQuery(T,B):"")},r.addQuery=function(b,T,B){if(typeof T=="object")for(var R in T)c.call(T,R)&&r.addQuery(b,R,T[R]);else if(typeof T=="string"){if(b[T]===void 0){b[T]=B;return}else typeof b[T]=="string"&&(b[T]=[b[T]]);h(B)||(B=[B]),b[T]=(b[T]||[]).concat(B)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(b,T,B){if(typeof T=="object")for(var R in T)c.call(T,R)&&r.setQuery(b,R,T[R]);else if(typeof T=="string")b[T]=B===void 0?null:B;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(b,T,B){var R,O,U;if(h(T))for(R=0,O=T.length;R<O;R++)b[T[R]]=void 0;else if(f(T)==="RegExp")for(U in b)T.test(U)&&(b[U]=void 0);else if(typeof T=="object")for(U in T)c.call(T,U)&&r.removeQuery(b,U,T[U]);else if(typeof T=="string")B!==void 0?f(B)==="RegExp"?!h(b[T])&&B.test(b[T])?b[T]=void 0:b[T]=m(b[T],B):b[T]===String(B)&&(!h(B)||B.length===1)?b[T]=void 0:h(b[T])&&(b[T]=m(b[T],B)):b[T]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(b,T,B,R){switch(f(T)){case"String":break;case"RegExp":for(var O in b)if(c.call(b,O)&&T.test(O)&&(B===void 0||r.hasQuery(b,O,B)))return!0;return!1;case"Object":for(var U in T)if(c.call(T,U)&&!r.hasQuery(b,U,T[U]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(B)){case"Undefined":return T in b;case"Boolean":var k=!!(h(b[T])?b[T].length:b[T]);return B===k;case"Function":return!!B(b[T],T,b);case"Array":if(!h(b[T]))return!1;var z=R?g:A;return z(b[T],B);case"RegExp":return h(b[T])?R?g(b[T],B):!1:!!(b[T]&&b[T].match(B));case"Number":B=String(B);case"String":return h(b[T])?R?g(b[T],B):!1:b[T]===B;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var b=[],T=[],B=0,R=0;R<arguments.length;R++){var O=new r(arguments[R]);b.push(O);for(var U=O.segment(),k=0;k<U.length;k++)typeof U[k]=="string"&&T.push(U[k]),U[k]&&B++}if(!T.length||!B)return new r("");var z=new r("").segment(T);return(b[0].path()===""||b[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(b,T){var B=Math.min(b.length,T.length),R;for(R=0;R<B;R++)if(b.charAt(R)!==T.charAt(R)){R--;break}return R<1?b.charAt(0)===T.charAt(0)&&b.charAt(0)==="/"?"/":"":((b.charAt(R)!=="/"||T.charAt(R)!=="/")&&(R=b.substring(0,R).lastIndexOf("/")),b.substring(0,R+1))},r.withinString=function(b,T,B){B||(B={});var R=B.start||r.findUri.start,O=B.end||r.findUri.end,U=B.trim||r.findUri.trim,k=B.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(R.lastIndex=0;;){var Q=R.exec(b);if(!Q)break;var H=Q.index;if(B.ignoreHtml){var W=b.slice(Math.max(H-3,0),H);if(W&&z.test(W))continue}for(var Z=H+b.slice(H).search(O),Y=b.slice(H,Z),$=-1;;){var K=k.exec(Y);if(!K)break;var fe=K.index+K[0].length;$=Math.max($,fe)}if($>-1?Y=Y.slice(0,$)+Y.slice($).replace(U,""):Y=Y.replace(U,""),!(Y.length<=Q[0].length)&&!(B.ignore&&B.ignore.test(Y))){Z=H+Y.length;var ge=T(Y,H,Z,b);if(ge===void 0){R.lastIndex=Z;continue}ge=String(ge),b=b.slice(0,H)+ge+b.slice(Z),R.lastIndex=H+ge.length}}return R.lastIndex=0,b},r.ensureValidHostname=function(b,T){var B=!!b,R=!!T,O=!1;if(R&&(O=g(r.hostProtocols,T)),O&&!B)throw new TypeError("Hostname cannot be empty, if protocol is "+T);if(b&&b.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(b).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(b){if(b){var T=Number(b);if(!(s(T)&&T>0&&T<65536))throw new TypeError('Port "'+b+'" is not a valid port')}},r.noConflict=function(b){if(b){var T={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(T.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(T.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(T.SecondLevelDomains=i.SecondLevelDomains.noConflict()),T}else i.URI===this&&(i.URI=o);return this},a.build=function(b){return b===!0?this._deferred_build=!0:(b===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 w(b){return function(T,B){return T===void 0?this._parts[b]||"":(this._parts[b]=T||null,this.build(!B),this)}}function v(b,T){return function(B,R){return B===void 0?this._parts[b]||"":(B!==null&&(B=B+"",B.charAt(0)===T&&(B=B.substring(1))),this._parts[b]=B,this.build(!R),this)}}a.protocol=w("protocol"),a.username=w("username"),a.password=w("password"),a.hostname=w("hostname"),a.port=w("port"),a.query=v("query","?"),a.fragment=v("fragment","#"),a.search=function(b,T){var B=this.query(b,T);return typeof B=="string"&&B.length?"?"+B:B},a.hash=function(b,T){var B=this.fragment(b,T);return typeof B=="string"&&B.length?"#"+B:B},a.pathname=function(b,T){if(b===void 0||b===!0){var B=this._parts.path||(this._parts.hostname?"/":"");return b?(this._parts.urn?r.decodeUrnPath:r.decodePath)(B):B}else return this._parts.urn?this._parts.path=b?r.recodeUrnPath(b):"":this._parts.path=b?r.recodePath(b):"/",this.build(!T),this},a.path=a.pathname,a.href=function(b,T){var B;if(b===void 0)return this.toString();this._string="",this._parts=r._parts();var R=b instanceof r,O=typeof b=="object"&&(b.hostname||b.path||b.pathname);if(b.nodeName){var U=r.getDomAttribute(b);b=b[U]||"",O=!1}if(!R&&O&&b.pathname!==void 0&&(b=b.toString()),typeof b=="string"||b instanceof String)this._parts=r.parse(String(b),this._parts);else if(R||O){var k=R?b._parts:b;for(B in k)B!=="query"&&c.call(this._parts,B)&&(this._parts[B]=k[B]);k.query&&this.query(k.query,!1)}else throw new TypeError("invalid input");return this.build(!T),this},a.is=function(b){var T=!1,B=!1,R=!1,O=!1,U=!1,k=!1,z=!1,Q=!this._parts.urn;switch(this._parts.hostname&&(Q=!1,B=r.ip4_expression.test(this._parts.hostname),R=r.ip6_expression.test(this._parts.hostname),T=B||R,O=!T,U=O&&n&&n.has(this._parts.hostname),k=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),b.toLowerCase()){case"relative":return Q;case"absolute":return!Q;case"domain":case"name":return O;case"sld":return U;case"ip":return T;case"ip4":case"ipv4":case"inet4":return B;case"ip6":case"ipv6":case"inet6":return R;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var P=a.protocol,N=a.port,L=a.hostname;a.protocol=function(b,T){if(b&&(b=b.replace(/:(\/\/)?$/,""),!b.match(r.protocol_expression)))throw new TypeError('Protocol "'+b+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,b,T)},a.scheme=a.protocol,a.port=function(b,T){return this._parts.urn?b===void 0?"":this:(b!==void 0&&(b===0&&(b=null),b&&(b+="",b.charAt(0)===":"&&(b=b.substring(1)),r.ensureValidPort(b))),N.call(this,b,T))},a.hostname=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b!==void 0){var B={preventInvalidHostname:this._parts.preventInvalidHostname},R=r.parseHost(b,B);if(R!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');b=B.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(b,this._parts.protocol)}return L.call(this,b,T)},a.origin=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var B=this.protocol(),R=this.authority();return R?(B?B+"://":"")+this.authority():""}else{var O=r(b);return this.protocol(O.protocol()).authority(O.authority()).build(!T),this}},a.host=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var B=r.parseHost(b,this._parts);if(B!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!T),this},a.authority=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var B=r.parseAuthority(b,this._parts);if(B!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!T),this},a.userinfo=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var B=r.buildUserinfo(this._parts);return B&&B.substring(0,B.length-1)}else return b[b.length-1]!=="@"&&(b+="@"),r.parseUserinfo(b,this._parts),this.build(!T),this},a.resource=function(b,T){var B;return b===void 0?this.path()+this.search()+this.hash():(B=r.parse(b),this._parts.path=B.path,this._parts.query=B.query,this._parts.fragment=B.fragment,this.build(!T),this)},a.subdomain=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var B=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,B)||""}else{var R=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,R),U=new RegExp("^"+u(O));if(b&&b.charAt(b.length-1)!=="."&&(b+="."),b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return b&&r.ensureValidHostname(b,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(U,b),this.build(!T),this}},a.domain=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(T=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var B=this._parts.hostname.match(/\./g);if(B&&B.length<2)return this._parts.hostname;var R=this._parts.hostname.length-this.tld(T).length-1;return R=this._parts.hostname.lastIndexOf(".",R-1)+1,this._parts.hostname.substring(R)||""}else{if(!b)throw new TypeError("cannot set domain empty");if(b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(b,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=b;else{var O=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,b)}return this.build(!T),this}},a.tld=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(T=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var B=this._parts.hostname.lastIndexOf("."),R=this._parts.hostname.substring(B+1);return T!==!0&&n&&n.list[R.toLowerCase()]&&n.get(this._parts.hostname)||R}else{var O;if(b)if(b.match(/[^a-zA-Z0-9-]/))if(n&&n.is(b))O=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,b);else throw new TypeError('TLD "'+b+'" 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");O=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,b)}else throw new TypeError("cannot set TLD empty");return this.build(!T),this}},a.directory=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var B=this._parts.path.length-this.filename().length-1,R=this._parts.path.substring(0,B)||(this._parts.hostname?"/":"");return b?r.decodePath(R):R}else{var O=this._parts.path.length-this.filename().length,U=this._parts.path.substring(0,O),k=new RegExp("^"+u(U));return this.is("relative")||(b||(b="/"),b.charAt(0)!=="/"&&(b="/"+b)),b&&b.charAt(b.length-1)!=="/"&&(b+="/"),b=r.recodePath(b),this._parts.path=this._parts.path.replace(k,b),this.build(!T),this}},a.filename=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(typeof b!="string"){if(!this._parts.path||this._parts.path==="/")return"";var B=this._parts.path.lastIndexOf("/"),R=this._parts.path.substring(B+1);return b?r.decodePathSegment(R):R}else{var O=!1;b.charAt(0)==="/"&&(b=b.substring(1)),b.match(/\.?\//)&&(O=!0);var U=new RegExp(u(this.filename())+"$");return b=r.recodePath(b),this._parts.path=this._parts.path.replace(U,b),O?this.normalizePath(T):this.build(!T),this}},a.suffix=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path||this._parts.path==="/")return"";var B=this.filename(),R=B.lastIndexOf("."),O,U;return R===-1?"":(O=B.substring(R+1),U=/^[a-z0-9%]+$/i.test(O)?O:"",b?r.decodePathSegment(U):U)}else{b.charAt(0)==="."&&(b=b.substring(1));var k=this.suffix(),z;if(k)b?z=new RegExp(u(k)+"$"):z=new RegExp(u("."+k)+"$");else{if(!b)return this;this._parts.path+="."+r.recodePath(b)}return z&&(b=r.recodePath(b),this._parts.path=this._parts.path.replace(z,b)),this.build(!T),this}},a.segment=function(b,T,B){var R=this._parts.urn?":":"/",O=this.path(),U=O.substring(0,1)==="/",k=O.split(R);if(b!==void 0&&typeof b!="number"&&(B=T,T=b,b=void 0),b!==void 0&&typeof b!="number")throw new Error('Bad segment "'+b+'", must be 0-based integer');if(U&&k.shift(),b<0&&(b=Math.max(k.length+b,0)),T===void 0)return b===void 0?k:k[b];if(b===null||k[b]===void 0)if(h(T)){k=[];for(var z=0,Q=T.length;z<Q;z++)!T[z].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(_(T[z])))}else(T||typeof T=="string")&&(T=_(T),k[k.length-1]===""?k[k.length-1]=T:k.push(T));else T?k[b]=_(T):k.splice(b,1);return U&&k.unshift(""),this.path(k.join(R),B)},a.segmentCoded=function(b,T,B){var R,O,U;if(typeof b!="number"&&(B=T,T=b,b=void 0),T===void 0){if(R=this.segment(b,T,B),!h(R))R=R!==void 0?r.decode(R):void 0;else for(O=0,U=R.length;O<U;O++)R[O]=r.decode(R[O]);return R}if(!h(T))T=typeof T=="string"||T instanceof String?r.encode(T):T;else for(O=0,U=T.length;O<U;O++)T[O]=r.encode(T[O]);return this.segment(b,T,B)};var p=a.query;return a.query=function(b,T){if(b===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof b=="function"){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),R=b.call(this,B);return this._parts.query=r.buildQuery(R||B,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!T),this}else return b!==void 0&&typeof b!="string"?(this._parts.query=r.buildQuery(b,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!T),this):p.call(this,b,T)},a.setQuery=function(b,T,B){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof b=="string"||b instanceof String)R[b]=T!==void 0?T:null;else if(typeof b=="object")for(var O in b)c.call(b,O)&&(R[O]=b[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(B=T),this.build(!B),this},a.addQuery=function(b,T,B){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(R,b,T===void 0?null:T),this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(B=T),this.build(!B),this},a.removeQuery=function(b,T,B){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(R,b,T),this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(B=T),this.build(!B),this},a.hasQuery=function(b,T,B){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(R,b,T,B)},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(b){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!b)),this},a.normalizeHostname=function(b){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(!b)),this},a.normalizePort=function(b){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!b)),this},a.normalizePath=function(b){var T=this._parts.path;if(!T)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!b),this;if(this._parts.path==="/")return this;T=r.recodePath(T);var B,R="",O,U;for(T.charAt(0)!=="/"&&(B=!0,T="/"+T),(T.slice(-3)==="/.."||T.slice(-2)==="/.")&&(T+="/"),T=T.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),B&&(R=T.substring(1).match(/^(\.\.\/)+/)||"",R&&(R=R[0]));O=T.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){T=T.substring(3);continue}U=T.substring(0,O).lastIndexOf("/"),U===-1&&(U=O),T=T.substring(0,U)+T.substring(O+3)}return B&&this.is("relative")&&(T=R+T.substring(1)),this._parts.path=T,this.build(!b),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(b){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(!b)),this},a.normalizeFragment=function(b){return this._parts.fragment||(this._parts.fragment=null,this.build(!b)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var b=r.encode,T=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=b,r.decode=T}return this},a.unicode=function(){var b=r.encode,T=r.decode;r.encode=y,r.decode=unescape;try{this.normalize()}finally{r.encode=b,r.decode=T}return this},a.readable=function(){var b=this.clone();b.username("").password("").normalize();var T="";if(b._parts.protocol&&(T+=b._parts.protocol+"://"),b._parts.hostname&&(b.is("punycode")&&e?(T+=e.toUnicode(b._parts.hostname),b._parts.port&&(T+=":"+b._parts.port)):T+=b.host()),b._parts.hostname&&b._parts.path&&b._parts.path.charAt(0)!=="/"&&(T+="/"),T+=b.path(!0),b._parts.query){for(var B="",R=0,O=b._parts.query.split("&"),U=O.length;R<U;R++){var k=(O[R]||"").split("=");B+="&"+r.decodeQuery(k[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),k[1]!==void 0&&(B+="="+r.decodeQuery(k[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}T+="?"+B.substring(1)}return T+=r.decodeQuery(b.hash(),!0),T},a.absoluteTo=function(b){var T=this.clone(),B=["protocol","username","password","hostname","port"],R,O,U;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(b instanceof r||(b=new r(b)),T._parts.protocol||(T._parts.protocol=b._parts.protocol,this._parts.hostname))return T;for(O=0;U=B[O];O++)T._parts[U]=b._parts[U];return T._parts.path?(T._parts.path.substring(-2)===".."&&(T._parts.path+="/"),T.path().charAt(0)!=="/"&&(R=b.directory(),R=R||(b.path().indexOf("/")===0?"/":""),T._parts.path=(R?R+"/":"")+T._parts.path,T.normalizePath())):(T._parts.path=b._parts.path,T._parts.query||(T._parts.query=b._parts.query)),T.build(),T},a.relativeTo=function(b){var T=this.clone().normalize(),B,R,O,U,k;if(T._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(b=new r(b).normalize(),B=T._parts,R=b._parts,U=T.path(),k=b.path(),U.charAt(0)!=="/")throw new Error("URI is already relative");if(k.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(B.protocol===R.protocol&&(B.protocol=null),B.username!==R.username||B.password!==R.password||B.protocol!==null||B.username!==null||B.password!==null)return T.build();if(B.hostname===R.hostname&&B.port===R.port)B.hostname=null,B.port=null;else return T.build();if(U===k)return B.path="",T.build();if(O=r.commonPath(U,k),!O)return T.build();var z=R.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return B.path=z+B.path.substring(O.length)||"./",T.build()},a.equals=function(b){var T=this.clone(),B=new r(b),R={},O={},U={},k,z,Q;if(T.normalize(),B.normalize(),T.toString()===B.toString())return!0;if(k=T.query(),z=B.query(),T.query(""),B.query(""),T.toString()!==B.toString()||k.length!==z.length)return!1;R=r.parseQuery(k,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(Q in R)if(c.call(R,Q)){if(h(R[Q])){if(!A(R[Q],O[Q]))return!1}else if(R[Q]!==O[Q])return!1;U[Q]=!0}for(Q in O)if(c.call(O,Q)&&!U[Q])return!1;return!0},a.preventInvalidHostname=function(b){return this._parts.preventInvalidHostname=!!b,this},a.duplicateQueryParameters=function(b){return this._parts.duplicateQueryParameters=!!b,this},a.escapeQuerySpace=function(b){return this._parts.escapeQuerySpace=!!b,this},r})});var Uce=di((CM,wj)=>{var nV=(function(){"use strict";var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuec;G:Qdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq;i28Adbk:Bhdhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;C: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;C:kjjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;C:kjjbk:Ese5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd;m:kjjbgrc;GeV86bbalc;abfcFecjez:xjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc;i1jjbfydbcdtfydbh3aLaoc;e1jjbfydbcdtfydbh8AaLaoc;a1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc;a1jjbfydbcdtfydbgKTaLavc;e1jjbfydbcdtfydbg8AceSGaLavc;i1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavc:W1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkdnaeaP9nmbcbhvxekcbhvinaeavfavc:W1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:kjjbk:Adewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb;m: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;q:kjjbHjjjjbbgrBd:SeavceBd:mdaraeawz:wjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaradaiavc:Sefz:pjjjbavyd:GehDadci9Ugqcbyd;q:kjjbHjjjjbbheavc:Sefavyd:mdgkcdtfaeBdbavakcefgwBd:mdaecbaqz:xjjjbhxavc:SefawcdtfcuaicdtaicFFFFi0Ecbyd;q:kjjbHjjjjbbgmBdbavakcdfgPBd:mdalc;ebfhsaDheamhwinawalIdbasaeydbgzcwazcw6EcdtfIdbMUdbaeclfheawclfhwaicufgimbkavc:SefaPcdtfcuaqcdtadcFFFF970Ecbyd;q:kjjbHjjjjbbgPBdbdnadci6mbarheaPhwaqhiinawamaeydbcdtfIdbamaeclfydbcdtfIdbMamaecwfydbcdtfIdbMUdbaecxfheawclfhwaicufgimbkkakcifhoalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhzcbhwcbhXcehQinaehLcihkarawci2gKcdtfgeydbhsaeclfydbhdabaXcx2fgicwfaecwfydbgYBdbaiclfadBdbaiasBdbaxawfce86bbaOaYBdwaOadBdlaOasBdbaPawcdtfcbBdbdnazTmbcihkaLhiinaOakcdtfaiydbgeBdbakaeaY9haeas9haead9hGGfhkaiclfhiazcufgzmbkkaXcefhXcbhzinaCaAarazaKfcdtfydbcdtgifydbcdtfgYheaDaifgdydbgshidnasTmbdninaeydbawSmeaeclfheaicufgiTmdxbkkaeaYascdtfc98fydbBdbadadydbcufBdbkazcefgzci9hmbkdndnakTmbcuhwJbbbbh8Acbhdavyd:KehYavyd:OehKindndnaDaOadcdtfydbcdtgzfydbgembadcefhdxekadcs0hiamazfgsIdbhEasalcbadcefgdaiEcdtfIdbaHaecwaecw6EcdtfIdbMg3Udba3aE:th3aecdthiaKaYazfydbcdtfheinaPaeydbgzcdtfgsa3asIdbMgEUdbaEa8Aa8AaE9DgsEh8AazawasEhwaeclfheaic98fgimbkkadak9hmbkawcu9hmekaQaq9pmdindnaxaQfRbbmbaQhwxdkaqaQcefgQ9hmbxikkakczakcz6EhzaOheaLhOawcu9hmbkkaocdtavc:Seffc98fhedninaoTmeaeydbcbyd;u:kjjbH:bjjjbbaec98fheaocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd;q:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic;K1jjbz:ojjjbkQbabaeadaic;m:jjjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:Vvioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:kjjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:kjjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkclhvdninavc98Smealcxfavfydbcbyd;u: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;y:kjjbgeabcifc98GfgbBd;y:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:kjjbgeabcrfc94GfgbBd;y:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;y:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;y:kjjbfgdBd;y:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk;Qddbcjwk;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;mqkzebbbebbbdbbb9G: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(0),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var A=new Uint8Array(g.length),_=0;_<g.length;++_){var C=g.charCodeAt(_);A[_]=C>96?C-97:C>64?C-39:C+4}for(var y=0,_=0;_<g.length;++_)A[y++]=A[_]<60?t[A[_]]:(A[_]-60)*64+A[++_];return A.buffer.slice(0,y)}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,A,_,C){var y=n.exports.sbrk,E=y(A.length*4),I=y(_*4),x=new Uint8Array(n.exports.memory.buffer),S=s(A);x.set(S,E),C&&C(E,E,A.length,_);var w=g(I,E,A.length,_);x=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(_);new Uint8Array(v.buffer).set(x.subarray(I,I+_*4)),S.set(x.subarray(E,E+A.length*4)),y(E-y(0));for(var P=0;P<A.length;++P)A[P]=v[A[P]];return[v,w]}function c(g,A,_,C){var y=n.exports.sbrk,E=y(_*4),I=y(_*C),x=new Uint8Array(n.exports.memory.buffer);x.set(s(A),I),g(E,I,_,C),x=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(_);return new Uint8Array(S.buffer).set(x.subarray(E,E+_*4)),y(E-y(0)),S}function u(g,A,_,C,y,E,I){var x=n.exports.sbrk,S=x(A),w=x(C*y),v=new Uint8Array(n.exports.memory.buffer);v.set(s(_),w);var P=g(S,A,w,C,y,E,I),N=new Uint8Array(P);return N.set(v.subarray(S,S+P)),x(S-x(0)),N}function f(g){for(var A=0,_=0;_<g.length;++_){var C=g[_];A=A<C?C:A}return A}function h(g,A){if(r(A==2||A==4),A==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var _=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(_)}function m(g,A,_,C,y,E,I){var x=n.exports.sbrk,S=x(_*C),w=x(_*E),v=new Uint8Array(n.exports.memory.buffer);v.set(s(A),w),g(S,_,C,y,w,I);var P=new Uint8Array(_*C);return P.set(v.subarray(S,S+_*C)),x(S-x(0)),P}return{ready:i,supported:!0,reorderMesh:function(g,A,_){var C=A?_?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,C)},reorderPoints:function(g,A){return r(g instanceof Float32Array),r(g.length%A==0),r(A>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/A,A*4)},encodeVertexBuffer:function(g,A,_){r(_>0&&_<=256),r(_%4==0);var C=n.exports.meshopt_encodeVertexBufferBound(A,_);return u(n.exports.meshopt_encodeVertexBuffer,C,g,A,_)},encodeVertexBufferLevel:function(g,A,_,C,y){r(_>0&&_<=256),r(_%4==0),r(C>=0&&C<=3),r(y===void 0||y==0||y==1);var E=n.exports.meshopt_encodeVertexBufferBound(A,_);return u(n.exports.meshopt_encodeVertexBufferLevel,E,g,A,_,C,y||0)},encodeIndexBuffer:function(g,A,_){r(_==2||_==4),r(A%3==0);var C=h(g,_),y=n.exports.meshopt_encodeIndexBufferBound(A,f(C)+1);return u(n.exports.meshopt_encodeIndexBuffer,y,C,A,4)},encodeIndexSequence:function(g,A,_){r(_==2||_==4);var C=h(g,_),y=n.exports.meshopt_encodeIndexSequenceBound(A,f(C)+1);return u(n.exports.meshopt_encodeIndexSequence,y,C,A,4)},encodeGltfBuffer:function(g,A,_,C){var y={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(y[C]),y[C](g,A,_)},encodeFilterOct:function(g,A,_,C){return r(_==4||_==8),r(C>=1&&C<=16),m(n.exports.meshopt_encodeFilterOct,g,A,_,C,16)},encodeFilterQuat:function(g,A,_,C){return r(_==8),r(C>=4&&C<=16),m(n.exports.meshopt_encodeFilterQuat,g,A,_,C,16)},encodeFilterExp:function(g,A,_,C,y){r(_>0&&_%4==0),r(C>=1&&C<=24);var E={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return m(n.exports.meshopt_encodeFilterExp,g,A,_,C,_,y?E[y]:1)},encodeFilterColor:function(g,A,_,C){return r(_==4||_==8),r(C>=2&&C<=16),m(n.exports.meshopt_encodeFilterColor,g,A,_,C,16)}}})();typeof CM=="object"&&typeof wj=="object"?wj.exports=nV:typeof define=="function"&&define.amd?define([],function(){return nV}):typeof CM=="object"?CM.MeshoptEncoder=nV:(typeof self<"u"?self:CM).MeshoptEncoder=nV});var Gce=di((yM,Dj)=>{var iV=(function(){"use strict";var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuec:W:Odkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;BZkdbk;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;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91: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;Iwllue97euo978Jjjjjbca9Rhidnaec98GglTmbcbhvabhoinaocKfpxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81ZaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qp;6ep;NegxaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meaxarczp:Sep;6ep;Megmamp;Meaxaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgxp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgPp9oamaxp;Mearp;Keczp:Rep9qgmaDaxp;Mearp;KeaPp9oaqaxp;Mearp;Keczp:Rep9qgrpmwDKYqk8AExm35Ps8E8FgDp5eakclp:RegxpEi:T:j83ibawaDp5baxpEd:T:j83ibaocwfamarpmbezHdiOAlvCXorQLgrp5eaxpEe:T:j83ibaoarp5baxpEb:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiczfpxbbbbbbbbbbbbbbbbgxpklbaiaxpklbaiabalcitfgoaeciGgvcitgw;8qbbdnavTmbaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81ZaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qp;6ep;NegxaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meaxarczp:Sep;6ep;Megmamp;Meaxaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgxp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgPp9oamaxp;Mearp;Keczp:Rep9qgmaDaxp;Mearp;KeaPp9oaqaxp;Mearp;Keczp:Rep9qgrpmwDKYqk8AExm35Ps8E8FgDp5eakclp:RegxpEi:T:j83iKaiaDp5baxpEd:T:j83izaiamarpmbezHdiOAlvCXorQLgrp5eaxpEe:T:j83iwaiarp5baxpEb: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(y){r=y.instance,r.exports.__wasm_call_ctors()});function a(y){for(var E=new Uint8Array(y.length),I=0;I<y.length;++I){var x=y.charCodeAt(I);E[I]=x>96?x-97:x>64?x-39:x+4}for(var S=0,I=0;I<y.length;++I)E[S++]=E[I]<60?i[E[I]]:(E[I]-60)*64+E[++I];return E.buffer.slice(0,S)}function c(y,E,I,x,S,w,v){var P=y.exports.sbrk,N=x+3&-4,L=P(N*S),p=P(w.length),b=new Uint8Array(y.exports.memory.buffer);b.set(w,p);var T=E(L,x,S,p,w.length);if(T==0&&v&&v(L,N,S),I.set(b.subarray(L,L+x*S)),P(L-P(0)),T!=0)throw new Error("Malformed buffer data: "+T)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],m=0;function g(y){var E={object:new Worker(y),pending:0,requests:{}};return E.object.onmessage=function(I){var x=I.data;E.pending-=x.count,E.requests[x.id][x.action](x.value),delete E.requests[x.id]},E}function A(y){for(var E="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(),I=new Blob([E],{type:"text/javascript"}),x=URL.createObjectURL(I),S=h.length;S<y;++S)h[S]=g(x);for(var S=y;S<h.length;++S)h[S].object.postMessage({});h.length=y,URL.revokeObjectURL(x)}function _(y,E,I,x,S){for(var w=h[0],v=1;v<h.length;++v)h[v].pending<w.pending&&(w=h[v]);return new Promise(function(P,N){var L=new Uint8Array(I),p=++m;w.pending+=y,w.requests[p]={resolve:P,reject:N},w.object.postMessage({id:p,count:y,size:E,source:L,mode:x,filter:S},[L.buffer])})}function C(y){var E=y.data;if(!E.id)return self.close();self.ready.then(function(I){try{var x=new Uint8Array(E.count*E.size);c(I,I.exports[E.mode],x,E.count,E.size,E.source,I.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:x},[x.buffer])}catch(S){self.postMessage({id:E.id,count:E.count,action:"reject",value:S})}})}return{ready:s,supported:!0,useWorkers:function(y){A(y)},decodeVertexBuffer:function(y,E,I,x,S){c(r,r.exports.meshopt_decodeVertexBuffer,y,E,I,x,r.exports[u[S]])},decodeIndexBuffer:function(y,E,I,x){c(r,r.exports.meshopt_decodeIndexBuffer,y,E,I,x)},decodeIndexSequence:function(y,E,I,x){c(r,r.exports.meshopt_decodeIndexSequence,y,E,I,x)},decodeGltfBuffer:function(y,E,I,x,S,w){c(r,r.exports[f[S]],y,E,I,x,r.exports[u[w]])},decodeGltfBufferAsync:function(y,E,I,x,S){return h.length>0?_(y,E,I,f[x],u[S]):s.then(function(){var w=new Uint8Array(y*E);return c(r,r.exports[f[x]],w,y,E,I,r.exports[u[S]]),w})}}})();typeof yM=="object"&&typeof Dj=="object"?Dj.exports=iV:typeof define=="function"&&define.amd?define([],function(){return iV}):typeof yM=="object"?yM.MeshoptDecoder=iV:(typeof self<"u"?self:yM).MeshoptDecoder=iV});var zce=di((EM,vj)=>{var oV=(function(){"use strict";var e="b9H79Tebbbe:Gez9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuiXCdilvorlwiDqkxmPbssbelve9Weiiviebeoweuec:G:Pdkr;7eko9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95br8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bw8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbDQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bqX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbkQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bxX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbma9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbPl79IV9RbsDwebcekdOAq:d;OeCdbk:J1eo3ue99euE99Cue9:8Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:rjjjb8AdnabaeSmbabaeadcdtz:qjjjb8AkdnamcdGTmbalcrfci4gHcbyd1:jjjbHjjjjbbheasc:Cefasyd;8egOcdtfaeBdbasaOcefBd;8eaecbaHz:rjjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd1:jjjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:jjjbHjjjjbbhHasc:Cefasyd;8egCcdtfaHBdbasaCcefBd;8eaHcFeaOz:rjjjbhQdnadTmbaecufhLcbhKindndnaQabaXcdtfgYydbgCc:v;t;h;Ev2aLGgOcdtfgAydbgHcuSmbceheinazaHcdtfydbaCSmdaOaefhHaecefheaQaHaLGgOcdtfgAydbgHcu9hmbkkazaKcdtfaCBdbaAaKBdbaKhHaKcefhKkaYaHBdbaXcefgXad9hmbkkaQcbyd:m:jjjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:jjjbHjjjjbbhKasc:Cefasyd;8egecdtfaKBdbasaKBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:jjjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:jjjbHjjjjbbhCasc:Cefasyd;8egHcdtfaCBdbasaHcefBd;8ea3cbyd1:jjjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8eaCaYaialavazasc:Cefz:djjjbalcbyd1:jjjbHjjjjbbh5asc:Cefasyd;8egHcdtfa5BdbasaHcefBd;8ea3cbyd1:jjjbHjjjjbbhHasc:Cefasyd;8egOcdtfaHBdbasaOcefBd;8ea3cbyd1:jjjbHjjjjbbhOasc:Cefasyd;8egAcdtfaOBdbasaAcefBd;8eaHcFeaez:rjjjbh8EaOcFeaez:rjjjbh8FdnalTmbaEcwfhaindnaKa8AgOcefg8AcdtfydbgAaKaOcdtgefydbgHSmbaAaH9RhhaEaHcitfhga8Faefh8Ja8Eaefh8KcbhQindndnagaQcitfydbgLaO9hmba8KaOBdba8JaOBdbxekdnaKaLcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgAfydbaOSmeaHae9Rh8Maecu7aHfhXaaaAfhHcbheinaXaeSmeaecefheaHydbhAaHcwfhHaAaO9hmbkaea8M6meka8Fa8LfgeaOaLaeydbcuSEBdba8KaLaOa8KydbcuSEBdbkaQcefgQah9hmbkka8Aal9hmbkaChHaYhOa8FhAa8EhQcbheindndnaeaHydbgL9hmbdnaeaOydbgL9hmbaQydbhLdnaAydbgXcu9hmbaLcu9hmba5aefcb86bbxikdnaXcuSmbaLcuSmbaeaXSmbaCaXcdtfydbaCaLcdtfydb9hmba5aefcd86bbxika5aefh8KdnaeaXSmbaeaLSmba8Kce86bbxika8Kcl86bbxdkdnaeaYaLcdtgXfydb9hmbdnaAydbg8KcuSmbaea8KSmbaQydbghcuSmbaeahSmba8FaXfydbggcuSmbagaLSmba8EaXfydbgXcuSmbaXaLSmbdnaCa8KcdtfydbgLaCaXcdtfydb9hmbaLaCahcdtfydbgXSmbaXaCagcdtfydb9hmba5aefcd86bbxlka5aefcl86bbxika5aefcl86bbxdka5aefcl86bbxeka5aefa5aLfRbb86bbkaHclfhHaOclfhOaAclfhAaQclfhQalaecefge9hmbkdnamcaGTmbaEcwfh8Jcbh8Nindndna5a8NfgyRbbg8Pc9:fPibebekdndndnaCa8Ncdtfydbgea8N9hmbdnaqmbcbhgxdkdnazTmbcbhga8NheinagaqazaecdtgefydbfRbbcdGce4VhgaYaefydbgea8N9hmbxikkcbhga8NheinagaqaefRbbcdGce4VhgaYaecdtfydbgea8N9hmbxdkka5aefRbbhexeka8NheindnaKaecdtgafgeclfydbgHaeydbgeSmbaHae9Rh8AaEaecitfh8MaCaafh8Lcbh8Kina8Ma8KcitfydbgXhednindnaKaecdtgLfgeclfydbgHaeydbgeSmbdnaCaEaecitgOfydbcdtfydba8LydbgQ9hmbcehexikaHae9Rhhaecu7aHfhAa8JaOfhHcbheinaAaeSmeaecefheaHydbhOaHcwfhHaCaOcdtfydbaQ9hmbkaeah6hexdkaYaLfydbgeaX9hmbkcbhekagaece7Vhga8Kcefg8Ka8A9hmbkkaYaafydbgea8N9hmbka8PciagceGEhekayae86bbka8Ncefg8Nal9hmbkkdnaqTmbdndnazTmbazheaChHalhOindnaqaeydbfRbbceGTmba5aHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaChealhHindnaqRbbceGTmba5aeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaChealhOa5hHindna5aeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmba5healhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbhIcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbhaasc:Cefasyd;8egecdtfaaBdbasaecefBd;8easc:qefcbBdbas9cb83i1eaaaialavazasc1efz:ejjjbh8RdndnaDmbcbh8Scbh8Lxekcbh8LawhecbhHindnaeIdbJbbbb9ETmbasa8LcdtfaHBdba8Lcefh8LkaeclfheaDaHcefgH9hmbkcua8Lal2gecdtaecFFFFi0Ecbyd1:jjjbHjjjjbbh8Sasc:Cefasyd;8egecdtfa8SBdbasaecefBd;8ealTmbdna8Lmbcbh8Lxekarcd4hXdnazTmba8Lcdth8KcbhLa8ShKinaoazaLcdtfydbaX2cdtfhQasheaKhHa8LhOinaHaQaeydbcdtgAfIdbawaAfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKa8KfhKaLcefgLal9hmbxdkka8Lcdth8KcbhLa8ShKinaoaLaX2cdtfhQasheaKhHa8LhOinaHaQaeydbcdtgAfIdbawaAfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKa8KfhKaLcefgLal9hmbkkcualc8S2gHalc;D;O;f8U0EgAcbyd1:jjjbHjjjjbbheasc:Cefasyd;8egOcdtfaeBdbasaOcefBd;8eaecbaHz:rjjjbhycbhqcbh8Ndna8LTmbcbhIaAcbyd1:jjjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8ea8NcbaHz:rjjjb8Acua8Lal2gecltgHaecFFFFb0Ecbyd1:jjjbHjjjjbbhqasc:Cefasyd;8egecdtfaqBdbasaecefBd;8eaqcbaHz:rjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:jjjbHjjjjbbhIasc:Cefasyd;8egHcdtfaIBdbasaHcefBd;8eaIcbaez:rjjjb8AkdnadTmbcbhQabhHinaaaHclfydbgLcx2fgeIdbaaaHydbgKcx2fgOIdbgR:tg8UaaaHcwfydbgXcx2fgAIdlaOIdlg8V:tg8WNaAIdbaR:tg8XaeIdla8V:tg8YN:tg8Zh80aeIdwaOIdwg81:tgBa8XNaAIdwa81:tg83a8UN:tgUh8Xa8Ya83Na8WaBN:tg8Yh8Udna8Za8ZNa8Ya8YNaUaUNMM:rgBJbbbb9EgOTmba8ZaB:vh80aUaB:vh8Xa8YaB:vh8UkayaCaKcdtfydbgAc8S2fgea8UaB:rg8Wa8UNNg85aeIdbMUdbaea8Xa8Wa8XNg86Ng87aeIdlMUdlaea80a8Wa80Ng83Ng88aeIdwMUdwaea86a8UNg86aeIdxMUdxaea83a8UNg89aeIdzMUdzaea83a8XNg8:aeIdCMUdCaea8Ua8Wa80a81Na8UaRNa8Va8XNMM:mgZNg83Ng8UaeIdKMUdKaea8Xa83Ng8XaeId3MUd3aea80a83Ng80aeIdaMUdaaea83aZNg83aeId8KMUd8Kaea8WaeIdyMUdyayaCaLcdtfydbgLc8S2fgea85aeIdbMUdbaea87aeIdlMUdlaea88aeIdwMUdwaea86aeIdxMUdxaea89aeIdzMUdzaea8:aeIdCMUdCaea8UaeIdKMUdKaea8XaeId3MUd3aea80aeIdaMUdaaea83aeId8KMUd8Kaea8WaeIdyMUdyayaCaXcdtfydbgKc8S2fgea85aeIdbMUdbaea87aeIdlMUdlaea88aeIdwMUdwaea86aeIdxMUdxaea89aeIdzMUdzaea8:aeIdCMUdCaea8UaeIdKMUdKaea8XaeId3MUd3aea80aeIdaMUdaaea83aeId8KMUd8Kaea8WaeIdyMUdydnaITmbdnaOTmba8ZaB:vh8ZaUaB:vhUa8YaB:vh8YkaIaAcltfgeaBJbbbZNg8UaUNg8WaeIdlMUdlaea8Ua8ZNg8XaeIdwMUdwaea8Ua8YNg80aeIdbMUdbaea8UaR:ma8YNaUa8VN:ta81a8ZN:tNg8UaeIdxMUdxaIaLcltfgea8WaeIdlMUdlaea8XaeIdwMUdwaea80aeIdbMUdbaea8UaeIdxMUdxaIaKcltfgea8WaeIdlMUdlaea8XaeIdwMUdwaea80aeIdbMUdbaea8UaeIdxMUdxkaHcxfhHaQcifgQad6mbkkdnalTmbJ;n;m;m89J:v:;;w8ZamczGEh8YcbhOaChAaahHayheindnaOaAydb9hmbaecxfgQaQIdbJbbbbMUdbaeczfgQaQIdbJbbbbMUdbaecCfgQaQIdbJbbbbMUdbaea8YaecyfgQIdbg8ZNg8UaeIdbMUdbaeclfgLa8UaLIdbMUdbaecwfgLa8UaLIdbMUdbaecKfgLaLIdbaHIdbg8Xa8UN:tUdbaHcwfIdbh8Waec3fgLaLIdba8UaHclfIdbg80N:tUdbaecafgLaLIdba8Ua8WN:tUdbaec8KfgLIdbhUaQa8Za8UMUdbaLaUa8Ua8Wa8WNa8Xa8XNa80a80NMMNMUdbkaAclfhAaHcxfhHaec8SfhealaOcefgO9hmbkkdnadTmbcbhXabhKinabaXcdtfhLcbhHina5aLaHc:G1jjbfydbcdtfydbgOfRbbhedndna5aKaHfydbgAfRbbgQc99fcFeGcpe0mbaec99fcFeGc;:e6mekdnaQcufcFeGce0mba8EaAcdtfydbaO9hmekdnaecufcFeGce0mba8FaOcdtfydbaA9hmekJbbacJbbacJbbbZaecFeGceSEaQcFeGceSEh88aaaOcx2fgeIdwaaaAcx2fgQIdwgB:tg80:mh86aeIdlaQIdlg83:tg8Z:mh89aeIdbaQIdbgR:tgU:mh8:dnaaaLaHc:K1jjbfydbcdtfydbcx2fgeIdwaB:tg8Va80a80NaUaUNa8Za8ZNMMg8YNa8Va80NaeIdbaR:tg81aUNa8ZaeIdla83:tg85NMMg8Wa80N:tg8Xa8XNa81a8YNa8WaUN:tg8Ua8UNa85a8YNa8Wa8ZN:tg8Wa8WNMM:rg87Jbbbb9ETmba8Xa87:vh8Xa8Wa87:vh8Wa8Ua87:vh8Uka88a8Y:rNg8Ya8XaBNa8UaRNa83a8WNMM:mgZNg87aZNhZa8Xa87Nhna8Wa87Nhca8Ua87Nh9ca8Ya8XNg87a8WNhJa87a8UNh9ea8Ya8WNgTa8UNhSa8Xa87Nh87a8WaTNhTa8Ua8Ya8UNNh9hdnaUa85Na81a89NMg8Xa8XNa8Za8VNa85a86NMg8Ua8UNa80a81Na8Va8:NMg8Wa8WNMM:rg80Jbbbb9ETmba8Xa80:vh8Xa8Wa80:vh8Wa8Ua80:vh8UkayaCaAcdtfydbc8S2fgeaeIdba9ha8Ua88a80:rNg80a8UNNMgUMUdbaeaTa8Wa80a8WNg8VNMg81aeIdlMUdlaea87a8Xa80a8XNg8ZNMg85aeIdwMUdwaeaSa8Va8UNMg8VaeIdxMUdxaea9ea8Za8UNMg87aeIdzMUdzaeaJa8Za8WNMg8ZaeIdCMUdCaea9ca8Ua80a8XaBNa8UaRNa83a8WNMMgB:mNg80NMg8UaeIdKMUdKaeaca8Wa80NMg8WaeId3MUd3aeana8Xa80NMg8XaeIdaMUdaaeaZaBa80N:tg80aeId8KMUd8Kaea8YJbbbbMg8YaeIdyMUdyayaCaOcdtfydbc8S2fgeaUaeIdbMUdbaea81aeIdlMUdlaea85aeIdwMUdwaea8VaeIdxMUdxaea87aeIdzMUdzaea8ZaeIdCMUdCaea8UaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea80aeId8KMUd8Kaea8YaeIdyMUdykaHclfgHcx9hmbkaKcxfhKaXcifgXad6mbka8LTmbcbhKinJbbbbh8YaaabaKcdtfgeclfydbgXcx2fgHIdwaaaeydbg8Kcx2fgOIdwg81:tg8Wa8WNaHIdbaOIdbg85:tg8Xa8XNaHIdlaOIdlg87:tg80a80NMMgRaaaecwfydbghcx2fgeIdwa81:tg8ZNa8Wa8Wa8ZNa8XaeIdba85:tgUNa80aeIdla87:tgBNMMg8UN:tJbbbbJbbjZaRa8Za8ZNaUaUNaBaBNMMg8VNa8Ua8UN:tg83:va83Jbbbb9BEg83Nh89a8Va8WNa8Za8UN:ta83Nh8:aRaBNa80a8UN:ta83NhZa8Va80NaBa8UN:ta83NhnaRaUNa8Xa8UN:ta83Nhca8Va8XNaUa8UN:ta83Nh9ca8XaBNaUa80N:tg8Ua8UNa80a8ZNaBa8WN:tg8Ua8UNa8WaUNa8Za8XN:tg8Ua8UNMM:rJbbbZNh8Ua8Sa8Ka8L2ggcdtfhHa8Saha8L2gEcdtfhOa8SaXa8L2g8JcdtfhAa81:mhJa87:mh9ea85:mhTcbhQa8LhLJbbbbhBJbbbbh83JbbbbhRJbbbbh8VJbbbbh81Jbbbbh85Jbbbbh87Jbbbbh88Jbbbbh86inascjdfaQfgecwfa8Ua8:aAIdbaHIdbg8Z:tg80Na89aOIdba8Z:tgUNMg8WNUdbaeclfa8Uana80NaZaUNMg8XNUdbaea8Ua9ca80NacaUNMg80NUdbaecxfa8UaJa8WNa9ea8XNa8ZaTa80NMMMg8ZNUdba8Ua8Wa8XNNa8VMh8Va8Ua8Wa80NNa81Mh81a8Ua8Xa80NNa85Mh85a8Ua8Za8ZNNa8YMh8Ya8Ua8Wa8ZNNaBMhBa8Ua8Xa8ZNNa83Mh83a8Ua80a8ZNNaRMhRa8Ua8Wa8WNNa87Mh87a8Ua8Xa8XNNa88Mh88a8Ua80a80NNa86Mh86aHclfhHaAclfhAaOclfhOaQczfhQaLcufgLmbka8Na8Kc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdya8NaXc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdya8Nahc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdyaqagcltfhLcbhHa8LhAinaLaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkaqa8JcltfhLcbhHa8LhAinaLaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkaqaEcltfhLcbhHa8LhAinaLaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkaKcifgKad6mbkkcbhOdndnamcwGg9imbJbbbbh85cbh6cbh9kcbh0xekcbh6a3cbyd1:jjjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ecua0alabadaCz:fjjjbgAcltaAcjjjjiGEcbyd1:jjjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ea9kaAa0aaalz:gjjjbJFFuuh85aATmba9kheaAhHinaeIdbg8Ua85a85a8U9EEh85aeclfheaHcufgHmbkaAh6kasydNeh9mdnalTmba9mclfhea9mydbhAa5hHalhQcbhOincbaeydbgLaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaLhAaQcufgQmbkaOce4hOkcuadaO9Rcifg9ncx2a9nc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ecua9ncdta9ncFFFFi0Ecbyd1:jjjbHjjjjbbh9oasc:Cefasyd;8egecdtfa9oBdbasaecefBd;8ea3cbyd1:jjjbHjjjjbbhDasc:Cefasyd;8egecdtfaDBdbasaecefBd;8ealcbyd1:jjjbHjjjjbbh9pasc:Cefasyd;8egecdtfa9pBdbasaecefBd;8eaxaxNa8RJbbjZamclGEgnanN:vh88Jbbbbh86dnadak9nmbdna9nci6mbasyd:yeh9qa8Lclth9ra8Pcwfh9sJbbbbh87Jbbbbh86inascNefabadalaCz:cjjjbabh8Kcbh8Mcbh3inaba3cdtfhgcbheindnaCa8KaefydbgOcdtgXfydbgAaCagaec:W1jjbfydbcdtfydbgHcdtghfydbgQSmba5aHfRbbgKcv2a5aOfRbbgLfc;a1jjbfRbbg8JaLcv2aKfgEc;a1jjbfRbbg8AVcFeGTmbdnaQaA9nmbaEc;G1jjbfRbbcFeGmekdnaLcufcFeGce0mbaKTmba8EaXfydbaH9hmekdnaLTmbaKcufcFeGce0mba8FahfydbaO9hmeka8Pa8Mcx2fgAaHaOa8AcFeGgQEBdlaAaOaHaQEBdbaAaQa8JGcb9hBdwa8Mcefh8Mkaeclfgecx9hmbkdna3cifg3ad9pmba8Kcxfh8Ka8Mcifa9n9nmekka8MTmdcbhhinayaCa8Pahcx2fgKydbgQcdtgAfydbc8S2fgeIdwaaaKydlgLcx2fgHIdwg8XNaeIdzaHIdbg80NaeIdaMg8Ua8UMMa8XNaeIdlaHIdlg8ZNaeIdCa8XNaeId3Mg8Ua8UMMa8ZNaeIdba80NaeIdxa8ZNaeIdKMg8Ua8UMMa80NaeId8KMMM:lh8UJbbbbJbbjZaeIdyg8W:va8WJbbbb9BEh8WdndnaKydwg8KmbJFFuuh81xekJbbbbJbbjZayaCaLcdtfydbc8S2fgeIdygU:vaUJbbbb9BEaeIdwaaaQcx2fgHIdwgUNaeIdzaHIdbg8YNaeIdaMgBaBMMaUNaeIdlaHIdlgBNaeIdCaUNaeId3MgUaUMMaBNaeIdba8YNaeIdxaBNaeIdKMgUaUMMa8YNaeId8KMMM:lNh81ka8Wa8UNh8Vdna8LTmba8NaQc8S2fgHIdwa8XNaHIdza80NaHIdaMg8Ua8UMMa8XNaHIdla8ZNaHIdCa8XNaHId3Mg8Ua8UMMa8ZNaHIdba80NaHIdxa8ZNaHIdKMg8Ua8UMMa80NaHId8KMMMh8UaqaQa8L2ggcltfheaHIdyhUa8SaLa8L2gEcdtfgXhHa8LhOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbkdndna8KmbJbbbbh8Wxeka8NaLc8S2fgOIdwaaaQcx2fgeIdwg8YNaOIdzaeIdbgBNaOIdaMg8Wa8WMMa8YNaOIdlaeIdlg83NaOIdCa8YNaOId3Mg8Wa8WMMa83NaOIdbaBNaOIdxa83NaOIdKMg8Wa8WMMaBNaOId8KMMMh8Wa8SagcdtfhHaqaEcltfheaOIdyhRa8LhOinaHIdbgUaUaRNaecxfIdba8YaecwfIdbNaBaeIdbNa83aeclfIdbNMMMgUaUM:tNa8WMh8WaHclfhHaeczfheaOcufgOmbka8W:lh8Wka8Va8U:lMh8Va81a8WMh81dndndna5aQfRbbc9:fPdbedkdna8Fa8Ea8EaAfydbaLSEaYaAfydbgXcdtfydbgAcu9hmbaYaLcdtfydbhAka8NaXc8S2fgOIdwaaaAcx2fgeIdwg8XNaOIdzaeIdbg80NaOIdaMg8Ua8UMMa8XNaOIdlaeIdlg8ZNaOIdCa8XNaOId3Mg8Ua8UMMa8ZNaOIdba80NaOIdxa8ZNaOIdKMg8Ua8UMMa80NaOId8KMMMh8Ua8SaAa8L2ggcdtfhHaqaXa8L2gEcltfheaOIdyhUa8LhOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbkdndna8KmbJbbbbh8Wxeka8NaAc8S2fgOIdwaaaXcx2fgeIdwg80NaOIdzaeIdbg8ZNaOIdaMg8Wa8WMMa80NaOIdlaeIdlgUNaOIdCa80NaOId3Mg8Wa8WMMaUNaOIdba8ZNaOIdxaUNaOIdKMg8Wa8WMMa8ZNaOId8KMMMh8Wa8SaEcdtfhHaqagcltfheaOIdyh8Ya8LhOinaHIdbg8Xa8Xa8YNaecxfIdba80aecwfIdbNa8ZaeIdbNaUaeclfIdbNMMMg8Xa8XM:tNa8WMh8WaHclfhHaeczfheaOcufgOmbka8W:lh8Wka8Va8U:lMh8Va81a8WMh81xdkaYaAfydbgAaQSmbina8NaAc8S2fgHIdwa8XNaHIdza80NaHIdaMg8Ua8UMMa8XNaHIdla8ZNaHIdCa8XNaHId3Mg8Ua8UMMa8ZNaHIdba80NaHIdxa8ZNaHIdKMg8Ua8UMMa80NaHId8KMMMh8UaqaAa8L2cltfheaHIdyhUaXhHa8LhOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbka8Va8U:lMh8VaYaAcdtfydbgAaQ9hmbkka5aLfRbbci9hmba8KTmbaYaLcdtfydbgAaLSmba8SagcdtfhXaaaQcx2fgeIdbh8XaeIdwh80aeIdlh8Zina8NaAc8S2fgHIdwa80NaHIdza8XNaHIdaMg8Ua8UMMa80NaHIdla8ZNaHIdCa80NaHId3Mg8Ua8UMMa8ZNaHIdba8XNaHIdxa8ZNaHIdKMg8Ua8UMMa8XNaHId8KMMMh8UaqaAa8L2cltfheaHIdyhUaXhHa8LhOinaHIdbg8Wa8WaUNaecxfIdba80aecwfIdbNa8XaeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbka81a8U:lMh81aYaAcdtfydbgAaL9hmbkkaKa81a8Va81a8V9DgeEUdwaKaQaLaea8Kcb9hGgeEBdlaKaLaQaeEBdbahcefgha8M9hmbkascjdfcbcj;qbz:rjjjb8Aa9shea8MhHinascjdfaeydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgOydbhAaOaHBdbaAaHfhHaeclfgecj;qb9hmbkcbhea9shHinascjdfaHydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbgOcefBdba9oaOcdtfaeBdbaHcxfhHa8Maecefge9hmbkadak9RgOci9Uh9tdnalTmbcbheaDhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ua9pcbalz:rjjjbh3aOcO9Uh9va9tce4h9wcbh8Acbh8Jdnina8Pa9oa8Jcdtfydbcx2fgEIdwg8Ua889Emea8Aa9t9pmeJFFuuh8Wdna9wa8M9pmba8Pa9oa9wcdtfydbcx2fIdwJbb;aZNh8Wkdna8Ua8W9ETmba8Ua869ETmba8Aa9v0mdkdna3aCaEydlghcdtg9xfydbgAfg9yRbba3aCaEydbg8Kcdtg9zfydbgefg9ARbbVmba5a8KfRbbh9Bdna9maecdtfgHclfydbgOaHydbgHSmbaOaH9RhQaaaAcx2fhKaaaecx2fhXa9qaHcitfhecbhHcehgdnindnaDaeydbcdtfydbgOaASmbaDaeclfydbcdtfydbgLaASmbaOaLSmbaaaLcx2fgLIdbaaaOcx2fgOIdbg8X:tg8UaXIdlaOIdlg80:tg8YNaXIdba8X:tgBaLIdla80:tg8WN:tg8Za8UaKIdla80:tg83NaKIdba8X:tgRa8WN:tg80Na8WaXIdwaOIdwgU:tg8VNa8YaLIdwaU:tg8XN:tg8Ya8WaKIdwaU:tg81Na83a8XN:tg8WNa8XaBNa8Va8UN:tgUa8XaRNa81a8UN:tg8UNMMa8Za8ZNa8Ya8YNaUaUNMMa80a80Na8Wa8WNa8Ua8UNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaQ6hgaQaH9hmbkkagceGTmba9wcefh9wxekdndndndna9Bc9:fPdebdka8KheinaDaecdtgefahBdbaYaefydbgea8K9hmbxikkdna8Fa8Ea8Ea9zfydbahSEaYa9zfydbg8Kcdtfydbgecu9hmbaYa9xfydbhekaDa9zfahBdbaehhkaDa8KcdtfahBdbka9Ace86bba9yce86bbaEIdwg8Ua86a86a8U9DEh86a9ucefh9ucecda9BceSEa8Afh8Aka8Jcefg8Ja8M9hmbkka9uTmddnalTmbcbhLcbhXindnaDaXcdtgefydbgOaXSmbaCaOcdtfydbh8KdnaXaCaefydb9hghmbaya8Kc8S2fgeayaXc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdyaITmbaIa8KcltfgeaIaXcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxka8LTmba8NaOc8S2fgea8NaXc8S2ggfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9raO2hKaqhHa8LhAinaHaKfgeaHaLfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkahmbJbbbbJbbjZayagfgeIdyg8U:va8UJbbbb9BEaeIdwaaa8Kcx2fgHIdwg8UNaeIdzaHIdbg8WNaeIdaMg8Xa8XMMa8UNaeIdlaHIdlg8XNaeIdCa8UNaeId3Mg8Ua8UMMa8XNaeIdba8WNaeIdxa8XNaeIdKMg8Ua8UMMa8WNaeId8KMMM:lNg8Ua87a87a8U9DEh87kaLa9rfhLaXcefgXal9hmbkcbhHa8EheindnaeydbgOcuSmbdnaHaDaOcdtgAfydbgO9hmbcuhOa8EaAfydbgAcuSmbaDaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHa8FheindnaeydbgOcuSmbdnaHaDaOcdtgAfydbgO9hmbcuhOa8FaAfydbgAcuSmbaDaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkka87a86a8LEh87cbhHabhecbhOindnaCaDaeydbcdtfydbgLcdtfydbgAaCaDaeclfydbcdtfydbgKcdtfydbgQSmbaAaCaDaecwfydbcdtfydbg8KcdtfydbgXSmbaQaXSmbabaHcdtfgAaLBdbaAcwfa8KBdbaAclfaKBdbaHcifhHkaecxfheaOcifgOad6mbkdndna9imbaHhdxekdnaHak0mbaHhdxekdna85a879FmbaHhdxekJFFuuh85cbhdabhecbhOindna9ka0aeydbgAcdtfydbcdtfIdbg8Ua879ETmbaeclf8Pdbh9CabadcdtfgQaABdbaQclfa9C83dba8Ua85a85a8U9EEh85adcifhdkaecxfheaOcifgOaH6mbkkadak0mbxdkkascNefabadalaCz:cjjjbkdndnadak0mbadhOxekdna9imbadhOxekdna85a889FmbadhOxekcehLina85Jbb;aZNg8Ua88a8Ua889DEh8XJbbbbh8Udna6Tmba9khea6hHinaeIdbg8Wa8Ua8Wa8X9FEa8Ua8Wa8U9EEh8UaeclfheaHcufgHmbkkJFFuuh85cbhOabhecbhHindna9ka0aeydbgAcdtfydbcdtfIdbg8Wa8X9ETmbaeclf8Pdbh9CabaOcdtfgQaABdbaQclfa9C83dba8Wa85a85a8W9EEh85aOcifhOkaecxfheaHcifgHad6mbkdnaLaOad9hVceGmbadhOxdka8Ua86a86a8U9DEh86aOak9nmecbhLaOhda85a889FmbkkdnamcjjjjdGTmba9pcbalz:rjjjbhLdnaOTmbabheaOhHinaLaeydbgAfa5aAfRbbcl9h86bbaeclfheaHcufgHmbkkascNefabaOalaCz:cjjjbalTmbcbhQasyd:yehgindnaLaQfRbbTmbdna5aQfRbbgecl0mbceaetcQGmekdnaCaQcdtgKfydbgeaQSmbaaaQcx2fgHaaaecx2fge8Pdb83dbaHcwfaecwfydbBdbxekayaQc8S2fgeIdyg8Ua8UJL:3;rUNg8UMh88aeIdwa8UMhRaeIdla8UMh8VaeIdba8UMhUaeIdaa8UaaaQcx2fg8KIdwg89N:th81aeId3a8Ua8KIdlg8:N:th85aeIdKa8KIdbgZa8UN:th8YJbbbbhcaeIdCJbbbbMh87aeIdzJbbbbMhBaeIdxJbbbbMh83dndna8LTmbaQhAinJbbbba88a8NaAc8S2fgHIdyg8U:va8UJbbbb9BEh8UaqaAa8L2cltfheaHIdaa88Na81Mh81aHId3a88Na85Mh85aHIdKa88Na8YMh8YaHIdCa88Na87Mh87aHIdza88NaBMhBaHIdxa88Na83Mh83aHIdwa88NaRMhRaHIdla88Na8VMh8VaHIdba88NaUMhUa8LhHina81aecxfIdbg8ZaecwfIdbg8WNa8UN:th81a85a8ZaeclfIdbg8XNa8UN:th85a87a8Wa8XNa8UN:th87aUaeIdbg80a80Na8UN:thUa8Ya8Za80Na8UN:th8YaBa8Wa80Na8UN:thBa83a8Xa80Na8UN:th83aRa8Wa8WNa8UN:thRa8Va8Xa8XNa8UN:th8VaeczfheaHcufgHmbkaYaAcdtfydbgAaQ9hmbkaITmbaIaQcltfgeIdxhTaeIdwh9caeIdlhJaeIdbh8UxekJbbbbhTJbbbbh9cJbbbbhJJbbbbh8UkaBaU:vg8Xa8YNa81:ta87aBa83aU:vg8WN:tg81a8Va83a8WN:tg8Z:vg80a8Wa8YNa85:tg8VN:th85a9ca8Ua8XN:taJa8Ua8WN:tg83a80N:tg87aRaBa8XN:ta81a80N:tgB:vgR:mh81a83a8Z:vg9c:mhJdnJbbbba8Ua8UaU:vg9eN:ta83a9cN:ta87aRN:tg83:la88J:983:g81Ng8U9ETmba81a85NaJa8VNa9ea8YNaT:tMMa83:vhckaU:la8U9ETmba8Z:la8U9ETmbaB:la8U9ETmba9e:macNa8X:ma81acNa85aB:vMg85Na8W:maJacNa80:ma85Na8Va8Z:vMMg87Na8Y:maU:vMMMh88a9maKfgeclfydbgHaeydbge9RhXagaecitfhKJbbbbh8UdnaHaeSghmbJbbbbh8UaKheaXhAinaaaeclfydbcx2fgHIdwa89:tg8Wa8WNaHIdbaZ:tg8Wa8WNaHIdla8::tg8Wa8WNMMg8Waaaeydbcx2fgHIdwa89:tg8Xa8XNaHIdbaZ:tg8Xa8XNaHIdla8::tg8Xa8XNMMg8Xa8Ua8Ua8X9DEg8Ua8Ua8W9DEh8UaecwfheaAcufgAmbkka85a89:tg8Wa8WNa88aZ:tg8Wa8WNa87a8::tg8Wa8WNMMa8U:rg8Ua8UN9EmbdnahmbcbhAcehhdninaaaKclfydbcx2fgeIdbaaaKydbcx2fgHIdbg8X:tg8Ua8:aHIdlg80:tg8YNaZa8X:tgBaeIdla80:tg8WN:tg8Za8Ua87a80:tg83Na88a8X:tgRa8WN:tg80Na8Wa89aHIdwgU:tg8VNa8YaeIdwaU:tg8XN:tg8Ya8Wa85aU:tg81Na83a8XN:tg8WNa8XaBNa8Va8UN:tgUa8XaRNa81a8UN:tg8UNMMa8Za8ZNa8Ya8YNaUaUNMMa80a80Na8Wa8WNa8Ua8UNMMN:rJbbj8:N9FmeaKcwfhKaAcefgAaX6hhaXaA9hmbkkahceGmeka8Ka85Udwa8Ka87Udla8Ka88UdbkaQcefgQal9hmbkdndna8LTmba8LclthYa8Lcdth8KcbhKa8ShXindnaLaKfRbbTmba5aKfRbbclSmbJbbbbJbbjZa8NaKc8S2fIdyg8U:va8UJbbbb9BEh8UaaaCaKcdtfydbcx2fhHaqheaXhAa8LhQinaAa8UaecwfIdbaHIdwNaeIdbaHIdbNaeclfIdbaHIdlNMMaecxfIdbMNUdbaeczfheaAclfhAaQcufgQmbkkaqaYfhqaXa8KfhXaKcefgKal9hmbkarcd4hXavcd4hYasId:qeh8UasId:meh8WasId1eh8XazTmea8Lcdth8KcbhKindnaLaKfRbbTmbaiazaKcdtfydbgCaY2cdtfgeaaaKcx2fgHIdba8RNa8XMUdbaeaHIdla8RNa8WMUdlaeaHIdwa8RNa8UMUdwaoaCaX2cdtfhQashea8ShHa8LhCinaQaeydbcdtgAfaHIdbawaAfIdb:vUdbaeclfheaHclfhHaCcufgCmbkka8Sa8Kfh8SaKcefgKal9hmbxikkavcd4hCasId:qeh8UasId:meh8WasId1eh8XdnazTmbazheindna9pRbbTmbaiaeydbaC2cdtfgHaaIdba8RNa8XMUdbaHaaclfIdba8RNa8WMUdlaHaacwfIdba8RNa8UMUdwka9pcefh9paeclfheaacxfhaalcufglmbxikkaCcdtheindna9pRbbTmbaiaaIdba8RNa8XMUdbaiclfaaclfIdba8RNa8WMUdbaicwfaacwfIdba8RNa8UMUdbka9pcefh9paacxfhaaiaefhialcufglmbxdkka8Lcdth8KcbhKindnaLaKfRbbTmbaiaKaY2cdtfgeaaaKcx2fgHIdba8RNa8XMUdbaeaHIdla8RNa8WMUdlaeaHIdwa8RNa8UMUdwaoaKaX2cdtfhQashea8ShHa8LhCinaQaeydbcdtgAfaHIdbawaAfIdb:vUdbaeclfheaHclfhHaCcufgCmbkka8Sa8Kfh8SaKcefgKal9hmbkkdnamcjjjjlGTmbazmbaOTmbcbhLabheina5aeydbgAfRbbc3thKaecwfgXydbhHdndna8EaAcdtg8KfydbaeclfgYydbgCSmbcbhQa8FaCcdtfydbaA9hmekcjjjj94hQkaeaKaQVaAVBdba5aCfRbbc3thKdndna8EaCcdtfydbaHSmbcbhQa8FaHcdtfydbaC9hmekcjjjj94hQkaYaKaQVaCVBdba5aHfRbbc3thQdndna8EaHcdtfydbaASmbcbhCa8Fa8KfydbaH9hmekcjjjj94hCkaXaQaCVaHVBdbaecxfheaLcifgLaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPana86:rNUdbkasyd;8egecdtasc:Ceffc98fhHdninaeTmeaHydbcbyd:m:jjjbH:bjjjbbaHc98fhHaecufhexbkkascj;sbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:rjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:jjjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:rjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:jjjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkawclfhwabclfhbaiaDcefgD9hmbkkk:hrdvuv998Jjjjjbca9Rgoczfcwfcbyd11jjbBdbaocb8Pdj1jjb83izaocwfcbydN1jjbBdbaocb8Pd:m1jjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:ZlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvc:G1jjbfydbcdtfydbcdtfydbhodnabalawavfydbcdtfydbgqcdtfgkydbgvaqSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnabaocdtfgkydbgvaoSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnabavfgDydbgvaxSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhvabhocbhkindndnavalydbgq9hmbdnavaoydbgq9hmbaoakBdbakcefhkxdkaoabaqcdtfydbBdbxekaoabaqcdtfydbBdbkaoclfhoalclfhlaeavcefgv9hmbkakk;Jiilud99duabcbaecltz:rjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakclfgxaqaxIdbMUdbakcwfgxaDaxIdbMUdbakcxfgkakIdbJbbjZMUdbaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhraehkinarcxfgoIdbhDaocbBdbararIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbarclfgoaDaoIdbNUdbarcwfgoaDaoIdbNUdbarczfhrakcufgkmbkkdnalTmbinavadydbcltfgrcxfgkaicwfIdbarcwfIdb:tgDaDNaiIdbarIdb:tgDaDNaiclfIdbarclfIdb:tgDaDNMMgDakIdbgqaqaD9DEUdbadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhrinabarIdbUdbarczfhrabclfhbaecufgembkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:p8Koque99due99iuq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:rjjjb8Aaqcualcx2alc;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:bwhHdndninashYaHhXaPhrakg8AaQ9pmeaXar9Rcd9imeavaXcufavaX9iEarcefavar9kEhzdnalTmbazcuf:YhwdnaoTmbcbhOaihPaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhHxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhHxekcjjjj94hHkaHcqthHdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskaHasVhHdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskaHascCtVhHkaPaHBdbaPclfhPavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhPindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhHxekcjjjj94hHkaHcCthHdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskascqtaHVhHdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskaOaHasVBdbavcxfhvaOclfhOaPcufgPmbkkcbhOdnadTmbaehvcbhPinaOaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgs9haiavydbcdtfydbgAaH9haAas9hGGfhOavcxfhvaPcifgPad6mbkkaYhsaOhkaXhHazhPdnaOaQ9nmbaOhsa8AhkazhHarhPkdndnaKcl0mbdnaY:Zgwa8A:ZgC:taz:YgEar:Y:tg3aEaX:Y:tg5aO:Zg8EaL:tNNNawaL:ta5NaCa8E:tNaCaL:ta3Na8Eaw:tNM:vaEMJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPaHfcd9ThvkaKcefgKcs9hmbxdkka8AhkarhPkdndndnakmbJbbjZhwcbhicdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgravcFFFFi0Ecbyd1:jjjbHjjjjbbgzBdCaqciBd2aqamcbyd1:jjjbHjjjjbbgXBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihHaxhPindndnaoaOfRbbceGTmbaOcjjjjlVhsxekdndnaPclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskascqthsdndnaPcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkasaAVhsdndnaPIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkasaAcCtVhskaHasBdbaHclfhHaPcxfhPalaOcefgO9hmbxikkazcFearz:rjjjb8AcbhrcbhvxdkaxhOaihPalhHindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskascCthsdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqtasVhsdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaPasaAVBdbaOcxfhOaPclfhPaHcufgHmbkkazcFearz:rjjjbhAavcufhocbhrcbhzindndndnaAaiazcdtgKfydbgHcm4aH7c:v;t;h;Ev2gvcs4av7aoGgPcdtfgsydbgOcuSmbcehvinaiaOcdtgOfydbaHSmdaPavfhOavcefhvaAaOaoGgPcdtfgsydbgOcu9hmbkkasazBdbarhvarcefhrxekaXaOfydbhvkaXaKfavBdbazcefgzal9hmbkcuarc8S2gOarc;D;O;f8U0EhvkcbhAaqavcbyd1:jjjbHjjjjbbgvBd3aqcvBd2avcbaOz:rjjjbhOdnadTmbaehiinJbbnnJbbjZaXaiydbgHcdtfydbgvaXaiclfydbgPcdtfydbgzSavaXaicwfydbgscdtfydbgKSGgoEh8FdnaxaPcx2fgPIdbaxaHcx2fgHIdbg8E:tgCaxascx2fgsIdlaHIdlg3:tgwNasIdba8E:tgEaPIdla3:tgaN:tgLaLNaaasIdwaHIdwg5:tghNawaPIdwa5:tgaN:tgwawNaaaENahaCN:tgCaCNMM:rgEJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNgaMUdbavaCaEaCNghNggavIdlMUdlavaLaEaLNg8FNg8JavIdwMUdwavahawNghavIdxMUdxava8FawNg8KavIdzMUdzava8FaCNg8FavIdCMUdCavawaEaLa5Nawa8ENa3aCNMM:mg3Ng8ENgwavIdKMUdKavaCa8ENgCavId3MUd3avaLa8ENgLavIdaMUdaava8Ea3Ng8EavId8KMUd8KavaEavIdyMUdydnaombaOazc8S2fgvaaavIdbMUdbavagavIdlMUdlava8JavIdwMUdwavahavIdxMUdxava8KavIdzMUdzava8FavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava8EavId8KMUd8KavaEavIdyMUdyaOaKc8S2fgvaaavIdbMUdbavagavIdlMUdlava8JavIdwMUdwavahavIdxMUdxava8KavIdzMUdzava8FavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava8EavId8KMUd8KavaEavIdyMUdykaicxfhiaAcifgAad6mbkkcbhHaqcuarcdtgvarcFFFFi0Egicbyd1:jjjbHjjjjbbgPBdaaqcoBd2aqaicbyd1:jjjbHjjjjbbgiBd8KaqcrBd2aPcFeavz:rjjjbhzdnalTmbaXhPinJbbbbJbbjZaOaPydbgsc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnazascdtgvfgsydbcuSmbaiavfIdbaw9ETmekasaHBdbaiavfawUdbkaPclfhPaxcxfhxalaHcefgH9hmbkkJbbbbhwdnarTmbinaiIdbgCawawaC9DEhwaiclfhiarcufgrmbkkakcd4akfhOcehiinaigvcethiavaO6mbkcbhiaqcuavcdtgOavcFFFFi0Ecbyd1:jjjbHjjjjbbgPBdyaPcFeaOz:rjjjbhsdnadTmbavcufhAcbhrcbhxindnaXaeaxcdtfgvydbcdtfydbgiaXavclfydbcdtfydbgOSmbaiaXavcwfydbcdtfydbgvSmbaOavSmbazavcdtfydbhHdndnazaOcdtfydbgvazaicdtfydbgi9pmbavaH9pmbaHhlaihoavhHxekdnaHai9pmbaHav9pmbaihlavhoxekavhlaHhoaihHkabarcx2fgvaHBdbavcwfaoBdbavclfalBdbdnasaoc:3F;N8N2alc:F:b:DD27aHc;D;O:B8J27aAGgOcdtfgvydbgicuSmbcehPinaPhvdnabaicx2fgiydbaH9hmbaiydlal9hmbaiydwaoSmikavcefhPasaOavfaAGgOcdtfgvydbgicu9hmbkkavarBdbarcefhrkaxcifgxad6mbkarci2hikdnaDmbcwhvxdkaw:rhwcwhvkaDawUdbkavcdthvdninavTmeavc98fgvaqcxffydbcbyd:m:jjjbH:bjjjbbxbkkaqc;Wbf8Kjjjjbaik:2ldwue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:rjjjb8AdnabaeSmbabaeadcdtz:qjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:jjjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbhkarcxfaryd2gxcdtgmfakBdbaraxcefgPBd2akaialavcbcbz:ejjjb8AarcxfaPcdtfaDcbyd1:jjjbHjjjjbbgvBdbaraxcdfgiBd2arcxfaicdtfcuavalaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:jjjbHjjjjbbgiBdbaiaeavakalz:gjjjbdnadTmbaoaoNhocbhwabhlcbhkindnaiavalydbgecdtfydbcdtfIdbao9ETmbalclf8PdbhsabawcdtfgqaeBdbaqclfas83dbawcifhwkalcxfhlakcifgkad6mbkkaxcifhlamarcxffcwfhkdninalTmeakydbcbyd:m:jjjbH:bjjjbbakc98fhkalcufhlxbkkarc;Wbf8Kjjjjbawk:FCoDud99rue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:rjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:jjjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:jjjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:rjjjbh3cbh5cbhPindna3axaPcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5aPcefgPad9hmbxdkkazcFeasz:rjjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8EaD:Y:tg8Fa8EaK:Y:tgaa5:ZghaH:tNNNaOaH:taaNa8Aah:tNa8AaH:ta8FNahaO:tNM:va8EMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd1:jjjbHjjjjbbg5BdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:rjjjbh3cbhDcbhYindndndna3axaYcdtgKfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbcehiinaxaecdtgefydbaCSmdamaifheaicefhia3aeaAGgmcdtfgEydbgecu9hmbkkaEaYBdbaDhiaDcefhDxeka5aefydbhika5aKfaiBdbaYcefgYad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:rjjjb8AcbhDcbhekawaecbyd1:jjjbHjjjjbbgeBd3awcvBd2aecbaiz:rjjjbhEavcd4hKdnadTmbdnalTmbaKcdth3a5hCaqhealhmadhAinaEaCydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaecxfheama3fhmaAcufgAmbxdkka5hmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd1:jjjbHjjjjbbgeBdaawcoBd2awaicbyd1:jjjbHjjjjbbg3Bd8KaecFeaYz:rjjjbhxdnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8AaKcdthPalheina8Aaec;81jjbalEgmIdwaEa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndnaxaAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka5clfh5aqcxfhqaeaPfheadaCcefgC9hmbkkabaxaYz:qjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd:m:jjjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Ydidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:rjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcifc98GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcrfc94GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:jjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:jjjbfgdBd:q:jjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk: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(y){n=y.instance,n.exports.__wasm_call_ctors()});function o(y){for(var E=new Uint8Array(y.length),I=0;I<y.length;++I){var x=y.charCodeAt(I);E[I]=x>96?x-97:x>64?x-39:x+4}for(var S=0,I=0;I<y.length;++I)E[S++]=E[I]<60?t[E[I]]:(E[I]-60)*64+E[++I];return E.buffer.slice(0,S)}function r(y){if(!y)throw new Error("Assertion failed")}function s(y){return new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}function a(y,E,I){var x=n.exports.sbrk,S=x(E.length*4),w=x(I*4),v=new Uint8Array(n.exports.memory.buffer),P=s(E);v.set(P,S);var N=y(w,S,E.length,I);v=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(I);new Uint8Array(L.buffer).set(v.subarray(w,w+I*4)),P.set(v.subarray(S,S+E.length*4)),x(S-x(0));for(var p=0;p<E.length;++p)E[p]=L[E[p]];return[L,N]}function c(y){for(var E=0,I=0;I<y.length;++I){var x=y[I];E=E<x?x:E}return E}function u(y,E,I,x,S,w,v,P,N){var L=n.exports.sbrk,p=L(4),b=L(I*4),T=L(S*w),B=L(I*4),R=new Uint8Array(n.exports.memory.buffer);R.set(s(x),T),R.set(s(E),B);var O=y(b,B,I,T,S,w,v,P,N,p);R=new Uint8Array(n.exports.memory.buffer);var U=new Uint32Array(O);s(U).set(R.subarray(b,b+O*4));var k=new Float32Array(1);return s(k).set(R.subarray(p,p+4)),L(p-L(0)),[U,k[0]]}function f(y,E,I,x,S,w,v,P,N,L,p,b,T){var B=n.exports.sbrk,R=B(4),O=B(I*4),U=B(S*w),k=B(S*P),z=B(N.length*4),Q=B(I*4),H=L?B(S):0,W=new Uint8Array(n.exports.memory.buffer);W.set(s(x),U),W.set(s(v),k),W.set(s(N),z),W.set(s(E),Q),L&&W.set(s(L),H);var Z=y(O,Q,I,U,S,w,k,P,z,N.length,H,p,b,T,R);W=new Uint8Array(n.exports.memory.buffer);var Y=new Uint32Array(Z);s(Y).set(W.subarray(O,O+Z*4));var $=new Float32Array(1);return s($).set(W.subarray(R,R+4)),B(R-B(0)),[Y,$[0]]}function h(y,E,I,x,S,w,v,P,N,L,p,b,T){var B=n.exports.sbrk,R=B(4),O=B(S*w),U=B(S*P),k=B(N.length*4),z=B(I*4),Q=L?B(S):0,H=new Uint8Array(n.exports.memory.buffer);H.set(s(x),O),H.set(s(v),U),H.set(s(N),k),H.set(s(E),z),L&&H.set(s(L),Q);var W=y(z,I,O,S,w,U,P,k,N.length,Q,p,b,T,R);H=new Uint8Array(n.exports.memory.buffer),s(E).set(H.subarray(z,z+W*4)),s(x).set(H.subarray(O,O+S*w)),s(v).set(H.subarray(U,U+S*P));var Z=new Float32Array(1);return s(Z).set(H.subarray(R,R+4)),B(R-B(0)),[W,Z[0]]}function m(y,E,I,x){var S=n.exports.sbrk,w=S(I*x),v=new Uint8Array(n.exports.memory.buffer);v.set(s(E),w);var P=y(w,I,x);return S(w-S(0)),P}function g(y,E,I,x,S,w,v,P){var N=n.exports.sbrk,L=N(P*4),p=N(I*x),b=N(I*w),T=new Uint8Array(n.exports.memory.buffer);T.set(s(E),p),S&&T.set(s(S),b);var B=y(L,p,I,x,b,w,v,P);T=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(B);return s(R).set(T.subarray(L,L+B*4)),N(L-N(0)),R}function A(y,E,I,x,S,w,v,P,N){var L=n.exports.sbrk,p=L(4),b=L(I*4),T=L(S*w),B=L(I*4),R=v?L(S):0,O=new Uint8Array(n.exports.memory.buffer);O.set(s(x),T),O.set(s(E),B),v&&O.set(s(v),R);var U=y(b,B,I,T,S,w,R,P,N,p);O=new Uint8Array(n.exports.memory.buffer);var k=new Uint32Array(U);s(k).set(O.subarray(b,b+U*4));var z=new Float32Array(1);return s(z).set(O.subarray(p,p+4)),L(p-L(0)),[k,z[0]]}function _(y,E,I,x,S,w,v){var P=n.exports.sbrk,N=P(I*4),L=P(S*w),p=P(I*4),b=new Uint8Array(n.exports.memory.buffer);b.set(s(x),L),b.set(s(E),p);var T=y(N,p,I,L,S,w,v);b=new Uint8Array(n.exports.memory.buffer);var B=new Uint32Array(T);return s(B).set(b.subarray(N,N+T*4)),P(N-P(0)),B}var C={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(y){r(y instanceof Uint32Array||y instanceof Int32Array||y instanceof Uint16Array||y instanceof Int16Array),r(y.length%3==0);var E=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return a(n.exports.meshopt_optimizeVertexFetchRemap,E,c(y)+1)},simplify:function(y,E,I,x,S,w){r(y instanceof Uint32Array||y instanceof Int32Array||y instanceof Uint16Array||y instanceof Int16Array),r(y.length%3==0),r(E instanceof Float32Array),r(E.length%I==0),r(I>=3),r(x>=0&&x<=y.length),r(x%3==0),r(S>=0);for(var v=0,P=0;P<(w?w.length:0);++P)r(w[P]in C),v|=C[w[P]];var N=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y),L=u(n.exports.meshopt_simplify,N,y.length,E,E.length/I,I*4,x,S,v);return L[0]=y instanceof Uint32Array?L[0]:new y.constructor(L[0]),L},simplifyWithAttributes:function(y,E,I,x,S,w,v,P,N,L){r(y instanceof Uint32Array||y instanceof Int32Array||y instanceof Uint16Array||y instanceof Int16Array),r(y.length%3==0),r(E instanceof Float32Array),r(E.length%I==0),r(I>=3),r(x instanceof Float32Array),r(x.length==S*(E.length/I)),r(S>=0),r(v==null||v instanceof Uint8Array),r(v==null||v.length==E.length/I),r(P>=0&&P<=y.length),r(P%3==0),r(N>=0),r(Array.isArray(w)),r(S>=w.length),r(w.length<=32);for(var p=0;p<w.length;++p)r(w[p]>=0);for(var b=0,p=0;p<(L?L.length:0);++p)r(L[p]in C),b|=C[L[p]];var T=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y),B=f(n.exports.meshopt_simplifyWithAttributes,T,y.length,E,E.length/I,I*4,x,S*4,new Float32Array(w),v,P,N,b);return B[0]=y instanceof Uint32Array?B[0]:new y.constructor(B[0]),B},simplifyWithUpdate:function(y,E,I,x,S,w,v,P,N,L){r(y instanceof Uint32Array||y instanceof Int32Array||y instanceof Uint16Array||y instanceof Int16Array),r(y.length%3==0),r(E instanceof Float32Array),r(E.length%I==0),r(I>=3),r(x instanceof Float32Array),r(x.length==S*(E.length/I)),r(S>=0),r(v==null||v instanceof Uint8Array),r(v==null||v.length==E.length/I),r(P>=0&&P<=y.length),r(P%3==0),r(N>=0),r(Array.isArray(w)),r(S>=w.length),r(w.length<=32);for(var p=0;p<w.length;++p)r(w[p]>=0);for(var b=0,p=0;p<(L?L.length:0);++p)r(L[p]in C),b|=C[L[p]];var T=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y),B=h(n.exports.meshopt_simplifyWithUpdate,T,y.length,E,E.length/I,I*4,x,S*4,new Float32Array(w),v,P,N,b);if(y!==T)for(var p=0;p<B[0];++p)y[p]=T[p];return B},getScale:function(y,E){return r(y instanceof Float32Array),r(y.length%E==0),r(E>=3),m(n.exports.meshopt_simplifyScale,y,y.length/E,E*4)},simplifyPoints:function(y,E,I,x,S,w){return r(y instanceof Float32Array),r(y.length%E==0),r(E>=3),r(I>=0&&I<=y.length/E),x?(r(x instanceof Float32Array),r(x.length%S==0),r(S>=3),r(y.length/E==x.length/S),g(n.exports.meshopt_simplifyPoints,y,y.length/E,E*4,x,S*4,w,I)):g(n.exports.meshopt_simplifyPoints,y,y.length/E,E*4,void 0,0,0,I)},simplifySloppy:function(y,E,I,x,S,w){r(y instanceof Uint32Array||y instanceof Int32Array||y instanceof Uint16Array||y instanceof Int16Array),r(y.length%3==0),r(E instanceof Float32Array),r(E.length%I==0),r(I>=3),r(x==null||x instanceof Uint8Array),r(x==null||x.length==E.length/I),r(S>=0&&S<=y.length),r(S%3==0),r(w>=0);var v=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y),P=A(n.exports.meshopt_simplifySloppy,v,y.length,E,E.length/I,I*4,x,S,w);return P[0]=y instanceof Uint32Array?P[0]:new y.constructor(P[0]),P},simplifyPrune:function(y,E,I,x){r(y instanceof Uint32Array||y instanceof Int32Array||y instanceof Uint16Array||y instanceof Int16Array),r(y.length%3==0),r(E instanceof Float32Array),r(E.length%I==0),r(I>=3),r(x>=0);var S=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y),w=_(n.exports.meshopt_simplifyPrune,S,y.length,E,E.length/I,I*4,x);return w=y instanceof Uint32Array?w:new y.constructor(w),w}}})();typeof EM=="object"&&typeof vj=="object"?vj.exports=oV:typeof define=="function"&&define.amd?define([],function(){return oV}):typeof EM=="object"?EM.MeshoptSimplifier=oV:(typeof self<"u"?self:EM).MeshoptSimplifier=oV});var Vce=di((IM,Pj)=>{var rV=(function(){var e="b9H79TebbbeVx9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gvuuuuueu9Gwuuuuuuuub9Gxuuuuuuuuuuuueu9Gkuuuuuuuuuu99eu9Gouuuuuub9Gruuuuuuub9GluuuubiAOdilvorwDqqDkbiibeilve9Weiiviebeoweuec;G:Odkr;qeDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bqL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbkl79IV9RbxDwebcekdszq:x9DOdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:w8KDPue99eux99dui99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:ojjjb8Adndnalcb9imbaoal9nmbamcuaocdtaocFFFFi0Egscbyd;u1jjbHjjjjbbgzBd:CwamceBd;8wamascbyd;u1jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;u1jjbHjjjjbbgOBd:KwamciBd;8waihsalhAinazasydbcdtfcbBdbasclfhsaAcufgAmbkaihsalhAinazasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkaihsalhCcbhXindnazasydbcdtgQfgAydbcb9imbaHaQfaXBdbaAaAydbgQcjjjj94VBdbaQaXfhXkasclfhsaCcufgCmbkalci9UhLdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhXaHaAydbcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaXcdtfgXaXydbgXcefBdbaOaXcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaihsalhAindnazasydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaHaCfgCaCydbaQ9RBdbkasclfhsaAcufgAmbxdkkamcuaocdtgsaocFFFFi0EgAcbyd;u1jjbHjjjjbbgzBd:CwamceBd;8wamaAcbyd;u1jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;u1jjbHjjjjbbgOBd:KwamciBd;8wazcbasz:ojjjbhXalci9UhLaihsalhAinaXasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkdnaoTmbcbhsaHhAaXhCaohQinaAasBdbaAclfhAaCydbasfhsaCclfhCaQcufgQmbkkdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhQaHaAydbcdtfgKaKydbgKcefBdbaOaKcdtfasBdbaHaQcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaoTmbcbhsaohAinaHasfgCaCydbaXasfydb9RBdbasclfhsaAcufgAmbkkamaLcbyd;u1jjbHjjjjbbgsBd:OwamclBd;8wascbaLz:ojjjbhYamcuaLcK2alcjjjjd0Ecbyd;u1jjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihAa8AhsaLhrJbbbbh5inavaAclfydbaK2cdtfgCIdlh8EavaAydbaK2cdtfgXIdlhEavaAcwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgasaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbasclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyascxfa8EaE:tg8Eagah:tggNa8FaE:tg8Faaah:tgaN:tgEJbbbbJbbjZa8Ja8K:tg8Ja8FNa8La8K:tg8Ka8EN:tghahNaEaENaaa8KNaga8JN:tgEaENMM:rg8K:va8KJbbbb9BEg8ENUdbasczfaEa8ENUdbascCfaha8ENUdbascwfa8Maya8NMMJbbnn:vUdba5a8KMh5aAcxfhAascKfhsarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;u1jjbHjjjjbbgCBd:WwamcoBd;8waEaq:ZNhEdna3mbcbhsaChAinaAasBdbaAclfhAaLascefgs9hmbkkaE:rhhcuh8PamcuaLcltalcFFFFd0Ecbyd;u1jjbHjjjjbbgIBd:0wamcrBd;8wcbaIa8AaCaLz:djjjb8AJFFuuhyJFFuuh8RJFFuuh8Sdnalci6gXmbJFFuuh8Sa8AhsaLhAJFFuuh8RJFFuuhyinascwfIdbgEayayaE9EEhyasclfIdbgEa8Ra8RaE9EEh8RasIdbgEa8Sa8SaE9EEh8SascKfhsaAcufgAmbkkahJbbbZNhgamaocetgscuaocu9kEcbyd;u1jjbHjjjjbbgABd:4waAcFeasz:ojjjbhCdnaXmbcbhAJFFuuhEa8Ahscuh8PinascwfIdbay:tghahNasIdba8S:tghahNasclfIdba8R:tghahNMM:rghaEa8PcuSahaE9DVgXEhEaAa8PaXEh8PascKfhsaLaAcefgA9hmbkkamczfcbcjwz:ojjjb8Aamcwf9cb83ibam9cb83ibagaxNhRJbbjZak:th8Ncbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YJbbbbh8ZJbbbbh80cbh81cbhPinJbbbbhEdna8UTmbJbbjZa8U:Z:vhEkJbbbbhhdna80a80Na8Ya8YNa8Za8ZNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8XaENh5a8WaENh8Fa8VaENhaa8PhQdndndndndna8UaPVTmbamydwgBTmea80ahNh8Ja8ZahNh8La8YahNh8Maeamydbcdtfh83cbh3JFFuuhEcvhXcuhQindnaza83a3cdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAindndnaCaiaAydbgKcx2fgsclfydbgrcetf8Vebcs4aCasydbgLcetf8Vebcs4faCascwfydbglcetf8Vebcs4fgombcbhsxekcehsazaLcdtfydbgLceSmbcehsazarcdtfydbgrceSmbcehsazalcdtfydbglceSmbdnarcdSaLcdSfalcdSfcd6mbaocefhsxekaocdfhskdnasaX9kmba8AaKcK2fgLIdwa5:thhaLIdla8F:th8KaLIdbaa:th8EdndnakJbbbb9DTmba8E:lg8Ea8K:lg8Ka8Ea8K9EEg8Kah:lgha8Kah9EEag:vJbbjZMhhxekahahNa8Ea8ENa8Ka8KNMM:rag:va8NNJbbjZMJ9VO:d86JbbjZaLIdCa8JNaLIdxa8MNa8LaLIdzNMMakN:tghahJ9VO:d869DENhhkaKaQasaX6ahaE9DVgLEhQasaXaLEhXahaEaLEhEkaAclfhAavcufgvmbkka3cefg3aB9hmbkkaQcu9hmekama5Ud:ODama8FUd:KDamaaUd:GDamcuBd:qDamcFFF;7rBdjDaIcba8AaYamc:GDfakJbbbb9Damc:qDfamcjDfz:ejjjbamyd:qDhQdndnaxJbbbb9ETmba8UaD6mbaQcuSmeceh3amIdjDaR9EmixdkaQcu9hmekdna8UTmbdnamydlgza8Uci2fgsciGTmbadasfcba8Uazcu7fciGcefz:ojjjb8AkabaPcltfgzam8Pib83dbazcwfamcwf8Pib83dbaPcefhPkc3hzinazc98Smvamc:Cwfazfydbcbyd;y1jjbH:bjjjbbazc98fhzxbkkcbh3a8Uaq9pmbamydwaCaiaQcx2fgsydbcetf8Vebcs4aCascwfydbcetf8Vebcs4faCasclfydbcetf8Vebcs4ffaw9nmekcbhscbhAdna81TmbcbhAamczfhXinamczfaAcdtfaXydbgLBdbaXclfhXaAaYaLfRbbTfhAa81cufg81mbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDaAc;8eaAclfc:bd6Eh81inamcjDfasfcFFF;7rBdbasclfgscz9hmbka81cdthBdnalTmbaeaXcdtfhocbhrindnazaoarcdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAcuhLcuhsinazaiaAydbgKcx2fgXclfydbcdtfydbazaXydbcdtfydbfazaXcwfydbcdtfydbfgXasaXas6gXEhsaKaLaXEhLaAclfhAavcufgvmbkaLcuSmba8AaLcK2fgAIdway:tgEaENaAIdba8S:tgEaENaAIdla8R:tgEaENMM:rhEcbhAindndnasamc:qDfaAfgvydbgX6mbasaX9hmeaEamcjDfaAfIdb9FTmekavasBdbamc:GDfaAfaLBdbamcjDfaAfaEUdbxdkaAclfgAcz9hmbkkarcefgral9hmbkkamczfaBfhLcbhscbhAindnamc:GDfasfydbgXcuSmbaLaAcdtfaXBdbaAcefhAkasclfgscz9hmbkaAa81fg81TmbJFFuuhhcuhKamczfhsa81hvcuhLina8AasydbgXcK2fgAIdway:tgEaENaAIdba8S:tgEaENaAIdla8R:tgEaENMM:rhEdndnazaiaXcx2fgAclfydbcdtfydbazaAydbcdtfydbfazaAcwfydbcdtfydbfgAaL6mbaAaL9hmeaEah9DTmekaEhhaAhLaXhKkasclfhsavcufgvmbkaKcuSmbaKhQkdnamaiaQcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YJbbbbh8ZJbbbbh80kcbhXinaOaHaraXcdtfydbcdtgAfydbcdtfgKhsazaAfgvydbgLhAdnaLTmbdninasydbaQSmeasclfhsaAcufgATmdxbkkasaKaLcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaQcK2fgsIdbhEasIdlhhasIdwh8KasIdxh8EasIdzh5asIdCh8FaYaQfce86bba80a8FMh80a8Za5Mh8Za8Ya8EMh8Ya8Xa8KMh8Xa8WahMh8Wa8VaEMh8Vamydxh8Uxbkkamc:WDf8KjjjjbaPk;Vvivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbararydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark:;idiud99dndnabaecitfgwydlgDciGgqciSmbinabcbaDcd4gDalaqcdtfIdbawIdb:tgkJbbbb9FEgwaecefgefadaialavaoarz:ejjjbak:larIdb9FTmdabawaD7aefgecitfgwydlgDciGgqci9hmbkkabaecitfgeclfhbdnavmbcuhwindnaiaeydbgDfRbbmbadaDcK2fgqIdwalIdw:tgkakNaqIdbalIdb:tgkakNaqIdlalIdl:tgkakNMM:rgkarIdb9DTmbarakUdbaoaDBdbkaecwfheawcefgwabydbcd46mbxdkkcuhwindnaiaeydbgDfRbbmbadaDcK2fgqIdbalIdb:t:lgkaqIdlalIdl:t:lgxakax9EEgkaqIdwalIdw:t:lgxakax9EEgkarIdb9DTmbarakUdbaoaDBdbkaecwfheawcefgwabydbcd46mbkkk;llevudnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0abydxaq9pVakVgDce9hmbavawcltfgxab8Pdb83dbaxcwfabcwfgx8Pdb83dbdnaxydbgqTmbaoabydbcdtfhxaqhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkdnabydxglci2gsabydlgxfgkciGTmbarakfcbalaxcu7fciGcefz:ojjjb8Aabydxci2hsabydlhxabydwhqkab9cb83dwababydbaqfBdbabascifc98GaxfBdlaP8Vebhscbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk8LbabaeadaialavaoarawaDaDaqJbbbbz:cjjjbk;Nkovud99euv99eul998Jjjjjbc:W;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:W:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaoc8Wfawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeaocbBd8Sao9cb83iKao9cb83izaoczfaoc8Wfawci2cxaoc8Sfcbcrz1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:W:qefawcxaoc8Sfcbciz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM: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:ojjjb8Aarc;Gbfcbavz:ojjjb8AarhvarcafhiaohqinavcFFF97BdbaicFFF;7rBdbaiclfhiavclfhvaqcufgqmbkdnadTmbcbhkinaeakaD2cdtfgvIdwhxavIdlhmavIdbhPalakaw2cdtfIdbhsarc;abfhzarhiarc;GbfhHarcafhqcj1jjbhvaohOinasavcwfIdbaxNavIdbaPNavclfIdbamNMMgAMhCakhXdnaAas:tgAaqIdbgQ9DgLmbaHydbhXkaHaXBdbakhXdnaCaiIdbgK9EmbazydbhXaKhCkazaXBdbaiaCUdbaqaAaQaLEUdbavcxfhvaqclfhqaHclfhHaiclfhiazclfhzaOcufgOmbkakcefgkad9hmbkkadThkJbbbbhCcbhXarc;abfhvarc;Gbfhicbhqinalavydbgzaw2cdtfIdbalaiydbgHaw2cdtfIdbaeazaD2cdtfgzIdwaeaHaD2cdtfgHIdw:tgsasNazIdbaHIdb:tgsasNazIdlaHIdl:tgsasNMM:rMMgsaCasaC9EgzEhCaqaXazEhXaiclfhiavclfhvaoaqcefgq9hmbkaCJbbbZNhKxekadThkcbhXJbbbbhKkJbbbbhCdnaearc;abfaXcdtgifydbgqaD2cdtfgvIdwaearc;GbfaifydbgzaD2cdtfgiIdwgm:tgsasNavIdbaiIdbgY:tgAaANavIdlaiIdlgP:tgQaQNMM:rgxJbbbb9ETmbaxalaqaw2cdtfIdbMalazaw2cdtfIdb:taxaxM:vhCkasaCNamMhmaQaCNaPMhPaAaCNaYMhYdnakmbaDcdthvawcdthiindnalIdbg8AaecwfIdbam:tgCaCNaeIdbaY:tgsasNaeclfIdbaP:tgAaANMM:rgQMgEaK9ETmbJbbbbhxdnaQJbbbb9ETmbaEaK:taQaQM:vhxkaxaCNamMhmaxaANaPMhPaxasNaYMhYa8AaKaQMMJbbbZNhKkaeavfhealaifhladcufgdmbkkabaKUdxabamUdwabaPUdlabaYUdbarcjef8Kjjjjbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Reeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrz1jjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk:3lequ8JjjjjbcjP9Rgl8Kjjjjbcbhvalcjxfcbaiz:ojjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjxfaDcefRbbfRbb9RcFeGci6aoalcjxfaDRbbfRbb9RcFeGci6faoalcjxfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:rjjjb8Aakalcjxffaocefgo86bbaxalcjxffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjxffao86bbarcifhravcefgvad9hmbkalcFeaicetz:ojjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkcetfgw8UebgDcu9kmbawax87ebaocjlfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjlfaDz:njjjb8AalcjPf8Kjjjjbk9teiucbcbyd;C1jjbgeabcifc98GfgbBd;C1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;C1jjbgeabcrfc94GfgbBd;C1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;C1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;C1jjbfgdBd;C1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkk9Tdbcjwk9ubbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;uwkxebbbdbbb9GNbb",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(_){n=_.instance,n.exports.__wasm_call_ctors()});function o(_){for(var C=new Uint8Array(_.length),y=0;y<_.length;++y){var E=_.charCodeAt(y);C[y]=E>96?E-97:E>64?E-39:E+4}for(var I=0,y=0;y<_.length;++y)C[I++]=C[y]<60?t[C[y]]:(C[y]-60)*64+C[++y];return C.buffer.slice(0,I)}function r(_){if(!_)throw new Error("Assertion failed")}function s(_){return new Uint8Array(_.buffer,_.byteOffset,_.byteLength)}var a=48,c=16;function u(_,C){var y=_.meshlets[C*4+0],E=_.meshlets[C*4+1],I=_.meshlets[C*4+2],x=_.meshlets[C*4+3];return{vertices:_.vertices.subarray(y,y+I),triangles:_.triangles.subarray(E,E+x*3)}}function f(_,C,y,E,I,x,S){var w=n.exports.sbrk,v=n.exports.meshopt_buildMeshletsBound(_.length,I,x),P=w(v*c),N=w(v*I*4),L=w(v*x*3),p=w(_.byteLength),b=w(C.byteLength),T=new Uint8Array(n.exports.memory.buffer);T.set(s(_),p),T.set(s(C),b);var B=n.exports.meshopt_buildMeshlets(P,N,L,p,_.length,b,y,E,I,x,S);T=new Uint8Array(n.exports.memory.buffer);for(var R=T.subarray(P,P+B*c),O=new Uint32Array(R.buffer,R.byteOffset,R.byteLength/4).slice(),U=0;U<B;++U){var k=O[U*4+0],z=O[U*4+1],y=O[U*4+2],Q=O[U*4+3];n.exports.meshopt_optimizeMeshlet(N+k*4,L+z,Q,y)}var H=O[(B-1)*4+0],W=O[(B-1)*4+1],Z=O[(B-1)*4+2],Y=O[(B-1)*4+3],$=H+Z,K=W+(Y*3+3&-4),fe={meshlets:O,vertices:new Uint32Array(T.buffer,N,$).slice(),triangles:new Uint8Array(T.buffer,L,K*3).slice(),meshletCount:B};return w(P-w(0)),fe}function h(_){var C=new Float32Array(n.exports.memory.buffer,_,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 m(_,C,y,E){var I=n.exports.sbrk,x=[],S=I(C.byteLength),w=I(_.vertices.byteLength),v=I(_.triangles.byteLength),P=I(a),N=new Uint8Array(n.exports.memory.buffer);N.set(s(C),S),N.set(s(_.vertices),w),N.set(s(_.triangles),v);for(var L=0;L<_.meshletCount;++L){var p=_.meshlets[L*4+0],b=_.meshlets[L*4+0+1],T=_.meshlets[L*4+0+3];n.exports.meshopt_computeMeshletBounds(P,w+p*4,v+b,T,S,y,E),x.push(h(P))}return I(S-I(0)),x}function g(_,C,y,E){var I=n.exports.sbrk,x=I(a),S=I(_.byteLength),w=I(C.byteLength),v=new Uint8Array(n.exports.memory.buffer);v.set(s(_),S),v.set(s(C),w),n.exports.meshopt_computeClusterBounds(x,S,_.length,w,y,E);var P=h(x);return I(x-I(0)),P}function A(_,C,y,E,I){var x=n.exports.sbrk,S=x(a),w=x(_.byteLength),v=E?x(E.byteLength):0,P=new Uint8Array(n.exports.memory.buffer);P.set(s(_),w),E&&P.set(s(E),v),n.exports.meshopt_computeSphereBounds(S,w,C,y,v,E?I:0);var N=h(S);return x(S-x(0)),N}return{ready:i,supported:!0,buildMeshlets:function(_,C,y,E,I,x){r(_.length%3==0),r(C instanceof Float32Array),r(C.length%y==0),r(y>=3),r(E<=256||E>0),r(I<=512),r(I%4==0),x=x||0;var S=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return f(S,C,C.length/y,y*4,E,I,x)},extractMeshlet:function(_,C){return r(C>=0&&C<_.meshletCount),u(_,C)},computeClusterBounds:function(_,C,y){r(_.length%3==0),r(_.length/3<=512),r(C instanceof Float32Array),r(C.length%y==0),r(y>=3);var E=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return g(E,C,C.length/y,y*4)},computeMeshletBounds:function(_,C,y){return r(_.meshletCount!=0),r(C instanceof Float32Array),r(C.length%y==0),r(y>=3),m(_,C,C.length/y,y*4)},computeSphereBounds:function(_,C,y,E){return r(_ instanceof Float32Array),r(_.length%C==0),r(C>=3),r(!y||y instanceof Float32Array),r(!y||y.length%E==0),r(!y||E>=1),r(!y||_.length/C==y.length/E),E=E||0,A(_,_.length/C,C*4,y,E*4)}}})();typeof IM=="object"&&typeof Pj=="object"?Pj.exports=rV:typeof define=="function"&&define.amd?define([],function(){return rV}):typeof IM=="object"?IM.MeshoptClusterizer=rV:(typeof self<"u"?self:IM).MeshoptClusterizer=rV});var Rj=di((yun,Hce)=>{var fze=Uce(),dze=Gce(),hze=zce(),Aze=Vce();Hce.exports={MeshoptEncoder:fze,MeshoptDecoder:dze,MeshoptSimplifier:hze,MeshoptClusterizer:Aze}});var khe=di((Z3n,Qhe)=>{"use strict";Qhe.exports=k7e;var YO=1e20;function k7e(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,u,f,h,m,g,A,_;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?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(m=e,h=m.getContext("2d"),r=m.width,s=m.height,g=h.getImageData(0,0,r,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(m=e.canvas,h=e,r=m.width,s=m.height,g=h.getImageData(0,0,r,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),A=0,_=Math.floor(u.length/f);A<_;A++)c[A]=u[A*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var C=Array(r*s),y=Array(r*s),E=Array(a),I=Array(a),x=Array(a+1),S=Array(a);for(A=0,_=r*s;A<_;A++){var w=c[A];C[A]=w===1?0:w===0?YO:Math.pow(Math.max(0,.5-w),2),y[A]=w===1?YO:w===0?0:Math.pow(Math.max(0,w-.5),2)}Ohe(C,r,s,E,I,S,x),Ohe(y,r,s,E,I,S,x);var v=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(A=0,_=r*s;A<_;A++)v[A]=Math.min(Math.max(1-((C[A]-y[A])/i+n),0),1);return v}function Ohe(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(Fhe(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(Fhe(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Fhe(e,t,n,i,o){n[0]=0,i[0]=-YO,i[1]=+YO;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]=+YO}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 Hhe=di((mUn,ZV)=>{function J7e(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,h=11,m=12,g=13,A=14,_=15,C=16,y=17,E=0,I=1,x=2,S=3,w=4;function v(p,b){return 55296<=p.charCodeAt(b)&&p.charCodeAt(b)<=56319&&56320<=p.charCodeAt(b+1)&&p.charCodeAt(b+1)<=57343}function P(p,b){b===void 0&&(b=0);var T=p.charCodeAt(b);if(55296<=T&&T<=56319&&b<p.length-1){var B=T,R=p.charCodeAt(b+1);return 56320<=R&&R<=57343?(B-55296)*1024+(R-56320)+65536:B}if(56320<=T&&T<=57343&&b>=1){var B=p.charCodeAt(b-1),R=T;return 55296<=B&&B<=56319?(B-55296)*1024+(R-56320)+65536:R}return T}function N(p,b,T){var B=[p].concat(b).concat([T]),R=B[B.length-2],O=T,U=B.lastIndexOf(A);if(U>1&&B.slice(1,U).every(function(Q){return Q==i})&&[i,g,y].indexOf(p)==-1)return x;var k=B.lastIndexOf(o);if(k>0&&B.slice(1,k).every(function(Q){return Q==o})&&[m,o].indexOf(R)==-1)return B.filter(function(Q){return Q==o}).length%2==1?S:w;if(R==e&&O==t)return E;if(R==n||R==e||R==t)return O==A&&b.every(function(Q){return Q==i})?x:I;if(O==n||O==e||O==t)return I;if(R==s&&(O==s||O==a||O==u||O==f))return E;if((R==u||R==a)&&(O==a||O==c))return E;if((R==f||R==c)&&O==c)return E;if(O==i||O==_)return E;if(O==r)return E;if(R==m)return E;var z=B.indexOf(i)!=-1?B.lastIndexOf(i)-1:B.length-2;return[g,y].indexOf(B[z])!=-1&&B.slice(z+1,-1).every(function(Q){return Q==i})&&O==A||R==_&&[C,y].indexOf(O)!=-1?E:b.indexOf(o)!=-1?x:R==o&&O==o?E:I}this.nextBreak=function(p,b){if(b===void 0&&(b=0),b<0)return 0;if(b>=p.length-1)return p.length;for(var T=L(P(p,b)),B=[],R=b+1;R<p.length;R++)if(!v(p,R-1)){var O=L(P(p,R));if(N(T,B,O))return R;B.push(O)}return p.length},this.splitGraphemes=function(p){for(var b=[],T=0,B;(B=this.nextBreak(p,T))<p.length;)b.push(p.slice(T,B)),T=B;return T<p.length&&b.push(p.slice(T)),b},this.iterateGraphemes=function(p){var b=0,T={next:(function(){var B,R;return(R=this.nextBreak(p,b))<p.length?(B=p.slice(b,R),b=R,{value:B,done:!1}):b<p.length?(B=p.slice(b),b=p.length,{value:B,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(T[Symbol.iterator]=function(){return T}),T},this.countGraphemes=function(p){for(var b=0,T=0,B;(B=this.nextBreak(p,T))<p.length;)T=B,b++;return T<p.length&&b++,b};function L(p){return 1536<=p&&p<=1541||p==1757||p==1807||p==2274||p==3406||p==69821||70082<=p&&p<=70083||p==72250||72326<=p&&p<=72329||p==73030?m:p==13?e:p==10?t:0<=p&&p<=9||11<=p&&p<=12||14<=p&&p<=31||127<=p&&p<=159||p==173||p==1564||p==6158||p==8203||8206<=p&&p<=8207||p==8232||p==8233||8234<=p&&p<=8238||8288<=p&&p<=8292||p==8293||8294<=p&&p<=8303||55296<=p&&p<=57343||p==65279||65520<=p&&p<=65528||65529<=p&&p<=65531||113824<=p&&p<=113827||119155<=p&&p<=119162||p==917504||p==917505||917506<=p&&p<=917535||917632<=p&&p<=917759||918e3<=p&&p<=921599?n:768<=p&&p<=879||1155<=p&&p<=1159||1160<=p&&p<=1161||1425<=p&&p<=1469||p==1471||1473<=p&&p<=1474||1476<=p&&p<=1477||p==1479||1552<=p&&p<=1562||1611<=p&&p<=1631||p==1648||1750<=p&&p<=1756||1759<=p&&p<=1764||1767<=p&&p<=1768||1770<=p&&p<=1773||p==1809||1840<=p&&p<=1866||1958<=p&&p<=1968||2027<=p&&p<=2035||2070<=p&&p<=2073||2075<=p&&p<=2083||2085<=p&&p<=2087||2089<=p&&p<=2093||2137<=p&&p<=2139||2260<=p&&p<=2273||2275<=p&&p<=2306||p==2362||p==2364||2369<=p&&p<=2376||p==2381||2385<=p&&p<=2391||2402<=p&&p<=2403||p==2433||p==2492||p==2494||2497<=p&&p<=2500||p==2509||p==2519||2530<=p&&p<=2531||2561<=p&&p<=2562||p==2620||2625<=p&&p<=2626||2631<=p&&p<=2632||2635<=p&&p<=2637||p==2641||2672<=p&&p<=2673||p==2677||2689<=p&&p<=2690||p==2748||2753<=p&&p<=2757||2759<=p&&p<=2760||p==2765||2786<=p&&p<=2787||2810<=p&&p<=2815||p==2817||p==2876||p==2878||p==2879||2881<=p&&p<=2884||p==2893||p==2902||p==2903||2914<=p&&p<=2915||p==2946||p==3006||p==3008||p==3021||p==3031||p==3072||3134<=p&&p<=3136||3142<=p&&p<=3144||3146<=p&&p<=3149||3157<=p&&p<=3158||3170<=p&&p<=3171||p==3201||p==3260||p==3263||p==3266||p==3270||3276<=p&&p<=3277||3285<=p&&p<=3286||3298<=p&&p<=3299||3328<=p&&p<=3329||3387<=p&&p<=3388||p==3390||3393<=p&&p<=3396||p==3405||p==3415||3426<=p&&p<=3427||p==3530||p==3535||3538<=p&&p<=3540||p==3542||p==3551||p==3633||3636<=p&&p<=3642||3655<=p&&p<=3662||p==3761||3764<=p&&p<=3769||3771<=p&&p<=3772||3784<=p&&p<=3789||3864<=p&&p<=3865||p==3893||p==3895||p==3897||3953<=p&&p<=3966||3968<=p&&p<=3972||3974<=p&&p<=3975||3981<=p&&p<=3991||3993<=p&&p<=4028||p==4038||4141<=p&&p<=4144||4146<=p&&p<=4151||4153<=p&&p<=4154||4157<=p&&p<=4158||4184<=p&&p<=4185||4190<=p&&p<=4192||4209<=p&&p<=4212||p==4226||4229<=p&&p<=4230||p==4237||p==4253||4957<=p&&p<=4959||5906<=p&&p<=5908||5938<=p&&p<=5940||5970<=p&&p<=5971||6002<=p&&p<=6003||6068<=p&&p<=6069||6071<=p&&p<=6077||p==6086||6089<=p&&p<=6099||p==6109||6155<=p&&p<=6157||6277<=p&&p<=6278||p==6313||6432<=p&&p<=6434||6439<=p&&p<=6440||p==6450||6457<=p&&p<=6459||6679<=p&&p<=6680||p==6683||p==6742||6744<=p&&p<=6750||p==6752||p==6754||6757<=p&&p<=6764||6771<=p&&p<=6780||p==6783||6832<=p&&p<=6845||p==6846||6912<=p&&p<=6915||p==6964||6966<=p&&p<=6970||p==6972||p==6978||7019<=p&&p<=7027||7040<=p&&p<=7041||7074<=p&&p<=7077||7080<=p&&p<=7081||7083<=p&&p<=7085||p==7142||7144<=p&&p<=7145||p==7149||7151<=p&&p<=7153||7212<=p&&p<=7219||7222<=p&&p<=7223||7376<=p&&p<=7378||7380<=p&&p<=7392||7394<=p&&p<=7400||p==7405||p==7412||7416<=p&&p<=7417||7616<=p&&p<=7673||7675<=p&&p<=7679||p==8204||8400<=p&&p<=8412||8413<=p&&p<=8416||p==8417||8418<=p&&p<=8420||8421<=p&&p<=8432||11503<=p&&p<=11505||p==11647||11744<=p&&p<=11775||12330<=p&&p<=12333||12334<=p&&p<=12335||12441<=p&&p<=12442||p==42607||42608<=p&&p<=42610||42612<=p&&p<=42621||42654<=p&&p<=42655||42736<=p&&p<=42737||p==43010||p==43014||p==43019||43045<=p&&p<=43046||43204<=p&&p<=43205||43232<=p&&p<=43249||43302<=p&&p<=43309||43335<=p&&p<=43345||43392<=p&&p<=43394||p==43443||43446<=p&&p<=43449||p==43452||p==43493||43561<=p&&p<=43566||43569<=p&&p<=43570||43573<=p&&p<=43574||p==43587||p==43596||p==43644||p==43696||43698<=p&&p<=43700||43703<=p&&p<=43704||43710<=p&&p<=43711||p==43713||43756<=p&&p<=43757||p==43766||p==44005||p==44008||p==44013||p==64286||65024<=p&&p<=65039||65056<=p&&p<=65071||65438<=p&&p<=65439||p==66045||p==66272||66422<=p&&p<=66426||68097<=p&&p<=68099||68101<=p&&p<=68102||68108<=p&&p<=68111||68152<=p&&p<=68154||p==68159||68325<=p&&p<=68326||p==69633||69688<=p&&p<=69702||69759<=p&&p<=69761||69811<=p&&p<=69814||69817<=p&&p<=69818||69888<=p&&p<=69890||69927<=p&&p<=69931||69933<=p&&p<=69940||p==70003||70016<=p&&p<=70017||70070<=p&&p<=70078||70090<=p&&p<=70092||70191<=p&&p<=70193||p==70196||70198<=p&&p<=70199||p==70206||p==70367||70371<=p&&p<=70378||70400<=p&&p<=70401||p==70460||p==70462||p==70464||p==70487||70502<=p&&p<=70508||70512<=p&&p<=70516||70712<=p&&p<=70719||70722<=p&&p<=70724||p==70726||p==70832||70835<=p&&p<=70840||p==70842||p==70845||70847<=p&&p<=70848||70850<=p&&p<=70851||p==71087||71090<=p&&p<=71093||71100<=p&&p<=71101||71103<=p&&p<=71104||71132<=p&&p<=71133||71219<=p&&p<=71226||p==71229||71231<=p&&p<=71232||p==71339||p==71341||71344<=p&&p<=71349||p==71351||71453<=p&&p<=71455||71458<=p&&p<=71461||71463<=p&&p<=71467||72193<=p&&p<=72198||72201<=p&&p<=72202||72243<=p&&p<=72248||72251<=p&&p<=72254||p==72263||72273<=p&&p<=72278||72281<=p&&p<=72283||72330<=p&&p<=72342||72344<=p&&p<=72345||72752<=p&&p<=72758||72760<=p&&p<=72765||p==72767||72850<=p&&p<=72871||72874<=p&&p<=72880||72882<=p&&p<=72883||72885<=p&&p<=72886||73009<=p&&p<=73014||p==73018||73020<=p&&p<=73021||73023<=p&&p<=73029||p==73031||92912<=p&&p<=92916||92976<=p&&p<=92982||94095<=p&&p<=94098||113821<=p&&p<=113822||p==119141||119143<=p&&p<=119145||119150<=p&&p<=119154||119163<=p&&p<=119170||119173<=p&&p<=119179||119210<=p&&p<=119213||119362<=p&&p<=119364||121344<=p&&p<=121398||121403<=p&&p<=121452||p==121461||p==121476||121499<=p&&p<=121503||121505<=p&&p<=121519||122880<=p&&p<=122886||122888<=p&&p<=122904||122907<=p&&p<=122913||122915<=p&&p<=122916||122918<=p&&p<=122922||125136<=p&&p<=125142||125252<=p&&p<=125258||917536<=p&&p<=917631||917760<=p&&p<=917999?i:127462<=p&&p<=127487?o:p==2307||p==2363||2366<=p&&p<=2368||2377<=p&&p<=2380||2382<=p&&p<=2383||2434<=p&&p<=2435||2495<=p&&p<=2496||2503<=p&&p<=2504||2507<=p&&p<=2508||p==2563||2622<=p&&p<=2624||p==2691||2750<=p&&p<=2752||p==2761||2763<=p&&p<=2764||2818<=p&&p<=2819||p==2880||2887<=p&&p<=2888||2891<=p&&p<=2892||p==3007||3009<=p&&p<=3010||3014<=p&&p<=3016||3018<=p&&p<=3020||3073<=p&&p<=3075||3137<=p&&p<=3140||3202<=p&&p<=3203||p==3262||3264<=p&&p<=3265||3267<=p&&p<=3268||3271<=p&&p<=3272||3274<=p&&p<=3275||3330<=p&&p<=3331||3391<=p&&p<=3392||3398<=p&&p<=3400||3402<=p&&p<=3404||3458<=p&&p<=3459||3536<=p&&p<=3537||3544<=p&&p<=3550||3570<=p&&p<=3571||p==3635||p==3763||3902<=p&&p<=3903||p==3967||p==4145||4155<=p&&p<=4156||4182<=p&&p<=4183||p==4228||p==6070||6078<=p&&p<=6085||6087<=p&&p<=6088||6435<=p&&p<=6438||6441<=p&&p<=6443||6448<=p&&p<=6449||6451<=p&&p<=6456||6681<=p&&p<=6682||p==6741||p==6743||6765<=p&&p<=6770||p==6916||p==6965||p==6971||6973<=p&&p<=6977||6979<=p&&p<=6980||p==7042||p==7073||7078<=p&&p<=7079||p==7082||p==7143||7146<=p&&p<=7148||p==7150||7154<=p&&p<=7155||7204<=p&&p<=7211||7220<=p&&p<=7221||p==7393||7410<=p&&p<=7411||p==7415||43043<=p&&p<=43044||p==43047||43136<=p&&p<=43137||43188<=p&&p<=43203||43346<=p&&p<=43347||p==43395||43444<=p&&p<=43445||43450<=p&&p<=43451||43453<=p&&p<=43456||43567<=p&&p<=43568||43571<=p&&p<=43572||p==43597||p==43755||43758<=p&&p<=43759||p==43765||44003<=p&&p<=44004||44006<=p&&p<=44007||44009<=p&&p<=44010||p==44012||p==69632||p==69634||p==69762||69808<=p&&p<=69810||69815<=p&&p<=69816||p==69932||p==70018||70067<=p&&p<=70069||70079<=p&&p<=70080||70188<=p&&p<=70190||70194<=p&&p<=70195||p==70197||70368<=p&&p<=70370||70402<=p&&p<=70403||p==70463||70465<=p&&p<=70468||70471<=p&&p<=70472||70475<=p&&p<=70477||70498<=p&&p<=70499||70709<=p&&p<=70711||70720<=p&&p<=70721||p==70725||70833<=p&&p<=70834||p==70841||70843<=p&&p<=70844||p==70846||p==70849||71088<=p&&p<=71089||71096<=p&&p<=71099||p==71102||71216<=p&&p<=71218||71227<=p&&p<=71228||p==71230||p==71340||71342<=p&&p<=71343||p==71350||71456<=p&&p<=71457||p==71462||72199<=p&&p<=72200||p==72249||72279<=p&&p<=72280||p==72343||p==72751||p==72766||p==72873||p==72881||p==72884||94033<=p&&p<=94078||p==119142||p==119149?r:4352<=p&&p<=4447||43360<=p&&p<=43388?s:4448<=p&&p<=4519||55216<=p&&p<=55238?a:4520<=p&&p<=4607||55243<=p&&p<=55291?c:p==44032||p==44060||p==44088||p==44116||p==44144||p==44172||p==44200||p==44228||p==44256||p==44284||p==44312||p==44340||p==44368||p==44396||p==44424||p==44452||p==44480||p==44508||p==44536||p==44564||p==44592||p==44620||p==44648||p==44676||p==44704||p==44732||p==44760||p==44788||p==44816||p==44844||p==44872||p==44900||p==44928||p==44956||p==44984||p==45012||p==45040||p==45068||p==45096||p==45124||p==45152||p==45180||p==45208||p==45236||p==45264||p==45292||p==45320||p==45348||p==45376||p==45404||p==45432||p==45460||p==45488||p==45516||p==45544||p==45572||p==45600||p==45628||p==45656||p==45684||p==45712||p==45740||p==45768||p==45796||p==45824||p==45852||p==45880||p==45908||p==45936||p==45964||p==45992||p==46020||p==46048||p==46076||p==46104||p==46132||p==46160||p==46188||p==46216||p==46244||p==46272||p==46300||p==46328||p==46356||p==46384||p==46412||p==46440||p==46468||p==46496||p==46524||p==46552||p==46580||p==46608||p==46636||p==46664||p==46692||p==46720||p==46748||p==46776||p==46804||p==46832||p==46860||p==46888||p==46916||p==46944||p==46972||p==47e3||p==47028||p==47056||p==47084||p==47112||p==47140||p==47168||p==47196||p==47224||p==47252||p==47280||p==47308||p==47336||p==47364||p==47392||p==47420||p==47448||p==47476||p==47504||p==47532||p==47560||p==47588||p==47616||p==47644||p==47672||p==47700||p==47728||p==47756||p==47784||p==47812||p==47840||p==47868||p==47896||p==47924||p==47952||p==47980||p==48008||p==48036||p==48064||p==48092||p==48120||p==48148||p==48176||p==48204||p==48232||p==48260||p==48288||p==48316||p==48344||p==48372||p==48400||p==48428||p==48456||p==48484||p==48512||p==48540||p==48568||p==48596||p==48624||p==48652||p==48680||p==48708||p==48736||p==48764||p==48792||p==48820||p==48848||p==48876||p==48904||p==48932||p==48960||p==48988||p==49016||p==49044||p==49072||p==49100||p==49128||p==49156||p==49184||p==49212||p==49240||p==49268||p==49296||p==49324||p==49352||p==49380||p==49408||p==49436||p==49464||p==49492||p==49520||p==49548||p==49576||p==49604||p==49632||p==49660||p==49688||p==49716||p==49744||p==49772||p==49800||p==49828||p==49856||p==49884||p==49912||p==49940||p==49968||p==49996||p==50024||p==50052||p==50080||p==50108||p==50136||p==50164||p==50192||p==50220||p==50248||p==50276||p==50304||p==50332||p==50360||p==50388||p==50416||p==50444||p==50472||p==50500||p==50528||p==50556||p==50584||p==50612||p==50640||p==50668||p==50696||p==50724||p==50752||p==50780||p==50808||p==50836||p==50864||p==50892||p==50920||p==50948||p==50976||p==51004||p==51032||p==51060||p==51088||p==51116||p==51144||p==51172||p==51200||p==51228||p==51256||p==51284||p==51312||p==51340||p==51368||p==51396||p==51424||p==51452||p==51480||p==51508||p==51536||p==51564||p==51592||p==51620||p==51648||p==51676||p==51704||p==51732||p==51760||p==51788||p==51816||p==51844||p==51872||p==51900||p==51928||p==51956||p==51984||p==52012||p==52040||p==52068||p==52096||p==52124||p==52152||p==52180||p==52208||p==52236||p==52264||p==52292||p==52320||p==52348||p==52376||p==52404||p==52432||p==52460||p==52488||p==52516||p==52544||p==52572||p==52600||p==52628||p==52656||p==52684||p==52712||p==52740||p==52768||p==52796||p==52824||p==52852||p==52880||p==52908||p==52936||p==52964||p==52992||p==53020||p==53048||p==53076||p==53104||p==53132||p==53160||p==53188||p==53216||p==53244||p==53272||p==53300||p==53328||p==53356||p==53384||p==53412||p==53440||p==53468||p==53496||p==53524||p==53552||p==53580||p==53608||p==53636||p==53664||p==53692||p==53720||p==53748||p==53776||p==53804||p==53832||p==53860||p==53888||p==53916||p==53944||p==53972||p==54e3||p==54028||p==54056||p==54084||p==54112||p==54140||p==54168||p==54196||p==54224||p==54252||p==54280||p==54308||p==54336||p==54364||p==54392||p==54420||p==54448||p==54476||p==54504||p==54532||p==54560||p==54588||p==54616||p==54644||p==54672||p==54700||p==54728||p==54756||p==54784||p==54812||p==54840||p==54868||p==54896||p==54924||p==54952||p==54980||p==55008||p==55036||p==55064||p==55092||p==55120||p==55148||p==55176?u:44033<=p&&p<=44059||44061<=p&&p<=44087||44089<=p&&p<=44115||44117<=p&&p<=44143||44145<=p&&p<=44171||44173<=p&&p<=44199||44201<=p&&p<=44227||44229<=p&&p<=44255||44257<=p&&p<=44283||44285<=p&&p<=44311||44313<=p&&p<=44339||44341<=p&&p<=44367||44369<=p&&p<=44395||44397<=p&&p<=44423||44425<=p&&p<=44451||44453<=p&&p<=44479||44481<=p&&p<=44507||44509<=p&&p<=44535||44537<=p&&p<=44563||44565<=p&&p<=44591||44593<=p&&p<=44619||44621<=p&&p<=44647||44649<=p&&p<=44675||44677<=p&&p<=44703||44705<=p&&p<=44731||44733<=p&&p<=44759||44761<=p&&p<=44787||44789<=p&&p<=44815||44817<=p&&p<=44843||44845<=p&&p<=44871||44873<=p&&p<=44899||44901<=p&&p<=44927||44929<=p&&p<=44955||44957<=p&&p<=44983||44985<=p&&p<=45011||45013<=p&&p<=45039||45041<=p&&p<=45067||45069<=p&&p<=45095||45097<=p&&p<=45123||45125<=p&&p<=45151||45153<=p&&p<=45179||45181<=p&&p<=45207||45209<=p&&p<=45235||45237<=p&&p<=45263||45265<=p&&p<=45291||45293<=p&&p<=45319||45321<=p&&p<=45347||45349<=p&&p<=45375||45377<=p&&p<=45403||45405<=p&&p<=45431||45433<=p&&p<=45459||45461<=p&&p<=45487||45489<=p&&p<=45515||45517<=p&&p<=45543||45545<=p&&p<=45571||45573<=p&&p<=45599||45601<=p&&p<=45627||45629<=p&&p<=45655||45657<=p&&p<=45683||45685<=p&&p<=45711||45713<=p&&p<=45739||45741<=p&&p<=45767||45769<=p&&p<=45795||45797<=p&&p<=45823||45825<=p&&p<=45851||45853<=p&&p<=45879||45881<=p&&p<=45907||45909<=p&&p<=45935||45937<=p&&p<=45963||45965<=p&&p<=45991||45993<=p&&p<=46019||46021<=p&&p<=46047||46049<=p&&p<=46075||46077<=p&&p<=46103||46105<=p&&p<=46131||46133<=p&&p<=46159||46161<=p&&p<=46187||46189<=p&&p<=46215||46217<=p&&p<=46243||46245<=p&&p<=46271||46273<=p&&p<=46299||46301<=p&&p<=46327||46329<=p&&p<=46355||46357<=p&&p<=46383||46385<=p&&p<=46411||46413<=p&&p<=46439||46441<=p&&p<=46467||46469<=p&&p<=46495||46497<=p&&p<=46523||46525<=p&&p<=46551||46553<=p&&p<=46579||46581<=p&&p<=46607||46609<=p&&p<=46635||46637<=p&&p<=46663||46665<=p&&p<=46691||46693<=p&&p<=46719||46721<=p&&p<=46747||46749<=p&&p<=46775||46777<=p&&p<=46803||46805<=p&&p<=46831||46833<=p&&p<=46859||46861<=p&&p<=46887||46889<=p&&p<=46915||46917<=p&&p<=46943||46945<=p&&p<=46971||46973<=p&&p<=46999||47001<=p&&p<=47027||47029<=p&&p<=47055||47057<=p&&p<=47083||47085<=p&&p<=47111||47113<=p&&p<=47139||47141<=p&&p<=47167||47169<=p&&p<=47195||47197<=p&&p<=47223||47225<=p&&p<=47251||47253<=p&&p<=47279||47281<=p&&p<=47307||47309<=p&&p<=47335||47337<=p&&p<=47363||47365<=p&&p<=47391||47393<=p&&p<=47419||47421<=p&&p<=47447||47449<=p&&p<=47475||47477<=p&&p<=47503||47505<=p&&p<=47531||47533<=p&&p<=47559||47561<=p&&p<=47587||47589<=p&&p<=47615||47617<=p&&p<=47643||47645<=p&&p<=47671||47673<=p&&p<=47699||47701<=p&&p<=47727||47729<=p&&p<=47755||47757<=p&&p<=47783||47785<=p&&p<=47811||47813<=p&&p<=47839||47841<=p&&p<=47867||47869<=p&&p<=47895||47897<=p&&p<=47923||47925<=p&&p<=47951||47953<=p&&p<=47979||47981<=p&&p<=48007||48009<=p&&p<=48035||48037<=p&&p<=48063||48065<=p&&p<=48091||48093<=p&&p<=48119||48121<=p&&p<=48147||48149<=p&&p<=48175||48177<=p&&p<=48203||48205<=p&&p<=48231||48233<=p&&p<=48259||48261<=p&&p<=48287||48289<=p&&p<=48315||48317<=p&&p<=48343||48345<=p&&p<=48371||48373<=p&&p<=48399||48401<=p&&p<=48427||48429<=p&&p<=48455||48457<=p&&p<=48483||48485<=p&&p<=48511||48513<=p&&p<=48539||48541<=p&&p<=48567||48569<=p&&p<=48595||48597<=p&&p<=48623||48625<=p&&p<=48651||48653<=p&&p<=48679||48681<=p&&p<=48707||48709<=p&&p<=48735||48737<=p&&p<=48763||48765<=p&&p<=48791||48793<=p&&p<=48819||48821<=p&&p<=48847||48849<=p&&p<=48875||48877<=p&&p<=48903||48905<=p&&p<=48931||48933<=p&&p<=48959||48961<=p&&p<=48987||48989<=p&&p<=49015||49017<=p&&p<=49043||49045<=p&&p<=49071||49073<=p&&p<=49099||49101<=p&&p<=49127||49129<=p&&p<=49155||49157<=p&&p<=49183||49185<=p&&p<=49211||49213<=p&&p<=49239||49241<=p&&p<=49267||49269<=p&&p<=49295||49297<=p&&p<=49323||49325<=p&&p<=49351||49353<=p&&p<=49379||49381<=p&&p<=49407||49409<=p&&p<=49435||49437<=p&&p<=49463||49465<=p&&p<=49491||49493<=p&&p<=49519||49521<=p&&p<=49547||49549<=p&&p<=49575||49577<=p&&p<=49603||49605<=p&&p<=49631||49633<=p&&p<=49659||49661<=p&&p<=49687||49689<=p&&p<=49715||49717<=p&&p<=49743||49745<=p&&p<=49771||49773<=p&&p<=49799||49801<=p&&p<=49827||49829<=p&&p<=49855||49857<=p&&p<=49883||49885<=p&&p<=49911||49913<=p&&p<=49939||49941<=p&&p<=49967||49969<=p&&p<=49995||49997<=p&&p<=50023||50025<=p&&p<=50051||50053<=p&&p<=50079||50081<=p&&p<=50107||50109<=p&&p<=50135||50137<=p&&p<=50163||50165<=p&&p<=50191||50193<=p&&p<=50219||50221<=p&&p<=50247||50249<=p&&p<=50275||50277<=p&&p<=50303||50305<=p&&p<=50331||50333<=p&&p<=50359||50361<=p&&p<=50387||50389<=p&&p<=50415||50417<=p&&p<=50443||50445<=p&&p<=50471||50473<=p&&p<=50499||50501<=p&&p<=50527||50529<=p&&p<=50555||50557<=p&&p<=50583||50585<=p&&p<=50611||50613<=p&&p<=50639||50641<=p&&p<=50667||50669<=p&&p<=50695||50697<=p&&p<=50723||50725<=p&&p<=50751||50753<=p&&p<=50779||50781<=p&&p<=50807||50809<=p&&p<=50835||50837<=p&&p<=50863||50865<=p&&p<=50891||50893<=p&&p<=50919||50921<=p&&p<=50947||50949<=p&&p<=50975||50977<=p&&p<=51003||51005<=p&&p<=51031||51033<=p&&p<=51059||51061<=p&&p<=51087||51089<=p&&p<=51115||51117<=p&&p<=51143||51145<=p&&p<=51171||51173<=p&&p<=51199||51201<=p&&p<=51227||51229<=p&&p<=51255||51257<=p&&p<=51283||51285<=p&&p<=51311||51313<=p&&p<=51339||51341<=p&&p<=51367||51369<=p&&p<=51395||51397<=p&&p<=51423||51425<=p&&p<=51451||51453<=p&&p<=51479||51481<=p&&p<=51507||51509<=p&&p<=51535||51537<=p&&p<=51563||51565<=p&&p<=51591||51593<=p&&p<=51619||51621<=p&&p<=51647||51649<=p&&p<=51675||51677<=p&&p<=51703||51705<=p&&p<=51731||51733<=p&&p<=51759||51761<=p&&p<=51787||51789<=p&&p<=51815||51817<=p&&p<=51843||51845<=p&&p<=51871||51873<=p&&p<=51899||51901<=p&&p<=51927||51929<=p&&p<=51955||51957<=p&&p<=51983||51985<=p&&p<=52011||52013<=p&&p<=52039||52041<=p&&p<=52067||52069<=p&&p<=52095||52097<=p&&p<=52123||52125<=p&&p<=52151||52153<=p&&p<=52179||52181<=p&&p<=52207||52209<=p&&p<=52235||52237<=p&&p<=52263||52265<=p&&p<=52291||52293<=p&&p<=52319||52321<=p&&p<=52347||52349<=p&&p<=52375||52377<=p&&p<=52403||52405<=p&&p<=52431||52433<=p&&p<=52459||52461<=p&&p<=52487||52489<=p&&p<=52515||52517<=p&&p<=52543||52545<=p&&p<=52571||52573<=p&&p<=52599||52601<=p&&p<=52627||52629<=p&&p<=52655||52657<=p&&p<=52683||52685<=p&&p<=52711||52713<=p&&p<=52739||52741<=p&&p<=52767||52769<=p&&p<=52795||52797<=p&&p<=52823||52825<=p&&p<=52851||52853<=p&&p<=52879||52881<=p&&p<=52907||52909<=p&&p<=52935||52937<=p&&p<=52963||52965<=p&&p<=52991||52993<=p&&p<=53019||53021<=p&&p<=53047||53049<=p&&p<=53075||53077<=p&&p<=53103||53105<=p&&p<=53131||53133<=p&&p<=53159||53161<=p&&p<=53187||53189<=p&&p<=53215||53217<=p&&p<=53243||53245<=p&&p<=53271||53273<=p&&p<=53299||53301<=p&&p<=53327||53329<=p&&p<=53355||53357<=p&&p<=53383||53385<=p&&p<=53411||53413<=p&&p<=53439||53441<=p&&p<=53467||53469<=p&&p<=53495||53497<=p&&p<=53523||53525<=p&&p<=53551||53553<=p&&p<=53579||53581<=p&&p<=53607||53609<=p&&p<=53635||53637<=p&&p<=53663||53665<=p&&p<=53691||53693<=p&&p<=53719||53721<=p&&p<=53747||53749<=p&&p<=53775||53777<=p&&p<=53803||53805<=p&&p<=53831||53833<=p&&p<=53859||53861<=p&&p<=53887||53889<=p&&p<=53915||53917<=p&&p<=53943||53945<=p&&p<=53971||53973<=p&&p<=53999||54001<=p&&p<=54027||54029<=p&&p<=54055||54057<=p&&p<=54083||54085<=p&&p<=54111||54113<=p&&p<=54139||54141<=p&&p<=54167||54169<=p&&p<=54195||54197<=p&&p<=54223||54225<=p&&p<=54251||54253<=p&&p<=54279||54281<=p&&p<=54307||54309<=p&&p<=54335||54337<=p&&p<=54363||54365<=p&&p<=54391||54393<=p&&p<=54419||54421<=p&&p<=54447||54449<=p&&p<=54475||54477<=p&&p<=54503||54505<=p&&p<=54531||54533<=p&&p<=54559||54561<=p&&p<=54587||54589<=p&&p<=54615||54617<=p&&p<=54643||54645<=p&&p<=54671||54673<=p&&p<=54699||54701<=p&&p<=54727||54729<=p&&p<=54755||54757<=p&&p<=54783||54785<=p&&p<=54811||54813<=p&&p<=54839||54841<=p&&p<=54867||54869<=p&&p<=54895||54897<=p&&p<=54923||54925<=p&&p<=54951||54953<=p&&p<=54979||54981<=p&&p<=55007||55009<=p&&p<=55035||55037<=p&&p<=55063||55065<=p&&p<=55091||55093<=p&&p<=55119||55121<=p&&p<=55147||55149<=p&&p<=55175||55177<=p&&p<=55203?f:p==9757||p==9977||9994<=p&&p<=9997||p==127877||127938<=p&&p<=127940||p==127943||127946<=p&&p<=127948||128066<=p&&p<=128067||128070<=p&&p<=128080||p==128110||128112<=p&&p<=128120||p==128124||128129<=p&&p<=128131||128133<=p&&p<=128135||p==128170||128372<=p&&p<=128373||p==128378||p==128400||128405<=p&&p<=128406||128581<=p&&p<=128583||128587<=p&&p<=128591||p==128675||128692<=p&&p<=128694||p==128704||p==128716||129304<=p&&p<=129308||129310<=p&&p<=129311||p==129318||129328<=p&&p<=129337||129341<=p&&p<=129342||129489<=p&&p<=129501?g:127995<=p&&p<=127999?A:p==8205?_:p==9792||p==9794||9877<=p&&p<=9878||p==9992||p==10084||p==127752||p==127806||p==127859||p==127891||p==127908||p==127912||p==127979||p==127981||p==128139||128187<=p&&p<=128188||p==128295||p==128300||p==128488||p==128640||p==128658?C:128102<=p&&p<=128105?y:h}return this}typeof ZV<"u"&&ZV.exports&&(ZV.exports=J7e)});var bCe=di(($4,ICe)=>{(function(e,t){typeof $4=="object"&&typeof ICe<"u"?t($4):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})($4,function(e){"use strict";function t(I){return I}function n(I){if(I==null)return t;var x,S,w=I.scale[0],v=I.scale[1],P=I.translate[0],N=I.translate[1];return function(L,p){p||(x=S=0);var b=2,T=L.length,B=new Array(T);for(B[0]=(x+=L[0])*w+P,B[1]=(S+=L[1])*v+N;b<T;)B[b]=L[b],++b;return B}}function i(I){var x=n(I.transform),S,w=1/0,v=w,P=-w,N=-w;function L(b){b=x(b),b[0]<w&&(w=b[0]),b[0]>P&&(P=b[0]),b[1]<v&&(v=b[1]),b[1]>N&&(N=b[1])}function p(b){switch(b.type){case"GeometryCollection":b.geometries.forEach(p);break;case"Point":L(b.coordinates);break;case"MultiPoint":b.coordinates.forEach(L);break}}I.arcs.forEach(function(b){for(var T=-1,B=b.length,R;++T<B;)R=x(b[T],T),R[0]<w&&(w=R[0]),R[0]>P&&(P=R[0]),R[1]<v&&(v=R[1]),R[1]>N&&(N=R[1])});for(S in I.objects)p(I.objects[S]);return[w,v,P,N]}function o(I,x){for(var S,w=I.length,v=w-x;v<--w;)S=I[v],I[v++]=I[w],I[w]=S}function r(I,x){return typeof x=="string"&&(x=I.objects[x]),x.type==="GeometryCollection"?{type:"FeatureCollection",features:x.geometries.map(function(S){return s(I,S)})}:s(I,x)}function s(I,x){var S=x.id,w=x.bbox,v=x.properties==null?{}:x.properties,P=a(I,x);return S==null&&w==null?{type:"Feature",properties:v,geometry:P}:w==null?{type:"Feature",id:S,properties:v,geometry:P}:{type:"Feature",id:S,bbox:w,properties:v,geometry:P}}function a(I,x){var S=n(I.transform),w=I.arcs;function v(T,B){B.length&&B.pop();for(var R=w[T<0?~T:T],O=0,U=R.length;O<U;++O)B.push(S(R[O],O));T<0&&o(B,U)}function P(T){return S(T)}function N(T){for(var B=[],R=0,O=T.length;R<O;++R)v(T[R],B);return B.length<2&&B.push(B[0]),B}function L(T){for(var B=N(T);B.length<4;)B.push(B[0]);return B}function p(T){return T.map(L)}function b(T){var B=T.type,R;switch(B){case"GeometryCollection":return{type:B,geometries:T.geometries.map(b)};case"Point":R=P(T.coordinates);break;case"MultiPoint":R=T.coordinates.map(P);break;case"LineString":R=N(T.arcs);break;case"MultiLineString":R=T.arcs.map(N);break;case"Polygon":R=p(T.arcs);break;case"MultiPolygon":R=T.arcs.map(p);break;default:return null}return{type:B,coordinates:R}}return b(x)}function c(I,x){var S={},w={},v={},P=[],N=-1;x.forEach(function(b,T){var B=I.arcs[b<0?~b:b],R;B.length<3&&!B[1][0]&&!B[1][1]&&(R=x[++N],x[N]=b,x[T]=R)}),x.forEach(function(b){var T=L(b),B=T[0],R=T[1],O,U;if(O=v[B])if(delete v[O.end],O.push(b),O.end=R,U=w[R]){delete w[U.start];var k=U===O?O:O.concat(U);w[k.start=O.start]=v[k.end=U.end]=k}else w[O.start]=v[O.end]=O;else if(O=w[R])if(delete w[O.start],O.unshift(b),O.start=B,U=v[B]){delete v[U.end];var z=U===O?O:U.concat(O);w[z.start=U.start]=v[z.end=O.end]=z}else w[O.start]=v[O.end]=O;else O=[b],w[O.start=B]=v[O.end=R]=O});function L(b){var T=I.arcs[b<0?~b:b],B=T[0],R;return I.transform?(R=[0,0],T.forEach(function(O){R[0]+=O[0],R[1]+=O[1]})):R=T[T.length-1],b<0?[R,B]:[B,R]}function p(b,T){for(var B in b){var R=b[B];delete T[R.start],delete R.start,delete R.end,R.forEach(function(O){S[O<0?~O:O]=1}),P.push(R)}}return p(v,w),p(w,v),x.forEach(function(b){S[b<0?~b:b]||P.push([b])}),P}function u(I){return a(I,f.apply(this,arguments))}function f(I,x,S){var w,v,P;if(arguments.length>1)w=h(I,x,S);else for(v=0,w=new Array(P=I.arcs.length);v<P;++v)w[v]=v;return{type:"MultiLineString",arcs:c(I,w)}}function h(I,x,S){var w=[],v=[],P;function N(B){var R=B<0?~B:B;(v[R]||(v[R]=[])).push({i:B,g:P})}function L(B){B.forEach(N)}function p(B){B.forEach(L)}function b(B){B.forEach(p)}function T(B){switch(P=B,B.type){case"GeometryCollection":B.geometries.forEach(T);break;case"LineString":L(B.arcs);break;case"MultiLineString":case"Polygon":p(B.arcs);break;case"MultiPolygon":b(B.arcs);break}}return T(x),v.forEach(S==null?function(B){w.push(B[0].i)}:function(B){S(B[0].g,B[B.length-1].g)&&w.push(B[0].i)}),w}function m(I){for(var x=-1,S=I.length,w,v=I[S-1],P=0;++x<S;)w=v,v=I[x],P+=w[0]*v[1]-w[1]*v[0];return Math.abs(P)}function g(I){return a(I,A.apply(this,arguments))}function A(I,x){var S={},w=[],v=[];x.forEach(P);function P(p){switch(p.type){case"GeometryCollection":p.geometries.forEach(P);break;case"Polygon":N(p.arcs);break;case"MultiPolygon":p.arcs.forEach(N);break}}function N(p){p.forEach(function(b){b.forEach(function(T){(S[T=T<0?~T:T]||(S[T]=[])).push(p)})}),w.push(p)}function L(p){return m(a(I,{type:"Polygon",arcs:[p]}).coordinates[0])}return w.forEach(function(p){if(!p._){var b=[],T=[p];for(p._=1,v.push(b);p=T.pop();)b.push(p),p.forEach(function(B){B.forEach(function(R){S[R<0?~R:R].forEach(function(O){O._||(O._=1,T.push(O))})})})}}),w.forEach(function(p){delete p._}),{type:"MultiPolygon",arcs:v.map(function(p){var b=[],T;if(p.forEach(function(k){k.forEach(function(z){z.forEach(function(Q){S[Q<0?~Q:Q].length<2&&b.push(Q)})})}),b=c(I,b),(T=b.length)>1)for(var B=1,R=L(b[0]),O,U;B<T;++B)(O=L(b[B]))>R&&(U=b[0],b[0]=b[B],b[B]=U,R=O);return b}).filter(function(p){return p.length>0})}}function _(I,x){for(var S=0,w=I.length;S<w;){var v=S+w>>>1;I[v]<x?S=v+1:w=v}return S}function C(I){var x={},S=I.map(function(){return[]});function w(k,z){k.forEach(function(Q){Q<0&&(Q=~Q);var H=x[Q];H?H.push(z):x[Q]=[z]})}function v(k,z){k.forEach(function(Q){w(Q,z)})}function P(k,z){k.type==="GeometryCollection"?k.geometries.forEach(function(Q){P(Q,z)}):k.type in N&&N[k.type](k.arcs,z)}var N={LineString:w,MultiLineString:v,Polygon:v,MultiPolygon:function(k,z){k.forEach(function(Q){v(Q,z)})}};I.forEach(P);for(var L in x)for(var p=x[L],b=p.length,T=0;T<b;++T)for(var B=T+1;B<b;++B){var R=p[T],O=p[B],U;(U=S[R])[L=_(U,O)]!==O&&U.splice(L,0,O),(U=S[O])[L=_(U,R)]!==R&&U.splice(L,0,R)}return S}function y(I){if(I==null)return t;var x,S,w=I.scale[0],v=I.scale[1],P=I.translate[0],N=I.translate[1];return function(L,p){p||(x=S=0);var b=2,T=L.length,B=new Array(T),R=Math.round((L[0]-P)/w),O=Math.round((L[1]-N)/v);for(B[0]=R-x,x=R,B[1]=O-S,S=O;b<T;)B[b]=L[b],++b;return B}}function E(I,x){if(I.transform)throw new Error("already quantized");if(!x||!x.scale){if(!((N=Math.floor(x))>=2))throw new Error("n must be \u22652");p=I.bbox||i(I);var S=p[0],w=p[1],v=p[2],P=p[3],N;x={scale:[v-S?(v-S)/(N-1):1,P-w?(P-w)/(N-1):1],translate:[S,w]}}else p=I.bbox;var L=y(x),p,b,T=I.objects,B={};function R(k){return L(k)}function O(k){var z;switch(k.type){case"GeometryCollection":z={type:"GeometryCollection",geometries:k.geometries.map(O)};break;case"Point":z={type:"Point",coordinates:R(k.coordinates)};break;case"MultiPoint":z={type:"MultiPoint",coordinates:k.coordinates.map(R)};break;default:return k}return k.id!=null&&(z.id=k.id),k.bbox!=null&&(z.bbox=k.bbox),k.properties!=null&&(z.properties=k.properties),z}function U(k){var z=0,Q=1,H=k.length,W,Z=new Array(H);for(Z[0]=L(k[0],0);++z<H;)((W=L(k[z],z))[0]||W[1])&&(Z[Q++]=W);return Q===1&&(Z[Q++]=[0,0]),Z.length=Q,Z}for(b in T)B[b]=O(T[b]);return{type:"Topology",bbox:p,transform:x,objects:B,arcs:I.arcs.map(U)}}e.bbox=i,e.feature=r,e.merge=g,e.mergeArcs=A,e.mesh=u,e.meshArcs=f,e.neighbors=C,e.quantize=E,e.transform=n,e.untransform=y,Object.defineProperty(e,"__esModule",{value:!0})})});var CA={};cne(CA,{__addDisposableResource:()=>hye,__assign:()=>nH,__asyncDelegator:()=>rye,__asyncGenerator:()=>oye,__asyncValues:()=>sye,__await:()=>KS,__awaiter:()=>ZCe,__classPrivateFieldGet:()=>uye,__classPrivateFieldIn:()=>dye,__classPrivateFieldSet:()=>fye,__createBinding:()=>oH,__decorate:()=>YCe,__disposeResources:()=>Aye,__esDecorate:()=>jCe,__exportStar:()=>eye,__extends:()=>VCe,__generator:()=>$Ce,__importDefault:()=>lye,__importStar:()=>cye,__makeTemplateObject:()=>aye,__metadata:()=>XCe,__param:()=>WCe,__propKey:()=>KCe,__read:()=>TJ,__rest:()=>HCe,__rewriteRelativeImportExtension:()=>mye,__runInitializers:()=>qCe,__setFunctionName:()=>JCe,__spread:()=>tye,__spreadArray:()=>iye,__spreadArrays:()=>nye,__values:()=>iH,default:()=>Llt});function VCe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");bJ(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function HCe(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function YCe(e,t,n,i){var o=arguments.length,r=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function WCe(e,t){return function(n,i){t(n,i,e)}}function jCe(e,t,n,i,o,r){function s(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),h,m=!1,g=n.length-1;g>=0;g--){var A={};for(var _ in i)A[_]=_==="access"?{}:i[_];for(var _ in i.access)A.access[_]=i.access[_];A.addInitializer=function(y){if(m)throw new TypeError("Cannot add initializers after decoration has completed");r.push(s(y||null))};var C=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[c],A);if(a==="accessor"){if(C===void 0)continue;if(C===null||typeof C!="object")throw new TypeError("Object expected");(h=s(C.get))&&(f.get=h),(h=s(C.set))&&(f.set=h),(h=s(C.init))&&o.unshift(h)}else(h=s(C))&&(a==="field"?o.unshift(h):f[c]=h)}u&&Object.defineProperty(u,i.name,f),m=!0}function qCe(e,t,n){for(var i=arguments.length>2,o=0;o<t.length;o++)n=i?t[o].call(e,n):t[o].call(e);return i?n:void 0}function KCe(e){return typeof e=="symbol"?e:"".concat(e)}function JCe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function XCe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function ZCe(e,t,n,i){function o(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function a(f){try{u(i.next(f))}catch(h){s(h)}}function c(f){try{u(i.throw(f))}catch(h){s(h)}}function u(f){f.done?r(f.value):o(f.value).then(a,c)}u((i=i.apply(e,t||[])).next())})}function $Ce(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){n.label=u[1];break}if(u[0]===6&&n.label<r[1]){n.label=r[1],r=u;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(u);break}r[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function eye(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&oH(t,e,n)}function iH(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function TJ(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 tye(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(TJ(arguments[t]));return e}function nye(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),o=0,t=0;t<n;t++)for(var r=arguments[t],s=0,a=r.length;s<a;s++,o++)i[o]=r[s];return i}function iye(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))}function KS(e){return this instanceof KS?(this.v=e,this):new KS(e)}function oye(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),o,r=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(g){return function(A){return Promise.resolve(A).then(g,h)}}function a(g,A){i[g]&&(o[g]=function(_){return new Promise(function(C,y){r.push([g,_,C,y])>1||c(g,_)})},A&&(o[g]=A(o[g])))}function c(g,A){try{u(i[g](A))}catch(_){m(r[0][3],_)}}function u(g){g.value instanceof KS?Promise.resolve(g.value.v).then(f,h):m(r[0][2],g)}function f(g){c("next",g)}function h(g){c("throw",g)}function m(g,A){g(A),r.shift(),r.length&&c(r[0][0],r[0][1])}}function rye(e){var t,n;return t={},i("next"),i("throw",function(o){throw o}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(o,r){t[o]=e[o]?function(s){return(n=!n)?{value:KS(e[o](s)),done:!1}:r?r(s):s}:r}}function sye(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof iH=="function"?iH(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=e[r]&&function(s){return new Promise(function(a,c){s=e[r](s),o(a,c,s.done,s.value)})}}function o(r,s,a,c){Promise.resolve(c).then(function(u){r({value:u,done:a})},s)}}function aye(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function cye(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=xJ(e),i=0;i<n.length;i++)n[i]!=="default"&&oH(t,e,n[i]);return Mlt(t,e),t}function lye(e){return e&&e.__esModule?e:{default:e}}function uye(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function fye(e,t,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function dye(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function hye(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(o=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");o&&(i=function(){try{o.call(this)}catch(r){return Promise.reject(r)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function Aye(e){function t(r){e.error=e.hasError?new Nlt(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}var n,i=0;function o(){for(;n=e.stack.pop();)try{if(!n.async&&i===1)return i=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var r=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(r).then(o,function(s){return t(s),o()})}else i|=1}catch(s){t(s)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function mye(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,o,r,s){return i?t?".jsx":".js":o&&(!r||!s)?n:o+r+"."+s.toLowerCase()+"js"}):e}var bJ,nH,oH,Mlt,xJ,Nlt,Llt,yA=IDe(()=>{bJ=function(e,t){return bJ=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])},bJ(e,t)};nH=function(){return nH=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},nH.apply(this,arguments)};oH=Object.create?(function(e,t,n,i){i===void 0&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]});Mlt=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},xJ=function(e){return xJ=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},xJ(e)};Nlt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};Llt={__extends:VCe,__assign:nH,__rest:HCe,__decorate:YCe,__param:WCe,__esDecorate:jCe,__runInitializers:qCe,__propKey:KCe,__setFunctionName:JCe,__metadata:XCe,__awaiter:ZCe,__generator:$Ce,__createBinding:oH,__exportStar:eye,__values:iH,__read:TJ,__spread:tye,__spreadArrays:nye,__spreadArray:iye,__await:KS,__asyncGenerator:oye,__asyncDelegator:rye,__asyncValues:sye,__makeTemplateObject:aye,__importStar:cye,__importDefault:lye,__classPrivateFieldGet:uye,__classPrivateFieldSet:fye,__classPrivateFieldIn:dye,__addDisposableResource:hye,__disposeResources:Aye,__rewriteRelativeImportExtension:mye}});var pye=di(rH=>{"use strict";Object.defineProperty(rH,"__esModule",{value:!0});rH.version=void 0;rH.version="4.1.5"});var py=di(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.hasOwnProperty=void 0;my.isBoolean=Olt;my.ellipsis=Flt;my.removeWithPredicate=Qlt;my.assertNever=klt;my.hasOwnProperty=Object.prototype.hasOwnProperty;function Olt(e){return typeof e=="boolean"}function Flt(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 Qlt(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function klt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var sH=di(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.HtmlTag=Nm.whitespaceRe=void 0;var Ult=py();Nm.whitespaceRe=/\s+/;var Glt=(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(Nm.whitespaceRe):[],o=t.split(Nm.whitespaceRe),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(Nm.whitespaceRe):[],o=t.split(Nm.whitespaceRe),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)Ult.hasOwnProperty.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();Nm.HtmlTag=Glt});var _ye=di(BJ=>{"use strict";Object.defineProperty(BJ,"__esModule",{value:!0});BJ.truncateSmart=zlt;function zlt(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=Vlt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=gye(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=gye(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):SJ(c,r,n).substr(0,r+i);var u="";if(s.path&&(u+="/"+s.path),s.query&&(u+="?"+s.query),u)if((c+u).length>=r){if((c+u).length==t)return(c+u).substr(0,t);var f=r-c.length;return(c+SJ(u,f,n)).substr(0,r+i)}else c+=u;if(s.fragment){var h="#"+s.fragment;if((c+h).length>=r){if((c+h).length==t)return(c+h).substr(0,t);var m=r-c.length;return(c+SJ(h,m,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 A="";return r>0&&(A=c.substr(-1*Math.floor(r/2))),(c.substr(0,Math.ceil(r/2))+n+A).substr(0,r+i)}function Vlt(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 gye(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 SJ(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 Cye=di(wJ=>{"use strict";Object.defineProperty(wJ,"__esModule",{value:!0});wJ.truncateMiddle=Hlt;function Hlt(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 yye=di(DJ=>{"use strict";Object.defineProperty(DJ,"__esModule",{value:!0});DJ.truncateEnd=Wlt;var Ylt=py();function Wlt(e,t,n){return(0,Ylt.ellipsis)(e,t,n)}});var vJ=di(aH=>{"use strict";Object.defineProperty(aH,"__esModule",{value:!0});aH.AnchorTagBuilder=void 0;var jlt=sH(),qlt=_ye(),Klt=Cye(),Jlt=yye(),Xlt=(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 jlt.HtmlTag({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"?(0,qlt.truncateSmart)(t,i):o==="middle"?(0,Klt.truncateMiddle)(t,i):(0,Jlt.truncateEnd)(t,i)},e})();aH.AnchorTagBuilder=Xlt});var B0=di(cH=>{"use strict";Object.defineProperty(cH,"__esModule",{value:!0});cH.AbstractMatch=void 0;var Zlt=(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})();cH.AbstractMatch=Zlt});var w0=di(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.isControlChar=$lt;Bf.isAsciiLetterChar=eut;Bf.isDigitChar=tut;Bf.isQuoteChar=nut;Bf.isWhitespaceChar=iut;Bf.isAlphaNumericOrMarkChar=out;Bf.isValidEmailLocalPartSpecialChar=rut;Bf.isUrlSuffixAllowedSpecialChar=sut;Bf.isUrlSuffixNotAllowedAsFinalChar=aut;Bf.isOpenBraceChar=cut;Bf.isCloseBraceChar=lut;function $lt(e){return e>=0&&e<=31||e==127}function eut(e){return e>=65&&e<=90||e>=97&&e<=122}function tut(e){return e>=48&&e<=57}function nut(e){return e==34||e==39}function iut(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 out(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 rut(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 sut(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 aut(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function cut(e){return e<91?e==40:e==91||e==123}function lut(e){return e<93?e==41:e==93||e==125}});var Eye=di(lH=>{"use strict";Object.defineProperty(lH,"__esModule",{value:!0});lH.tldRegex=void 0;lH.tldRegex=/^(?: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 uH=di(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.isDomainLabelStartChar=Jo.isSchemeStartChar=Jo.tldUrlHostRe=Jo.schemeUrlRe=Jo.invalidSchemeRe=Jo.httpSchemePrefixRe=Jo.httpSchemeRe=void 0;Jo.isSchemeChar=fut;Jo.isDomainLabelChar=dut;Jo.isPathChar=hut;Jo.isUrlSuffixStartChar=Aut;Jo.isKnownTld=Iye;Jo.isValidSchemeUrl=mut;Jo.isValidTldMatch=put;Jo.isValidIpV4Address=Cut;var D0=w0(),uut=Eye();Jo.httpSchemeRe=/https?:\/\//i;Jo.httpSchemePrefixRe=new RegExp("^"+Jo.httpSchemeRe.source,"i");Jo.invalidSchemeRe=/^(javascript|vbscript):/i;Jo.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Jo.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;Jo.isSchemeStartChar=D0.isAsciiLetterChar;function fut(e){return(0,D0.isAsciiLetterChar)(e)||(0,D0.isDigitChar)(e)||e===43||e===45||e===46}Jo.isDomainLabelStartChar=D0.isAlphaNumericOrMarkChar;function dut(e){return e===95||(0,Jo.isDomainLabelStartChar)(e)}function hut(e){return(0,D0.isAlphaNumericOrMarkChar)(e)||(0,D0.isUrlSuffixAllowedSpecialChar)(e)||(0,D0.isUrlSuffixNotAllowedAsFinalChar)(e)}function Aut(e){return e===47||e===63||e===35}function Iye(e){return uut.tldRegex.test(e.toLowerCase())}function mut(e){if(Jo.invalidSchemeRe.test(e))return!1;var t=e.match(Jo.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function put(e){var t=e.match(Jo.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!Iye(o)}var gut=/^(?:(?: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]?)$/,_ut=/[:/?#]/;function Cut(e){var t=e.split(_ut,1)[0];return gut.test(t)}});var PJ=di(fH=>{"use strict";Object.defineProperty(fH,"__esModule",{value:!0});fH.UrlMatch=void 0;var yut=(yA(),fh(CA)),Eut=B0(),Iut=uH(),but=/^(https?:\/\/)?(?:www\.)?/i,xut=/^\/\//,Tut=(function(e){yut.__extends(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=wut(n)),this.stripPrefix.scheme&&(n=Sut(n)),this.stripPrefix.www&&(n=But(n)),this.stripTrailingSlash&&(n=Dut(n)),this.decodePercentEncoding&&(n=vut(n)),n},t})(Eut.AbstractMatch);fH.UrlMatch=Tut;function Sut(e){return e.replace(Iut.httpSchemePrefixRe,"")}function But(e){return e.includes("www.")?e.replace(but,"$1"):e}function wut(e){return e.replace(xut,"")}function Dut(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function vut(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 xye=di(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});e_.isEmailLocalPartStartChar=e_.mailtoSchemePrefixRe=void 0;e_.isEmailLocalPartChar=Rut;e_.isValidEmail=Mut;var bye=w0(),Put=uH();e_.mailtoSchemePrefixRe=/^mailto:/i;e_.isEmailLocalPartStartChar=bye.isAlphaNumericOrMarkChar;function Rut(e){return(0,e_.isEmailLocalPartStartChar)(e)||(0,bye.isValidEmailLocalPartSpecialChar)(e)}function Mut(e){var t=e.split(".").pop();return(0,Put.isKnownTld)(t)}});var RJ=di(dH=>{"use strict";Object.defineProperty(dH,"__esModule",{value:!0});dH.EmailMatch=void 0;var Nut=(yA(),fh(CA)),Lut=B0(),Out=(function(e){Nut.__extends(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})(Lut.AbstractMatch);dH.EmailMatch=Out});var MJ=di(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});JS.hashtagServices=void 0;JS.isHashtagTextChar=Qut;JS.isValidHashtag=kut;var Fut=w0();function Qut(e){return e===95||(0,Fut.isAlphaNumericOrMarkChar)(e)}function kut(e){return e.length<=140}JS.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var NJ=di(hH=>{"use strict";Object.defineProperty(hH,"__esModule",{value:!0});hH.HashtagMatch=void 0;var Uut=(yA(),fh(CA)),Gut=py(),zut=B0(),Vut=(function(e){Uut.__extends(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:(0,Gut.assertNever)(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})(zut.AbstractMatch);hH.HashtagMatch=Vut});var LJ=di(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});XS.mentionServices=void 0;XS.isMentionTextChar=Yut;XS.isValidMention=Wut;var Tye=w0(),Hut={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function Yut(e){return e===45||e===46||e===95||(0,Tye.isAsciiLetterChar)(e)||(0,Tye.isDigitChar)(e)}function Wut(e,t){var n=Hut[t];return n.test(e)}XS.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var OJ=di(AH=>{"use strict";Object.defineProperty(AH,"__esModule",{value:!0});AH.MentionMatch=void 0;var jut=(yA(),fh(CA)),qut=py(),Kut=B0(),Jut=(function(e){jut.__extends(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:(0,qut.assertNever)(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})(Kut.AbstractMatch);AH.MentionMatch=Jut});var Sye=di(cQ=>{"use strict";Object.defineProperty(cQ,"__esModule",{value:!0});cQ.isPhoneNumberSeparatorChar=tft;cQ.isPhoneNumberControlChar=nft;cQ.isValidPhoneNumber=ift;var Xut=/[-. ()]/,Zut=/(?:(?:(?:(\+)?\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]+#?)*/,$ut=/(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})/,eft=new RegExp("^".concat(Zut.source,"|").concat($ut.source,"$"));function tft(e){return e===45||e===46||e===32}function nft(e){return e===44||e===59}function ift(e){var t=e.charAt(0)==="+"||Xut.test(e);return t&&eft.test(e)}});var FJ=di(mH=>{"use strict";Object.defineProperty(mH,"__esModule",{value:!0});mH.PhoneMatch=void 0;var oft=(yA(),fh(CA)),rft=B0(),sft=(function(e){oft.__extends(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})(rft.AbstractMatch);mH.PhoneMatch=sft});var zJ=di(CH=>{"use strict";Object.defineProperty(CH,"__esModule",{value:!0});CH.parseMatches=hft;CH.excludeUnbalancedTrailingBracesAndPunctuation=Dye;var aft=PJ(),pH=py(),Sr=uH(),ZS=xye(),cft=RJ(),UJ=MJ(),lft=NJ(),GJ=LJ(),uft=OJ(),$S=Sye(),fft=FJ(),js=w0(),dft=(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),wye(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),wye(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function hft(e,t){for(var n=new dft(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)gH(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var s=n.stateMachines[r];switch(s.state){case 11:Cft(n,s,o);break;case 12:yft(n,s,o);break;case 0:Aft(n,s,o);break;case 1:mft(n,s,o);break;case 2:pft(n,s,o);break;case 3:gft(n,s,o);break;case 4:_ft(n,s,i,o);break;case 5:Eft(n,s,o);break;case 6:Ift(n,s,i,o);break;case 7:bft(n,s,i,o);break;case 13:xft(n,s,o);break;case 14:Tft(n,s,o);break;case 8:Sft(n,s,o);break;case 9:Bft(n,s,o);break;case 10:wft(n,s,o);break;case 15:Dft(n,s,i,o);break;case 16:vft(n,s,i,o);break;case 17:Pft(n,s,i,o);break;case 18:Rft(n,s,i,o);break;case 19:Mft(n,s,i,o);break;case 20:Nft(n,s,o);break;case 21:Lft(n,s,o);break;case 22:v0(n,s,o);break;case 23:Oft(n,s,o);break;case 24:Fft(n,s,o);break;case 25:Qft(n,s,o);break;case 26:kft(n,s,o);break;case 27:Uft(n,s,o);break;case 28:Gft(n,s,o);break;case 29:zft(n,s,o);break;case 30:Vft(n,s,o);break;case 31:Hft(n,s,o);break;case 32:Wft(n,s,i,o);break;case 33:jft(n,s,o);break;case 34:qft(n,s,o);break;case 35:Kft(n,s,o);break;case 36:Jft(n,s,i,o);break;case 37:Yft(n,s,i,o);break;case 38:Xft(n,s,i,o);break;case 39:Zft(n,s,i,o);break;case 40:$ft(n,s,o);break;case 41:edt(n,s,o);break;default:(0,pH.assertNever)(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&(0,Sr.isSchemeStartChar)(o)){var a=n.text.charCodeAt(n.charIdx-1);(0,Sr.isSchemeStartChar)(a)||n.addMachine(_H(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return Cs(n,u)});return n.matches}function gH(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(odt(i,28));else if(n===64)e.addMachine(rdt(i,30));else if(n===47)e.addMachine(kJ(i,11));else if(n===43)e.addMachine(QJ(i,37));else if(n===40)e.addMachine(QJ(i,32));else{if((0,js.isDigitChar)(n)&&(e.addMachine(QJ(i,38)),e.addMachine(ndt(i,13))),(0,ZS.isEmailLocalPartStartChar)(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(idt(i,o))}(0,Sr.isSchemeStartChar)(n)&&e.addMachine(_H(i,0)),(0,js.isAlphaNumericOrMarkChar)(n)&&e.addMachine(kJ(i,5))}}function Aft(e,t,n){n===58?t.state=2:n===45?t.state=1:(0,Sr.isSchemeChar)(n)||e.removeMachine(t)}function mft(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(kJ(i,11))):(0,Sr.isSchemeChar)(n)?t.state=0:e.removeMachine(t))}function pft(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):(0,Sr.isDomainLabelStartChar)(n)?(t.state=5,(0,Sr.isSchemeStartChar)(n)&&e.addMachine(_H(i,0))):e.removeMachine(t)}function gft(e,t,n){n===47?t.state=4:(0,Sr.isPathChar)(n)?(t.state=10,t.acceptStateReached=!0):Cs(e,t)}function _ft(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):(0,Sr.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function Cft(e,t,n){n===47?t.state=12:e.removeMachine(t)}function yft(e,t,n){(0,Sr.isDomainLabelStartChar)(n)?t.state=5:e.removeMachine(t)}function Eft(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:(0,Sr.isUrlSuffixStartChar)(n)?t.state=10:(0,Sr.isDomainLabelChar)(n)||Cs(e,t)}function Ift(e,t,n,i){i===45||(i===46?Cs(e,t):(0,Sr.isDomainLabelStartChar)(i)?t.state=5:Cs(e,t))}function bft(e,t,n,i){i===46?Cs(e,t):(0,Sr.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):Cs(e,t)}function xft(e,t,n){n===46?t.state=14:n===58?t.state=8:(0,js.isDigitChar)(n)||((0,Sr.isUrlSuffixStartChar)(n)?t.state=10:(0,js.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Cs(e,t))}function Tft(e,t,n){(0,js.isDigitChar)(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Cs(e,t)}function Sft(e,t,n){(0,js.isDigitChar)(n)?t.state=9:Cs(e,t)}function Bft(e,t,n){(0,js.isDigitChar)(n)||((0,Sr.isUrlSuffixStartChar)(n)?t.state=10:Cs(e,t))}function wft(e,t,n){(0,Sr.isPathChar)(n)||Cs(e,t)}function Dft(e,t,n,i){n.toLowerCase()==="a"?t.state=16:v0(e,t,i)}function vft(e,t,n,i){n.toLowerCase()==="i"?t.state=17:v0(e,t,i)}function Pft(e,t,n,i){n.toLowerCase()==="l"?t.state=18:v0(e,t,i)}function Rft(e,t,n,i){n.toLowerCase()==="t"?t.state=19:v0(e,t,i)}function Mft(e,t,n,i){n.toLowerCase()==="o"?t.state=20:v0(e,t,i)}function Nft(e,t,n){n===58?t.state=21:v0(e,t,n)}function Lft(e,t,n){(0,ZS.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function v0(e,t,n){n===46?t.state=23:n===64?t.state=24:(0,ZS.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function Oft(e,t,n){n===46||n===64?e.removeMachine(t):(0,ZS.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function Fft(e,t,n){(0,Sr.isDomainLabelStartChar)(n)?t.state=25:e.removeMachine(t)}function Qft(e,t,n){n===46?t.state=27:n===45?t.state=26:(0,Sr.isDomainLabelChar)(n)||Cs(e,t)}function kft(e,t,n){n===45||n===46?Cs(e,t):(0,Sr.isDomainLabelChar)(n)?t.state=25:Cs(e,t)}function Uft(e,t,n){n===46||n===45?Cs(e,t):(0,Sr.isDomainLabelStartChar)(n)?(t.state=25,t.acceptStateReached=!0):Cs(e,t)}function Gft(e,t,n){(0,UJ.isHashtagTextChar)(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function zft(e,t,n){(0,UJ.isHashtagTextChar)(n)||Cs(e,t)}function Vft(e,t,n){(0,GJ.isMentionTextChar)(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function Hft(e,t,n){(0,GJ.isMentionTextChar)(n)||((0,js.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Cs(e,t))}function Yft(e,t,n,i){(0,js.isDigitChar)(i)?t.state=38:(e.removeMachine(t),gH(e,n,i))}function Wft(e,t,n,i){(0,js.isDigitChar)(i)?t.state=33:e.removeMachine(t),gH(e,n,i)}function jft(e,t,n){(0,js.isDigitChar)(n)?t.state=34:e.removeMachine(t)}function qft(e,t,n){(0,js.isDigitChar)(n)?t.state=35:e.removeMachine(t)}function Kft(e,t,n){n===41?t.state=36:e.removeMachine(t)}function Jft(e,t,n,i){(0,js.isDigitChar)(i)?t.state=38:(0,$S.isPhoneNumberSeparatorChar)(i)?t.state=39:e.removeMachine(t)}function Xft(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,(0,$S.isPhoneNumberControlChar)(i)?t.state=40:i===35?t.state=41:(0,js.isDigitChar)(i)||(i===40?t.state=32:(0,$S.isPhoneNumberSeparatorChar)(i)?t.state=39:(Cs(e,t),(0,Sr.isSchemeStartChar)(i)&&e.addMachine(_H(o,0))))}function Zft(e,t,n,i){(0,js.isDigitChar)(i)?t.state=38:i===40?t.state=32:(Cs(e,t),gH(e,n,i))}function $ft(e,t,n){(0,$S.isPhoneNumberControlChar)(n)||(n===35?t.state=41:(0,js.isDigitChar)(n)?t.state=38:Cs(e,t))}function edt(e,t,n){(0,$S.isPhoneNumberControlChar)(n)?t.state=40:(0,js.isDigitChar)(n)?e.removeMachine(t):Cs(e,t)}function Cs(e,t){var n=e.matches,i=e.text,o=e.charIdx,r=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var h=t.startIdx,m=i.slice(t.startIdx,o);switch(m=Dye(m),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var A=Sr.httpSchemeRe.exec(m);if(A&&(h=h+A.index,m=m.slice(A.index)),!(0,Sr.isValidSchemeUrl)(m))return;break}case 1:{if(!(0,Sr.isValidTldMatch)(m))return;break}case 2:{if(!(0,Sr.isValidIpV4Address)(m))return;break}default:(0,pH.assertNever)(t)}n.push(new aft.UrlMatch({tagBuilder:r,matchedText:m,offset:h,urlMatchType:tdt(t.matchType),url:m,protocolRelativeMatch:m.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{(0,ZS.isValidEmail)(m)&&n.push(new cft.EmailMatch({tagBuilder:r,matchedText:m,offset:h,email:m.replace(ZS.mailtoSchemePrefixRe,"")}));break}case 2:{(0,UJ.isValidHashtag)(m)&&n.push(new lft.HashtagMatch({tagBuilder:r,matchedText:m,offset:h,serviceName:u,hashtag:m.slice(1)}));break}case 3:{(0,GJ.isValidMention)(m,f)&&n.push(new uft.MentionMatch({tagBuilder:r,matchedText:m,offset:h,serviceName:f,mention:m.slice(1)}));break}case 4:{if(m=m.replace(/ +$/g,""),(0,$S.isValidPhoneNumber)(m)){var _=m.replace(/[^0-9,;#]/g,"");n.push(new fft.PhoneMatch({tagBuilder:r,matchedText:m,offset:h,number:_,plusSign:m.charAt(0)==="+"}))}break}default:(0,pH.assertNever)(t)}}}function tdt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:(0,pH.assertNever)(e)}}var Bye={")":"(","}":"{","]":"["};function Dye(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);(0,js.isOpenBraceChar)(o)?t[i]++:(0,js.isCloseBraceChar)(o)&&t[Bye[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if((0,js.isCloseBraceChar)(o)){var s=Bye[i];if(t[s]<0)t[s]++,r--;else break}else if((0,js.isUrlSuffixNotAllowedAsFinalChar)(o))r--;else break}return e.slice(0,r+1)}function _H(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function kJ(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function ndt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function idt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function odt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function rdt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function QJ(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function wye(e){return e.type===0&&e.matchType===0}});var vye=di(YJ=>{"use strict";Object.defineProperty(YJ,"__esModule",{value:!0});YJ.parseHtml=cdt;var nl=(yA(),fh(CA)),Wl=w0(),sdt=py(),Lm=(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})(),HJ=new Lm,adt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=HJ,this.html=t,this.callbacks=n}return e})();function cdt(e,t){for(var n=new adt(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:ldt(n,o);break;case 1:udt(n,o,r);break;case 2:ddt(n,o,r);break;case 3:fdt(n,o,r);break;case 4:hdt(n,o,r);break;case 5:Adt(n,o,r);break;case 6:mdt(n,o,r);break;case 7:pdt(n,o,r);break;case 8:gdt(n,o);break;case 9:_dt(n,o);break;case 10:Cdt(n,o,r);break;case 11:ydt(n,o,r);break;case 12:Edt(n,o);break;case 13:Idt(n);break;case 14:bdt(n,o);break;case 15:xdt(n,o);break;case 16:Tdt(n,o);break;case 17:Sdt(n,o);break;case 18:Bdt(n,o);break;case 19:wdt(n,o);break;case 20:Ddt(n,o);break;default:(0,sdt.assertNever)(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&vdt(n)}function ldt(e,t){t==="<"&&Om(e)}function udt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new Lm(nl.__assign(nl.__assign({},e.currentTag),{isClosing:!0}))):t==="<"?Om(e):(0,Wl.isAsciiLetterChar)(n)?(e.state=3,e.currentTag=new Lm(nl.__assign(nl.__assign({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=HJ)}function fdt(e,t,n){(0,Wl.isWhitespaceChar)(n)?(e.currentTag=new Lm(nl.__assign(nl.__assign({},e.currentTag),{name:VJ(e)})),e.state=4):t==="<"?Om(e):t==="/"?(e.currentTag=new Lm(nl.__assign(nl.__assign({},e.currentTag),{name:VJ(e)})),e.state=12):t===">"?(e.currentTag=new Lm(nl.__assign(nl.__assign({},e.currentTag),{name:VJ(e)})),Fm(e)):!(0,Wl.isAsciiLetterChar)(n)&&!(0,Wl.isDigitChar)(n)&&t!==":"&&Vd(e)}function ddt(e,t,n){t===">"?Vd(e):(0,Wl.isAsciiLetterChar)(n)?e.state=3:Vd(e)}function hdt(e,t,n){(0,Wl.isWhitespaceChar)(n)||(t==="/"?e.state=12:t===">"?Fm(e):t==="<"?Om(e):t==="="||(0,Wl.isQuoteChar)(n)||(0,Wl.isControlChar)(n)?Vd(e):e.state=5)}function Adt(e,t,n){(0,Wl.isWhitespaceChar)(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?Fm(e):t==="<"?Om(e):(0,Wl.isQuoteChar)(n)&&Vd(e)}function mdt(e,t,n){(0,Wl.isWhitespaceChar)(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?Fm(e):t==="<"?Om(e):(0,Wl.isQuoteChar)(n)?Vd(e):e.state=5)}function pdt(e,t,n){(0,Wl.isWhitespaceChar)(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Vd(e):t==="<"?Om(e):e.state=10)}function gdt(e,t){t==='"'&&(e.state=11)}function _dt(e,t){t==="'"&&(e.state=11)}function Cdt(e,t,n){(0,Wl.isWhitespaceChar)(n)?e.state=4:t===">"?Fm(e):t==="<"&&Om(e)}function ydt(e,t,n){(0,Wl.isWhitespaceChar)(n)?e.state=4:t==="/"?e.state=12:t===">"?Fm(e):t==="<"?Om(e):(e.state=4,Pdt(e))}function Edt(e,t){t===">"?(e.currentTag=new Lm(nl.__assign(nl.__assign({},e.currentTag),{isClosing:!0})),Fm(e)):Vd(e)}function Idt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new Lm(nl.__assign(nl.__assign({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new Lm(nl.__assign(nl.__assign({},e.currentTag),{type:"doctype"})),e.state=20):Vd(e)}function bdt(e,t){t==="-"?e.state=15:t===">"?Vd(e):e.state=16}function xdt(e,t){t==="-"?e.state=18:t===">"?Vd(e):e.state=16}function Tdt(e,t){t==="-"&&(e.state=17)}function Sdt(e,t){t==="-"?e.state=18:e.state=16}function Bdt(e,t){t===">"?Fm(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function wdt(e,t){t==="-"?e.state=17:t===">"?Fm(e):e.state=16}function Ddt(e,t){t===">"?Fm(e):t==="<"&&Om(e)}function Vd(e){e.state=0,e.currentTag=HJ}function Om(e){e.state=1,e.currentTag=new Lm({idx:e.charIdx})}function Fm(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)),Vd(e),e.currentDataIdx=e.charIdx+1}function vdt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function VJ(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function Pdt(e){e.charIdx--}});var yH=di(jJ=>{"use strict";Object.defineProperty(jJ,"__esModule",{value:!0});var WJ=(yA(),fh(CA)),Rdt=pye(),Pa=py(),Mdt=vJ(),Ndt=sH(),Ldt=zJ(),Odt=vye(),Fdt=LJ(),Qdt=MJ(),kdt=(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=Udt(t.urls),this.email=(0,Pa.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Pa.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Pa.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Gdt(t.stripPrefix),this.stripTrailingSlash=(0,Pa.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Pa.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Fdt.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Qdt.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=zdt(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(0,Odt.parseHtml)(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,u=s.split(c),f=a;u.forEach(function(h,m){if(m%2===0){var g=n.parseText(h,f);r.push.apply(r,WJ.__spreadArray([],WJ.__read(g),!1))}f+=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(Vdt);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||(0,Pa.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,Pa.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,Pa.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,Pa.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,Pa.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,Pa.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,Pa.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=(0,Ldt.parseMatches)(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 Ndt.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Mdt.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Rdt.version,e})();jJ.default=kdt;function Udt(e){return e==null&&(e=!0),(0,Pa.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,Pa.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,Pa.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,Pa.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function Gdt(e){return e==null&&(e=!0),(0,Pa.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,Pa.isBoolean)(e.scheme)?e.scheme:!0,www:(0,Pa.isBoolean)(e.www)?e.www:!0}}function zdt(e){return typeof e=="number"?{length:e,location:"end"}:WJ.__assign({length:Number.POSITIVE_INFINITY,location:"end"},e)}function Vdt(e,t){return e.getOffset()-t.getOffset()}});var Rye=di(Pye=>{"use strict";Object.defineProperty(Pye,"__esModule",{value:!0})});var Mye=di(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});var P0=(yA(),fh(CA));P0.__exportStar(Rye(),t_);P0.__exportStar(RJ(),t_);P0.__exportStar(NJ(),t_);P0.__exportStar(B0(),t_);P0.__exportStar(OJ(),t_);P0.__exportStar(FJ(),t_);P0.__exportStar(PJ(),t_)});var Nye=di(qJ=>{"use strict";Object.defineProperty(qJ,"__esModule",{value:!0});var Hdt=(yA(),fh(CA));Hdt.__exportStar(zJ(),qJ)});var KJ=di((EA,Oye)=>{"use strict";EA=Oye.exports=yH().default;Object.defineProperty(EA,"__esModule",{value:!0});EA.Autolinker=void 0;var eB=(yA(),fh(CA)),Lye=eB.__importDefault(yH());EA.Autolinker=Lye.default;EA.default=Lye.default;eB.__exportStar(yH(),EA);eB.__exportStar(vJ(),EA);eB.__exportStar(sH(),EA);eB.__exportStar(Mye(),EA);eB.__exportStar(Nye(),EA)});var dZ=di((exports,module)=>{/*!
* protobuf.js v7.5.4 (c) 2016, daniel wirtz
* compiled fri, 15 aug 2025 23:28:54 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,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(h,m){s[a]=function(A){if(u)if(u=!1,A)m(A);else{for(var _=new Array(arguments.length-1),C=0;C<_.length;)_[C++]=arguments[C];h.apply(null,_)}};try{o.apply(r||null,s)}catch(g){u&&(u=!1,m(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var h=0;--f%4>1&&u.charAt(f)==="=";)++h;return Math.ceil(u.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(u,f,h){for(var m=null,g=[],A=0,_=0,C;f<h;){var y=u[f++];switch(_){case 0:g[A++]=o[y>>2],C=(y&3)<<4,_=1;break;case 1:g[A++]=o[C|y>>4],C=(y&15)<<2,_=2;break;case 2:g[A++]=o[C|y>>6],g[A++]=o[y&63],_=0;break}A>8191&&((m||(m=[])).push(String.fromCharCode.apply(String,g)),A=0)}return _&&(g[A++]=o[C],g[A++]=61,_===1&&(g[A++]=61)),m?(A&&m.push(String.fromCharCode.apply(String,g.slice(0,A))),m.join("")):String.fromCharCode.apply(String,g.slice(0,A))};var a="invalid encoding";i.decode=function(u,f,h){for(var m=h,g=0,A,_=0;_<u.length;){var C=u.charCodeAt(_++);if(C===61&&g>1)break;if((C=r[C])===undefined)throw Error(a);switch(g){case 0:A=C,g=1;break;case 1:f[h++]=A<<2|(C&48)>>4,A=C,g=2;break;case 2:f[h++]=(A&15)<<4|(C&60)>>2,A=C,g=3;break;case 3:f[h++]=(A&3)<<6|C,g=0;break}}if(g===1)throw Error(a);return h-m},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],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 u=new Float32Array([-0]),f=new Uint8Array(u.buffer),h=f[3]===128;function m(C,y,E){u[0]=C,y[E]=f[0],y[E+1]=f[1],y[E+2]=f[2],y[E+3]=f[3]}function g(C,y,E){u[0]=C,y[E]=f[3],y[E+1]=f[2],y[E+2]=f[1],y[E+3]=f[0]}c.writeFloatLE=h?m:g,c.writeFloatBE=h?g:m;function A(C,y){return f[0]=C[y],f[1]=C[y+1],f[2]=C[y+2],f[3]=C[y+3],u[0]}function _(C,y){return f[3]=C[y],f[2]=C[y+1],f[1]=C[y+2],f[0]=C[y+3],u[0]}c.readFloatLE=h?A:_,c.readFloatBE=h?_:A})():(function(){function u(h,m,g,A){var _=m<0?1:0;if(_&&(m=-m),m===0)h(1/m>0?0:2147483648,g,A);else if(isNaN(m))h(2143289344,g,A);else if(m>34028234663852886e22)h((_<<31|2139095040)>>>0,g,A);else if(m<11754943508222875e-54)h((_<<31|Math.round(m/1401298464324817e-60))>>>0,g,A);else{var C=Math.floor(Math.log(m)/Math.LN2),y=Math.round(m*Math.pow(2,-C)*8388608)&8388607;h((_<<31|C+127<<23|y)>>>0,g,A)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(h,m,g){var A=h(m,g),_=(A>>31)*2+1,C=A>>>23&255,y=A&8388607;return C===255?y?NaN:_*(1/0):C===0?_*1401298464324817e-60*y:_*Math.pow(2,C-150)*(y+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)})(),typeof Float64Array<"u"?(function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),h=f[7]===128;function m(C,y,E){u[0]=C,y[E]=f[0],y[E+1]=f[1],y[E+2]=f[2],y[E+3]=f[3],y[E+4]=f[4],y[E+5]=f[5],y[E+6]=f[6],y[E+7]=f[7]}function g(C,y,E){u[0]=C,y[E]=f[7],y[E+1]=f[6],y[E+2]=f[5],y[E+3]=f[4],y[E+4]=f[3],y[E+5]=f[2],y[E+6]=f[1],y[E+7]=f[0]}c.writeDoubleLE=h?m:g,c.writeDoubleBE=h?g:m;function A(C,y){return f[0]=C[y],f[1]=C[y+1],f[2]=C[y+2],f[3]=C[y+3],f[4]=C[y+4],f[5]=C[y+5],f[6]=C[y+6],f[7]=C[y+7],u[0]}function _(C,y){return f[7]=C[y],f[6]=C[y+1],f[5]=C[y+2],f[4]=C[y+3],f[3]=C[y+4],f[2]=C[y+5],f[1]=C[y+6],f[0]=C[y+7],u[0]}c.readDoubleLE=h?A:_,c.readDoubleBE=h?_:A})():(function(){function u(h,m,g,A,_,C){var y=A<0?1:0;if(y&&(A=-A),A===0)h(0,_,C+m),h(1/A>0?0:2147483648,_,C+g);else if(isNaN(A))h(0,_,C+m),h(2146959360,_,C+g);else if(A>17976931348623157e292)h(0,_,C+m),h((y<<31|2146435072)>>>0,_,C+g);else{var E;if(A<22250738585072014e-324)E=A/5e-324,h(E>>>0,_,C+m),h((y<<31|E/4294967296)>>>0,_,C+g);else{var I=Math.floor(Math.log(A)/Math.LN2);I===1024&&(I=1023),E=A*Math.pow(2,-I),h(E*4503599627370496>>>0,_,C+m),h((y<<31|I+1023<<20|E*1048576&1048575)>>>0,_,C+g)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(h,m,g,A,_){var C=h(A,_+m),y=h(A,_+g),E=(y>>31)*2+1,I=y>>>20&2047,x=4294967296*(y&1048575)+C;return I===2047?x?NaN:E*(1/0):I===0?E*5e-324*x:E*Math.pow(2,I-1075)*(x+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)})(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+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,u=null,f=a;return function(m){if(m<1||m>c)return o(m);f+m>a&&(u=o(a),f=0);var g=r.call(u,f,f+=m);return f&7&&(f=(f|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 u=null,f=[],h=0,m;s<a;)m=r[s++],m<128?f[h++]=m:m>191&&m<224?f[h++]=(m&31)<<6|r[s++]&63:m>239&&m<365?(m=((m&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,f[h++]=55296+(m>>10),f[h++]=56320+(m&1023)):f[h++]=(m&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),h=0);return u?(h&&u.push(String.fromCharCode.apply(String,f.slice(0,h))),u.join("")):String.fromCharCode.apply(String,f.slice(0,h))},i.write=function(r,s,a){for(var c=a,u,f,h=0;h<r.length;++h)u=r.charCodeAt(h),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(h+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++h,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&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(A,_){return RangeError("index out of range: "+A.pos+" + "+(_||1)+" > "+A.len)}function c(A){this.buf=A,this.pos=0,this.len=A.length}var u=typeof Uint8Array<"u"?function(_){if(_ instanceof Uint8Array||Array.isArray(_))return new c(_);throw Error("illegal buffer")}:function(_){if(Array.isArray(_))return new c(_);throw Error("illegal buffer")},f=function(){return i.Buffer?function(C){return(c.create=function(E){return i.Buffer.isBuffer(E)?new o(E):u(E)})(C)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(function(){var _=4294967295;return function(){if(_=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(_=(_|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(_=(_|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(_=(_|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(_=(_|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return _;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return _}})(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var _=this.uint32();return _>>>1^-(_&1)|0};function h(){var A=new r(0,0),_=0;if(this.len-this.pos>4){for(;_<4;++_)if(A.lo=(A.lo|(this.buf[this.pos]&127)<<_*7)>>>0,this.buf[this.pos++]<128)return A;if(A.lo=(A.lo|(this.buf[this.pos]&127)<<28)>>>0,A.hi=(A.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return A;_=0}else{for(;_<3;++_){if(this.pos>=this.len)throw a(this);if(A.lo=(A.lo|(this.buf[this.pos]&127)<<_*7)>>>0,this.buf[this.pos++]<128)return A}return A.lo=(A.lo|(this.buf[this.pos++]&127)<<_*7)>>>0,A}if(this.len-this.pos>4){for(;_<5;++_)if(A.hi=(A.hi|(this.buf[this.pos]&127)<<_*7+3)>>>0,this.buf[this.pos++]<128)return A}else for(;_<5;++_){if(this.pos>=this.len)throw a(this);if(A.hi=(A.hi|(this.buf[this.pos]&127)<<_*7+3)>>>0,this.buf[this.pos++]<128)return A}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function m(A,_){return(A[_-4]|A[_-3]<<8|A[_-2]<<16|A[_-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return m(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return m(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(m(this.buf,this.pos+=4),m(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var _=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,_},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var _=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,_},c.prototype.bytes=function(){var _=this.uint32(),C=this.pos,y=this.pos+_;if(y>this.len)throw a(this,_);if(this.pos+=_,Array.isArray(this.buf))return this.buf.slice(C,y);if(C===y){var E=i.Buffer;return E?E.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,C,y)},c.prototype.string=function(){var _=this.bytes();return s.read(_,0,_.length)},c.prototype.skip=function(_){if(typeof _=="number"){if(this.pos+_>this.len)throw a(this,_);this.pos+=_}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(A){switch(A){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(A=this.uint32()&7)!==4;)this.skipType(A);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+A+" at offset "+this.pos)}return this},c._configure=function(A){o=A,c.create=f(),o._configure();var _=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[_](!1)},uint64:function(){return h.call(this)[_](!0)},sint64:function(){return h.call(this).zzDecode()[_](!1)},fixed64:function(){return g.call(this)[_](!0)},sfixed64:function(){return g.call(this)[_](!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,u,f){if(!u)throw TypeError("request must be specified");var h=this;if(!f)return i.asPromise(r,h,s,a,c,u);if(!h.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,A){if(g)return h.emit("error",g,s),f(g);if(A===null)return h.end(!0),undefined;if(!(A instanceof c))try{A=c[h.responseDelimited?"decodeDelimited":"decode"](A)}catch(_){return h.emit("error",_,s),f(_)}return h.emit("data",A,s),f(null,A)})}catch(m){return h.emit("error",m,s),setTimeout(function(){f(m)},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,u){this.lo=c>>>0,this.hi=u>>>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(u){if(u===0)return r;var f=u<0;f&&(u=-u);var h=u>>>0,m=(u-h)/4294967296>>>0;return f&&(m=~m>>>0,h=~h>>>0,++h>4294967295&&(h=0,++m>4294967295&&(m=0))),new o(h,m)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,h=~this.hi>>>0;return f||(h=h+1>>>0),-(f+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,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 u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<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 u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).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 u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}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={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),h=f.length-1;h>-1;--h)if(c[f[h]]===1&&this[f[h]]!==undefined&&this[f[h]]!==null)return f[h]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},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,u){return new s(c,u)},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(I,x,S){this.fn=I,this.len=x,this.next=undefined,this.val=S}function u(){}function f(I){this.head=I.head,this.tail=I.tail,this.len=I.len,this.next=I.states}function h(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var m=function(){return i.Buffer?function(){return(h.create=function(){return new o})()}:function(){return new h}};h.create=m(),h.alloc=function(x){return new i.Array(x)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(x,S,w){return this.tail=this.tail.next=new c(x,S,w),this.len+=S,this};function g(I,x,S){x[S]=I&255}function A(I,x,S){for(;I>127;)x[S++]=I&127|128,I>>>=7;x[S]=I}function _(I,x){this.len=I,this.next=undefined,this.val=x}_.prototype=Object.create(c.prototype),_.prototype.fn=A,h.prototype.uint32=function(x){return this.len+=(this.tail=this.tail.next=new _((x=x>>>0)<128?1:x<16384?2:x<2097152?3:x<268435456?4:5,x)).len,this},h.prototype.int32=function(x){return x<0?this._push(C,10,r.fromNumber(x)):this.uint32(x)},h.prototype.sint32=function(x){return this.uint32((x<<1^x>>31)>>>0)};function C(I,x,S){for(;I.hi;)x[S++]=I.lo&127|128,I.lo=(I.lo>>>7|I.hi<<25)>>>0,I.hi>>>=7;for(;I.lo>127;)x[S++]=I.lo&127|128,I.lo=I.lo>>>7;x[S++]=I.lo}h.prototype.uint64=function(x){var S=r.from(x);return this._push(C,S.length(),S)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(x){var S=r.from(x).zzEncode();return this._push(C,S.length(),S)},h.prototype.bool=function(x){return this._push(g,1,x?1:0)};function y(I,x,S){x[S]=I&255,x[S+1]=I>>>8&255,x[S+2]=I>>>16&255,x[S+3]=I>>>24}h.prototype.fixed32=function(x){return this._push(y,4,x>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(x){var S=r.from(x);return this._push(y,4,S.lo)._push(y,4,S.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(x){return this._push(i.float.writeFloatLE,4,x)},h.prototype.double=function(x){return this._push(i.float.writeDoubleLE,8,x)};var E=i.Array.prototype.set?function(x,S,w){S.set(x,w)}:function(x,S,w){for(var v=0;v<x.length;++v)S[w+v]=x[v]};h.prototype.bytes=function(x){var S=x.length>>>0;if(!S)return this._push(g,1,0);if(i.isString(x)){var w=h.alloc(S=s.length(x));s.decode(x,w,0),x=w}return this.uint32(S)._push(E,S,x)},h.prototype.string=function(x){var S=a.length(x);return S?this.uint32(S)._push(a.write,S,x):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},h.prototype.ldelim=function(){var x=this.head,S=this.tail,w=this.len;return this.reset().uint32(w),w&&(this.tail.next=x.next,this.tail=S,this.len+=w),this},h.prototype.finish=function(){for(var x=this.head.next,S=this.constructor.alloc(this.len),w=0;x;)x.fn(x.val,S,w),w+=x.len,x=x.next;return S},h._configure=function(I){o=I,h.create=m(),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,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var h=0;h<c.length;)u[f++]=c[h++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var _we=di((uqi,e9)=>{/* 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(f,h){h=h||{};var m=h.encodedMaskData||h.encodedMaskData===null,g=c(f,h.inputOffset||0,m),A=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,_=r(g,h.pixelType||Float32Array,h.encodedMaskData,A,h.returnMask),C={width:g.width,height:g.height,pixelData:_.resultPixels,minValue:_.minValue,maxValue:g.pixels.maxValue,noDataValue:A};return _.resultMask&&(C.maskData=_.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(f,h,m,g,A){var _=0,C=f.pixels.numBlocksX,y=f.pixels.numBlocksY,E=Math.floor(f.width/C),I=Math.floor(f.height/y),x=2*f.maxZError,S=Number.MAX_VALUE,w;m=m||(f.mask?f.mask.bitset:null);var v,P;v=new h(f.width*f.height),A&&m&&(P=new Uint8Array(f.width*f.height));for(var N=new Float32Array(E*I),L,p,b=0;b<=y;b++){var T=b!==y?I:f.height%y;if(T!==0)for(var B=0;B<=C;B++){var R=B!==C?E:f.width%C;if(R!==0){var O=b*f.width*I+B*E,U=f.width-R,k=f.pixels.blocks[_],z,Q,H;k.encoding<2?(k.encoding===0?z=k.rawData:(u(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,x,N,f.pixels.maxValue),z=N),Q=0):k.encoding===2?H=0:H=k.offset;var W;if(m)for(p=0;p<T;p++){for(O&7&&(W=m[O>>3],W<<=O&7),L=0;L<R;L++)O&7||(W=m[O>>3]),W&128?(P&&(P[O]=1),w=k.encoding<2?z[Q++]:H,S=S>w?w:S,v[O++]=w):(P&&(P[O]=0),v[O++]=g),W<<=1;O+=U}else if(k.encoding<2)for(p=0;p<T;p++){for(L=0;L<R;L++)w=z[Q++],S=S>w?w:S,v[O++]=w;O+=U}else for(S=S>H?H:S,p=0;p<T;p++){for(L=0;L<R;L++)v[O++]=H;O+=U}if(k.encoding===1&&Q!==k.numValidPixels)throw"Block and Mask do not match";_++}}}return{resultPixels:v,resultMask:P,minValue:S}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var h=f.pixels.numBlocksX*f.pixels.numBlocksY,m={},g=0;g<h;g++){var A=f.pixels.blocks[g];A.encoding===0?m.float32=!0:A.encoding===1?m[A.bitsPerPixel]=!0:m[0]=!0}return Object.keys(m)},c=function(f,h,m){var g={},A=new Uint8Array(f,h,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,A),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;h+=10;var _=new DataView(f,h,24);if(g.fileVersion=_.getInt32(0,!0),g.imageType=_.getInt32(4,!0),g.height=_.getUint32(8,!0),g.width=_.getUint32(12,!0),g.maxZError=_.getFloat64(16,!0),h+=24,!m)if(_=new DataView(f,h,16),g.mask={},g.mask.numBlocksY=_.getUint32(0,!0),g.mask.numBlocksX=_.getUint32(4,!0),g.mask.numBytes=_.getUint32(8,!0),g.mask.maxValue=_.getFloat32(12,!0),h+=16,g.mask.numBytes>0){var C=new Uint8Array(Math.ceil(g.width*g.height/8));_=new DataView(f,h,g.mask.numBytes);var y=_.getInt16(0,!0),E=2,I=0;do{if(y>0)for(;y--;)C[I++]=_.getUint8(E++);else{var x=_.getUint8(E++);for(y=-y;y--;)C[I++]=x}y=_.getInt16(E,!0),E+=2}while(E<g.mask.numBytes);if(y!==-32768||I<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)));_=new DataView(f,h,16),g.pixels={},g.pixels.numBlocksY=_.getUint32(0,!0),g.pixels.numBlocksX=_.getUint32(4,!0),g.pixels.numBytes=_.getUint32(8,!0),g.pixels.maxValue=_.getFloat32(12,!0),h+=16;var S=g.pixels.numBlocksX,w=g.pixels.numBlocksY,v=S+(g.width%S>0?1:0),P=w+(g.height%w>0?1:0);g.pixels.blocks=new Array(v*P);for(var N=0,L=0;L<P;L++)for(var p=0;p<v;p++){var b=0,T=f.byteLength-h;_=new DataView(f,h,Math.min(10,T));var B={};g.pixels.blocks[N++]=B;var R=_.getUint8(0);if(b++,B.encoding=R&63,B.encoding>3)throw"Invalid block encoding ("+B.encoding+")";if(B.encoding===2){h++;continue}if(R!==0&&R!==2){if(R>>=6,B.offsetType=R,R===2)B.offset=_.getInt8(1),b++;else if(R===1)B.offset=_.getInt16(1,!0),b+=2;else if(R===0)B.offset=_.getFloat32(1,!0),b+=4;else throw"Invalid block offset type";if(B.encoding===1)if(R=_.getUint8(b),b++,B.bitsPerPixel=R&63,R>>=6,B.numValidPixelsType=R,R===2)B.numValidPixels=_.getUint8(b),b++;else if(R===1)B.numValidPixels=_.getUint16(b,!0),b+=2;else if(R===0)B.numValidPixels=_.getUint32(b,!0),b+=4;else throw"Invalid valid pixel count type"}if(h+=b,B.encoding!==3){var O,U;if(B.encoding===0){var k=(g.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";O=new ArrayBuffer(k*4),U=new Uint8Array(O),U.set(new Uint8Array(f,h,k*4));var z=new Float32Array(O);B.rawData=z,h+=k*4}else if(B.encoding===1){var Q=Math.ceil(B.numValidPixels*B.bitsPerPixel/8),H=Math.ceil(Q/4);O=new ArrayBuffer(H*4),U=new Uint8Array(O),U.set(new Uint8Array(f,h,Q)),B.stuffedData=new Uint32Array(O),h+=Q}}}return g.eofOffset=h,g},u=function(f,h,m,g,A,_,C){var y=(1<<h)-1,E=0,I,x=0,S,w,v=Math.ceil((C-g)/A),P=f.length*4-Math.ceil(h*m/8);for(f[f.length-1]<<=8*P,I=0;I<m;I++){if(x===0&&(w=f[E++],x=32),x>=h)S=w>>>x-h&y,x-=h;else{var N=h-x;S=(w&y)<<N&y,w=f[E++],x=32-N,S+=w>>>x}_[I]=S<v?g+S*A:C}return _};return o})(),t=(function(){"use strict";var o={unstuff:function(c,u,f,h,m,g,A,_){var C=(1<<f)-1,y=0,E,I=0,x,S,w,v,P=c.length*4-Math.ceil(f*h/8);if(c[c.length-1]<<=8*P,m)for(E=0;E<h;E++)I===0&&(S=c[y++],I=32),I>=f?(x=S>>>I-f&C,I-=f):(w=f-I,x=(S&C)<<w&C,S=c[y++],I=32-w,x+=S>>>I),u[E]=m[x];else for(v=Math.ceil((_-g)/A),E=0;E<h;E++)I===0&&(S=c[y++],I=32),I>=f?(x=S>>>I-f&C,I-=f):(w=f-I,x=(S&C)<<w&C,S=c[y++],I=32-w,x+=S>>>I),u[E]=x<v?g+x*A:_},unstuffLUT:function(c,u,f,h,m,g){var A=(1<<u)-1,_=0,C=0,y=0,E=0,I=0,x,S=[],w=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*w;var v=Math.ceil((g-h)/m);for(C=0;C<f;C++)E===0&&(x=c[_++],E=32),E>=u?(I=x>>>E-u&A,E-=u):(y=u-E,I=(x&A)<<y&A,x=c[_++],E=32-y,I+=x>>>E),S[C]=I<v?h+I*m:g;return S.unshift(h),S},unstuff2:function(c,u,f,h,m,g,A,_){var C=(1<<f)-1,y=0,E,I=0,x=0,S,w,v;if(m)for(E=0;E<h;E++)I===0&&(w=c[y++],I=32,x=0),I>=f?(S=w>>>x&C,I-=f,x+=f):(v=f-I,S=w>>>x&C,w=c[y++],I=32-v,S|=(w&(1<<v)-1)<<f-v,x=v),u[E]=m[S];else{var P=Math.ceil((_-g)/A);for(E=0;E<h;E++)I===0&&(w=c[y++],I=32,x=0),I>=f?(S=w>>>x&C,I-=f,x+=f):(v=f-I,S=w>>>x&C,w=c[y++],I=32-v,S|=(w&(1<<v)-1)<<f-v,x=v),u[E]=S<P?g+S*A:_}return u},unstuffLUT2:function(c,u,f,h,m,g){var A=(1<<u)-1,_=0,C=0,y=0,E=0,I=0,x=0,S,w=[],v=Math.ceil((g-h)/m);for(C=0;C<f;C++)E===0&&(S=c[_++],E=32,x=0),E>=u?(I=S>>>x&A,E-=u,x+=u):(y=u-E,I=S>>>x&A,S=c[_++],E=32-y,I|=(S&(1<<y)-1)<<u-y,x=y),w[C]=I<v?h+I*m:g;return w.unshift(h),w},originalUnstuff:function(c,u,f,h){var m=(1<<f)-1,g=0,A,_=0,C,y,E,I=c.length*4-Math.ceil(f*h/8);for(c[c.length-1]<<=8*I,A=0;A<h;A++)_===0&&(y=c[g++],_=32),_>=f?(C=y>>>_-f&m,_-=f):(E=f-_,C=(y&m)<<E&m,y=c[g++],_=32-E,C+=y>>>_),u[A]=C;return u},originalUnstuff2:function(c,u,f,h){var m=(1<<f)-1,g=0,A,_=0,C=0,y,E,I;for(A=0;A<h;A++)_===0&&(E=c[g++],_=32,C=0),_>=f?(y=E>>>C&m,_-=f,C+=f):(I=f-_,y=E>>>C&m,E=c[g++],_=32-I,y|=(E&(1<<I)-1)<<f-I,C=I),u[A]=y;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,h=c.length,m=Math.floor(h/2),g=0;m;){var A=m>=359?359:m;m-=A;do u+=c[g++]<<8,f+=u+=c[g++];while(--A);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return h&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,h=new Uint8Array(c,f,6),m={};if(m.fileIdentifierString=String.fromCharCode.apply(null,h),m.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+m.fileIdentifierString;f+=6;var g=new DataView(c,f,8),A=g.getInt32(0,!0);m.fileVersion=A,f+=4,A>=3&&(m.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),m.height=g.getUint32(0,!0),m.width=g.getUint32(4,!0),f+=8,A>=4?(m.numDims=g.getUint32(8,!0),f+=4):m.numDims=1,g=new DataView(c,f,40),m.numValidPixel=g.getUint32(0,!0),m.microBlockSize=g.getInt32(4,!0),m.blobSize=g.getInt32(8,!0),m.imageType=g.getInt32(12,!0),m.maxZError=g.getFloat64(16,!0),m.zMin=g.getFloat64(24,!0),m.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=m,u.ptr=f;var _,C;if(A>=3&&(C=A>=4?52:48,_=this.computeChecksumFletcher32(new Uint8Array(c,f-C,m.blobSize-14)),_!==m.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,h=this.getDataTypeArray(f.imageType),m=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,h,m),A=this.readSubArray(c,u.ptr+m,h,m);u.ptr+=2*m;var _,C=!0;for(_=0;_<f.numDims;_++)if(g[_]!==A[_]){C=!1;break}return f.minValues=g,f.maxValues=A,C},readSubArray:function(c,u,f,h){var m;if(f===Uint8Array)m=new Uint8Array(c,u,h);else{var g=new ArrayBuffer(h),A=new Uint8Array(g);A.set(new Uint8Array(c,u,h)),m=new f(g)}return m},readMask:function(c,u){var f=u.ptr,h=u.headerInfo,m=h.width*h.height,g=h.numValidPixel,A=new DataView(c,f,4),_={};if(_.numBytes=A.getUint32(0,!0),f+=4,(g===0||m===g)&&_.numBytes!==0)throw"invalid mask";var C,y;if(g===0)C=new Uint8Array(Math.ceil(m/8)),_.bitset=C,y=new Uint8Array(m),u.pixels.resultMask=y,f+=_.numBytes;else if(_.numBytes>0){C=new Uint8Array(Math.ceil(m/8)),A=new DataView(c,f,_.numBytes);var E=A.getInt16(0,!0),I=2,x=0,S=0;do{if(E>0)for(;E--;)C[x++]=A.getUint8(I++);else for(S=A.getUint8(I++),E=-E;E--;)C[x++]=S;E=A.getInt16(I,!0),I+=2}while(I<_.numBytes);if(E!==-32768||x<C.length)throw"Unexpected end of mask RLE encoding";y=new Uint8Array(m);var w=0,v=0;for(v=0;v<m;v++)v&7?(w=C[v>>3],w<<=v&7):w=C[v>>3],w&128&&(y[v]=1);u.pixels.resultMask=y,_.bitset=C,f+=_.numBytes}return u.ptr=f,u.mask=_,!0},readDataOneSweep:function(c,u,f){var h=u.ptr,m=u.headerInfo,g=m.numDims,A=m.width*m.height,_=m.imageType,C=m.numValidPixel*r.getDataTypeSize(_)*g,y,E=u.pixels.resultMask;if(f===Uint8Array)y=new Uint8Array(c,h,C);else{var I=new ArrayBuffer(C),x=new Uint8Array(I);x.set(new Uint8Array(c,h,C)),y=new f(I)}if(y.length===A*g)u.pixels.resultPixels=y;else{u.pixels.resultPixels=new f(A*g);var S=0,w=0,v=0,P=0;if(g>1)for(v=0;v<g;v++)for(P=v*A,w=0;w<A;w++)E[w]&&(u.pixels.resultPixels[P+w]=y[S++]);else for(w=0;w<A;w++)E[w]&&(u.pixels.resultPixels[w]=y[S++])}return h+=C,u.ptr=h,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(c,u.ptr,16);u.ptr+=16;var m=h.getInt32(0,!0);if(m<2)throw"unsupported Huffman version";var g=h.getInt32(4,!0),A=h.getInt32(8,!0),_=h.getInt32(12,!0);if(A>=_)return!1;var C=new Uint32Array(_-A);r.decodeBits(c,u,C);var y=[],E,I,x,S;for(E=A;E<_;E++)I=E-(E<g?0:g),y[I]={first:C[E-A],second:null};var w=c.byteLength-u.ptr,v=Math.ceil(w/4),P=new ArrayBuffer(v*4),N=new Uint8Array(P);N.set(new Uint8Array(c,u.ptr,w));var L=new Uint32Array(P),p=0,b,T=0;for(b=L[0],E=A;E<_;E++)I=E-(E<g?0:g),S=y[I].first,S>0&&(y[I].second=b<<p>>>32-S,32-p>=S?(p+=S,p===32&&(p=0,T++,b=L[T])):(p+=S-32,T++,b=L[T],y[I].second|=b>>>32-p));var B=0,R=0,O=new s;for(E=0;E<y.length;E++)y[E]!==void 0&&(B=Math.max(B,y[E].first));B>=f?R=f:R=B,B>=30&&console.log("WARning, large NUM LUT BITS IS "+B);var U=[],k,z,Q,H,W,Z;for(E=A;E<_;E++)if(I=E-(E<g?0:g),S=y[I].first,S>0)if(k=[S,I],S<=R)for(z=y[I].second<<R-S,Q=1<<R-S,x=0;x<Q;x++)U[z|x]=k;else for(z=y[I].second,Z=O,H=S-1;H>=0;H--)W=z>>>H&1,W?(Z.right||(Z.right=new s),Z=Z.right):(Z.left||(Z.left=new s),Z=Z.left),H===0&&!Z.val&&(Z.val=k[1]);return{decodeLut:U,numBitsLUTQick:R,numBitsLUT:B,tree:O,stuffedData:L,srcPtr:T,bitPos:p}},readHuffman:function(c,u,f){var h=u.headerInfo,m=h.numDims,g=u.headerInfo.height,A=u.headerInfo.width,_=A*g,C=this.readHuffmanTree(c,u),y=C.decodeLut,E=C.tree,I=C.stuffedData,x=C.srcPtr,S=C.bitPos,w=C.numBitsLUTQick,v=C.numBitsLUT,P=u.headerInfo.imageType===0?128:0,N,L,p,b=u.pixels.resultMask,T,B,R,O,U,k,z,Q=0;S>0&&(x++,S=0);var H=I[x],W=u.encodeMode===1,Z=new f(_*m),Y=Z,$;for($=0;$<h.numDims;$++){if(m>1&&(Y=new f(Z.buffer,_*$,_),Q=0),u.headerInfo.numValidPixel===A*g)for(k=0,O=0;O<g;O++)for(U=0;U<A;U++,k++){if(L=0,T=H<<S>>>32-w,B=T,32-S<w&&(T|=I[x+1]>>>64-S-w,B=T),y[B])L=y[B][1],S+=y[B][0];else for(T=H<<S>>>32-v,B=T,32-S<v&&(T|=I[x+1]>>>64-S-v,B=T),N=E,z=0;z<v;z++)if(R=T>>>v-z-1&1,N=R?N.right:N.left,!(N.left||N.right)){L=N.val,S=S+z+1;break}S>=32&&(S-=32,x++,H=I[x]),p=L-P,W?(U>0?p+=Q:O>0?p+=Y[k-A]:p+=Q,p&=255,Y[k]=p,Q=p):Y[k]=p}else for(k=0,O=0;O<g;O++)for(U=0;U<A;U++,k++)if(b[k]){if(L=0,T=H<<S>>>32-w,B=T,32-S<w&&(T|=I[x+1]>>>64-S-w,B=T),y[B])L=y[B][1],S+=y[B][0];else for(T=H<<S>>>32-v,B=T,32-S<v&&(T|=I[x+1]>>>64-S-v,B=T),N=E,z=0;z<v;z++)if(R=T>>>v-z-1&1,N=R?N.right:N.left,!(N.left||N.right)){L=N.val,S=S+z+1;break}S>=32&&(S-=32,x++,H=I[x]),p=L-P,W?(U>0&&b[k-1]?p+=Q:O>0&&b[k-A]?p+=Y[k-A]:p+=Q,p&=255,Y[k]=p,Q=p):Y[k]=p}u.ptr=u.ptr+(x+1)*4+(S>0?4:0)}u.pixels.resultPixels=Z},decodeBits:function(c,u,f,h,m){{var g=u.headerInfo,A=g.fileVersion,_=0,C=new DataView(c,u.ptr,5),y=C.getUint8(0);_++;var E=y>>6,I=E===0?4:3-E,x=(y&32)>0,S=y&31,w=0;if(I===1)w=C.getUint8(_),_++;else if(I===2)w=C.getUint16(_,!0),_+=2;else if(I===4)w=C.getUint32(_,!0),_+=4;else throw"Invalid valid pixel count type";var v=2*g.maxZError,P,N,L,p,b,T,B,R,O,U,k=g.numDims>1?g.maxValues[m]:g.zMax;if(x){for(u.counter.lut++,R=C.getUint8(_),O=S,_++,p=Math.ceil((R-1)*S/8),b=Math.ceil(p/4),N=new ArrayBuffer(b*4),L=new Uint8Array(N),u.ptr+=_,L.set(new Uint8Array(c,u.ptr,p)),B=new Uint32Array(N),u.ptr+=p,U=0;R-1>>>U;)U++;p=Math.ceil(w*U/8),b=Math.ceil(p/4),N=new ArrayBuffer(b*4),L=new Uint8Array(N),L.set(new Uint8Array(c,u.ptr,p)),P=new Uint32Array(N),u.ptr+=p,A>=3?T=o.unstuffLUT2(B,S,R-1,h,v,k):T=o.unstuffLUT(B,S,R-1,h,v,k),A>=3?o.unstuff2(P,f,U,w,T):o.unstuff(P,f,U,w,T)}else u.counter.bitstuffer++,U=S,u.ptr+=_,U>0&&(p=Math.ceil(w*U/8),b=Math.ceil(p/4),N=new ArrayBuffer(b*4),L=new Uint8Array(N),L.set(new Uint8Array(c,u.ptr,p)),P=new Uint32Array(N),u.ptr+=p,A>=3?h==null?o.originalUnstuff2(P,f,U,w):o.unstuff2(P,f,U,w,!1,h,v,k):h==null?o.originalUnstuff(P,f,U,w):o.unstuff(P,f,U,w,!1,h,v,k))}},readTiles:function(c,u,f){var h=u.headerInfo,m=h.width,g=h.height,A=h.microBlockSize,_=h.imageType,C=r.getDataTypeSize(_),y=Math.ceil(m/A),E=Math.ceil(g/A);u.pixels.numBlocksY=E,u.pixels.numBlocksX=y,u.pixels.ptr=0;var I=0,x=0,S=0,w=0,v=0,P=0,N=0,L=0,p=0,b=0,T=0,B=0,R=0,O=0,U=0,k=0,z,Q,H,W,Z,Y,$=new f(A*A),K=g%A||A,fe=m%A||A,ge,ne,Ce=h.numDims,ye,De=u.pixels.resultMask,be=u.pixels.resultPixels;for(S=0;S<E;S++)for(v=S!==E-1?A:K,w=0;w<y;w++)for(P=w!==y-1?A:fe,T=S*m*A+w*A,B=m-P,ye=0;ye<Ce;ye++){if(Ce>1&&(be=new f(u.pixels.resultPixels.buffer,m*g*ye*C,m*g)),N=c.byteLength-u.ptr,z=new DataView(c,u.ptr,Math.min(10,N)),Q={},k=0,L=z.getUint8(0),k++,p=L>>6&255,b=L>>2&15,b!==(w*A>>3&15))throw"integrity issue";if(Y=L&3,Y>3)throw u.ptr+=k,"Invalid block encoding ("+Y+")";if(Y===2){u.counter.constant++,u.ptr+=k;continue}else if(Y===0){if(u.counter.uncompressed++,u.ptr+=k,R=v*P*C,O=c.byteLength-u.ptr,R=R<O?R:O,H=new ArrayBuffer(R%C===0?R:R+C-R%C),W=new Uint8Array(H),W.set(new Uint8Array(c,u.ptr,R)),Z=new f(H),U=0,De)for(I=0;I<v;I++){for(x=0;x<P;x++)De[T]&&(be[T]=Z[U++]),T++;T+=B}else for(I=0;I<v;I++){for(x=0;x<P;x++)be[T++]=Z[U++];T+=B}u.ptr+=U*C}else if(ge=r.getDataTypeUsed(_,p),ne=r.getOnePixel(Q,k,ge,z),k+=r.getDataTypeSize(ge),Y===3)if(u.ptr+=k,u.counter.constantoffset++,De)for(I=0;I<v;I++){for(x=0;x<P;x++)De[T]&&(be[T]=ne),T++;T+=B}else for(I=0;I<v;I++){for(x=0;x<P;x++)be[T++]=ne;T+=B}else if(u.ptr+=k,r.decodeBits(c,u,$,ne,ye),k=0,De)for(I=0;I<v;I++){for(x=0;x<P;x++)De[T]&&(be[T]=$[k++]),T++;T+=B}else for(I=0;I<v;I++){for(x=0;x<P;x++)be[T++]=$[k++];T+=B}}},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 u=c.headerInfo.zMax,f=c.headerInfo.numDims,h=c.headerInfo.height*c.headerInfo.width,m=h*f,g=0,A=0,_=0,C=c.pixels.resultMask;if(C)if(f>1)for(g=0;g<f;g++)for(_=g*h,A=0;A<h;A++)C[A]&&(c.pixels.resultPixels[_+A]=u);else for(A=0;A<h;A++)C[A]&&(c.pixels.resultPixels[A]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(A=0;A<m;A++)c.pixels.resultPixels[A]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,h){var m=0;switch(f){case 0:m=h.getInt8(u);break;case 1:m=h.getUint8(u);break;case 2:m=h.getInt16(u,!0);break;case 3:m=h.getUint16(u,!0);break;case 4:m=h.getInt32(u,!0);break;case 5:m=h.getUInt32(u,!0);break;case 6:m=h.getFloat32(u,!0);break;case 7:m=h.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return m}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,h=0,m={};if(m.ptr=u.inputOffset||0,m.pixels={},!!r.readHeaderInfo(c,m)){var g=m.headerInfo,A=g.fileVersion,_=r.getDataTypeArray(g.imageType);r.readMask(c,m),g.numValidPixel!==g.width*g.height&&!m.pixels.resultMask&&(m.pixels.resultMask=u.maskData);var C=g.width*g.height;if(m.pixels.resultPixels=new _(C*g.numDims),m.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(m);else if(A>=4&&r.checkMinMaxRanges(c,m))r.constructConstantSurface(m);else{var y=new DataView(c,m.ptr,2),E=y.getUint8(0);if(m.ptr++,E)r.readDataOneSweep(c,m,_);else if(A>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var I=y.getUint8(1);if(m.ptr++,m.encodeMode=I,I>2||A<4&&I>1)throw"Invalid Huffman flag "+I;I?r.readHuffman(c,m,_):r.readTiles(c,m,_)}else r.readTiles(c,m,_)}m.eofOffset=m.ptr;var x;u.inputOffset?(x=m.headerInfo.blobSize+u.inputOffset-m.ptr,Math.abs(x)>=1&&(m.eofOffset=u.inputOffset+m.headerInfo.blobSize)):(x=m.headerInfo.blobSize-m.ptr,Math.abs(x)>=1&&(m.eofOffset=m.headerInfo.blobSize));var S={width:g.width,height:g.height,pixelData:m.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:m.pixels.resultMask};if(m.pixels.resultMask&&r.isValidPixelValue(g.imageType,f)){var w=m.pixels.resultMask;for(h=0;h<C;h++)w[h]||(S.pixelData[h]=f);S.noDataValue=f}return m.noDataValue=f,u.returnFileInfo&&(S.fileInfo=r.formatFileInfo(m)),S}},getBandCount:function(c){var u=0,f=0,h={};for(h.ptr=0,h.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,h),f+=h.headerInfo.blobSize,u++,h.ptr=f;return u}};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),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var h=0,m=o.byteLength-10,g,A=[],_,C,y={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<m;){var E=u.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=E.fileInfo.eofOffset,h===0&&(g=E.encodedMaskData,C=E.maskData,y.width=E.width,y.height=E.height,y.dimCount=E.dimCount||1,y.pixelType=E.pixelType||E.fileInfo.pixelType,y.mask=E.maskData),f>1&&E.fileInfo.mask&&E.fileInfo.mask.numBytes>0&&A.push(E.maskData),h++,y.pixels.push(E.pixelData),y.statistics.push({minValue:E.minValue,maxValue:E.maxValue,noDataValue:E.noDataValue,dimStats:E.dimStats})}var I,x,S;if(f>1&&A.length>1){for(S=y.width*y.height,y.bandMasks=A,C=new Uint8Array(S),C.set(A[0]),I=1;I<A.length;I++)for(_=A[I],x=0;x<S;x++)C[x]=C[x]&_[x];y.maskData=C}return y}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof e9<"u"&&e9.exports?e9.exports=i:this.Lerc=i})()});var sDe=di((_G,Kte)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof _G=="object"&&typeof Kte=="object"?Kte.exports=t():typeof define=="function"&&define.amd?define([],t):typeof _G=="object"?_G.NoSleep=t():e.NoSleep=t()})(_G,(function(){return(function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(i,o,r){n.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:r})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,o){if(1&o&&(i=n(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var s in i)n.d(r,s,function(a){return i[a]}.bind(null,s));return r},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=0)})([function(e,t,n){"use strict";var i=(function(){function f(h,m){for(var g=0;g<m.length;g++){var A=m[g];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}return function(h,m,g){return m&&f(h.prototype,m),g&&f(h,g),h}})(),o=n(1),r=o.webm,s=o.mp4,a=function(){return 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},c=function(){return"wakeLock"in navigator},u=(function(){function f(){var h=this;if((function(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")})(this,f),this.enabled=!1,c()){this._wakeLock=null;var m=function(){h._wakeLock!==null&&document.visibilityState==="visible"&&h.enable()};document.addEventListener("visibilitychange",m),document.addEventListener("fullscreenchange",m)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",r),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",(function(){h.noSleepVideo.duration<=1?h.noSleepVideo.setAttribute("loop",""):h.noSleepVideo.addEventListener("timeupdate",(function(){h.noSleepVideo.currentTime>.5&&(h.noSleepVideo.currentTime=Math.random())}))})))}return i(f,[{key:"_addSourceToVideo",value:function(h,m,g){var A=document.createElement("source");A.src=g,A.type="video/"+m,h.appendChild(A)}},{key:"enable",value:function(){var h=this;return c()?navigator.wakeLock.request("screen").then((function(m){h._wakeLock=m,h.enabled=!0,console.log("Wake Lock active."),h._wakeLock.addEventListener("release",(function(){console.log("Wake Lock released.")}))})).catch((function(m){throw h.enabled=!1,console.error(m.name+", "+m.message),m})):a()?(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((function(){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((function(m){return h.enabled=!0,m})).catch((function(m){throw h.enabled=!1,m}))}},{key:"disable",value:function(){c()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn(`
NoSleep now disabled for older iOS devices.
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f})();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,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",mp4:"data:video/mp4;base64,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"}}])}))});var TOt={};cne(TOt,{AlphaMode:()=>lm,AlphaPipelineStage:()=>aL,AnchorPointDirect:()=>uN,AnchorPointIndirect:()=>fN,Animation:()=>OU,AnimationViewModel:()=>FU,Appearance:()=>yo,ApproximateTerrainHeights:()=>Si,ArcGISTiledElevationTerrainProvider:()=>U7,ArcGisBaseMapType:()=>Wh,ArcGisMapServerImageryProvider:()=>Ag,ArcGisMapService:()=>af,ArcType:()=>an,ArticulationStageType:()=>Wc,AssociativeArray:()=>Pt,Atmosphere:()=>yI,AtmospherePipelineStage:()=>GN,AttributeCompression:()=>bn,AttributeType:()=>Ut,AutoExposure:()=>n3,AutomaticUniforms:()=>dp,Axis:()=>eo,AxisAlignedBoundingBox:()=>Xu,Azure2DImageryProvider:()=>VL,B3dmLoader:()=>TN,B3dmParser:()=>IN,BaseLayerPicker:()=>kU,BaseLayerPickerViewModel:()=>QU,BatchTable:()=>RE,BatchTableHierarchy:()=>tI,BatchTexture:()=>vl,BatchTexturePipelineStage:()=>cL,Billboard:()=>So,BillboardCollection:()=>ff,BillboardGraphics:()=>Qc,BillboardLoadState:()=>Ns,BillboardTexture:()=>_g,BillboardVisualizer:()=>HP,BingMapsGeocoderService:()=>z7,BingMapsImageryProvider:()=>RL,BingMapsStyle:()=>pT,BlendEquation:()=>gc,BlendFunction:()=>Wo,BlendOption:()=>Ko,BlendingState:()=>dn,BoundingRectangle:()=>Xe,BoundingSphere:()=>le,BoundingSphereState:()=>mt,BoundingVolumeSemantics:()=>gC,BoxEmitter:()=>Fee,BoxGeometry:()=>mc,BoxGeometryUpdater:()=>nM,BoxGraphics:()=>UE,BoxOutlineGeometry:()=>bh,BrdfLutGenerator:()=>ck,Buffer:()=>ut,BufferLoader:()=>aI,BufferUsage:()=>Oe,CPUStylingPipelineStage:()=>dL,CallbackPositionProperty:()=>iM,CallbackProperty:()=>Dh,Camera:()=>bo,CameraEventAggregator:()=>c3,CameraEventType:()=>Xi,CameraFlightPath:()=>uk,Cartesian2:()=>F,Cartesian3:()=>d,Cartesian4:()=>se,CartesianRectangle:()=>BT,Cartographic:()=>he,CartographicGeocoderService:()=>H7,CatmullRomSpline:()=>Y7,Cesium3DContentGroup:()=>eI,Cesium3DTile:()=>Rd,Cesium3DTileBatchTable:()=>Nh,Cesium3DTileColorBlendMode:()=>hu,Cesium3DTileContent:()=>Qee,Cesium3DTileContentFactory:()=>VI,Cesium3DTileContentState:()=>lr,Cesium3DTileContentType:()=>oa,Cesium3DTileFeature:()=>Ia,Cesium3DTileFeatureTable:()=>zh,Cesium3DTileOptimizationHint:()=>Bd,Cesium3DTileOptimizations:()=>x1,Cesium3DTilePass:()=>nr,Cesium3DTilePassState:()=>Zd,Cesium3DTilePointFeature:()=>Cg,Cesium3DTileRefine:()=>ar,Cesium3DTileStyle:()=>Mb,Cesium3DTileStyleEngine:()=>v1,Cesium3DTilesInspector:()=>YU,Cesium3DTilesInspectorViewModel:()=>HU,Cesium3DTilesTerrainData:()=>a2,Cesium3DTilesTerrainGeometryProcessor:()=>bB,Cesium3DTilesTerrainProvider:()=>Z7,Cesium3DTilesVoxelProvider:()=>kee,Cesium3DTileset:()=>Ys,Cesium3DTilesetBaseTraversal:()=>O1,Cesium3DTilesetCache:()=>B1,Cesium3DTilesetGraphics:()=>jE,Cesium3DTilesetHeatmap:()=>w1,Cesium3DTilesetMetadata:()=>$I,Cesium3DTilesetMostDetailedTraversal:()=>M1,Cesium3DTilesetSkipTraversal:()=>k1,Cesium3DTilesetStatistics:()=>iA,Cesium3DTilesetTraversal:()=>wa,Cesium3DTilesetVisualizer:()=>U1,CesiumInspector:()=>qU,CesiumInspectorViewModel:()=>jU,CesiumTerrainProvider:()=>Y0,CesiumWidget:()=>iU,Check:()=>Fo,CheckerboardMaterialProperty:()=>XT,CircleEmitter:()=>cU,CircleGeometry:()=>oZ,CircleOutlineGeometry:()=>rZ,ClassificationModelDrawCommand:()=>BO,ClassificationPipelineStage:()=>lL,ClassificationPrimitive:()=>yx,ClassificationType:()=>Jn,ClearCommand:()=>ai,ClippingPlane:()=>zs,ClippingPlaneCollection:()=>cs,ClippingPolygon:()=>Jx,ClippingPolygonCollection:()=>Qh,Clock:()=>lA,ClockRange:()=>_s,ClockStep:()=>No,ClockViewModel:()=>MU,CloudCollection:()=>Yee,CloudType:()=>sw,Color:()=>G,ColorBlendMode:()=>Yc,ColorGeometryInstanceAttribute:()=>Xt,ColorMaterialProperty:()=>jt,Command:()=>Lte,ComponentDatatype:()=>q,Composite3DTileContent:()=>dM,CompositeEntityCollection:()=>iK,CompositeMaterialProperty:()=>$T,CompositePositionProperty:()=>ec,CompositeProperty:()=>Zc,CompressedTextureBuffer:()=>Gw,ComputeCommand:()=>hl,ComputeEngine:()=>Uw,ConditionsExpression:()=>oU,ConeEmitter:()=>jee,ConstantPositionProperty:()=>El,ConstantProperty:()=>li,ConstantSpline:()=>DN,ContentMetadata:()=>m1,Context:()=>bE,ContextLimits:()=>Ft,CoplanarPolygonGeometry:()=>xF,CoplanarPolygonGeometryLibrary:()=>wg,CoplanarPolygonOutlineGeometry:()=>Pd,CornerType:()=>ji,CorrelationGroup:()=>dN,CorridorGeometry:()=>o0,CorridorGeometryLibrary:()=>io,CorridorGeometryUpdater:()=>K1,CorridorGraphics:()=>zE,CorridorOutlineGeometry:()=>q1,Credit:()=>pt,CreditDisplay:()=>Ak,CubeMap:()=>Kr,CubeMapFace:()=>Xw,CubicRealPolynomial:()=>mE,CullFace:()=>Ni,CullingVolume:()=>Gs,CumulusCloud:()=>Yf,CustomDataSource:()=>tF,CustomHeightmapTerrainProvider:()=>sZ,CustomShader:()=>xb,CustomShaderMode:()=>dg,CustomShaderPipelineStage:()=>CL,CustomShaderTranslucencyMode:()=>RC,CylinderGeometry:()=>nF,CylinderGeometryLibrary:()=>r0,CylinderGeometryUpdater:()=>oF,CylinderGraphics:()=>VE,CylinderOutlineGeometry:()=>iF,CzmlDataSource:()=>AF,DataSource:()=>gs,DataSourceClock:()=>uA,DataSourceCollection:()=>mF,DataSourceDisplay:()=>iQ,DebugAppearance:()=>qee,DebugCameraPrimitive:()=>Zm,DebugInspector:()=>p3,DebugModelMatrixPrimitive:()=>uU,DefaultProxy:()=>aZ,DepthFunction:()=>Wa,DepthPlane:()=>gk,DequantizationPipelineStage:()=>EL,DerivedCommand:()=>$m,DeveloperError:()=>Ae,DeviceOrientationCameraController:()=>_k,DirectionalLight:()=>Kee,DiscardEmptyTileImagePolicy:()=>gT,DiscardMissingTileImagePolicy:()=>vL,DistanceDisplayCondition:()=>Qt,DistanceDisplayConditionGeometryInstanceAttribute:()=>Kn,DoubleEndedPriorityQueue:()=>l_,DoublyLinkedList:()=>S1,DracoLoader:()=>qp,DrawCommand:()=>et,DynamicAtmosphereLightingType:()=>tg,DynamicEnvironmentMapManager:()=>ng,DynamicGeometryBatch:()=>d0,DynamicGeometryUpdater:()=>yi,EarthOrientationParameters:()=>Rw,EarthOrientationParametersSample:()=>R_,EasingFunction:()=>ys,EdgeDetectionPipelineStage:()=>bL,EdgeFramebuffer:()=>Tk,EdgeVisibilityPipelineStage:()=>TL,EllipseGeometry:()=>Yl,EllipseGeometryLibrary:()=>Bu,EllipseGeometryUpdater:()=>gF,EllipseGraphics:()=>HE,EllipseOutlineGeometry:()=>xf,Ellipsoid:()=>te,EllipsoidGeodesic:()=>vp,EllipsoidGeometry:()=>va,EllipsoidGeometryUpdater:()=>CF,EllipsoidGraphics:()=>YE,EllipsoidOutlineGeometry:()=>pf,EllipsoidPrimitive:()=>ok,EllipsoidRhumbLine:()=>_c,EllipsoidSurfaceAppearance:()=>Jee,EllipsoidTangentPlane:()=>Ss,EllipsoidTerrainProvider:()=>qm,EllipsoidalOccluder:()=>aA,Empty3DTileContent:()=>QT,EncodedCartesian3:()=>$n,Entity:()=>Er,EntityCluster:()=>_f,EntityCollection:()=>Da,EntityView:()=>rQ,Event:()=>_e,EventHelper:()=>kr,Expression:()=>fd,ExpressionNodeType:()=>bt,ExtrapolationType:()=>yf,FeatureDetection:()=>zt,FeatureIdPipelineStage:()=>PC,Fog:()=>Ck,ForEach:()=>Me,FrameRateMonitor:()=>hU,FrameState:()=>yk,Framebuffer:()=>os,FramebufferManager:()=>Ci,Frozen:()=>V,FrustumCommands:()=>Sk,FrustumGeometry:()=>j0,FrustumOutlineGeometry:()=>f2,Fullscreen:()=>Yr,FullscreenButton:()=>JU,FullscreenButtonViewModel:()=>KU,GaussianSplat3DTileContent:()=>HC,GaussianSplatPrimitive:()=>FT,GaussianSplatRenderResources:()=>d1,GaussianSplatSorter:()=>LT,GaussianSplatTextureGenerator:()=>f1,GeoJsonDataSource:()=>Ay,GeoJsonLoader:()=>SN,GeocodeType:()=>Ry,Geocoder:()=>ZU,GeocoderService:()=>wB,GeocoderViewModel:()=>XU,GeographicProjection:()=>Gi,GeographicTilingScheme:()=>Vi,Geometry:()=>ht,Geometry3DTileContent:()=>mM,GeometryAttribute:()=>ve,GeometryAttributes:()=>pn,GeometryFactory:()=>fZ,GeometryInstance:()=>Rt,GeometryInstanceAttribute:()=>kc,GeometryOffsetAttribute:()=>un,GeometryPipeline:()=>Un,GeometryPipelineStage:()=>DL,GeometryType:()=>Xf,GeometryUpdater:()=>Ei,GeometryUpdaterSet:()=>b0,GeometryVisualizer:()=>YF,GetFeatureInfoFormat:()=>BI,Globe:()=>ik,GlobeDepth:()=>Bk,GlobeSurfaceShaderSet:()=>W2,GlobeSurfaceTile:()=>Jd,GlobeSurfaceTileProvider:()=>q2,GlobeTranslucency:()=>K2,GlobeTranslucencyFramebuffer:()=>wk,GlobeTranslucencyState:()=>Ek,GltfBufferViewLoader:()=>Mx,GltfDracoLoader:()=>Nx,GltfGpmLoader:()=>AN,GltfGpmLocal:()=>Zx,GltfImageLoader:()=>Lx,GltfIndexBufferLoader:()=>Ox,GltfJsonLoader:()=>Qx,GltfLoader:()=>sf,GltfLoaderUtil:()=>pu,GltfMeshPrimitiveGpmLoader:()=>_N,GltfSpzLoader:()=>FM,GltfStructuralMetadataLoader:()=>cN,GltfTextureLoader:()=>kx,GltfVertexBufferLoader:()=>Ux,Google2DImageryProvider:()=>zL,GoogleEarthEnterpriseImageryProvider:()=>Zee,GoogleEarthEnterpriseMapsProvider:()=>LL,GoogleEarthEnterpriseMetadata:()=>f_,GoogleEarthEnterpriseTerrainData:()=>DB,GoogleEarthEnterpriseTerrainProvider:()=>_Z,GoogleEarthEnterpriseTileInformation:()=>d2,GoogleGeocoderService:()=>yZ,GoogleMaps:()=>yd,GpxDataSource:()=>dQ,GregorianDate:()=>Ap,GridImageryProvider:()=>$ee,GridMaterialProperty:()=>lS,GroundGeometryUpdater:()=>ti,GroundPolylineGeometry:()=>OE,GroundPolylinePrimitive:()=>xh,GroundPrimitive:()=>Cl,GroupMetadata:()=>qT,HeadingPitchRange:()=>zd,HeadingPitchRoll:()=>hc,Heap:()=>ww,HeightReference:()=>$e,HeightmapEncoding:()=>jd,HeightmapTerrainData:()=>Sc,HeightmapTessellator:()=>gB,HermitePolynomialApproximation:()=>rF,HermiteSpline:()=>wC,HilbertOrder:()=>Dx,HomeButton:()=>eG,HomeButtonViewModel:()=>$U,HorizontalOrigin:()=>Mi,I3SBuildingSceneLayerExplorer:()=>Hte,I3SBuildingSceneLayerExplorerViewModel:()=>tG,I3SDataProvider:()=>UA,I3SDecoder:()=>AU,I3SFeature:()=>mU,I3SField:()=>pU,I3SGeometry:()=>aw,I3SLayer:()=>Qb,I3SNode:()=>cw,I3SStatistics:()=>CU,I3SSublayer:()=>EU,I3SSymbology:()=>_U,I3dmLoader:()=>wN,I3dmParser:()=>BN,ITwinData:()=>ite,ITwinPlatform:()=>fa,Iau2000Orientation:()=>A2,Iau2006XysData:()=>Mw,Iau2006XysSample:()=>fE,IauOrientationAxes:()=>m2,IauOrientationParameters:()=>h2,ImageBasedLighting:()=>$E,ImageBasedLightingPipelineStage:()=>VN,ImageMaterialProperty:()=>J_,Imagery:()=>TT,ImageryConfiguration:()=>FO,ImageryCoverage:()=>wT,ImageryFlags:()=>WL,ImageryInput:()=>qL,ImageryLayer:()=>ds,ImageryLayerCollection:()=>t0,ImageryLayerFeatureInfo:()=>Yh,ImageryPipelineStage:()=>KL,ImageryProvider:()=>Ol,ImageryState:()=>Wn,Implicit3DTileContent:()=>Hx,ImplicitAvailabilityBitstream:()=>Px,ImplicitMetadataView:()=>Rx,ImplicitSubdivisionScheme:()=>Ds,ImplicitSubtree:()=>Zp,ImplicitSubtreeCache:()=>sU,ImplicitSubtreeMetadata:()=>pM,ImplicitTileCoordinates:()=>xm,ImplicitTileset:()=>bm,IndexDatatype:()=>Fe,InfoBox:()=>lG,InfoBoxViewModel:()=>cG,InspectorShared:()=>Gu,InstanceAttributeSemantic:()=>Ps,InstancingPipelineStage:()=>iL,InterpolationAlgorithm:()=>IZ,InterpolationType:()=>Uh,Intersect:()=>qt,IntersectionTests:()=>ci,Intersections2D:()=>wA,Interval:()=>qr,InvertClassification:()=>YB,Ion:()=>Rh,IonGeocodeProviderType:()=>d_,IonGeocoderService:()=>K0,IonImageryProvider:()=>Fl,IonImageryProviderFactory:()=>bT,IonResource:()=>ss,IonWorldImageryStyle:()=>pg,Iso8601:()=>Ke,JobScheduler:()=>Ik,JobType:()=>Ec,JsonMetadataTable:()=>ig,JulianDate:()=>J,KTX2Transcoder:()=>zw,KeyboardEventModifier:()=>Na,KeyframeNode:()=>Oo,KmlCamera:()=>hQ,KmlDataSource:()=>Q0,KmlLookAt:()=>jQ,KmlTour:()=>qQ,KmlTourFlyTo:()=>JQ,KmlTourWait:()=>XQ,Label:()=>kC,LabelCollection:()=>Cm,LabelGraphics:()=>Sh,LabelStyle:()=>cr,LabelVisualizer:()=>WF,LagrangePolynomialApproximation:()=>sF,LeapSecond:()=>lo,Light:()=>ote,LightingModel:()=>mm,LightingPipelineStage:()=>XL,LinearApproximation:()=>a0,LinearSpline:()=>BC,ManagedArray:()=>Dl,MapMode2D:()=>Lu,MapProjection:()=>TZ,MapboxImageryProvider:()=>OL,MapboxStyleImageryProvider:()=>rte,MappedPositions:()=>jL,Material:()=>uo,MaterialAppearance:()=>xo,MaterialPipelineStage:()=>$L,MaterialProperty:()=>yr,Math:()=>D,Matrix2:()=>zi,Matrix3:()=>X,Matrix4:()=>M,Megatexture:()=>ZB,MeshPrimitiveGpmLocal:()=>gN,MetadataClass:()=>Fh,MetadataClassProperty:()=>sm,MetadataComponentType:()=>kt,MetadataEntity:()=>Yn,MetadataEnum:()=>UM,MetadataEnumValue:()=>kM,MetadataPicking:()=>bk,MetadataPickingPipelineStage:()=>lf,MetadataPipelineStage:()=>_d,MetadataSchema:()=>Pl,MetadataSchemaLoader:()=>mC,MetadataSemantic:()=>md,MetadataTable:()=>dd,MetadataTableProperty:()=>_M,MetadataType:()=>_t,MipmapHint:()=>ed,Model:()=>qh,Model3DTileContent:()=>uf,ModelAlphaOptions:()=>RI,ModelAnimation:()=>MN,ModelAnimationChannel:()=>RN,ModelAnimationCollection:()=>NN,ModelAnimationLoop:()=>gu,ModelAnimationState:()=>Vh,ModelArticulation:()=>YN,ModelArticulationStage:()=>HN,ModelClippingPlanesPipelineStage:()=>qN,ModelClippingPolygonsPipelineStage:()=>XN,ModelColorPipelineStage:()=>vC,ModelComponents:()=>yn,ModelDrawCommand:()=>DO,ModelDrawCommands:()=>RO,ModelFeature:()=>LN,ModelFeatureTable:()=>FN,ModelGraphics:()=>Lp,ModelImagery:()=>QO,ModelImageryMapping:()=>DI,ModelLightingOptions:()=>xO,ModelMatrixUpdateStage:()=>oL,ModelNode:()=>ZN,ModelPrimitiveImagery:()=>vI,ModelReader:()=>hg,ModelRenderResources:()=>gO,ModelRuntimeNode:()=>sL,ModelRuntimePrimitive:()=>mO,ModelSceneGraph:()=>MO,ModelSilhouettePipelineStage:()=>yO,ModelSkin:()=>pO,ModelSplitterPipelineStage:()=>IO,ModelStatistics:()=>NO,ModelType:()=>Fr,ModelUtility:()=>Lt,ModelVisualizer:()=>jF,Moon:()=>sk,MorphTargetsPipelineStage:()=>tO,MorphWeightSpline:()=>SZ,MortonOrder:()=>jC,Multiple3DTileContent:()=>_1,MultisampleFramebuffer:()=>LP,NavigationHelpButton:()=>iG,NavigationHelpButtonViewModel:()=>nG,NearFarScalar:()=>Ht,NeverTileDiscardPolicy:()=>ate,NodeRenderResources:()=>bO,NodeStatisticsPipelineStage:()=>rL,NodeTransformationProperty:()=>WE,OIT:()=>Dk,Occluder:()=>_2,OffsetGeometryInstanceAttribute:()=>po,OpenCageGeocoderService:()=>DZ,OpenStreetMapImageryProvider:()=>T_,OrderedGroundPrimitiveCollection:()=>pF,OrientedBoundingBox:()=>$t,OrthographicFrustum:()=>fn,OrthographicOffCenterFrustum:()=>rs,Packable:()=>vZ,PackableForInterpolation:()=>PZ,Particle:()=>fw,ParticleBurst:()=>lte,ParticleEmitter:()=>ute,ParticleSystem:()=>fte,Pass:()=>we,PassState:()=>Fc,PathGraphics:()=>Op,PathVisualizer:()=>KF,PeliasGeocoderService:()=>g2,PerInstanceColorAppearance:()=>hn,PerformanceDisplay:()=>A_,PerformanceWatchdog:()=>rG,PerformanceWatchdogViewModel:()=>oG,PerspectiveFrustum:()=>ki,PerspectiveOffCenterFrustum:()=>Kl,PickDepth:()=>xk,PickDepthFramebuffer:()=>Pk,PickFramebuffer:()=>Rk,PickedMetadataInfo:()=>Y3,Picking:()=>Fk,PickingPipelineStage:()=>nO,PinBuilder:()=>$g,PixelDatatype:()=>Ge,PixelFormat:()=>qe,Plane:()=>rn,PlaneGeometry:()=>yF,PlaneGeometryUpdater:()=>IF,PlaneGraphics:()=>KR,PlaneOutlineGeometry:()=>EF,PntsLoader:()=>OO,PntsParser:()=>OI,PointCloud:()=>tU,PointCloudEyeDomeLighting:()=>rg,PointCloudShading:()=>fm,PointCloudStylingPipelineStage:()=>oO,PointGraphics:()=>qE,PointPrimitive:()=>aa,PointPrimitiveCollection:()=>oS,PointVisualizer:()=>XF,PolygonGeometry:()=>eg,PolygonGeometryLibrary:()=>Zn,PolygonGeometryUpdater:()=>SF,PolygonGraphics:()=>Bh,PolygonHierarchy:()=>Cc,PolygonOutlineGeometry:()=>TF,PolygonPipeline:()=>bi,Polyline:()=>xd,PolylineArrowMaterialProperty:()=>fS,PolylineCollection:()=>Zh,PolylineColorAppearance:()=>Bs,PolylineDashMaterialProperty:()=>hS,PolylineGeometry:()=>Zg,PolylineGeometryUpdater:()=>eQ,PolylineGlowMaterialProperty:()=>mS,PolylineGraphics:()=>Uc,PolylineMaterialAppearance:()=>ja,PolylineOutlineMaterialProperty:()=>ty,PolylinePipeline:()=>Wi,PolylineVisualizer:()=>nQ,PolylineVolumeGeometry:()=>DF,PolylineVolumeGeometryLibrary:()=>oA,PolylineVolumeGeometryUpdater:()=>MF,PolylineVolumeGraphics:()=>KE,PolylineVolumeOutlineGeometry:()=>RF,PositionProperty:()=>Th,PositionPropertyArray:()=>zg,PostProcessStage:()=>vo,PostProcessStageCollection:()=>r3,PostProcessStageComposite:()=>Fu,PostProcessStageLibrary:()=>Uf,PostProcessStageSampleMode:()=>kf,PostProcessStageTextureCache:()=>pb,PpeMetadata:()=>pN,PpeSource:()=>Pte,PpeTexture:()=>mN,Primitive:()=>Ln,PrimitiveCollection:()=>Hl,PrimitiveLoadPlan:()=>bI,PrimitiveOutlineGenerator:()=>II,PrimitiveOutlinePipelineStage:()=>aO,PrimitivePipeline:()=>ME,PrimitiveRenderResources:()=>TO,PrimitiveState:()=>Xr,PrimitiveStatisticsPipelineStage:()=>cO,PrimitiveType:()=>Pe,ProjectionPicker:()=>aG,ProjectionPickerViewModel:()=>sG,Property:()=>j,PropertyArray:()=>gS,PropertyAttribute:()=>EI,PropertyAttributeProperty:()=>oN,PropertyBag:()=>bl,PropertyTable:()=>Nl,PropertyTexture:()=>og,PropertyTextureProperty:()=>iN,ProviderViewModel:()=>or,Proxy:()=>RZ,QuadraticRealPolynomial:()=>Al,QuadtreeOccluders:()=>J2,QuadtreePrimitive:()=>nk,QuadtreeTile:()=>X2,QuadtreeTileLoadState:()=>La,QuadtreeTileProvider:()=>dte,QuantizedMeshTerrainData:()=>H0,QuarticRealPolynomial:()=>Yw,Quaternion:()=>Qe,QuaternionSpline:()=>PN,Queue:()=>yC,Ray:()=>gn,Rectangle:()=>ce,RectangleCollisionChecker:()=>T0,RectangleGeometry:()=>g0,RectangleGeometryLibrary:()=>ra,RectangleGeometryUpdater:()=>NF,RectangleGraphics:()=>wh,RectangleOutlineGeometry:()=>WI,ReferenceFrame:()=>$i,ReferenceProperty:()=>Vg,RenderState:()=>ze,Renderbuffer:()=>Ku,RenderbufferFormat:()=>pl,Request:()=>pr,RequestErrorEvent:()=>YA,RequestScheduler:()=>Nc,RequestState:()=>hi,RequestType:()=>Qs,Resource:()=>Be,ResourceCache:()=>Di,ResourceCacheKey:()=>Rl,ResourceCacheStatistics:()=>VM,ResourceLoader:()=>Yi,ResourceLoaderState:()=>dt,Rotation:()=>Od,RuntimeError:()=>ue,S2Cell:()=>Hp,SDFSettings:()=>Sa,SampledPositionProperty:()=>nc,SampledProperty:()=>If,Sampler:()=>Jt,ScaledPositionProperty:()=>Rm,Scene:()=>j3,SceneFramebuffer:()=>lb,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>lO,SceneModePicker:()=>AG,SceneModePickerViewModel:()=>hG,SceneTransforms:()=>to,SceneTransitioner:()=>a3,ScreenSpaceCameraController:()=>f3,ScreenSpaceEventHandler:()=>Ff,ScreenSpaceEventType:()=>Sn,SelectedFeatureIdPipelineStage:()=>MC,SelectionIndicator:()=>dG,SelectionIndicatorViewModel:()=>fG,SensorVolumePortionToDisplay:()=>ES,ShaderBuilder:()=>xp,ShaderCache:()=>vP,ShaderDestination:()=>pe,ShaderFunction:()=>QP,ShaderProgram:()=>sn,ShaderSource:()=>We,ShaderStruct:()=>FP,ShadowMap:()=>g_,ShadowMapShader:()=>np,ShadowMode:()=>Tn,ShadowVolumeAppearance:()=>$u,SharedContext:()=>kP,ShowGeometryInstanceAttribute:()=>xn,Simon1994PlanetaryPositions:()=>V_,SimplePolylineGeometry:()=>GZ,SingleTileImageryProvider:()=>FL,SkinningPipelineStage:()=>fO,SkyAtmosphere:()=>q3,SkyBox:()=>K3,SpatialNode:()=>G3,Spdcf:()=>hN,SpecularEnvironmentCubeMap:()=>Ph,SphereEmitter:()=>Ate,SphereGeometry:()=>zZ,SphereOutlineGeometry:()=>vg,Spherical:()=>aF,Spline:()=>Io,SplitDirection:()=>Lr,Splitter:()=>nw,StaticGeometryColorBatch:()=>Ud,StaticGeometryPerMaterialBatch:()=>Gd,StaticGroundGeometryColorBatch:()=>GS,StaticGroundGeometryPerMaterialBatch:()=>HF,StaticGroundPolylinePerMaterialBatch:()=>tQ,StaticOutlineGeometryBatch:()=>HS,StencilConstants:()=>Yt,StencilFunction:()=>Xn,StencilOperation:()=>yt,SteppedSpline:()=>vN,Stereographic:()=>Hc,StorageType:()=>bC,StripeMaterialProperty:()=>CS,StripeOrientation:()=>fA,StructuralMetadata:()=>xa,StyleCommandsNeeded:()=>Hh,StyleExpression:()=>mte,Sun:()=>Z3,SunLight:()=>bp,SunPostProcess:()=>A3,SupportedImageFormats:()=>lN,SvgPathBindingHandler:()=>PU,Sync:()=>UP,TaskProcessor:()=>qn,Terrain:()=>TU,TerrainData:()=>Mu,TerrainEncoding:()=>fr,TerrainFillMesh:()=>kB,TerrainMesh:()=>sc,TerrainOffsetProperty:()=>JE,TerrainPicker:()=>n2,TerrainProvider:()=>zo,TerrainQuantization:()=>Ma,TerrainState:()=>Do,Texture:()=>Bt,Texture3D:()=>bW,TextureAtlas:()=>BE,TextureCache:()=>PP,TextureMagnificationFilter:()=>mi,TextureManager:()=>L3,TextureMinificationFilter:()=>Kt,TexturePacker:()=>dx,TextureUniform:()=>Dte,TextureWrap:()=>En,TileAvailability:()=>BA,TileBoundingRegion:()=>mf,TileBoundingS2Cell:()=>I1,TileBoundingSphere:()=>Pg,TileBoundingVolume:()=>pte,TileCoordinatesImageryProvider:()=>BU,TileDiscardPolicy:()=>_te,TileEdge:()=>In,TileImagery:()=>ST,TileMapServiceImageryProvider:()=>LC,TileMetadata:()=>p1,TileOrientedBoundingBox:()=>xu,TileProviderError:()=>qo,TileReplacementQueue:()=>Z2,TileSelectionResult:()=>si,TileState:()=>Cte,Tileset3DTileContent:()=>GO,TilesetMetadata:()=>b1,TilesetPipelineStage:()=>QN,TilingScheme:()=>VZ,TimeConstants:()=>ri,TimeDynamicImagery:()=>wI,TimeDynamicPointCloud:()=>ow,TimeInterval:()=>wn,TimeIntervalCollection:()=>ps,TimeIntervalCollectionPositionProperty:()=>Hg,TimeIntervalCollectionProperty:()=>Yg,TimeStandard:()=>ni,Timeline:()=>gG,TimelineHighlightRange:()=>mG,TimelineTrack:()=>pG,Tipsify:()=>Ww,ToggleButtonViewModel:()=>Xy,Tonemapper:()=>C_,TrackingReferenceFrame:()=>Dp,Transforms:()=>It,TranslationRotationScale:()=>X_,TranslucentTileClassification:()=>Mk,TridiagonalSystemSolver:()=>sT,TrustedServers:()=>ex,TweenCollection:()=>Cb,UniformState:()=>NP,UniformType:()=>JB,UrlTemplateImageryProvider:()=>Vs,VERSION:()=>xOt,VRButton:()=>yG,VRButtonViewModel:()=>CG,VRTheWorldTerrainProvider:()=>HZ,VaryingType:()=>vte,Vector3DTileBatch:()=>om,Vector3DTileClampedPolylines:()=>c1,Vector3DTileContent:()=>u1,Vector3DTileGeometry:()=>Vp,Vector3DTilePoints:()=>t1,Vector3DTilePolygons:()=>n1,Vector3DTilePolylines:()=>zI,Vector3DTilePrimitive:()=>oI,VelocityOrientationProperty:()=>lF,VelocityVectorProperty:()=>Wg,VertexArray:()=>oi,VertexArrayFacade:()=>Tp,VertexAttributeSemantic:()=>rt,VertexFormat:()=>Re,VerticalExaggeration:()=>Eo,VerticalExaggerationPipelineStage:()=>hO,VerticalOrigin:()=>Gn,VideoSynchronizer:()=>YZ,View:()=>db,Viewer:()=>Xte,ViewportQuad:()=>yte,Visibility:()=>Vr,Visualizer:()=>w7,VoxelBoundsCollection:()=>I_,VoxelBoxShape:()=>Sb,VoxelCell:()=>g3,VoxelContent:()=>Tb,VoxelCylinderShape:()=>Bb,VoxelEllipsoidShape:()=>wb,VoxelInspector:()=>IG,VoxelInspectorViewModel:()=>EG,VoxelMetadataOrder:()=>nh,VoxelPrimitive:()=>qy,VoxelProvider:()=>Ite,VoxelRenderResources:()=>M3,VoxelShape:()=>bte,VoxelShapeType:()=>lc,VoxelTraversal:()=>z3,VulkanConstants:()=>WZ,WallGeometry:()=>OF,WallGeometryLibrary:()=>_0,WallGeometryUpdater:()=>kF,WallGraphics:()=>Fp,WallOutlineGeometry:()=>QF,WebGLConstants:()=>ee,WebMapServiceImageryProvider:()=>kL,WebMapTileServiceImageryProvider:()=>GL,WebMercatorProjection:()=>ui,WebMercatorTilingScheme:()=>Rs,WindingOrder:()=>ks,WireframeIndexGenerator:()=>DT,WireframePipelineStage:()=>AO,_shadersAcesTonemappingStage:()=>Qk,_shadersAdditiveBlend:()=>d3,_shadersAdjustTranslucentFS:()=>RB,_shadersAllMaterialAppearanceFS:()=>jP,_shadersAllMaterialAppearanceVS:()=>qP,_shadersAmbientOcclusionGenerate:()=>kk,_shadersAmbientOcclusionModulate:()=>Uk,_shadersAspectRampMaterial:()=>$P,_shadersAtmosphereCommon:()=>kh,_shadersAtmosphereStageFS:()=>kN,_shadersAtmosphereStageVS:()=>UN,_shadersBasicMaterialAppearanceFS:()=>KP,_shadersBasicMaterialAppearanceVS:()=>JP,_shadersBillboardCollectionFS:()=>zO,_shadersBillboardCollectionVS:()=>VO,_shadersBlackAndWhite:()=>Gk,_shadersBloomComposite:()=>zk,_shadersBrdfLutGeneratorFS:()=>S2,_shadersBrightPass:()=>h3,_shadersBrightness:()=>Vk,_shadersBumpMapMaterial:()=>eR,_shadersCPUStylingStageFS:()=>fL,_shadersCPUStylingStageVS:()=>uL,_shadersCheckerboardMaterial:()=>tR,_shadersCloudCollectionFS:()=>B2,_shadersCloudCollectionVS:()=>w2,_shadersCloudNoiseFS:()=>D2,_shadersCloudNoiseVS:()=>v2,_shadersCompareAndPackTranslucentDepth:()=>P2,_shadersCompositeOITFS:()=>R2,_shadersCompositeTranslucentClassification:()=>fb,_shadersComputeIrradianceFS:()=>JM,_shadersComputeRadianceMapFS:()=>XM,_shadersContrastBias:()=>Hk,_shadersConvolveSpecularMapFS:()=>ZM,_shadersConvolveSpecularMapVS:()=>$M,_shadersCustomShaderStageFS:()=>AL,_shadersCustomShaderStageVS:()=>hL,_shadersCzmBuiltins:()=>EE,_shadersDepthOfField:()=>Yk,_shadersDepthPlaneFS:()=>M2,_shadersDepthPlaneVS:()=>N2,_shadersDepthView:()=>Wk,_shadersDepthViewPacked:()=>wte,_shadersDotMaterial:()=>nR,_shadersEdgeDetection:()=>jk,_shadersEdgeDetectionStageFS:()=>IL,_shadersEdgeVisibilityStageFS:()=>xL,_shadersElevationBandMaterial:()=>iR,_shadersElevationContourMaterial:()=>oR,_shadersElevationRampMaterial:()=>rR,_shadersEllipsoidFS:()=>MB,_shadersEllipsoidSurfaceAppearanceFS:()=>fU,_shadersEllipsoidSurfaceAppearanceVS:()=>dU,_shadersEllipsoidVS:()=>NB,_shadersFXAA:()=>Jk,_shadersFXAA3_11:()=>L2,_shadersFadeMaterial:()=>sR,_shadersFeatureIdStageFS:()=>mL,_shadersFeatureIdStageVS:()=>pL,_shadersFilmicTonemapping:()=>qk,_shadersGaussianBlur1D:()=>Yy,_shadersGeometryStageFS:()=>SL,_shadersGeometryStageVS:()=>BL,_shadersGlobeFS:()=>O2,_shadersGlobeVS:()=>F2,_shadersGridMaterial:()=>aR,_shadersGroundAtmosphere:()=>LB,_shadersHSBToRGB:()=>jD,_shadersHSLToRGB:()=>qD,_shadersImageBasedLightingStageFS:()=>zN,_shadersInstancingStageCommon:()=>$N,_shadersInstancingStageVS:()=>eL,_shadersIntersectBox:()=>T3,_shadersIntersectCylinder:()=>S3,_shadersIntersectDepth:()=>b3,_shadersIntersectEllipsoid:()=>B3,_shadersIntersectLongitude:()=>KB,_shadersIntersectPlane:()=>x3,_shadersIntersection:()=>Ib,_shadersIntersectionUtils:()=>I3,_shadersLegacyInstancingStageVS:()=>tL,_shadersLensFlare:()=>Xk,_shadersLightingStageFS:()=>JL,_shadersMaterialStageFS:()=>ZL,_shadersMegatexture:()=>R3,_shadersMetadataStageFS:()=>gL,_shadersMetadataStageVS:()=>_L,_shadersModelClippingPlanesStageFS:()=>jN,_shadersModelClippingPolygonsStageFS:()=>JN,_shadersModelClippingPolygonsStageVS:()=>KN,_shadersModelColorStageFS:()=>WN,_shadersModelFS:()=>PO,_shadersModelSilhouetteStageFS:()=>_O,_shadersModelSilhouetteStageVS:()=>CO,_shadersModelSplitterStageFS:()=>EO,_shadersModelVS:()=>vO,_shadersModifiedReinhardTonemapping:()=>Zk,_shadersMorphTargetsStageVS:()=>eO,_shadersNightVision:()=>$k,_shadersNormalMapMaterial:()=>cR,_shadersOctree:()=>P3,_shadersPassThrough:()=>Ou,_shadersPassThroughDepth:()=>zy,_shadersPbrNeutralTonemapping:()=>Kk,_shadersPerInstanceColorAppearanceFS:()=>CR,_shadersPerInstanceColorAppearanceVS:()=>yR,_shadersPerInstanceFlatColorAppearanceFS:()=>PE,_shadersPerInstanceFlatColorAppearanceVS:()=>ER,_shadersPointCloudEyeDomeLighting:()=>yN,_shadersPointCloudStylingStageVS:()=>iO,_shadersPointPrimitiveCollectionFS:()=>ey,_shadersPointPrimitiveCollectionVS:()=>J1,_shadersPolygonSignedDistanceFS:()=>qM,_shadersPolylineArrowMaterial:()=>lR,_shadersPolylineColorAppearanceVS:()=>OR,_shadersPolylineCommon:()=>ef,_shadersPolylineDashMaterial:()=>uR,_shadersPolylineFS:()=>QE,_shadersPolylineGlowMaterial:()=>fR,_shadersPolylineMaterialAppearanceVS:()=>FR,_shadersPolylineOutlineMaterial:()=>dR,_shadersPolylineShadowVolumeFS:()=>RR,_shadersPolylineShadowVolumeMorphFS:()=>MR,_shadersPolylineShadowVolumeMorphVS:()=>NR,_shadersPolylineShadowVolumeVS:()=>LR,_shadersPolylineVS:()=>KO,_shadersPrimitiveGaussianSplatFS:()=>A1,_shadersPrimitiveGaussianSplatVS:()=>h1,_shadersPrimitiveOutlineStageFS:()=>sO,_shadersPrimitiveOutlineStageVS:()=>rO,_shadersRGBToHSB:()=>KD,_shadersRGBToHSL:()=>JD,_shadersRGBToXYZ:()=>XD,_shadersReinhardTonemapping:()=>e3,_shadersReprojectWebMercatorFS:()=>HL,_shadersReprojectWebMercatorVS:()=>YL,_shadersRimLightingMaterial:()=>hR,_shadersSelectedFeatureIdStageCommon:()=>hT,_shadersShadowVolumeAppearanceFS:()=>_x,_shadersShadowVolumeAppearanceVS:()=>xR,_shadersShadowVolumeFS:()=>j_,_shadersSilhouette:()=>t3,_shadersSkinningStageVS:()=>uO,_shadersSkyAtmosphereCommon:()=>OB,_shadersSkyAtmosphereFS:()=>Q2,_shadersSkyAtmosphereVS:()=>k2,_shadersSkyBoxFS:()=>U2,_shadersSkyBoxVS:()=>G2,_shadersSlopeRampMaterial:()=>AR,_shadersStripeMaterial:()=>mR,_shadersSunFS:()=>z2,_shadersSunTextureFS:()=>V2,_shadersSunVS:()=>H2,_shadersTexturedMaterialAppearanceFS:()=>XP,_shadersTexturedMaterialAppearanceVS:()=>ZP,_shadersVector3DTileClampedPolylinesFS:()=>s1,_shadersVector3DTileClampedPolylinesVS:()=>r1,_shadersVector3DTilePolylinesVS:()=>i1,_shadersVectorTileVS:()=>wx,_shadersVerticalExaggerationStageVS:()=>dO,_shadersViewportQuadFS:()=>Y2,_shadersViewportQuadVS:()=>dE,_shadersVoxelFS:()=>y3,_shadersVoxelUtils:()=>C3,_shadersVoxelVS:()=>E3,_shadersWater:()=>gR,_shadersWaterMaskMaterial:()=>pR,_shadersXYZToRGB:()=>ZD,_shadersacesTonemapping:()=>$D,_shadersalphaWeight:()=>ev,_shadersantialias:()=>tv,_shadersapplyHSBShift:()=>nv,_shadersapproximateSphericalCoordinates:()=>iv,_shadersapproximateTanh:()=>ov,_shadersbackFacing:()=>rv,_shadersbranchFreeTernary:()=>sv,_shaderscascadeColor:()=>av,_shaderscascadeDistance:()=>cv,_shaderscascadeMatrix:()=>lv,_shaderscascadeWeights:()=>uv,_shadersclipPolygons:()=>fv,_shaderscolumbusViewMorph:()=>dv,_shaderscomputeAtmosphereColor:()=>hv,_shaderscomputeGroundAtmosphereScattering:()=>Av,_shaderscomputePosition:()=>mv,_shaderscomputeScattering:()=>pv,_shadersconvertLocalToBoxUv:()=>w3,_shadersconvertLocalToCylinderUv:()=>D3,_shadersconvertLocalToEllipsoidUv:()=>v3,_shaderscosineAndSine:()=>gv,_shadersdecompressTextureCoordinates:()=>_v,_shadersdegreesPerRadian:()=>$w,_shadersdepthClamp:()=>Cv,_shadersdepthRange:()=>eD,_shadersdepthRangeStruct:()=>kD,_shaderseastNorthUpToEyeCoordinates:()=>yv,_shadersellipsoidContainsPoint:()=>Ev,_shadersellipsoidTextureCoordinates:()=>Iv,_shadersepsilon1:()=>tD,_shadersepsilon2:()=>nD,_shadersepsilon3:()=>iD,_shadersepsilon4:()=>oD,_shadersepsilon5:()=>rD,_shadersepsilon6:()=>sD,_shadersepsilon7:()=>aD,_shadersequalsEpsilon:()=>bv,_shaderseyeOffset:()=>xv,_shaderseyeToWindowCoordinates:()=>Tv,_shadersfastApproximateAtan:()=>Sv,_shadersfog:()=>Bv,_shadersgammaCorrect:()=>wv,_shadersgeodeticSurfaceNormal:()=>Dv,_shadersgetDefaultMaterial:()=>vv,_shadersgetDynamicAtmosphereLightDirection:()=>Pv,_shadersgetLambertDiffuse:()=>Rv,_shadersgetSpecular:()=>Mv,_shadersgetWaterNoise:()=>Nv,_shadershue:()=>Lv,_shadersinfinity:()=>cD,_shadersinverseGamma:()=>Ov,_shadersisEmpty:()=>Fv,_shadersisFull:()=>Qv,_shaderslatitudeToWebMercatorFraction:()=>kv,_shaderslineDistance:()=>Uv,_shaderslinearToSrgb:()=>Gv,_shadersluminance:()=>zv,_shadersmaterial:()=>UD,_shadersmaterialInput:()=>GD,_shadersmaximumComponent:()=>Vv,_shadersmetersPerPixel:()=>Hv,_shadersmodelMaterial:()=>zD,_shadersmodelToWindowCoordinates:()=>Yv,_shadersmodelVertexOutput:()=>VD,_shadersmultiplyWithColorBalance:()=>Wv,_shadersnearFarScalar:()=>jv,_shadersoctDecode:()=>qv,_shadersoneOverPi:()=>lD,_shadersoneOverTwoPi:()=>uD,_shaderspackDepth:()=>Kv,_shaderspassCesium3DTile:()=>fD,_shaderspassCesium3DTileClassification:()=>dD,_shaderspassCesium3DTileClassificationIgnoreShow:()=>hD,_shaderspassCesium3DTileEdges:()=>AD,_shaderspassClassification:()=>mD,_shaderspassCompute:()=>pD,_shaderspassEnvironment:()=>gD,_shaderspassGaussianSplats:()=>_D,_shaderspassGlobe:()=>CD,_shaderspassOpaque:()=>yD,_shaderspassOverlay:()=>ED,_shaderspassTerrainClassification:()=>ID,_shaderspassTranslucent:()=>bD,_shaderspassVoxels:()=>xD,_shaderspbrLighting:()=>Jv,_shaderspbrNeutralTonemapping:()=>Xv,_shadersphong:()=>Zv,_shaderspi:()=>TD,_shaderspiOverFour:()=>SD,_shaderspiOverSix:()=>BD,_shaderspiOverThree:()=>wD,_shaderspiOverTwo:()=>DD,_shadersplaneDistance:()=>$v,_shaderspointAlongRay:()=>eP,_shadersradiansPerDegree:()=>vD,_shadersray:()=>HD,_shadersrayEllipsoidIntersectionInterval:()=>tP,_shadersraySegment:()=>YD,_shadersraySphereIntersectionInterval:()=>nP,_shadersreadDepth:()=>iP,_shadersreadNonPerspective:()=>oP,_shadersreverseLogDepth:()=>rP,_shadersround:()=>sP,_shaderssaturation:()=>aP,_shaderssceneMode2D:()=>PD,_shaderssceneMode3D:()=>RD,_shaderssceneModeColumbusView:()=>MD,_shaderssceneModeMorphing:()=>ND,_shadersshadowDepthCompare:()=>cP,_shadersshadowParameters:()=>WD,_shadersshadowVisibility:()=>lP,_shaderssignNotZero:()=>uP,_shaderssolarRadius:()=>LD,_shaderssphericalHarmonics:()=>fP,_shaderssrgbToLinear:()=>dP,_shaderstangentToEyeSpaceMatrix:()=>hP,_shaderstextureCube:()=>AP,_shadersthreePiOver2:()=>OD,_shaderstransformPlane:()=>mP,_shaderstranslateRelativeToEye:()=>pP,_shaderstranslucentPhong:()=>gP,_shaderstranspose:()=>_P,_shaderstwoPi:()=>FD,_shadersunpackClippingExtents:()=>CP,_shadersunpackDepth:()=>yP,_shadersunpackFloat:()=>EP,_shadersunpackUint:()=>IP,_shadersvalueTransform:()=>bP,_shadersvertexLogDepth:()=>xP,_shaderswebMercatorMaxLatitude:()=>QD,_shaderswindowToEyeCoordinates:()=>TP,_shaderswriteDepthClamp:()=>SP,_shaderswriteLogDepth:()=>BP,_shaderswriteNonPerspective:()=>wP,addAllToArray:()=>ei,addBuffer:()=>vM,addDefaults:()=>bM,addExtensionsRequired:()=>BM,addExtensionsUsed:()=>hd,addPipelineExtras:()=>cC,addToArray:()=>ta,appendForwardSlash:()=>xw,arrayRemoveDuplicates:()=>Uo,barycentricCoordinates:()=>AE,binarySearch:()=>go,buildModuleUrl:()=>Zt,buildVoxelDrawCommands:()=>N3,clone:()=>Ve,combine:()=>St,computeFlyToLocationForRectangle:()=>tb,createBillboardPointCallback:()=>QI,createCommand:()=>Dn,createDefaultImageryProviderViewModels:()=>UU,createDefaultTerrainProviderViewModels:()=>GU,createElevationBandMaterial:()=>xte,createGooglePhotorealistic3DTileset:()=>Tte,createGuid:()=>jn,createMaterialPropertyDescriptor:()=>er,createOsmBuildingsAsync:()=>Ste,createPropertyDescriptor:()=>me,createRawPropertyDescriptor:()=>Il,createTangentSpaceDebugPrimitive:()=>Bte,createTaskProcessorWorker:()=>Rte,createUniform:()=>Fw,createUniformArray:()=>Qw,createWorldBathymetryAsync:()=>E2,createWorldImageryAsync:()=>gg,createWorldTerrainAsync:()=>Z0,decodeGoogleEarthEnterpriseData:()=>I2,decodeVectorPolylinePositions:()=>l1,defer:()=>ou,defined:()=>l,demodernizeShader:()=>DP,deprecationWarning:()=>Ea,destroyObject:()=>de,exportKml:()=>M7,findAccessorMinMax:()=>hI,findContentMetadata:()=>HI,findGroupMetadata:()=>YI,findTileMetadata:()=>g1,forEachTextureInMaterial:()=>Fx,formatError:()=>hm,freezeRenderState:()=>SY,getAbsoluteUri:()=>VA,getAccessorByteStride:()=>mu,getBaseUri:()=>Tw,getBinaryAccessor:()=>ld,getClipAndStyleCode:()=>$3,getClippingFunction:()=>nb,getComponentReader:()=>Xp,getElement:()=>On,getExtensionFromUri:()=>mp,getFilenameFromUri:()=>Ug,getImageFromTypedArray:()=>b2,getImagePixels:()=>hh,getJsonFromTypedArray:()=>Ir,getMagic:()=>Mh,getMeshPrimitives:()=>CN,getMetadataClassProperty:()=>H3,getMetadataProperty:()=>W3,getStringFromTypedArray:()=>du,getTimestamp:()=>Oi,hasExtension:()=>Ii,heightReferenceOnEntityPropertyChanged:()=>Qp,isBitSet:()=>il,isBlobUri:()=>oE,isCrossOriginUrl:()=>N_,isDataUri:()=>Ah,isLeapYear:()=>dh,knockout:()=>xe,knockout_3_5_1:()=>kb,knockout_es5:()=>vU,loadAndExecuteScript:()=>rE,loadCubeMap:()=>zP,loadImageFromTypedArray:()=>Kp,loadKTX2:()=>su,mergeSort:()=>Xm,moveTechniqueRenderStates:()=>SM,moveTechniquesToExtension:()=>wM,numberOfComponentsForType:()=>of,objectToQuery:()=>sE,oneTimeWarning:()=>At,parseBatchTable:()=>cg,parseFeatureMetadataLegacy:()=>aN,parseGlb:()=>dI,parseResponseHeaders:()=>Sw,parseStructuralMetadata:()=>sN,pickModel:()=>vT,pointInsideTriangle:()=>XZ,preprocess3DTileContent:()=>Bg,processVoxelProperties:()=>_3,queryToObject:()=>Wu,readAccessorPacked:()=>PM,removeExtension:()=>AI,removeExtensionsRequired:()=>xM,removeExtensionsUsed:()=>fI,removePipelineExtras:()=>TM,removeUnusedElements:()=>DM,resizeImageToNextPowerOfTwo:()=>fC,sampleTerrain:()=>x2,sampleTerrainMostDetailed:()=>$0,scaleToGeodeticSurface:()=>iE,srgbToLinear:()=>eb,subdivideArray:()=>TR,subscribeAndEvaluate:()=>uc,updateAccessorComponentTypes:()=>RM,updateVersion:()=>MM,usesExtension:()=>Or,viewerCesium3DTilesInspectorMixin:()=>Zte,viewerCesiumInspectorMixin:()=>$te,viewerDragDropMixin:()=>tne,viewerPerformanceWatchdogMixin:()=>nne,viewerVoxelInspectorMixin:()=>one,webGLConstantToGlslType:()=>e$,wrapFunction:()=>T2,writeTextToCanvas:()=>UI});module.exports=fh(TOt);function bDe(e){return e!=null}var l=bDe;function tE(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(tE.prototype=Object.create(Error.prototype),tE.prototype.constructor=tE);tE.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};tE.throwInstantiationError=function(){throw new tE("This function defines an interface and should not be called directly.")};var Ae=tE;var $s={};$s.typeOf={};function xDe(e){return`${e} is required, actual value was undefined`}function Hb(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}$s.defined=function(e,t){if(!l(t))throw new Ae(xDe(e))};$s.typeOf.func=function(e,t){if(typeof t!="function")throw new Ae(Hb(typeof t,"function",e))};$s.typeOf.string=function(e,t){if(typeof t!="string")throw new Ae(Hb(typeof t,"string",e))};$s.typeOf.number=function(e,t){if(typeof t!="number")throw new Ae(Hb(typeof t,"number",e))};$s.typeOf.number.lessThan=function(e,t,n){if($s.typeOf.number(e,t),t>=n)throw new Ae(`Expected ${e} to be less than ${n}, actual value was ${t}`)};$s.typeOf.number.lessThanOrEquals=function(e,t,n){if($s.typeOf.number(e,t),t>n)throw new Ae(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};$s.typeOf.number.greaterThan=function(e,t,n){if($s.typeOf.number(e,t),t<=n)throw new Ae(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};$s.typeOf.number.greaterThanOrEquals=function(e,t,n){if($s.typeOf.number(e,t),t<n)throw new Ae(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};$s.typeOf.object=function(e,t){if(typeof t!="object")throw new Ae(Hb(typeof t,"object",e))};$s.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new Ae(Hb(typeof t,"boolean",e))};$s.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new Ae(Hb(typeof t,"bigint",e))};$s.typeOf.number.equals=function(e,t,n,i){if($s.typeOf.number(e,n),$s.typeOf.number(t,i),n!==i)throw new Ae(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Fo=$s;var L9=mr(SG(),1);var ft={};ft.EPSILON1=.1;ft.EPSILON2=.01;ft.EPSILON3=.001;ft.EPSILON4=1e-4;ft.EPSILON5=1e-5;ft.EPSILON6=1e-6;ft.EPSILON7=1e-7;ft.EPSILON8=1e-8;ft.EPSILON9=1e-9;ft.EPSILON10=1e-10;ft.EPSILON11=1e-11;ft.EPSILON12=1e-12;ft.EPSILON13=1e-13;ft.EPSILON14=1e-14;ft.EPSILON15=1e-15;ft.EPSILON16=1e-16;ft.EPSILON17=1e-17;ft.EPSILON18=1e-18;ft.EPSILON19=1e-19;ft.EPSILON20=1e-20;ft.EPSILON21=1e-21;ft.GRAVITATIONALPARAMETER=3986004418e5;ft.SOLAR_RADIUS=6955e5;ft.LUNAR_RADIUS=1737400;ft.SIXTY_FOUR_KILOBYTES=64*1024;ft.FOUR_GIGABYTES=4*1024*1024*1024;ft.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};ft.signNotZero=function(e){return e<0?-1:1};ft.toSNorm=function(e,t){return t=t??255,Math.round((ft.clamp(e,-1,1)*.5+.5)*t)};ft.fromSNorm=function(e,t){return t=t??255,ft.clamp(e,0,t)/t*2-1};ft.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:ft.clamp((e-t)/n,0,1)};ft.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};ft.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};ft.lerp=function(e,t,n){return(1-n)*e+n*t};ft.PI=Math.PI;ft.ONE_OVER_PI=1/Math.PI;ft.PI_OVER_TWO=Math.PI/2;ft.PI_OVER_THREE=Math.PI/3;ft.PI_OVER_FOUR=Math.PI/4;ft.PI_OVER_SIX=Math.PI/6;ft.THREE_PI_OVER_TWO=3*Math.PI/2;ft.TWO_PI=2*Math.PI;ft.ONE_OVER_TWO_PI=1/(2*Math.PI);ft.RADIANS_PER_DEGREE=Math.PI/180;ft.DEGREES_PER_RADIAN=180/Math.PI;ft.RADIANS_PER_ARCSECOND=ft.RADIANS_PER_DEGREE/3600;ft.toRadians=function(e){return e*ft.RADIANS_PER_DEGREE};ft.toDegrees=function(e){return e*ft.DEGREES_PER_RADIAN};ft.convertLongitudeRange=function(e){let t=ft.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};ft.clampToLatitudeRange=function(e){return ft.clamp(e,-1*ft.PI_OVER_TWO,ft.PI_OVER_TWO)};ft.negativePiToPi=function(e){return e>=-ft.PI&&e<=ft.PI?e:ft.zeroToTwoPi(e+ft.PI)-ft.PI};ft.zeroToTwoPi=function(e){if(e>=0&&e<=ft.TWO_PI)return e;let t=ft.mod(e,ft.TWO_PI);return Math.abs(t)<ft.EPSILON14&&Math.abs(e)>ft.EPSILON14?ft.TWO_PI:t};ft.mod=function(e,t){return ft.sign(e)===ft.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};ft.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))};ft.lessThan=function(e,t,n){return e-t<-n};ft.lessThanOrEquals=function(e,t,n){return e-t<n};ft.greaterThan=function(e,t,n){return e-t>n};ft.greaterThanOrEquals=function(e,t,n){return e-t>-n};var BG=[1];ft.factorial=function(e){let t=BG.length;if(e>=t){let n=BG[t-1];for(let i=t;i<=e;i++){let o=n*i;BG.push(o),n=o}}return BG[e]};ft.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};ft.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};ft.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};ft.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};ft.clamp=function(e,t,n){return e<t?t:e>n?n:e};var fne=new L9.default;ft.setRandomNumberSeed=function(e){fne=new L9.default(e)};ft.nextRandomNumber=function(){return fne.random()};ft.randomBetween=function(e,t){return ft.nextRandomNumber()*(t-e)+e};ft.acosClamped=function(e){return Math.acos(ft.clamp(e,-1,1))};ft.asinClamped=function(e){return Math.asin(ft.clamp(e,-1,1))};ft.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};ft.logBase=function(e,t){return Math.log(e)/Math.log(t)};ft.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};ft.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};ft.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};ft.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};ft.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=ft.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?ft.PI_OVER_TWO-i:i,i=e<0?ft.PI-i:i,i=t<0?-i:i,i};var D=ft;function tt(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}tt.fromSpherical=function(e,t){l(t)||(t=new tt);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};tt.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new tt(e,t,n)};tt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new tt(e.x,e.y,e.z)};tt.fromCartesian4=tt.clone;tt.packedLength=3;tt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};tt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new tt),n.x=e[t++],n.y=e[t++],n.z=e[t],n};tt.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)tt.pack(e[o],t,o*3);return t};tt.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]=tt.unpack(e,i,t[o])}return t};tt.fromArray=tt.unpack;tt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};tt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};tt.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};tt.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};tt.clamp=function(e,t,n,i){let o=D.clamp(e.x,t.x,n.x),r=D.clamp(e.y,t.y,n.y),s=D.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};tt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};tt.magnitude=function(e){return Math.sqrt(tt.magnitudeSquared(e))};var DG=new tt;tt.distance=function(e,t){return tt.subtract(e,t,DG),tt.magnitude(DG)};tt.distanceSquared=function(e,t){return tt.subtract(e,t,DG),tt.magnitudeSquared(DG)};tt.normalize=function(e,t){let n=tt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};tt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};tt.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};tt.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};tt.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};tt.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};tt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};tt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};tt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};tt.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 dne=new tt;tt.lerp=function(e,t,n,i){return tt.multiplyByScalar(t,n,dne),i=tt.multiplyByScalar(e,1-n,i),tt.add(dne,i,i)};var wG=new tt,O9=new tt;tt.angleBetween=function(e,t){tt.normalize(e,wG),tt.normalize(t,O9);let n=tt.dot(wG,O9),i=tt.magnitude(tt.cross(wG,O9,wG));return Math.atan2(i,n)};var TDe=new tt;tt.mostOrthogonalAxis=function(e,t){let n=tt.normalize(e,TDe);return tt.abs(n,n),n.x<=n.y?n.x<=n.z?t=tt.clone(tt.UNIT_X,t):t=tt.clone(tt.UNIT_Z,t):n.y<=n.z?t=tt.clone(tt.UNIT_Y,t):t=tt.clone(tt.UNIT_Z,t),t};tt.projectVector=function(e,t,n){let i=tt.dot(e,t)/tt.dot(t,t);return tt.multiplyByScalar(t,i,n)};tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};tt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};tt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.x,t.x,n,i)&&D.equalsEpsilon(e.y,t.y,n,i)&&D.equalsEpsilon(e.z,t.z,n,i)};tt.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,u=o*c-r*a,f=r*s-i*c,h=i*a-o*s;return n.x=u,n.y=f,n.z=h,n};tt.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};tt.fromDegrees=function(e,t,n,i,o){return e=D.toRadians(e),t=D.toRadians(t),tt.fromRadians(e,t,n,i,o)};var Kf=new tt,Yb=new tt;tt._ellipsoidRadiiSquared=new tt(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);tt.fromRadians=function(e,t,n,i,o){n=n??0;let r=l(i)?i.radiiSquared:tt._ellipsoidRadiiSquared,s=Math.cos(t);Kf.x=s*Math.cos(e),Kf.y=s*Math.sin(e),Kf.z=Math.sin(t),Kf=tt.normalize(Kf,Kf),tt.multiplyComponents(r,Kf,Yb);let a=Math.sqrt(tt.dot(Kf,Yb));return Yb=tt.divideByScalar(Yb,a,Yb),Kf=tt.multiplyByScalar(Kf,n,Kf),l(o)||(o=new tt),tt.add(Yb,Kf,o)};tt.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]=tt.fromDegrees(r,s,0,t,n[a])}return n};tt.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]=tt.fromRadians(r,s,0,t,n[a])}return n};tt.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]=tt.fromDegrees(r,s,a,t,n[c])}return n};tt.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]=tt.fromRadians(r,s,a,t,n[c])}return n};tt.ZERO=Object.freeze(new tt(0,0,0));tt.ONE=Object.freeze(new tt(1,1,1));tt.UNIT_X=Object.freeze(new tt(1,0,0));tt.UNIT_Y=Object.freeze(new tt(0,1,0));tt.UNIT_Z=Object.freeze(new tt(0,0,1));tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.prototype.equalsEpsilon=function(e,t,n){return tt.equalsEpsilon(this,e,t,n)};tt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var d=tt;function Tt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}Tt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new Tt(e,t,n,i)};Tt.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 Tt(e.red,e.green,e.blue,e.alpha)};Tt.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 Tt(e.x,e.y,e.z,e.w)};Tt.packedLength=4;Tt.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};Tt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Tt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};Tt.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)Tt.pack(e[o],t,o*4);return t};Tt.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]=Tt.unpack(e,i,t[o])}return t};Tt.fromArray=Tt.unpack;Tt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};Tt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};Tt.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};Tt.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};Tt.clamp=function(e,t,n,i){let o=D.clamp(e.x,t.x,n.x),r=D.clamp(e.y,t.y,n.y),s=D.clamp(e.z,t.z,n.z),a=D.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};Tt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};Tt.magnitude=function(e){return Math.sqrt(Tt.magnitudeSquared(e))};var vG=new Tt;Tt.distance=function(e,t){return Tt.subtract(e,t,vG),Tt.magnitude(vG)};Tt.distanceSquared=function(e,t){return Tt.subtract(e,t,vG),Tt.magnitudeSquared(vG)};Tt.normalize=function(e,t){let n=Tt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};Tt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};Tt.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};Tt.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};Tt.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};Tt.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};Tt.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};Tt.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};Tt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};Tt.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 hne=new Tt;Tt.lerp=function(e,t,n,i){return Tt.multiplyByScalar(t,n,hne),i=Tt.multiplyByScalar(e,1-n,i),Tt.add(hne,i,i)};var SDe=new Tt;Tt.mostOrthogonalAxis=function(e,t){let n=Tt.normalize(e,SDe);return Tt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=Tt.clone(Tt.UNIT_X,t):t=Tt.clone(Tt.UNIT_W,t):n.z<=n.w?t=Tt.clone(Tt.UNIT_Z,t):t=Tt.clone(Tt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=Tt.clone(Tt.UNIT_Y,t):t=Tt.clone(Tt.UNIT_W,t):n.z<=n.w?t=Tt.clone(Tt.UNIT_Z,t):t=Tt.clone(Tt.UNIT_W,t),t};Tt.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};Tt.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]};Tt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.x,t.x,n,i)&&D.equalsEpsilon(e.y,t.y,n,i)&&D.equalsEpsilon(e.z,t.z,n,i)&&D.equalsEpsilon(e.w,t.w,n,i)};Tt.ZERO=Object.freeze(new Tt(0,0,0,0));Tt.ONE=Object.freeze(new Tt(1,1,1,1));Tt.UNIT_X=Object.freeze(new Tt(1,0,0,0));Tt.UNIT_Y=Object.freeze(new Tt(0,1,0,0));Tt.UNIT_Z=Object.freeze(new Tt(0,0,1,0));Tt.UNIT_W=Object.freeze(new Tt(0,0,0,1));Tt.prototype.clone=function(e){return Tt.clone(this,e)};Tt.prototype.equals=function(e){return Tt.equals(this,e)};Tt.prototype.equalsEpsilon=function(e,t,n){return Tt.equalsEpsilon(this,e,t,n)};Tt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var F9=new Float32Array(1),vc=new Uint8Array(F9.buffer),BDe=new Uint32Array([287454020]),wDe=new Uint8Array(BDe.buffer),Ane=wDe[0]===68;Tt.packFloat=function(e,t){return l(t)||(t=new Tt),F9[0]=e,Ane?(t.x=vc[0],t.y=vc[1],t.z=vc[2],t.w=vc[3]):(t.x=vc[3],t.y=vc[2],t.z=vc[1],t.w=vc[0]),t};Tt.unpackFloat=function(e){return Ane?(vc[0]=e.x,vc[1]=e.y,vc[2]=e.z,vc[3]=e.w):(vc[0]=e.w,vc[1]=e.z,vc[2]=e.y,vc[3]=e.x),F9[0]};var se=Tt;var Q9={};Q9.EMPTY_OBJECT=Object.freeze({});Q9.EMPTY_ARRAY=Object.freeze([]);var V=Q9;function ot(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}ot.packedLength=9;ot.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};ot.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ot),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};ot.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)ot.pack(e[o],t,o*9);return t};ot.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]=ot.unpack(e,i,t[o])}return t};ot.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 ot(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};ot.fromArray=ot.unpack;ot.fromColumnMajorArray=function(e,t){return ot.clone(e,t)};ot.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 ot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};ot.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,u=e.z*e.z,f=e.z*e.w,h=e.w*e.w,m=n-s-u+h,g=2*(i-f),A=2*(o+c),_=2*(i+f),C=-n+s-u+h,y=2*(a-r),E=2*(o-c),I=2*(a+r),x=-n-s+u+h;return l(t)?(t[0]=m,t[1]=_,t[2]=E,t[3]=g,t[4]=C,t[5]=I,t[6]=A,t[7]=y,t[8]=x,t):new ot(m,g,A,_,C,y,E,I,x)};ot.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,u=-o*s+a*r*i,f=a*s+o*r*i,h=n*s,m=o*i+a*r*s,g=-a*i+o*r*s,A=-r,_=a*n,C=o*n;return l(t)?(t[0]=c,t[1]=h,t[2]=A,t[3]=u,t[4]=m,t[5]=_,t[6]=f,t[7]=g,t[8]=C,t):new ot(c,u,f,h,m,g,A,_,C)};ot.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 ot(e.x,0,0,0,e.y,0,0,0,e.z)};ot.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 ot(e,0,0,0,e,0,0,0,e)};ot.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 ot(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};ot.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 ot(1,0,0,0,n,-i,0,i,n)};ot.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 ot(n,0,i,0,1,0,-i,0,n)};ot.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 ot(n,-i,0,i,n,0,0,0,1)};ot.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]]};ot.getElementIndex=function(e,t){return e*3+t};ot.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};ot.setColumn=function(e,t,n,i){i=ot.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};ot.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};ot.setRow=function(e,t,n,i){return i=ot.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var DDe=new d;ot.setScale=function(e,t,n){let i=ot.getScale(e,DDe),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 vDe=new d;ot.setUniformScale=function(e,t,n){let i=ot.getScale(e,vDe),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 k9=new d;ot.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],k9)),t.y=d.magnitude(d.fromElements(e[3],e[4],e[5],k9)),t.z=d.magnitude(d.fromElements(e[6],e[7],e[8],k9)),t};var mne=new d;ot.getMaximumScale=function(e){return ot.getScale(e,mne),d.maximumComponent(mne)};var PDe=new d;ot.setRotation=function(e,t,n){let i=ot.getScale(e,PDe);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 RDe=new d;ot.getRotation=function(e,t){let n=ot.getScale(e,RDe);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};ot.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],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=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]=u,n[7]=f,n[8]=h,n};ot.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};ot.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};ot.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};ot.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};ot.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};ot.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};ot.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};ot.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],u=e[5],f=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]=u,t[8]=f,t};function MDe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var U9=[1,0,0],G9=[2,2,1];function NDe(e){let t=0;for(let n=0;n<3;++n){let i=e[ot.getElementIndex(G9[n],U9[n])];t+=2*i*i}return Math.sqrt(t)}function LDe(e,t){let n=D.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[ot.getElementIndex(G9[u],U9[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=U9[o],c=G9[o];if(Math.abs(e[ot.getElementIndex(c,a)])>n){let u=e[ot.getElementIndex(c,c)],f=e[ot.getElementIndex(a,a)],h=e[ot.getElementIndex(c,a)],m=(u-f)/2/h,g;m<0?g=-1/(-m+Math.sqrt(1+m*m)):g=1/(m+Math.sqrt(1+m*m)),r=1/Math.sqrt(1+g*g),s=g*r}return t=ot.clone(ot.IDENTITY,t),t[ot.getElementIndex(a,a)]=t[ot.getElementIndex(c,c)]=r,t[ot.getElementIndex(c,a)]=s,t[ot.getElementIndex(a,c)]=-s,t}var PG=new ot,pne=new ot;ot.computeEigenDecomposition=function(e,t){let n=D.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=ot.clone(ot.IDENTITY,t.unitary),a=t.diagonal=ot.clone(e,t.diagonal),c=n*MDe(a);for(;r<i&&NDe(a)>c;)LDe(a,PG),ot.transpose(PG,pne),ot.multiply(a,PG,a),ot.multiply(pne,a,a),ot.multiply(s,PG,s),++o>2&&(++r,o=0);return t};ot.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};ot.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],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};ot.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],u=e[7],f=e[8],h=ot.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let m=1/h;return ot.multiplyByScalar(t,m,t)};var ODe=new ot;ot.inverseTranspose=function(e,t){return ot.inverse(ot.transpose(e,ODe),t)};ot.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]};ot.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};ot.IDENTITY=Object.freeze(new ot(1,0,0,0,1,0,0,0,1));ot.ZERO=Object.freeze(new ot(0,0,0,0,0,0,0,0,0));ot.COLUMN0ROW0=0;ot.COLUMN0ROW1=1;ot.COLUMN0ROW2=2;ot.COLUMN1ROW0=3;ot.COLUMN1ROW1=4;ot.COLUMN1ROW2=5;ot.COLUMN2ROW0=6;ot.COLUMN2ROW1=7;ot.COLUMN2ROW2=8;Object.defineProperties(ot.prototype,{length:{get:function(){return ot.packedLength}}});ot.prototype.clone=function(e){return ot.clone(this,e)};ot.prototype.equals=function(e){return ot.equals(this,e)};ot.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]};ot.prototype.equalsEpsilon=function(e,t){return ot.equalsEpsilon(this,e,t)};ot.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
(${this[1]}, ${this[4]}, ${this[7]})
(${this[2]}, ${this[5]}, ${this[8]})`};var X=ot;function yw(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(yw.prototype=Object.create(Error.prototype),yw.prototype.constructor=yw);yw.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};var ue=yw;function it(e,t,n,i,o,r,s,a,c,u,f,h,m,g,A,_){this[0]=e??0,this[1]=o??0,this[2]=c??0,this[3]=m??0,this[4]=t??0,this[5]=r??0,this[6]=u??0,this[7]=g??0,this[8]=n??0,this[9]=s??0,this[10]=f??0,this[11]=A??0,this[12]=i??0,this[13]=a??0,this[14]=h??0,this[15]=_??0}it.packedLength=16;it.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};it.unpack=function(e,t,n){return t=t??0,l(n)||(n=new it),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};it.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)it.pack(e[o],t,o*16);return t};it.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]=it.unpack(e,i,t[o])}return t};it.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 it(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])};it.fromArray=it.unpack;it.fromColumnMajorArray=function(e,t){return it.clone(e,t)};it.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 it(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])};it.fromRotationTranslation=function(e,t,n){return t=t??d.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 it(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)};it.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new it);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,h=t.y*t.y,m=t.y*t.z,g=t.y*t.w,A=t.z*t.z,_=t.z*t.w,C=t.w*t.w,y=a-h-A+C,E=2*(c-_),I=2*(u+g),x=2*(c+_),S=-a+h-A+C,w=2*(m-f),v=2*(u-g),P=2*(m+f),N=-a-h+A+C;return i[0]=y*o,i[1]=x*o,i[2]=v*o,i[3]=0,i[4]=E*r,i[5]=S*r,i[6]=P*r,i[7]=0,i[8]=I*s,i[9]=w*s,i[10]=N*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};it.fromTranslationRotationScale=function(e,t){return it.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};it.fromTranslation=function(e,t){return it.fromRotationTranslation(X.IDENTITY,e,t)};it.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 it(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};it.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 it(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};it.fromRotation=function(e,t){return l(t)||(t=new it),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 Wb=new d,jb=new d,Ew=new d;it.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;d.normalize(i,Wb),d.normalize(d.cross(Wb,o,jb),jb),d.normalize(d.cross(jb,Wb,Ew),Ew);let r=jb.x,s=jb.y,a=jb.z,c=Wb.x,u=Wb.y,f=Wb.z,h=Ew.x,m=Ew.y,g=Ew.z,A=n.x,_=n.y,C=n.z,y=r*-A+s*-_+a*-C,E=h*-A+m*-_+g*-C,I=c*A+u*_+f*C;return l(t)?(t[0]=r,t[1]=h,t[2]=-c,t[3]=0,t[4]=s,t[5]=m,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=y,t[13]=E,t[14]=I,t[15]=1,t):new it(r,s,a,y,h,m,g,E,-c,-u,-f,I,0,0,0,1)};it.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=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]=u,o[15]=0,o};it.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*a,h=-(i+n)*c,m=-(r+o)*u;return a*=2,c*=2,u*=-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]=u,s[11]=0,s[12]=f,s[13]=h,s[14]=m,s[15]=1,s};it.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),h=-(r+o)/(r-o),m=-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]=u,s[9]=f,s[10]=h,s[11]=m,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};it.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,h=-1,m=-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]=u,r[10]=f,r[11]=h,r[12]=0,r[13]=0,r[14]=m,r[15]=0,r};it.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new it),e=e??V.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,u=a*.5,f=(n-t)*.5,h=c,m=u,g=f,A=o+c,_=r+u,C=t+f,y=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=m,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=A,i[13]=_,i[14]=C,i[15]=y,i};it.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]=-d.dot(i,e),o[13]=-d.dot(n,e),o[14]=d.dot(t,e),o[15]=1,o};it.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]]};it.getElementIndex=function(e,t){return e*4+t};it.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};it.setColumn=function(e,t,n,i){i=it.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};it.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};it.setRow=function(e,t,n,i){return i=it.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};it.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 FDe=new d;it.setScale=function(e,t,n){let i=it.getScale(e,FDe),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 QDe=new d;it.setUniformScale=function(e,t,n){let i=it.getScale(e,QDe),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 z9=new d;it.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],z9)),t.y=d.magnitude(d.fromElements(e[4],e[5],e[6],z9)),t.z=d.magnitude(d.fromElements(e[8],e[9],e[10],z9)),t};var gne=new d;it.getMaximumScale=function(e){return it.getScale(e,gne),d.maximumComponent(gne)};var kDe=new d;it.setRotation=function(e,t,n){let i=it.getScale(e,kDe);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 UDe=new d;it.getRotation=function(e,t){let n=it.getScale(e,UDe);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};it.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],h=e[8],m=e[9],g=e[10],A=e[11],_=e[12],C=e[13],y=e[14],E=e[15],I=t[0],x=t[1],S=t[2],w=t[3],v=t[4],P=t[5],N=t[6],L=t[7],p=t[8],b=t[9],T=t[10],B=t[11],R=t[12],O=t[13],U=t[14],k=t[15],z=i*I+a*x+h*S+_*w,Q=o*I+c*x+m*S+C*w,H=r*I+u*x+g*S+y*w,W=s*I+f*x+A*S+E*w,Z=i*v+a*P+h*N+_*L,Y=o*v+c*P+m*N+C*L,$=r*v+u*P+g*N+y*L,K=s*v+f*P+A*N+E*L,fe=i*p+a*b+h*T+_*B,ge=o*p+c*b+m*T+C*B,ne=r*p+u*b+g*T+y*B,Ce=s*p+f*b+A*T+E*B,ye=i*R+a*O+h*U+_*k,De=o*R+c*O+m*U+C*k,be=r*R+u*O+g*U+y*k,Ne=s*R+f*O+A*U+E*k;return n[0]=z,n[1]=Q,n[2]=H,n[3]=W,n[4]=Z,n[5]=Y,n[6]=$,n[7]=K,n[8]=fe,n[9]=ge,n[10]=ne,n[11]=Ce,n[12]=ye,n[13]=De,n[14]=be,n[15]=Ne,n};it.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};it.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};it.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],h=e[10],m=e[12],g=e[13],A=e[14],_=t[0],C=t[1],y=t[2],E=t[4],I=t[5],x=t[6],S=t[8],w=t[9],v=t[10],P=t[12],N=t[13],L=t[14],p=i*_+s*C+u*y,b=o*_+a*C+f*y,T=r*_+c*C+h*y,B=i*E+s*I+u*x,R=o*E+a*I+f*x,O=r*E+c*I+h*x,U=i*S+s*w+u*v,k=o*S+a*w+f*v,z=r*S+c*w+h*v,Q=i*P+s*N+u*L+m,H=o*P+a*N+f*L+g,W=r*P+c*N+h*L+A;return n[0]=p,n[1]=b,n[2]=T,n[3]=0,n[4]=B,n[5]=R,n[6]=O,n[7]=0,n[8]=U,n[9]=k,n[10]=z,n[11]=0,n[12]=Q,n[13]=H,n[14]=W,n[15]=1,n};it.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],h=e[10],m=t[0],g=t[1],A=t[2],_=t[3],C=t[4],y=t[5],E=t[6],I=t[7],x=t[8],S=i*m+s*g+u*A,w=o*m+a*g+f*A,v=r*m+c*g+h*A,P=i*_+s*C+u*y,N=o*_+a*C+f*y,L=r*_+c*C+h*y,p=i*E+s*I+u*x,b=o*E+a*I+f*x,T=r*E+c*I+h*x;return n[0]=S,n[1]=w,n[2]=v,n[3]=0,n[4]=P,n[5]=N,n[6]=L,n[7]=0,n[8]=p,n[9]=b,n[10]=T,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};it.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};it.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?it.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)};it.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};it.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,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};it.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};it.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};it.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};it.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};it.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};it.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};it.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]};it.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};it.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};it.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 GDe=new X,zDe=new X,VDe=new se,HDe=new se(0,0,0,1);it.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],u=e[13],f=e[2],h=e[6],m=e[10],g=e[14],A=e[3],_=e[7],C=e[11],y=e[15],E=m*y,I=g*C,x=h*y,S=g*_,w=h*C,v=m*_,P=f*y,N=g*A,L=f*C,p=m*A,b=f*_,T=h*A,B=E*a+S*c+w*u-(I*a+x*c+v*u),R=I*s+P*c+p*u-(E*s+N*c+L*u),O=x*s+N*a+b*u-(S*s+P*a+T*u),U=v*s+L*a+T*c-(w*s+p*a+b*c),k=I*i+x*o+v*r-(E*i+S*o+w*r),z=E*n+N*o+L*r-(I*n+P*o+p*r),Q=S*n+P*i+T*r-(x*n+N*i+b*r),H=w*n+p*i+b*o-(v*n+L*i+T*o);E=o*u,I=r*c,x=i*u,S=r*a,w=i*c,v=o*a,P=n*u,N=r*s,L=n*c,p=o*s,b=n*a,T=i*s;let W=E*_+S*C+w*y-(I*_+x*C+v*y),Z=I*A+P*C+p*y-(E*A+N*C+L*y),Y=x*A+N*_+b*y-(S*A+P*_+T*y),$=v*A+L*_+T*C-(w*A+p*_+b*C),K=x*m+v*g+I*h-(w*g+E*h+S*m),fe=L*g+E*f+N*m-(P*m+p*g+I*f),ge=P*h+T*g+S*f-(b*g+x*f+N*h),ne=b*m+w*f+p*h-(L*h+T*m+v*f),Ce=n*B+i*R+o*O+r*U;if(Math.abs(Ce)<D.EPSILON21){if(X.equalsEpsilon(it.getMatrix3(e,GDe),zDe,D.EPSILON7)&&se.equals(it.getRow(e,3,VDe),HDe))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 ue("matrix is not invertible because its determinate is zero.")}return Ce=1/Ce,t[0]=B*Ce,t[1]=R*Ce,t[2]=O*Ce,t[3]=U*Ce,t[4]=k*Ce,t[5]=z*Ce,t[6]=Q*Ce,t[7]=H*Ce,t[8]=W*Ce,t[9]=Z*Ce,t[10]=Y*Ce,t[11]=$*Ce,t[12]=K*Ce,t[13]=fe*Ce,t[14]=ge*Ce,t[15]=ne*Ce,t};it.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],u=e[9],f=e[10],h=e[12],m=e[13],g=e[14],A=-n*h-i*m-o*g,_=-r*h-s*m-a*g,C=-c*h-u*m-f*g;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=A,t[13]=_,t[14]=C,t[15]=1,t};var YDe=new it;it.inverseTranspose=function(e,t){return it.inverse(it.transpose(e,YDe),t)};it.IDENTITY=Object.freeze(new it(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));it.ZERO=Object.freeze(new it(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));it.COLUMN0ROW0=0;it.COLUMN0ROW1=1;it.COLUMN0ROW2=2;it.COLUMN0ROW3=3;it.COLUMN1ROW0=4;it.COLUMN1ROW1=5;it.COLUMN1ROW2=6;it.COLUMN1ROW3=7;it.COLUMN2ROW0=8;it.COLUMN2ROW1=9;it.COLUMN2ROW2=10;it.COLUMN2ROW3=11;it.COLUMN3ROW0=12;it.COLUMN3ROW1=13;it.COLUMN3ROW2=14;it.COLUMN3ROW3=15;Object.defineProperties(it.prototype,{length:{get:function(){return it.packedLength}}});it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.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]};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.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 M=it;var WDe={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},ee=Object.freeze(WDe);var jDe=new d;function vt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var za={};za[ee.FLOAT]="float";za[ee.FLOAT_VEC2]="vec2";za[ee.FLOAT_VEC3]="vec3";za[ee.FLOAT_VEC4]="vec4";za[ee.INT]="int";za[ee.INT_VEC2]="ivec2";za[ee.INT_VEC3]="ivec3";za[ee.INT_VEC4]="ivec4";za[ee.BOOL]="bool";za[ee.BOOL_VEC2]="bvec2";za[ee.BOOL_VEC3]="bvec3";za[ee.BOOL_VEC4]="bvec4";za[ee.FLOAT_MAT2]="mat2";za[ee.FLOAT_MAT3]="mat3";za[ee.FLOAT_MAT4]="mat4";za[ee.SAMPLER_2D]="sampler2D";za[ee.SAMPLER_CUBE]="samplerCube";vt.prototype.getDeclaration=function(e){let t=`uniform ${za[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var qDe={czm_viewport:new vt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new vt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new vt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new vt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new vt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_model:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new vt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new vt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new vt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new vt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new vt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new vt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new vt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new vt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new vt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new vt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new vt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new vt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new vt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new vt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,jDe)}}),czm_frameNumber:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new vt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new vt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new vt({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new vt({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new vt({size:9,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new vt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new vt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new vt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new vt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},dp=qDe;function KDe(){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 jn=KDe;function JDe(){return!0}function XDe(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=JDe}var de=XDe;var pa={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT};pa.getSizeInBytes=function(e){switch(e){case pa.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case pa.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case pa.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};pa.fromSizeInBytes=function(e){switch(e){case 2:return pa.UNSIGNED_SHORT;case 4:return pa.UNSIGNED_INT;case 1:return pa.UNSIGNED_BYTE}};pa.validate=function(e){return l(e)&&(e===pa.UNSIGNED_BYTE||e===pa.UNSIGNED_SHORT||e===pa.UNSIGNED_INT)};pa.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};pa.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};pa.fromTypedArray=function(e){if(e instanceof Uint8Array)return pa.UNSIGNED_BYTE;if(e instanceof Uint16Array)return pa.UNSIGNED_SHORT;if(e instanceof Uint32Array)return pa.UNSIGNED_INT};var Fe=Object.freeze(pa);var Iw={STREAM_DRAW:ee.STREAM_DRAW,STATIC_DRAW:ee.STATIC_DRAW,DYNAMIC_DRAW:ee.DYNAMIC_DRAW,DYNAMIC_READ:ee.DYNAMIC_READ,validate:function(e){return e===Iw.STREAM_DRAW||e===Iw.STATIC_DRAW||e===Iw.DYNAMIC_DRAW||e===Iw.DYNAMIC_READ}},Oe=Object.freeze(Iw);function Pc(e){e=e??V.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=jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Pc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new Ae("A WebGL 2 context is required to create PixelBuffers.");return new Pc({context:e.context,bufferTarget:ee.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Pc.createVertexBuffer=function(e){return new Pc({context:e.context,bufferTarget:ee.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Pc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Fe.getSizeInBytes(n),o=new Pc({context:t,bufferTarget:ee.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(Pc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Pc.prototype._getBuffer=function(){return this._buffer};Pc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Pc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Pc.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)};Pc.prototype.copyFromBuffer=function(e,t,n,i){let o=ee.COPY_READ_BUFFER,r=ee.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)};Pc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=ee.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Pc.prototype.isDestroyed=function(){return!1};Pc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),de(this)};var ut=Pc;var P_,ns={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},iu={};Object.defineProperties(iu,{element:{get:function(){if(iu.supportsFullscreen())return document[ns.fullscreenElement]}},changeEventName:{get:function(){if(iu.supportsFullscreen())return ns.fullscreenchange}},errorEventName:{get:function(){if(iu.supportsFullscreen())return ns.fullscreenerror}},enabled:{get:function(){if(iu.supportsFullscreen())return document[ns.fullscreenEnabled]}},fullscreen:{get:function(){if(iu.supportsFullscreen())return iu.element!==null}}});iu.supportsFullscreen=function(){if(l(P_))return P_;P_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return ns.requestFullscreen="requestFullscreen",ns.exitFullscreen="exitFullscreen",ns.fullscreenEnabled="fullscreenEnabled",ns.fullscreenElement="fullscreenElement",ns.fullscreenchange="fullscreenchange",ns.fullscreenerror="fullscreenerror",P_=!0,P_;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"?(ns.requestFullscreen=n,P_=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(ns.requestFullscreen=n,P_=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?ns.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(ns.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?ns.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(ns.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?ns.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(ns.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),ns.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),ns.fullscreenerror=n)}return P_};iu.requestFullscreen=function(e,t){iu.supportsFullscreen()&&e[ns.requestFullscreen]({vrDisplay:t})};iu.exitFullscreen=function(){iu.supportsFullscreen()&&document[ns.exitFullscreen]()};iu._names=ns;var Yr=iu;var Rc;typeof navigator<"u"?Rc=navigator:Rc={};function nE(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var RG,_ne;function q9(){if(!l(RG)&&(RG=!1,!QG())){let e=/ Chrome\/([\.0-9]+)/.exec(Rc.userAgent);e!==null&&(RG=!0,_ne=nE(e[1]))}return RG}function ZDe(){return q9()&&_ne}var MG,Cne;function yne(){if(!l(MG)&&(MG=!1,!q9()&&!QG()&&/ Safari\/[\.0-9]+/.test(Rc.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Rc.userAgent);e!==null&&(MG=!0,Cne=nE(e[1]))}return MG}function $De(){return yne()&&Cne}var NG,W9;function Ene(){if(!l(NG)){NG=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Rc.userAgent);e!==null&&(NG=!0,W9=nE(e[1]),W9.isNightly=!!e[2])}return NG}function eve(){return Ene()&&W9}var bw,j9;function Ine(){if(!l(bw)){bw=!1;let e;Rc.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Rc.userAgent),e!==null&&(bw=!0,j9=nE(e[1]))):Rc.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Rc.userAgent),e!==null&&(bw=!0,j9=nE(e[1])))}return bw}function tve(){return Ine()&&j9}var LG,bne;function QG(){if(!l(LG)){LG=!1;let e=/ Edg\/([\.0-9]+)/.exec(Rc.userAgent);e!==null&&(LG=!0,bne=nE(e[1]))}return LG}function nve(){return QG()&&bne}var OG,K9;function kG(){if(!l(OG)){OG=!1;let e=/Firefox\/([\.0-9]+)/.exec(Rc.userAgent);e!==null&&(OG=!0,K9=nE(e[1]))}return OG}var V9;function ive(){return l(V9)||(V9=/Windows/i.test(Rc.appVersion)),V9}var H9;function ove(){return l(H9)||(H9=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),H9}function rve(){return kG()&&K9}var Y9;function sve(){return l(Y9)||(Y9=!kG()&&typeof PointerEvent<"u"&&(!l(Rc.pointerEnabled)||Rc.pointerEnabled)),Y9}var xne,FG;function Tne(){if(!l(FG)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;FG=l(t)&&t!=="",FG&&(xne=t)}return FG}function ave(){return Tne()?xne:void 0}function dl(){return dl._result}dl._promise=void 0;dl._result=void 0;dl.initialize=function(){return l(dl._promise)||(dl._promise=new Promise(e=>{let t=new Image;t.onload=function(){dl._result=t.width>0&&t.height>0,e(dl._result)},t.onerror=function(){dl._result=!1,e(dl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),dl._promise};Object.defineProperties(dl,{initialized:{get:function(){return l(dl._result)}}});var qb=[];typeof ArrayBuffer<"u"&&(qb.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&qb.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&qb.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&qb.push(BigInt64Array),typeof BigUint64Array<"u"&&qb.push(BigUint64Array));var Jf={isChrome:q9,chromeVersion:ZDe,isSafari:yne,safariVersion:$De,isWebkit:Ene,webkitVersion:eve,isInternetExplorer:Ine,internetExplorerVersion:tve,isEdge:QG,edgeVersion:nve,isFirefox:kG,firefoxVersion:rve,isWindows:ive,isIPadOrIOS:ove,hardwareConcurrency:Rc.hardwareConcurrency??3,supportsPointerEvents:sve,supportsImageRenderingPixelated:Tne,supportsWebP:dl,imageRenderingValue:ave,typedArrayTypes:qb};Jf.supportsBasis=function(e){return Jf.supportsWebAssembly()&&e.context.supportsBasis};Jf.supportsFullscreen=function(){return Yr.supportsFullscreen()};Jf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Jf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Jf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Jf.supportsBigInt=function(){return typeof BigInt<"u"};Jf.supportsWebWorkers=function(){return typeof Worker<"u"};Jf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Jf.supportsWebgl2=function(e){return e.context.webgl2};Jf.supportsEsmWebWorkers=function(){return!kG()||parseInt(K9)>=114};var zt=Jf;function J9(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 ae(e,t,n,i){this.red=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}ae.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 ae(e.x,e.y,e.z,e.w)};ae.fromBytes=function(e,t,n,i,o){return e=ae.byteToFloat(e??255),t=ae.byteToFloat(t??255),n=ae.byteToFloat(n??255),i=ae.byteToFloat(i??255),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new ae(e,t,n,i)};ae.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 ae(e.red,e.green,e.blue,t)};var X9,Z9,hp;zt.supportsTypedArrays()&&(X9=new ArrayBuffer(4),Z9=new Uint32Array(X9),hp=new Uint8Array(X9));ae.fromRgba=function(e,t){return Z9[0]=e,ae.fromBytes(hp[0],hp[1],hp[2],hp[3],t)};ae.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 u=2*n-c;r=J9(u,c,e+1/3),s=J9(u,c,e),a=J9(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new ae(r,s,a,i)};ae.fromRandom=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.red;if(!l(n)){let s=e.minimumRed??0,a=e.maximumRed??1;n=s+D.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;i=s+D.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;o=s+D.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;r=s+D.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ae(n,i,o,r)};var cve=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,lve=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,uve=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,fve=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;ae.fromCssColorString=function(e,t){l(t)||(t=new ae),e=e.trim();let n=ae[e.toUpperCase()];if(l(n))return ae.clone(n,t),t;let i=cve.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=lve.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=uve.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=fve.exec(e),i!==null?ae.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};ae.packedLength=4;ae.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};ae.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ae),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ae.byteToFloat=function(e){return e/255};ae.floatToByte=function(e){return e===1?255:e*256|0};ae.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 ae(e.red,e.green,e.blue,e.alpha)};ae.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};ae.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]};ae.prototype.clone=function(e){return ae.clone(this,e)};ae.prototype.equals=function(e){return ae.equals(this,e)};ae.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};ae.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ae.prototype.toCssColorString=function(){let e=ae.floatToByte(this.red),t=ae.floatToByte(this.green),n=ae.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ae.prototype.toCssHexString=function(){let e=ae.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ae.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ae.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ae.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ae.prototype.toBytes=function(e){let t=ae.floatToByte(this.red),n=ae.floatToByte(this.green),i=ae.floatToByte(this.blue),o=ae.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ae.bytesToRgba=function(e,t,n,i){return hp[0]=e,hp[1]=t,hp[2]=n,hp[3]=i,Z9[0]};ae.prototype.toRgba=function(){return ae.bytesToRgba(ae.floatToByte(this.red),ae.floatToByte(this.green),ae.floatToByte(this.blue),ae.floatToByte(this.alpha))};ae.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};ae.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};ae.prototype.withAlpha=function(e,t){return ae.fromAlpha(this,e,t)};ae.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};ae.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};ae.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};ae.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};ae.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};ae.lerp=function(e,t,n,i){return i.red=D.lerp(e.red,t.red,n),i.green=D.lerp(e.green,t.green,n),i.blue=D.lerp(e.blue,t.blue,n),i.alpha=D.lerp(e.alpha,t.alpha,n),i};ae.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};ae.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};ae.ALICEBLUE=Object.freeze(ae.fromCssColorString("#F0F8FF"));ae.ANTIQUEWHITE=Object.freeze(ae.fromCssColorString("#FAEBD7"));ae.AQUA=Object.freeze(ae.fromCssColorString("#00FFFF"));ae.AQUAMARINE=Object.freeze(ae.fromCssColorString("#7FFFD4"));ae.AZURE=Object.freeze(ae.fromCssColorString("#F0FFFF"));ae.BEIGE=Object.freeze(ae.fromCssColorString("#F5F5DC"));ae.BISQUE=Object.freeze(ae.fromCssColorString("#FFE4C4"));ae.BLACK=Object.freeze(ae.fromCssColorString("#000000"));ae.BLANCHEDALMOND=Object.freeze(ae.fromCssColorString("#FFEBCD"));ae.BLUE=Object.freeze(ae.fromCssColorString("#0000FF"));ae.BLUEVIOLET=Object.freeze(ae.fromCssColorString("#8A2BE2"));ae.BROWN=Object.freeze(ae.fromCssColorString("#A52A2A"));ae.BURLYWOOD=Object.freeze(ae.fromCssColorString("#DEB887"));ae.CADETBLUE=Object.freeze(ae.fromCssColorString("#5F9EA0"));ae.CHARTREUSE=Object.freeze(ae.fromCssColorString("#7FFF00"));ae.CHOCOLATE=Object.freeze(ae.fromCssColorString("#D2691E"));ae.CORAL=Object.freeze(ae.fromCssColorString("#FF7F50"));ae.CORNFLOWERBLUE=Object.freeze(ae.fromCssColorString("#6495ED"));ae.CORNSILK=Object.freeze(ae.fromCssColorString("#FFF8DC"));ae.CRIMSON=Object.freeze(ae.fromCssColorString("#DC143C"));ae.CYAN=Object.freeze(ae.fromCssColorString("#00FFFF"));ae.DARKBLUE=Object.freeze(ae.fromCssColorString("#00008B"));ae.DARKCYAN=Object.freeze(ae.fromCssColorString("#008B8B"));ae.DARKGOLDENROD=Object.freeze(ae.fromCssColorString("#B8860B"));ae.DARKGRAY=Object.freeze(ae.fromCssColorString("#A9A9A9"));ae.DARKGREEN=Object.freeze(ae.fromCssColorString("#006400"));ae.DARKGREY=ae.DARKGRAY;ae.DARKKHAKI=Object.freeze(ae.fromCssColorString("#BDB76B"));ae.DARKMAGENTA=Object.freeze(ae.fromCssColorString("#8B008B"));ae.DARKOLIVEGREEN=Object.freeze(ae.fromCssColorString("#556B2F"));ae.DARKORANGE=Object.freeze(ae.fromCssColorString("#FF8C00"));ae.DARKORCHID=Object.freeze(ae.fromCssColorString("#9932CC"));ae.DARKRED=Object.freeze(ae.fromCssColorString("#8B0000"));ae.DARKSALMON=Object.freeze(ae.fromCssColorString("#E9967A"));ae.DARKSEAGREEN=Object.freeze(ae.fromCssColorString("#8FBC8F"));ae.DARKSLATEBLUE=Object.freeze(ae.fromCssColorString("#483D8B"));ae.DARKSLATEGRAY=Object.freeze(ae.fromCssColorString("#2F4F4F"));ae.DARKSLATEGREY=ae.DARKSLATEGRAY;ae.DARKTURQUOISE=Object.freeze(ae.fromCssColorString("#00CED1"));ae.DARKVIOLET=Object.freeze(ae.fromCssColorString("#9400D3"));ae.DEEPPINK=Object.freeze(ae.fromCssColorString("#FF1493"));ae.DEEPSKYBLUE=Object.freeze(ae.fromCssColorString("#00BFFF"));ae.DIMGRAY=Object.freeze(ae.fromCssColorString("#696969"));ae.DIMGREY=ae.DIMGRAY;ae.DODGERBLUE=Object.freeze(ae.fromCssColorString("#1E90FF"));ae.FIREBRICK=Object.freeze(ae.fromCssColorString("#B22222"));ae.FLORALWHITE=Object.freeze(ae.fromCssColorString("#FFFAF0"));ae.FORESTGREEN=Object.freeze(ae.fromCssColorString("#228B22"));ae.FUCHSIA=Object.freeze(ae.fromCssColorString("#FF00FF"));ae.GAINSBORO=Object.freeze(ae.fromCssColorString("#DCDCDC"));ae.GHOSTWHITE=Object.freeze(ae.fromCssColorString("#F8F8FF"));ae.GOLD=Object.freeze(ae.fromCssColorString("#FFD700"));ae.GOLDENROD=Object.freeze(ae.fromCssColorString("#DAA520"));ae.GRAY=Object.freeze(ae.fromCssColorString("#808080"));ae.GREEN=Object.freeze(ae.fromCssColorString("#008000"));ae.GREENYELLOW=Object.freeze(ae.fromCssColorString("#ADFF2F"));ae.GREY=ae.GRAY;ae.HONEYDEW=Object.freeze(ae.fromCssColorString("#F0FFF0"));ae.HOTPINK=Object.freeze(ae.fromCssColorString("#FF69B4"));ae.INDIANRED=Object.freeze(ae.fromCssColorString("#CD5C5C"));ae.INDIGO=Object.freeze(ae.fromCssColorString("#4B0082"));ae.IVORY=Object.freeze(ae.fromCssColorString("#FFFFF0"));ae.KHAKI=Object.freeze(ae.fromCssColorString("#F0E68C"));ae.LAVENDER=Object.freeze(ae.fromCssColorString("#E6E6FA"));ae.LAVENDAR_BLUSH=Object.freeze(ae.fromCssColorString("#FFF0F5"));ae.LAWNGREEN=Object.freeze(ae.fromCssColorString("#7CFC00"));ae.LEMONCHIFFON=Object.freeze(ae.fromCssColorString("#FFFACD"));ae.LIGHTBLUE=Object.freeze(ae.fromCssColorString("#ADD8E6"));ae.LIGHTCORAL=Object.freeze(ae.fromCssColorString("#F08080"));ae.LIGHTCYAN=Object.freeze(ae.fromCssColorString("#E0FFFF"));ae.LIGHTGOLDENRODYELLOW=Object.freeze(ae.fromCssColorString("#FAFAD2"));ae.LIGHTGRAY=Object.freeze(ae.fromCssColorString("#D3D3D3"));ae.LIGHTGREEN=Object.freeze(ae.fromCssColorString("#90EE90"));ae.LIGHTGREY=ae.LIGHTGRAY;ae.LIGHTPINK=Object.freeze(ae.fromCssColorString("#FFB6C1"));ae.LIGHTSEAGREEN=Object.freeze(ae.fromCssColorString("#20B2AA"));ae.LIGHTSKYBLUE=Object.freeze(ae.fromCssColorString("#87CEFA"));ae.LIGHTSLATEGRAY=Object.freeze(ae.fromCssColorString("#778899"));ae.LIGHTSLATEGREY=ae.LIGHTSLATEGRAY;ae.LIGHTSTEELBLUE=Object.freeze(ae.fromCssColorString("#B0C4DE"));ae.LIGHTYELLOW=Object.freeze(ae.fromCssColorString("#FFFFE0"));ae.LIME=Object.freeze(ae.fromCssColorString("#00FF00"));ae.LIMEGREEN=Object.freeze(ae.fromCssColorString("#32CD32"));ae.LINEN=Object.freeze(ae.fromCssColorString("#FAF0E6"));ae.MAGENTA=Object.freeze(ae.fromCssColorString("#FF00FF"));ae.MAROON=Object.freeze(ae.fromCssColorString("#800000"));ae.MEDIUMAQUAMARINE=Object.freeze(ae.fromCssColorString("#66CDAA"));ae.MEDIUMBLUE=Object.freeze(ae.fromCssColorString("#0000CD"));ae.MEDIUMORCHID=Object.freeze(ae.fromCssColorString("#BA55D3"));ae.MEDIUMPURPLE=Object.freeze(ae.fromCssColorString("#9370DB"));ae.MEDIUMSEAGREEN=Object.freeze(ae.fromCssColorString("#3CB371"));ae.MEDIUMSLATEBLUE=Object.freeze(ae.fromCssColorString("#7B68EE"));ae.MEDIUMSPRINGGREEN=Object.freeze(ae.fromCssColorString("#00FA9A"));ae.MEDIUMTURQUOISE=Object.freeze(ae.fromCssColorString("#48D1CC"));ae.MEDIUMVIOLETRED=Object.freeze(ae.fromCssColorString("#C71585"));ae.MIDNIGHTBLUE=Object.freeze(ae.fromCssColorString("#191970"));ae.MINTCREAM=Object.freeze(ae.fromCssColorString("#F5FFFA"));ae.MISTYROSE=Object.freeze(ae.fromCssColorString("#FFE4E1"));ae.MOCCASIN=Object.freeze(ae.fromCssColorString("#FFE4B5"));ae.NAVAJOWHITE=Object.freeze(ae.fromCssColorString("#FFDEAD"));ae.NAVY=Object.freeze(ae.fromCssColorString("#000080"));ae.OLDLACE=Object.freeze(ae.fromCssColorString("#FDF5E6"));ae.OLIVE=Object.freeze(ae.fromCssColorString("#808000"));ae.OLIVEDRAB=Object.freeze(ae.fromCssColorString("#6B8E23"));ae.ORANGE=Object.freeze(ae.fromCssColorString("#FFA500"));ae.ORANGERED=Object.freeze(ae.fromCssColorString("#FF4500"));ae.ORCHID=Object.freeze(ae.fromCssColorString("#DA70D6"));ae.PALEGOLDENROD=Object.freeze(ae.fromCssColorString("#EEE8AA"));ae.PALEGREEN=Object.freeze(ae.fromCssColorString("#98FB98"));ae.PALETURQUOISE=Object.freeze(ae.fromCssColorString("#AFEEEE"));ae.PALEVIOLETRED=Object.freeze(ae.fromCssColorString("#DB7093"));ae.PAPAYAWHIP=Object.freeze(ae.fromCssColorString("#FFEFD5"));ae.PEACHPUFF=Object.freeze(ae.fromCssColorString("#FFDAB9"));ae.PERU=Object.freeze(ae.fromCssColorString("#CD853F"));ae.PINK=Object.freeze(ae.fromCssColorString("#FFC0CB"));ae.PLUM=Object.freeze(ae.fromCssColorString("#DDA0DD"));ae.POWDERBLUE=Object.freeze(ae.fromCssColorString("#B0E0E6"));ae.PURPLE=Object.freeze(ae.fromCssColorString("#800080"));ae.RED=Object.freeze(ae.fromCssColorString("#FF0000"));ae.ROSYBROWN=Object.freeze(ae.fromCssColorString("#BC8F8F"));ae.ROYALBLUE=Object.freeze(ae.fromCssColorString("#4169E1"));ae.SADDLEBROWN=Object.freeze(ae.fromCssColorString("#8B4513"));ae.SALMON=Object.freeze(ae.fromCssColorString("#FA8072"));ae.SANDYBROWN=Object.freeze(ae.fromCssColorString("#F4A460"));ae.SEAGREEN=Object.freeze(ae.fromCssColorString("#2E8B57"));ae.SEASHELL=Object.freeze(ae.fromCssColorString("#FFF5EE"));ae.SIENNA=Object.freeze(ae.fromCssColorString("#A0522D"));ae.SILVER=Object.freeze(ae.fromCssColorString("#C0C0C0"));ae.SKYBLUE=Object.freeze(ae.fromCssColorString("#87CEEB"));ae.SLATEBLUE=Object.freeze(ae.fromCssColorString("#6A5ACD"));ae.SLATEGRAY=Object.freeze(ae.fromCssColorString("#708090"));ae.SLATEGREY=ae.SLATEGRAY;ae.SNOW=Object.freeze(ae.fromCssColorString("#FFFAFA"));ae.SPRINGGREEN=Object.freeze(ae.fromCssColorString("#00FF7F"));ae.STEELBLUE=Object.freeze(ae.fromCssColorString("#4682B4"));ae.TAN=Object.freeze(ae.fromCssColorString("#D2B48C"));ae.TEAL=Object.freeze(ae.fromCssColorString("#008080"));ae.THISTLE=Object.freeze(ae.fromCssColorString("#D8BFD8"));ae.TOMATO=Object.freeze(ae.fromCssColorString("#FF6347"));ae.TURQUOISE=Object.freeze(ae.fromCssColorString("#40E0D0"));ae.VIOLET=Object.freeze(ae.fromCssColorString("#EE82EE"));ae.WHEAT=Object.freeze(ae.fromCssColorString("#F5DEB3"));ae.WHITE=Object.freeze(ae.fromCssColorString("#FFFFFF"));ae.WHITESMOKE=Object.freeze(ae.fromCssColorString("#F5F5F5"));ae.YELLOW=Object.freeze(ae.fromCssColorString("#FFFF00"));ae.YELLOWGREEN=Object.freeze(ae.fromCssColorString("#9ACD32"));ae.TRANSPARENT=Object.freeze(new ae(0,0,0,0));var G=ae;function UG(e){e=e??V.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}UG.ALL=Object.freeze(new UG({color:new G(0,0,0,0),depth:1,stencil:0}));UG.prototype.execute=function(e,t){e.clear(this,t)};var ai=UG;var dve={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},we=Object.freeze(dve);function Sne(e){e=e??V.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=we.COMPUTE,this.owner=e.owner}Sne.prototype.execute=function(e){e.execute(this)};var hl=Sne;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=D.clamp(e.x,t.x,n.x),r=D.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 GG=new Vt;Vt.distance=function(e,t){return Vt.subtract(e,t,GG),Vt.magnitude(GG)};Vt.distanceSquared=function(e,t){return Vt.subtract(e,t,GG),Vt.magnitudeSquared(GG)};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 Bne=new Vt;Vt.lerp=function(e,t,n,i){return Vt.multiplyByScalar(t,n,Bne),i=Vt.multiplyByScalar(e,1-n,i),Vt.add(Bne,i,i)};var wne=new Vt,Dne=new Vt;Vt.angleBetween=function(e,t){return Vt.normalize(e,wne),Vt.normalize(t,Dne),D.acosClamped(Vt.dot(wne,Dne))};var hve=new Vt;Vt.mostOrthogonalAxis=function(e,t){let n=Vt.normalize(e,hve);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)&&D.equalsEpsilon(e.x,t.x,n,i)&&D.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 F=Vt;var Ave=new d,mve=new d;function pve(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,h=r*r*c*c,m=s*s*u*u,g=a*a*f*f,A=h+m+g,_=Math.sqrt(1/A),C=d.multiplyByScalar(e,_,Ave);if(A<i)return isFinite(_)?d.clone(C,o):void 0;let y=n.x,E=n.y,I=n.z,x=mve;x.x=C.x*y*2,x.y=C.y*E*2,x.z=C.z*I*2;let S=(1-_)*d.magnitude(e)/(.5*d.magnitude(x)),w=0,v,P,N,L,p,b,T,B,R,O,U;do{S-=w,N=1/(1+S*y),L=1/(1+S*E),p=1/(1+S*I),b=N*N,T=L*L,B=p*p,R=b*N,O=T*L,U=B*p,v=h*b+m*T+g*B-1,P=h*R*y+m*O*E+g*U*I;let k=-2*P;w=v/k}while(Math.abs(v)>D.EPSILON12);return l(o)?(o.x=r*N,o.y=s*L,o.z=a*p,o):new d(r*N,s*L,a*p)}var iE=pve;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=D.toRadians(e),t=D.toRadians(t),rr.fromRadians(e,t,n,i)};var gve=new d,_ve=new d,Cve=new d;rr._ellipsoidOneOverRadii=new d(1/6378137,1/6378137,1/6356752314245179e-9);rr._ellipsoidOneOverRadiiSquared=new d(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));rr._ellipsoidCenterToleranceSquared=D.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=iE(e,i,o,r,_ve);if(!l(s))return;let a=d.multiplyComponents(s,o,gve);a=d.normalize(a,a);let c=d.subtract(e,s,Cve),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),h=D.sign(d.dot(c,e))*d.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=h,n):new rr(u,f,h)};rr.toCartesian=function(e,t,n){return d.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 he=rr;function Pne(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new d(t,n,i),e._radiiSquared=new d(t*t,n*n,i*i),e._radiiToTheFourth=new d(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new d(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new d(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=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Ti(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,Pne(this,e,t,n)}Object.defineProperties(Ti.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}}});Ti.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(d.clone(n,t._radii),d.clone(e._radiiSquared,t._radiiSquared),d.clone(e._radiiToTheFourth,t._radiiToTheFourth),d.clone(e._oneOverRadii,t._oneOverRadii),d.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Ti(n.x,n.y,n.z)};Ti.fromCartesian3=function(e,t){return l(t)||(t=new Ti),l(e)&&Pne(t,e.x,e.y,e.z),t};Ti.WGS84=Object.freeze(new Ti(6378137,6378137,6356752314245179e-9));Ti.UNIT_SPHERE=Object.freeze(new Ti(1,1,1));Ti.MOON=Object.freeze(new Ti(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Ti.MARS=Object.freeze(new Ti(3396190,3396190,3376200));Ti._default=Ti.WGS84;Object.defineProperties(Ti,{default:{get:function(){return Ti._default},set:function(e){Ti._default=e,d._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});Ti.prototype.clone=function(e){return Ti.clone(this,e)};Ti.packedLength=d.packedLength;Ti.pack=function(e,t,n){return n=n??0,d.pack(e._radii,t,n),t};Ti.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t);return Ti.fromCartesian3(i,n)};Ti.prototype.geocentricSurfaceNormal=d.normalize;Ti.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 d),t.x=r,t.y=s,t.z=a,d.normalize(t,t)};Ti.prototype.geodeticSurfaceNormal=function(e,t){if(!d.equalsEpsilon(e,d.ZERO,D.EPSILON14))return l(t)||(t=new d),t=d.multiplyComponents(e,this._oneOverRadiiSquared,t),d.normalize(t,t)};var yve=new d,Eve=new d;Ti.prototype.cartographicToCartesian=function(e,t){let n=yve,i=Eve;this.geodeticSurfaceNormalCartographic(e,n),d.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(d.dot(n,i));return d.divideByScalar(i,o,i),d.multiplyByScalar(n,e.height,n),l(t)||(t=new d),d.add(i,n,t)};Ti.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 Ive=new d,bve=new d,xve=new d;Ti.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,bve);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,Ive),o=d.subtract(e,n,xve),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=D.sign(d.dot(o,e))*d.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new he(r,s,a)};Ti.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};Ti.prototype.scaleToGeodeticSurface=function(e,t){return iE(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};Ti.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new d);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 d.multiplyByScalar(e,s,t)};Ti.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._oneOverRadii,t)};Ti.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._radii,t)};Ti.prototype.equals=function(e){return this===e||l(e)&&d.equals(this._radii,e._radii)};Ti.prototype.toString=function(){return this._radii.toString()};Ti.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=t??0;let i=this._squaredXOverSquaredZ;if(l(n)||(n=new d),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var Tve=new d;Ti.prototype.getLocalCurvature=function(e,t){l(t)||(t=new F);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,Tve),i=d.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return F.fromElements(1/i,1/r,t)};var Sve=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Bve=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function vne(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*Sve[s];r+=Bve[s]*(n(i+a)+n(i-a))}return r*=o,r}Ti.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=D.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,u=s*a;return vne(i,o,function(f){let h=Math.cos(f),m=Math.sin(f);return Math.cos(f)*vne(t,n,function(g){let A=Math.cos(g),_=Math.sin(g);return Math.sqrt(u*m*m+c*(a*A*A+s*_*_)*h*h)})})};var te=Ti;function zG(e){this._ellipsoid=e??te.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(zG.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});zG.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 d(i,o,r)};zG.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 he(i,o,r)};var Gi=zG;var wve={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},qt=Object.freeze(wve);function Dve(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 go=Dve;function vve(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var R_=vve;function Pve(e){return e%4===0&&e%100!==0||e%400===0}var dh=Pve;var Rne=[31,28,31,30,31,30,31,31,30,31,30,31];function Rve(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 _(){Fo.typeOf.number.greaterThanOrEquals("Year",e,1),Fo.typeOf.number.lessThanOrEquals("Year",e,9999),Fo.typeOf.number.greaterThanOrEquals("Month",t,1),Fo.typeOf.number.lessThanOrEquals("Month",t,12),Fo.typeOf.number.greaterThanOrEquals("Day",n,1),Fo.typeOf.number.lessThanOrEquals("Day",n,31),Fo.typeOf.number.greaterThanOrEquals("Hour",i,0),Fo.typeOf.number.lessThanOrEquals("Hour",i,23),Fo.typeOf.number.greaterThanOrEquals("Minute",o,0),Fo.typeOf.number.lessThanOrEquals("Minute",o,59),Fo.typeOf.bool("IsLeapSecond",a),Fo.typeOf.number.greaterThanOrEquals("Second",r,0),Fo.typeOf.number.lessThanOrEquals("Second",r,a?60:59),Fo.typeOf.number.greaterThanOrEquals("Millisecond",s,0),Fo.typeOf.number.lessThan("Millisecond",s,1e3)}function C(){let y=t===2&&dh(e)?Rne[t-1]+1:Rne[t-1];if(n>y)throw new Ae("Month and Day represents invalid date")}}var Ap=Rve;function Mve(e,t){this.julianDate=e,this.offset=t}var lo=Mve;var Nve={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},ri=Object.freeze(Nve);var Lve={UTC:0,TAI:1},ni=Object.freeze(Lve);var Nne=new Ap,$9=[31,28,31,30,31,30,31,31,30,31,30,31],eY=29;function tY(e,t){return Ot.compare(e.julianDate,t.julianDate)}var Kb=new lo;function HG(e){Kb.julianDate=e;let t=Ot.leapSeconds,n=go(t,Kb,tY);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Ot.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Ot.addSeconds(e,i,e)}function Mne(e,t){Kb.julianDate=e;let n=Ot.leapSeconds,i=go(n,Kb,tY);if(i<0&&(i=~i),i===0)return Ot.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Ot.addSeconds(e,-n[i-1].offset,t);let o=Ot.secondsDifference(n[i].julianDate,e);if(o===0)return Ot.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Ot.addSeconds(e,-n[--i].offset,t)}function M_(e,t,n){let i=t/ri.SECONDS_PER_DAY|0;return e+=i,t-=ri.SECONDS_PER_DAY*i,t<0&&(e--,t+=ri.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function nY(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(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 f=r+(i*ri.SECONDS_PER_HOUR+o*ri.SECONDS_PER_MINUTE+s*ri.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var Ove=/^(\d{4})$/,Fve=/^(\d{4})-(\d{2})$/,Qve=/^(\d{4})-?(\d{3})$/,kve=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Uve=/^(\d{4})-?(\d{2})-?(\d{2})$/,iY=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Gve=/^(\d{2})(\.\d+)?/.source+iY.source,zve=/^(\d{2}):?(\d{2})(\.\d+)?/.source+iY.source,Vve=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+iY.source;function Ot(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??ni.UTC;let i=e|0;t=t+(e-i)*ri.SECONDS_PER_DAY,M_(i,t,this),n===ni.UTC&&HG(this)}Ot.fromGregorianDate=function(e,t){let n=nY(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(M_(n[0],n[1],t),HG(t),t):new Ot(n[0],n[1],ni.UTC)};Ot.fromDate=function(e,t){let n=nY(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(M_(n[0],n[1],t),HG(t),t):new Ot(n[0],n[1],ni.UTC)};Ot.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],h=n[1],m,g;if(n=f.match(Uve),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(Fve),n!==null)i=+n[1],o=+n[2];else if(n=f.match(Ove),n!==null)i=+n[1];else{let y;if(n=f.match(Qve),n!==null)i=+n[1],y=+n[2],g=dh(i);else if(n=f.match(kve),n!==null){i=+n[1];let E=+n[2],I=+n[3]||0,x=new Date(Date.UTC(i,0,4));y=E*7+I-x.getUTCDay()-3}m=new Date(Date.UTC(i,0,1)),m.setUTCDate(y),o=m.getUTCMonth()+1,r=m.getUTCDate()}g=dh(i);let A;if(l(h)){n=h.match(Vve),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,A=5):(n=h.match(zve),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,A=4):(n=h.match(Gve),n!==null&&(s=+n[1],a=+(n[2]||0)*60,A=3)));let y=n[A],E=+n[A+1],I=+(n[A+2]||0);switch(y){case"+":s=s-E,a=a-I;break;case"-":s=s+E,a=a+I;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let _=c===60;for(_&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(m=g&&o===2?eY:$9[o-1];r>m;)r-=m,o++,o>12&&(o-=12,i++),m=g&&o===2?eY:$9[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),m=g&&o===2?eY:$9[o-1],r+=m;let C=nY(i,o,r,s,a,c,u);return l(t)?(M_(C[0],C[1],t),HG(t)):t=new Ot(C[0],C[1],ni.UTC),_&&Ot.addSeconds(t,1,t),t};Ot.now=function(e){return Ot.fromDate(new Date,e)};var VG=new Ot(0,0,ni.TAI);Ot.toGregorianDate=function(e,t){let n=!1,i=Mne(e,VG);l(i)||(Ot.addSeconds(e,-1,VG),i=Mne(VG,VG),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 u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let h=u+2-12*s|0,m=100*(a-49)+c+s|0,g=r/ri.SECONDS_PER_HOUR|0,A=r-g*ri.SECONDS_PER_HOUR,_=A/ri.SECONDS_PER_MINUTE|0;A=A-_*ri.SECONDS_PER_MINUTE;let C=A|0,y=(A-C)/ri.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(C+=1),l(t)?(t.year=m,t.month=h,t.day=f,t.hour=g,t.minute=_,t.second=C,t.millisecond=y,t.isLeapSecond=n,t):new Ap(m,h,f,g,_,C,y,n)};Ot.toDate=function(e){let t=Ot.toGregorianDate(e,Nne),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))};Ot.toIso8601=function(e,t){let n=Ot.toGregorianDate(e,Nne),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;if(!l(t)&&u!==0){let h=u*.01;return f=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")}.${f}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`:(f=(u*.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")}.${f}Z`)};Ot.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Ot(e.dayNumber,e.secondsOfDay,ni.TAI)};Ot.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Ot.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(Ot.secondsDifference(e,t))<=n};Ot.totalDays=function(e){return e.dayNumber+e.secondsOfDay/ri.SECONDS_PER_DAY};Ot.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*ri.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Ot.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/ri.SECONDS_PER_DAY;return n+i};Ot.computeTaiMinusUtc=function(e){Kb.julianDate=e;let t=Ot.leapSeconds,n=go(t,Kb,tY);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Ot.addSeconds=function(e,t,n){return M_(e.dayNumber,e.secondsOfDay+t,n)};Ot.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*ri.SECONDS_PER_MINUTE;return M_(e.dayNumber,i,n)};Ot.addHours=function(e,t,n){let i=e.secondsOfDay+t*ri.SECONDS_PER_HOUR;return M_(e.dayNumber,i,n)};Ot.addDays=function(e,t,n){let i=e.dayNumber+t;return M_(i,e.secondsOfDay,n)};Ot.lessThan=function(e,t){return Ot.compare(e,t)<0};Ot.lessThanOrEquals=function(e,t){return Ot.compare(e,t)<=0};Ot.greaterThan=function(e,t){return Ot.compare(e,t)>0};Ot.greaterThanOrEquals=function(e,t){return Ot.compare(e,t)>=0};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){return Ot.equalsEpsilon(this,e,t)};Ot.prototype.toString=function(){return Ot.toIso8601(this)};Ot.leapSeconds=[new lo(new Ot(2441317,43210,ni.TAI),10),new lo(new Ot(2441499,43211,ni.TAI),11),new lo(new Ot(2441683,43212,ni.TAI),12),new lo(new Ot(2442048,43213,ni.TAI),13),new lo(new Ot(2442413,43214,ni.TAI),14),new lo(new Ot(2442778,43215,ni.TAI),15),new lo(new Ot(2443144,43216,ni.TAI),16),new lo(new Ot(2443509,43217,ni.TAI),17),new lo(new Ot(2443874,43218,ni.TAI),18),new lo(new Ot(2444239,43219,ni.TAI),19),new lo(new Ot(2444786,43220,ni.TAI),20),new lo(new Ot(2445151,43221,ni.TAI),21),new lo(new Ot(2445516,43222,ni.TAI),22),new lo(new Ot(2446247,43223,ni.TAI),23),new lo(new Ot(2447161,43224,ni.TAI),24),new lo(new Ot(2447892,43225,ni.TAI),25),new lo(new Ot(2448257,43226,ni.TAI),26),new lo(new Ot(2448804,43227,ni.TAI),27),new lo(new Ot(2449169,43228,ni.TAI),28),new lo(new Ot(2449534,43229,ni.TAI),29),new lo(new Ot(2450083,43230,ni.TAI),30),new lo(new Ot(2450630,43231,ni.TAI),31),new lo(new Ot(2451179,43232,ni.TAI),32),new lo(new Ot(2453736,43233,ni.TAI),33),new lo(new Ot(2454832,43234,ni.TAI),34),new lo(new Ot(2456109,43235,ni.TAI),35),new lo(new Ot(2457204,43236,ni.TAI),36),new lo(new Ot(2457754,43237,ni.TAI),37)];var J=Ot;var $ne=mr(Yu(),1);function Hve(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xw=Hve;function Gne(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=Gne(o,t)),n[i]=o}return n}var Ve=Gne;function zne(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]=zne(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 St=zne;function Yve(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var ou=Yve;var Vne=mr(Yu(),1);function oY(e,t){let n;return typeof document<"u"&&(n=document),oY._implementation(e,t,n)}oY._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Vne.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var VA=oY;var Hne=mr(Yu(),1);function Wve(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Hne.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Tw=Wve;var Yne=mr(Yu(),1);function jve(e){let t=new Yne.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 mp=jve;var Wne={};function qve(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Wne[t];l(i)||(i={},Wne[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 hh=qve;var Kve=/^blob:/i;function Jve(e){return Kve.test(e)}var oE=Jve;var HA;function Xve(e){l(HA)||(HA=document.createElement("a")),HA.href=window.location.href;let t=HA.host,n=HA.protocol;return HA.href=e,HA.href=HA.href,n!==HA.protocol||t!==HA.host}var N_=Xve;var Zve=/^data:/i;function $ve(e){return Zve.test(e)}var Ah=$ve;function ePe(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 rE=ePe;function tPe(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 sE=tPe;function nPe(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 Wu=nPe;var iPe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},hi=Object.freeze(iPe);var oPe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Qs=Object.freeze(oPe);function qG(e){e=e??V.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??Qs.OTHER,this.serverKey=e.serverKey,this.state=hi.UNISSUED,this.deferred=void 0,this.cancelled=!1}qG.prototype.cancel=function(){this.cancelled=!0};qG.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=hi.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new qG(this)};var pr=qG;function rPe(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 Sw=rPe;function jne(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=Sw(this.responseHeaders))}jne.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var YA=jne;var KG=mr(Yu(),1);function Bw(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(Bw.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});Bw.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return sY(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function sY(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)}Bw.prototype.removeEventListener=function(e,t){let n=rY(this,this._listeners,e,t),i=rY(this,this._toAdd,e,t),o=n||i;return o&&this._listenerCount--,o};function rY(e,t,n,i){let o=t.get(n);if(!o||!o.has(i))return!1;if(e._invokingListeners){if(!sY(e,e._toRemove,n,i))return!1}else o.delete(i),o.size===0&&t.delete(n);return!0}Bw.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)sY(this,this._listeners,e,n);this._toAdd.clear();for(let[e,t]of this._toRemove.entries())for(let n of t)rY(this,this._listeners,e,n);this._toRemove.clear()};var _e=Bw;function aE(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(aE.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 aY(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}aE.prototype.reserve=function(e){e=e??this._length,this._array.length=e};aE.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?(aY(i,o,e),e=o):r=!1}};aE.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};aE.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)aY(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};aE.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return aY(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var ww=aE;function sPe(e,t){return e.priority-t.priority}var _o={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Zb=20,Mc=new ww({comparator:sPe});Mc.maximumLength=Zb;Mc.reserve(Zb);var WA=[],pp={},aPe=typeof document<"u"?new KG.default(document.location.href):new KG.default,JG=new _e;function gr(){}gr.maximumRequests=50;gr.maximumRequestsPerServer=18;gr.requestsByServer={};gr.throttleRequests=!0;gr.debugShowStatistics=!1;gr.requestCompletedEvent=JG;Object.defineProperties(gr,{statistics:{get:function(){return _o}},priorityHeapLength:{get:function(){return Zb},set:function(e){if(e<Zb)for(;Mc.length>e;){let t=Mc.pop();cE(t)}Zb=e,Mc.maximumLength=e,Mc.reserve(e)}}});function qne(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}gr.serverHasOpenSlots=function(e,t){t=t??1;let n=gr.requestsByServer[e]??gr.maximumRequestsPerServer;return pp[e]+t<=n};gr.heapHasOpenSlots=function(e){return Mc.length+e<=Zb};function Kne(e){return e.state===hi.UNISSUED&&(e.state=hi.ISSUED,e.deferred=ou()),e.deferred.promise}function cPe(e){return function(t){if(e.state===hi.CANCELLED)return;let n=e.deferred;--_o.numberOfActiveRequests,--pp[e.serverKey],JG.raiseEvent(),e.state=hi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function lPe(e){return function(t){e.state!==hi.CANCELLED&&(++_o.numberOfFailedRequests,--_o.numberOfActiveRequests,--pp[e.serverKey],JG.raiseEvent(t),e.state=hi.FAILED,e.deferred.reject(t))}}function Jne(e){let t=Kne(e);return e.state=hi.ACTIVE,WA.push(e),++_o.numberOfActiveRequests,++_o.numberOfActiveRequestsEver,++pp[e.serverKey],e.requestFunction().then(cPe(e)).catch(lPe(e)),t}function cE(e){let t=e.state===hi.ACTIVE;if(e.state=hi.CANCELLED,++_o.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--_o.numberOfActiveRequests,--pp[e.serverKey],++_o.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}gr.update=function(){let e,t,n=0,i=WA.length;for(e=0;e<i;++e){if(t=WA[e],t.cancelled&&cE(t),t.state!==hi.ACTIVE){++n;continue}n>0&&(WA[e-n]=t)}WA.length-=n;let o=Mc.internalArray,r=Mc.length;for(e=0;e<r;++e)qne(o[e]);Mc.resort();let s=Math.max(gr.maximumRequests-WA.length,0),a=0;for(;a<s&&Mc.length>0;){if(t=Mc.pop(),t.cancelled){cE(t);continue}if(t.throttleByServer&&!gr.serverHasOpenSlots(t.serverKey)){cE(t);continue}Jne(t),++a}uPe()};gr.getServerKey=function(e){let t=new KG.default(e);t.scheme()===""&&(t=t.absoluteTo(aPe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=pp[n];return l(i)||(pp[n]=0),n};gr.request=function(e){if(Ah(e.url)||oE(e.url))return JG.raiseEvent(),e.state=hi.RECEIVED,e.requestFunction();if(++_o.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=gr.getServerKey(e.url)),gr.throttleRequests&&e.throttleByServer&&!gr.serverHasOpenSlots(e.serverKey))return;if(!gr.throttleRequests||!e.throttle)return Jne(e);if(WA.length>=gr.maximumRequests)return;qne(e);let t=Mc.insert(e);if(l(t)){if(t===e)return;cE(t)}return Kne(e)};function uPe(){gr.debugShowStatistics&&(_o.numberOfActiveRequests===0&&_o.lastNumberOfActiveRequests>0&&(_o.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${_o.numberOfAttemptedRequests}`),_o.numberOfAttemptedRequests=0),_o.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${_o.numberOfCancelledRequests}`),_o.numberOfCancelledRequests=0),_o.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${_o.numberOfCancelledActiveRequests}`),_o.numberOfCancelledActiveRequests=0),_o.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${_o.numberOfFailedRequests}`),_o.numberOfFailedRequests=0)),_o.lastNumberOfActiveRequests=_o.numberOfActiveRequests)}gr.clearForSpecs=function(){for(;Mc.length>0;){let t=Mc.pop();cE(t)}let e=WA.length;for(let t=0;t<e;++t)cE(WA[t]);WA.length=0,pp={},_o.numberOfAttemptedRequests=0,_o.numberOfActiveRequests=0,_o.numberOfCancelledRequests=0,_o.numberOfCancelledActiveRequests=0,_o.numberOfFailedRequests=0,_o.numberOfActiveRequestsEver=0,_o.lastNumberOfActiveRequests=0};gr.numberOfActiveRequestsByServer=function(e){return pp[e]};gr.requestHeap=Mc;var Nc=gr;var Xne=mr(Yu(),1);var Dw={},$b={};Dw.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l($b[n])||($b[n]=!0)};Dw.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l($b[n])&&delete $b[n]};function fPe(e){let t=new Xne.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}}Dw.contains=function(e){let t=fPe(e);return!!(l(t)&&l($b[t]))};Dw.clear=function(){$b={}};var ex=Dw;var eie=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function Mt(e){e=e??V.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=jA(e.templateValues,{}),this._queryParameters=jA(e.queryParameters,{}),this.headers=jA(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 jA(e,t){return l(e)?Ve(e):t}Mt.createIfNeeded=function(e){return e instanceof Mt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Mt({url:e})};var tx;Mt.supportsImageBitmapOptions=function(){return l(tx)?tx:typeof createImageBitmap!="function"?(tx=Promise.resolve(!1),tx):(tx=Mt.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=hh(t[0]),i=hh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),tx)};Object.defineProperties(Mt,{isBlobSupported:{get:function(){return eie}}});Object.defineProperties(Mt.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 mp(this._url)}},isDataUri:{get:function(){return Ah(this._url)}},isBlobUri:{get:function(){return oE(this._url)}},isCrossOriginUrl:{get:function(){return N_(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Mt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Mt.prototype.parseUrl=function(e,t,n,i){let o=new $ne.default(e),r=dPe(o.query());this._queryParameters=t?ZG(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(VA(i))),this._url=o.toString()};function dPe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Wu(e)}function ZG(e,t,n){if(!n)return St(e,t);let i=Ve(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}Mt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${hPe(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 hPe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${sE(e)}`}Mt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=ZG(this._queryParameters,e,!1):this._queryParameters=ZG(e,this._queryParameters,!1)};Mt.prototype.appendQueryParameters=function(e){this._queryParameters=ZG(e,this._queryParameters,!0)};Mt.prototype.setTemplateValues=function(e,t){t?this._templateValues=St(this._templateValues,e):this._templateValues=St(e,this._templateValues)};Mt.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=St(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=St(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=St(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};Mt.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})};Mt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ve(this._queryParameters),e._templateValues=Ve(this._templateValues),e.headers=Ve(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Mt({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})};Mt.prototype.getBaseUri=function(e){return Tw(this.getUrlComponent(e),e)};Mt.prototype.appendForwardSlash=function(){this._url=xw(this._url)};Mt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Mt.fetchArrayBuffer=function(e){return new Mt(e).fetchArrayBuffer()};Mt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Mt.fetchBlob=function(e){return new Mt(e).fetchBlob()};Mt.prototype.fetchImage=function(e){e=e??V.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(cY(this.request),!eie||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,u;return Mt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return Mt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(f);return c=new Mt({url:h}),c._fetchImage({flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};Mt.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=ou();return Mt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Nc.request(r);if(l(s))return s.catch(function(a){return r.state!==hi.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=hi.UNISSUED,r.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})};Mt.fetchImage=function(e){return new Mt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Mt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Mt.fetchText=function(e){return new Mt(e).fetchText()};Mt.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)})};Mt.fetchJson=function(e){return new Mt(e).fetchJson()};Mt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Mt.fetchXML=function(e){return new Mt(e).fetchXML()};Mt.prototype.fetchJsonp=function(e){e=e??"callback",cY(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return tie(this,e,t)};function tie(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=ou();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Mt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Nc.request(o);if(l(s))return s.catch(function(a){return o.state!==hi.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=hi.UNISSUED,o.deferred=void 0,tie(e,t,n)):Promise.reject(a)})})}Mt.fetchJsonp=function(e){return new Mt(e).fetchJsonp(e.callbackParameterName)};Mt.prototype._makeRequest=function(e){let t=this;cY(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=St(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=ou(),h=Mt._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),f.promise};let o=Nc.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!==hi.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=hi.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function cY(e){if(e.state===hi.ISSUED||e.state===hi.ACTIVE)throw new ue("The Resource is already being fetched.");e.state=hi.UNISSUED,e.deferred=void 0}var APe=/^data:(.*?)(;base64)?,(.*)$/;function XG(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Zne(e,t){let n=XG(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 mPe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return XG(i,o);case"arraybuffer":return Zne(i,o);case"blob":return r=Zne(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(XG(i,o),n);case"json":return JSON.parse(XG(i,o));default:}}Mt.prototype.fetch=function(e){return e=jA(e,{}),e.method="GET",this._makeRequest(e)};Mt.fetch=function(e){return new Mt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Mt.prototype.delete=function(e){return e=jA(e,{}),e.method="DELETE",this._makeRequest(e)};Mt.delete=function(e){return new Mt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Mt.prototype.head=function(e){return e=jA(e,{}),e.method="HEAD",this._makeRequest(e)};Mt.head=function(e){return new Mt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Mt.prototype.options=function(e){return e=jA(e,{}),e.method="OPTIONS",this._makeRequest(e)};Mt.options=function(e){return new Mt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Mt.prototype.post=function(e,t){return Fo.defined("data",e),t=jA(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Mt.post=function(e){return new Mt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Mt.prototype.put=function(e,t){return Fo.defined("data",e),t=jA(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Mt.put=function(e){return new Mt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Mt.prototype.patch=function(e,t){return Fo.defined("data",e),t=jA(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Mt.patch=function(e){return new Mt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Mt._Implementations={};Mt._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&&(ex.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Mt._Implementations.createImage=function(e,t,n,i,o,r,s){let a=e.url;Mt.supportsImageBitmapOptions().then(function(c){if(!(c&&r)){Mt._Implementations.loadImageElement(a,t,n);return}let u="blob",f="GET",h=ou(),m=Mt._Implementations.loadWithXhr(a,u,f,void 0,s,h,void 0,void 0,void 0);return l(m)&&l(m.abort)&&(e.cancelFunction=function(){m.abort()}),h.promise.then(function(g){if(!l(g)){n.reject(new ue(`Successfully retrieved ${a} but it contained no content.`));return}return Mt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};Mt.createImageBitmapFromBlob=function(e,t){return Fo.defined("options",t),Fo.typeOf.bool("options.flipY",t.flipY),Fo.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),Fo.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function pPe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),r.reject(new YA(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 YA)})}var gPe=typeof XMLHttpRequest>"u";Mt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=APe.exec(e);if(a!==null){r.resolve(mPe(a,t));return}if(gPe){pPe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(ex.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new YA(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),A={};g.forEach(function(_){let C=_.split(": "),y=C.shift();A[y]=C.join(": ")}),r.resolve(A);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||h===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(m){r.reject(m)}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 ue("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new YA)},c.send(i),c};Mt._Implementations.loadAndExecuteScript=function(e,t,n){return rE(e,t).catch(function(i){n.reject(i)})};Mt._DefaultImplementations={};Mt._DefaultImplementations.createImage=Mt._Implementations.createImage;Mt._DefaultImplementations.loadWithXhr=Mt._Implementations.loadWithXhr;Mt._DefaultImplementations.loadAndExecuteScript=Mt._Implementations.loadAndExecuteScript;Mt.DEFAULT=Object.freeze(new Mt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Be=Mt;function Pw(e){e=e??V.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)?nie(this,e.data):nie(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Pw.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=Be.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ue(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new Pw({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};Pw.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 R_(0,0,0,0,0),t}});Pw.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new R_(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],u=J.lessThanOrEquals(a,e),f=!l(c),h=f||J.greaterThanOrEquals(c,e);if(u&&h)return o=i,!f&&c.equals(e)&&++o,r=o+1,oie(this,n,this._samples,e,o,r,t),t}let s=go(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,oie(this,n,this._samples,e,o,r,t),t};function _Pe(e,t){return J.compare(e.julianDate,t)}function nie(e,t){if(!l(t.columnNames))throw new ue("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new ue("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 ue("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=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,m=e._addNewLeapSeconds;for(let g=0,A=u.length;g<A;g+=e._columnCount){let _=u[g+n],C=u[g+c],y=_+ri.MODIFIED_JULIAN_DATE_DIFFERENCE,E=new J(y,C,ni.TAI);if(f.push(E),m){if(C!==h&&l(h)){let I=J.leapSeconds,x=go(I,E,_Pe);if(x<0){let S=new lo(E,C);I.splice(~x,0,S)}}h=C}}}function iie(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 vw(e,t,n){return t+e*(n-t)}function oie(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],u=t[r];if(c.equals(u)||i.equals(c))return iie(e,n,o,a,s),s;if(i.equals(u))return iie(e,n,r,a,s),s;let f=J.secondsDifference(i,c)/J.secondsDifference(u,c),h=o*a,m=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],A=n[m+e._ut1MinusUtcSecondsColumn],_=A-g;if(_>.5||_<-.5){let C=n[h+e._taiMinusUtcSecondsColumn],y=n[m+e._taiMinusUtcSecondsColumn];C!==y&&(u.equals(i)?g=A:A-=y-C)}return s.xPoleWander=vw(f,n[h+e._xPoleWanderRadiansColumn],n[m+e._xPoleWanderRadiansColumn]),s.yPoleWander=vw(f,n[h+e._yPoleWanderRadiansColumn],n[m+e._yPoleWanderRadiansColumn]),s.xPoleOffset=vw(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[m+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=vw(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[m+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=vw(f,g,A),s}var Rw=Pw;function Lc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Lc.fromQuaternion=function(e,t){l(t)||(t=new Lc);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=-D.asinClamped(n),t};Lc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Lc),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};Lc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Lc(e.heading,e.pitch,e.roll)};Lc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Lc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};Lc.prototype.clone=function(e){return Lc.clone(this,e)};Lc.prototype.equals=function(e){return Lc.equals(this,e)};Lc.prototype.equalsEpsilon=function(e,t,n){return Lc.equalsEpsilon(this,e,t,n)};Lc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var hc=Lc;var rie={},sie=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function CPe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=sie.exec(i);if(o!==null)return o[1]}}var $G;function aie(e){return typeof document>"u"?e:(l($G)||($G=document.createElement("a")),$G.href=e,$G.href)}var lE;function cie(){if(l(lE))return lE;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(rie?.url)?e=VA(".",rie.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=VA("..",uE("Core/buildModuleUrl.js")):e=CPe(),lE=new Be({url:aie(e)}),lE.appendForwardSlash(),lE}function yPe(e){return aie(require.toUrl(`../${e}`))}function lie(e){return cie().getDerivedResource({url:e}).url}var ez;function uE(e){return l(ez)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?ez=yPe:ez=lie),ez(e)}uE._cesiumScriptRegex=sie;uE._buildModuleUrlFromBaseUrl=lie;uE._clearBaseResource=function(){lE=void 0};uE.setBaseUrl=function(e){lE=Be.DEFAULT.getDerivedResource({url:e})};uE.getCesiumBaseUrl=cie;var Zt=uE;function EPe(e,t,n){this.x=e,this.y=t,this.s=n}var fE=EPe;function fY(e){e=e??V.EMPTY_OBJECT,this._xysFileUrlTemplate=Be.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new J(this._sampleZeroJulianEphemerisDate,0,ni.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 IPe=new J(0,0,ni.TAI);function lY(e,t,n){let i=IPe;return i.dayNumber=t,i.secondsOfDay=n,J.daysDifference(i,e._sampleZeroDateTT)}fY.prototype.preload=function(e,t,n,i){let o=lY(this,e,t),r=lY(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,u=a/this._samplesPerXysFile|0,f=[];for(let h=c;h<=u;++h)f.push(uY(this,h));return Promise.all(f)};fY.prototype.computeXysRadians=function(e,t,n){let i=lY(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,u=this._samples;if(l(u[s*3])||(uY(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(uY(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new fE(0,0,0);let f=i-s*this._stepSizeDays,h=this._work,m=this._denominators,g=this._coef,A=this._xTable,_,C;for(_=0;_<=r;++_)h[_]=f-A[_];for(_=0;_<=r;++_){for(g[_]=1,C=0;C<=r;++C)C!==_&&(g[_]*=h[C]);g[_]*=m[_];let y=(s+_)*3;n.x+=g[_]*u[y++],n.y+=g[_]*u[y++],n.s+=g[_]*u[y]}return n};function uY(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 Be({url:Zt(`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 u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var Mw=fY;function st(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var Nw=new d;st.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);Nw=d.normalize(e,Nw);let r=Nw.x*o,s=Nw.y*o,a=Nw.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new st(r,s,a,c)};var bPe=[1,2,0],xPe=new Array(3);st.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[X.COLUMN0ROW0],c=e[X.COLUMN1ROW1],u=e[X.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[X.COLUMN1ROW2]-e[X.COLUMN2ROW1])*n,o=(e[X.COLUMN2ROW0]-e[X.COLUMN0ROW2])*n,r=(e[X.COLUMN0ROW1]-e[X.COLUMN1ROW0])*n;else{let h=bPe,m=0;c>a&&(m=1),u>a&&u>c&&(m=2);let g=h[m],A=h[g];n=Math.sqrt(e[X.getElementIndex(m,m)]-e[X.getElementIndex(g,g)]-e[X.getElementIndex(A,A)]+1);let _=xPe;_[m]=.5*n,n=.5/n,s=(e[X.getElementIndex(A,g)]-e[X.getElementIndex(g,A)])*n,_[g]=(e[X.getElementIndex(g,m)]+e[X.getElementIndex(m,g)])*n,_[A]=(e[X.getElementIndex(A,m)]+e[X.getElementIndex(m,A)])*n,i=-_[0],o=-_[1],r=-_[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new st(i,o,r,s)};var uie=new st,fie=new st,dY=new st,die=new st;st.fromHeadingPitchRoll=function(e,t){return die=st.fromAxisAngle(d.UNIT_X,e.roll,uie),dY=st.fromAxisAngle(d.UNIT_Y,-e.pitch,t),t=st.multiply(dY,die,dY),fie=st.fromAxisAngle(d.UNIT_Z,-e.heading,uie),st.multiply(fie,t,t)};var tz=new d,hY=new d,mh=new st,hie=new st,nz=new st;st.packedLength=4;st.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};st.unpack=function(e,t,n){return t=t??0,l(n)||(n=new st),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};st.packedInterpolationLength=3;st.convertPackedArrayForInterpolation=function(e,t,n,i){st.unpack(e,n*4,nz),st.conjugate(nz,nz);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;st.unpack(e,(t+o)*4,mh),st.multiply(mh,nz,mh),mh.w<0&&st.negate(mh,mh),st.computeAxis(mh,tz);let a=st.computeAngle(mh);l(i)||(i=[]),i[s]=tz.x*a,i[s+1]=tz.y*a,i[s+2]=tz.z*a}};st.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new st),d.fromArray(e,0,hY);let r=d.magnitude(hY);return st.unpack(t,i*4,hie),r===0?st.clone(st.IDENTITY,mh):st.fromAxisAngle(hY,r,mh),st.multiply(mh,hie,o)};st.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 st(e.x,e.y,e.z,e.w)};st.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};st.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};st.magnitude=function(e){return Math.sqrt(st.magnitudeSquared(e))};st.normalize=function(e,t){let n=1/st.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};st.inverse=function(e,t){let n=st.magnitudeSquared(e);return t=st.conjugate(e,t),st.multiplyByScalar(t,1/n,t)};st.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};st.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};st.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};st.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};st.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,h=s*a+i*f+o*u-r*c,m=s*c-i*u+o*f+r*a,g=s*u+i*c-o*a+r*f,A=s*f-i*a-o*c-r*u;return n.x=h,n.y=m,n.z=g,n.w=A,n};st.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};st.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};st.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<D.EPSILON6||Math.abs(n+1)<D.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};st.computeAngle=function(e){return Math.abs(e.w-1)<D.EPSILON6?0:2*Math.acos(e.w)};var AY=new st;st.lerp=function(e,t,n,i){return AY=st.multiplyByScalar(t,n,AY),i=st.multiplyByScalar(e,1-n,i),st.add(AY,i,i)};var Aie=new st,mY=new st,pY=new st;st.slerp=function(e,t,n,i){let o=st.dot(e,t),r=t;if(o<0&&(o=-o,r=Aie=st.negate(t,Aie)),1-o<D.EPSILON6)return st.lerp(e,r,n,i);let s=Math.acos(o);return mY=st.multiplyByScalar(e,Math.sin((1-n)*s),mY),pY=st.multiplyByScalar(r,Math.sin(n*s),pY),i=st.add(mY,pY,i),st.multiplyByScalar(i,1/Math.sin(s),i)};st.log=function(e,t){let n=D.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),d.multiplyByScalar(e,i,t)};st.exp=function(e,t){let n=d.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 TPe=new d,SPe=new d,Lw=new st,nx=new st;st.computeInnerQuadrangle=function(e,t,n,i){let o=st.conjugate(t,Lw);st.multiply(o,n,nx);let r=st.log(nx,TPe);st.multiply(o,e,nx);let s=st.log(nx,SPe);return d.add(r,s,r),d.multiplyByScalar(r,.25,r),d.negate(r,r),st.exp(r,Lw),st.multiply(t,Lw,i)};st.squad=function(e,t,n,i,o,r){let s=st.slerp(e,t,o,Lw),a=st.slerp(n,i,o,nx);return st.slerp(s,a,2*o*(1-o),r)};var BPe=new st,mie=1.9011074535173003,iz=zt.supportsTypedArrays()?new Float32Array(8):[],oz=zt.supportsTypedArrays()?new Float32Array(8):[],gp=zt.supportsTypedArrays()?new Float32Array(8):[],_p=zt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;iz[e]=1/(t*n),oz[e]=t/n}iz[7]=mie/136;oz[7]=mie*8/17;st.fastSlerp=function(e,t,n,i){let o=st.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)gp[g]=(iz[g]*c-oz[g])*s,_p[g]=(iz[g]*u-oz[g])*s;let f=r*n*(1+gp[0]*(1+gp[1]*(1+gp[2]*(1+gp[3]*(1+gp[4]*(1+gp[5]*(1+gp[6]*(1+gp[7])))))))),h=a*(1+_p[0]*(1+_p[1]*(1+_p[2]*(1+_p[3]*(1+_p[4]*(1+_p[5]*(1+_p[6]*(1+_p[7])))))))),m=st.multiplyByScalar(e,h,BPe);return st.multiplyByScalar(t,f,i),st.add(m,i,i)};st.fastSquad=function(e,t,n,i,o,r){let s=st.fastSlerp(e,t,o,Lw),a=st.fastSlerp(n,i,o,nx);return st.fastSlerp(s,a,2*o*(1-o),r)};st.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};st.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};st.ZERO=Object.freeze(new st(0,0,0,0));st.IDENTITY=Object.freeze(new st(0,0,0,1));st.prototype.clone=function(e){return st.clone(this,e)};st.prototype.equals=function(e){return st.equals(this,e)};st.prototype.equalsEpsilon=function(e,t){return st.equalsEpsilon(this,e,t)};st.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Qe=st;var Ai={},gY={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"}},ix={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},_Y={},ru={east:new d,north:new d,up:new d,west:new d,south:new d,down:new d},L_=new d,O_=new d,F_=new d;Ai.localFrameToFixedFrameGenerator=function(e,t){if(!gY.hasOwnProperty(e)||!gY[e].hasOwnProperty(t))throw new Ae("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=gY[e][t],i,o=e+t;return l(_Y[o])?i=_Y[o]:(i=function(r,s,a){if(l(a)||(a=new M),d.equalsEpsilon(r,d.ZERO,D.EPSILON14))d.unpack(ix[e],0,L_),d.unpack(ix[t],0,O_),d.unpack(ix[n],0,F_);else if(D.equalsEpsilon(r.x,0,D.EPSILON14)&&D.equalsEpsilon(r.y,0,D.EPSILON14)){let c=D.sign(r.z);d.unpack(ix[e],0,L_),e!=="east"&&e!=="west"&&d.multiplyByScalar(L_,c,L_),d.unpack(ix[t],0,O_),t!=="east"&&t!=="west"&&d.multiplyByScalar(O_,c,O_),d.unpack(ix[n],0,F_),n!=="east"&&n!=="west"&&d.multiplyByScalar(F_,c,F_)}else{s=s??te.default,s.geodeticSurfaceNormal(r,ru.up);let c=ru.up,u=ru.east;u.x=-r.y,u.y=r.x,u.z=0,d.normalize(u,ru.east),d.cross(c,u,ru.north),d.multiplyByScalar(ru.up,-1,ru.down),d.multiplyByScalar(ru.east,-1,ru.west),d.multiplyByScalar(ru.north,-1,ru.south),L_=ru[e],O_=ru[t],F_=ru[n]}return a[0]=L_.x,a[1]=L_.y,a[2]=L_.z,a[3]=0,a[4]=O_.x,a[5]=O_.y,a[6]=O_.z,a[7]=0,a[8]=F_.x,a[9]=F_.y,a[10]=F_.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},_Y[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 wPe=new Qe,DPe=new d(1,1,1),vPe=new M;Ai.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??Ai.eastNorthUpToFixedFrame;let r=Qe.fromHeadingPitchRoll(t,wPe),s=M.fromTranslationQuaternionRotationScale(d.ZERO,r,DPe,vPe);return o=i(e,n,o),M.multiply(o,s,o)};var PPe=new M,RPe=new X;Ai.headingPitchRollQuaternion=function(e,t,n,i,o){let r=Ai.headingPitchRollToFixedFrame(e,t,n,i,PPe),s=M.getMatrix3(r,RPe);return Qe.fromRotationMatrix(s,o)};var MPe=new d(1,1,1),NPe=new d,pie=new M,LPe=new M,OPe=new X,FPe=new Qe;Ai.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??te.default,n=n??Ai.eastNorthUpToFixedFrame,l(i)||(i=new hc);let o=M.getTranslation(e,NPe);if(d.equals(o,d.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=M.inverseTransformation(n(o,t,pie),pie),s=M.setScale(e,MPe,LPe);s=M.setTranslation(s,d.ZERO,s),r=M.multiply(r,s,r);let a=Qe.fromRotationMatrix(M.getMatrix3(r,OPe),FPe);return a=Qe.normalize(a,a),hc.fromQuaternion(a,i)};var QPe=6*3600+2460+50.54841,kPe=8640184812866e-6,UPe=.093104,GPe=-62e-7,zPe=11772758384668e-32,VPe=72921158553e-15,HPe=D.TWO_PI/86400,rz=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){rz=J.addSeconds(e,-J.computeTaiMinusUtc(e),rz);let n=rz.dayNumber,i=rz.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/ri.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/ri.DAYS_PER_JULIAN_CENTURY;let a=(QPe+o*(kPe+o*(UPe+o*GPe)))*HPe%D.TWO_PI,c=VPe+zPe*(n-24515455e-1),u=(i+ri.SECONDS_PER_DAY*.5)%ri.SECONDS_PER_DAY,f=a+c*u,h=Math.cos(f),m=Math.sin(f);return l(t)?(t[0]=h,t[1]=-m,t[2]=0,t[3]=m,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new X(h,m,0,-m,h,0,0,0,1)};Ai.iau2006XysData=new Mw;Ai.earthOrientationParameters=Rw.NONE;var EY=32.184,YPe=2451545;Ai.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+EY,i=e.stop.dayNumber,o=e.stop.secondsOfDay+EY;return Ai.iau2006XysData.preload(t,n,i,o)};Ai.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new X);let n=Ai.computeFixedToIcrfMatrix(e,t);if(l(n))return X.transpose(n,t)};var WPe=32.184,jPe=2451545,sz=new hc,qPe=new X,KPe=new J;Ai.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new X);let n=J.addSeconds(e,WPe,KPe),i=J.totalDays(n)-jPe,o=D.toRadians(12.112)-D.toRadians(.052992)*i,r=D.toRadians(24.224)-D.toRadians(.105984)*i,s=D.toRadians(227.645)+D.toRadians(13.012)*i,a=D.toRadians(261.105)+D.toRadians(13.340716)*i,c=D.toRadians(358)+D.toRadians(.9856)*i;return sz.pitch=D.toRadians(180)-D.toRadians(3.878)*Math.sin(o)-D.toRadians(.12)*Math.sin(r)+D.toRadians(.07)*Math.sin(s)-D.toRadians(.017)*Math.sin(a),sz.roll=D.toRadians(66.53-90)+D.toRadians(1.543)*Math.cos(o)+D.toRadians(.24)*Math.cos(r)-D.toRadians(.028)*Math.cos(s)+D.toRadians(.007)*Math.cos(a),sz.heading=D.toRadians(244.375-90)+D.toRadians(13.17635831)*i+D.toRadians(3.558)*Math.sin(o)+D.toRadians(.121)*Math.sin(r)-D.toRadians(.064)*Math.sin(s)+D.toRadians(.016)*Math.sin(a)+D.toRadians(.025)*Math.sin(c),X.fromHeadingPitchRoll(sz,qPe)};Ai.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new X);let n=Ai.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return X.transpose(n,t)};var JPe=new fE(0,0,0),XPe=new R_(0,0,0,0,0,0),CY=new X,yY=new X;Ai.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new X);let n=Ai.earthOrientationParameters.compute(e,XPe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+EY,r=Ai.iau2006XysData.computeXysRadians(i,o,JPe);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)),u=CY;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=X.fromRotationZ(-r.s,yY),h=X.multiply(u,f,CY),m=e.dayNumber,g=e.secondsOfDay-J.computeTaiMinusUtc(e)+n.ut1MinusUtc,A=m-2451545,_=g/ri.SECONDS_PER_DAY,C=.779057273264+_+.00273781191135448*(A+_);C=C%1*D.TWO_PI;let y=X.fromRotationZ(C,yY),E=X.multiply(h,y,CY),I=Math.cos(n.xPoleWander),x=Math.cos(n.yPoleWander),S=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),v=i-YPe+o/ri.SECONDS_PER_DAY;v/=36525;let P=-47e-6*v*D.RADIANS_PER_DEGREE/3600,N=Math.cos(P),L=Math.sin(P),p=yY;return p[0]=I*N,p[1]=I*L,p[2]=S,p[3]=-x*L+w*S*N,p[4]=x*N+w*S*L,p[5]=-w*I,p[6]=-w*L-x*S*N,p[7]=w*N-x*S*L,p[8]=x*I,X.multiply(E,p,t)};var ZPe=new se;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 F);let o=ZPe;return M.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),M.multiplyByVector(t,o,o),F.fromCartesian4(o,i)};var $Pe=new d,eRe=new d,tRe=new d;Ai.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??te.default).geodeticSurfaceNormal(e,$Pe),r=d.cross(t,o,eRe);d.equalsEpsilon(r,d.ZERO,D.EPSILON6)&&(r=d.clone(d.UNIT_X,r));let s=d.cross(r,t,tRe);return d.normalize(s,s),d.cross(t,s,r),d.negate(r,r),d.normalize(r,r),l(i)||(i=new X),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 M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var gie=new he,IY=new d,nRe=new d,iRe=new X,bY=new M,_ie=new M;Ai.basisTo2D=function(e,t,n){let i=M.getTranslation(t,nRe),o=e.ellipsoid,r;if(d.equals(i,d.ZERO))r=d.clone(d.ZERO,IY);else{let f=o.cartesianToCartographic(i,gie);r=e.project(f,IY),d.fromElements(r.z,r.x,r.y,r)}let s=Ai.eastNorthUpToFixedFrame(i,o,bY),a=M.inverseTransformation(s,_ie),c=M.getMatrix3(t,iRe),u=M.multiplyByMatrix3(a,c,n);return M.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,u,n),M.setTranslation(n,r,n),n};Ai.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=Ai.eastNorthUpToFixedFrame(t,i,bY),r=M.inverseTransformation(o,_ie),s=i.cartesianToCartographic(t,gie),a=e.project(s,IY);d.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,bY);return M.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,r,n),M.multiply(c,n,n),n};var It=Ai;function Nn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(Nn.prototype,{width:{get:function(){return Nn.computeWidth(this)}},height:{get:function(){return Nn.computeHeight(this)}}});Nn.packedLength=4;Nn.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};Nn.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Nn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Nn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=D.TWO_PI),t-n};Nn.computeHeight=function(e){return e.north-e.south};Nn.fromDegrees=function(e,t,n,i,o){return e=D.toRadians(e??0),t=D.toRadians(t??0),n=D.toRadians(n??0),i=D.toRadians(i??0),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new Nn(e,t,n,i)};Nn.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 Nn(e,t,n,i)};Nn.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,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let h=f.longitude>=0?f.longitude:f.longitude+D.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>D.PI&&(i=i-D.TWO_PI),n>D.PI&&(n=n-D.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new Nn(n,s,i,a)};Nn.fromCartesianArray=function(e,t,n){t=t??te.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 u=0,f=e.length;u<f;u++){let h=t.cartesianToCartographic(e[u]);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 m=h.longitude>=0?h.longitude:h.longitude+D.TWO_PI;r=Math.min(r,m),s=Math.max(s,m)}return o-i>s-r&&(i=r,o=s,o>D.PI&&(o=o-D.TWO_PI),i>D.PI&&(i=i-D.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new Nn(i,a,o,c)};var oRe=new d,rRe=new d,sRe=new d,aRe=new d,cRe=new d,xY=new Array(5);for(let e=0;e<xY.length;++e)xY[e]=new d;Nn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=te.default),l(n)||(n=new Nn),d.equals(i,d.ZERO))return Nn.clone(Nn.MAX_VALUE,n),n;let r=It.eastNorthUpToFixedFrame(i,t,oRe),s=M.multiplyByPointAsVector(r,d.UNIT_X,rRe);d.normalize(s,s);let a=M.multiplyByPointAsVector(r,d.UNIT_Y,sRe);d.normalize(a,a),d.multiplyByScalar(a,o,a),d.multiplyByScalar(s,o,s);let c=d.negate(a,cRe),u=d.negate(s,aRe),f=xY,h=f[0];return d.add(i,a,h),h=f[1],d.add(i,u,h),h=f[2],d.add(i,c,h),h=f[3],d.add(i,s,h),f[4]=i,Nn.fromCartesianArray(f,t,n)};Nn.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 Nn(e.west,e.south,e.east,e.north)};Nn.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};Nn.prototype.clone=function(e){return Nn.clone(this,e)};Nn.prototype.equals=function(e){return Nn.equals(this,e)};Nn.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};Nn.prototype.equalsEpsilon=function(e,t){return Nn.equalsEpsilon(this,e,t)};Nn._validate=function(e){};Nn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};Nn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};Nn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};Nn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};Nn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=D.TWO_PI);let o=D.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new he(o,r)};Nn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=D.TWO_PI:r<s&&i>0&&(r+=D.TWO_PI),i<o&&s<0?s+=D.TWO_PI:r<s&&o<0&&(o+=D.TWO_PI);let a=D.negativePiToPi(Math.max(o,s)),c=D.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new Nn(a,u,c,f)};Nn.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 Nn(i,o,r,s)};Nn.union=function(e,t,n){l(n)||(n=new Nn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=D.TWO_PI:r<s&&i>0&&(r+=D.TWO_PI),i<o&&s<0?s+=D.TWO_PI:r<s&&o<0&&(o+=D.TWO_PI);let a=D.negativePiToPi(Math.min(o,s)),c=D.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};Nn.expand=function(e,t,n){return l(n)||(n=new Nn),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};Nn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=D.TWO_PI,n<0&&(n+=D.TWO_PI)),(n>o||D.equalsEpsilon(n,o,D.EPSILON14))&&(n<r||D.equalsEpsilon(n,r,D.EPSILON14))&&i>=e.south&&i<=e.north};var lRe=new he;Nn.subsample=function(e,t,n,i){t=t??te.default,n=n??0,l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=lRe;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*D.PI_OVER_TWO,Nn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};Nn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new Nn),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=D.TWO_PI+e.east-e.west;r.west=D.negativePiToPi(e.west+t*a),r.east=D.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};Nn.MAX_VALUE=Object.freeze(new Nn(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ce=Nn;function is(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}is.packedLength=4;is.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};is.unpack=function(e,t,n){return t=t??0,l(n)||(n=new is),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};is.fromPoints=function(e,t){if(l(t)||(t=new is),!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],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var Cie=new Gi,uRe=new he,fRe=new he;is.fromRectangle=function(e,t,n){if(l(n)||(n=new is),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;Cie._ellipsoid=te.default,t=t??Cie;let i=t.project(ce.southwest(e,uRe)),o=t.project(ce.northeast(e,fRe));return F.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};is.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 is(e.x,e.y,e.width,e.height)};is.union=function(e,t,n){l(n)||(n=new is);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};is.expand=function(e,t,n){n=is.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};is.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?qt.OUTSIDE:qt.INTERSECTING};is.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};is.prototype.clone=function(e){return is.clone(this,e)};is.prototype.intersect=function(e){return is.intersect(this,e)};is.prototype.equals=function(e){return is.equals(this,e)};var Xe=is;var Ac={POINTS:ee.POINTS,LINES:ee.LINES,LINE_LOOP:ee.LINE_LOOP,LINE_STRIP:ee.LINE_STRIP,TRIANGLES:ee.TRIANGLES,TRIANGLE_STRIP:ee.TRIANGLE_STRIP,TRIANGLE_FAN:ee.TRIANGLE_FAN};Ac.isLines=function(e){return e===Ac.LINES||e===Ac.LINE_LOOP||e===Ac.LINE_STRIP};Ac.isTriangles=function(e){return e===Ac.TRIANGLES||e===Ac.TRIANGLE_STRIP||e===Ac.TRIANGLE_FAN};Ac.validate=function(e){return e===Ac.POINTS||e===Ac.LINES||e===Ac.LINE_LOOP||e===Ac.LINE_STRIP||e===Ac.TRIANGLES||e===Ac.TRIANGLE_STRIP||e===Ac.TRIANGLE_FAN};var Pe=Object.freeze(Ac);var dE=`in vec4 position;
in vec2 textureCoordinates;
out vec2 v_textureCoordinates;
void main()
{
gl_Position = position;
v_textureCoordinates = textureCoordinates;
}
`;var Wr={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 Ow(e){e=e??V.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Pe.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 Oc(e,t){return(e._flags&t)===t}function Q_(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(Ow.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 Oc(this,Wr.CULL)},set:function(e){Oc(this,Wr.CULL)!==e&&(Q_(this,Wr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Oc(this,Wr.OCCLUDE)},set:function(e){Oc(this,Wr.OCCLUDE)!==e&&(Q_(this,Wr.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 Oc(this,Wr.CAST_SHADOWS)},set:function(e){Oc(this,Wr.CAST_SHADOWS)!==e&&(Q_(this,Wr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Oc(this,Wr.RECEIVE_SHADOWS)},set:function(e){Oc(this,Wr.RECEIVE_SHADOWS)!==e&&(Q_(this,Wr.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 Oc(this,Wr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Oc(this,Wr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Q_(this,Wr.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 Oc(this,Wr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Oc(this,Wr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Q_(this,Wr.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 Oc(this,Wr.PICK_ONLY)},set:function(e){Oc(this,Wr.PICK_ONLY)!==e&&(Q_(this,Wr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Oc(this,Wr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Oc(this,Wr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Q_(this,Wr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});Ow.shallowClone=function(e,t){if(l(e))return l(t)||(t=new Ow),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};Ow.prototype.execute=function(e,t){e.draw(this,t)};var et=Ow;var wi={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,HALF_FLOAT:ee.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ee.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ee.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ee.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ee.UNSIGNED_SHORT_5_6_5};wi.toWebGLConstant=function(e,t){switch(e){case wi.UNSIGNED_BYTE:return ee.UNSIGNED_BYTE;case wi.UNSIGNED_SHORT:return ee.UNSIGNED_SHORT;case wi.UNSIGNED_INT:return ee.UNSIGNED_INT;case wi.FLOAT:return ee.FLOAT;case wi.HALF_FLOAT:return t.webgl2?ee.HALF_FLOAT:ee.HALF_FLOAT_OES;case wi.UNSIGNED_INT_24_8:return ee.UNSIGNED_INT_24_8;case wi.UNSIGNED_SHORT_4_4_4_4:return ee.UNSIGNED_SHORT_4_4_4_4;case wi.UNSIGNED_SHORT_5_5_5_1:return ee.UNSIGNED_SHORT_5_5_5_1;case wi.UNSIGNED_SHORT_5_6_5:return wi.UNSIGNED_SHORT_5_6_5}};wi.isPacked=function(e){return e===wi.UNSIGNED_INT_24_8||e===wi.UNSIGNED_SHORT_4_4_4_4||e===wi.UNSIGNED_SHORT_5_5_5_1||e===wi.UNSIGNED_SHORT_5_6_5};wi.sizeInBytes=function(e){switch(e){case wi.UNSIGNED_BYTE:return 1;case wi.UNSIGNED_SHORT:case wi.UNSIGNED_SHORT_4_4_4_4:case wi.UNSIGNED_SHORT_5_5_5_1:case wi.UNSIGNED_SHORT_5_6_5:case wi.HALF_FLOAT:return 2;case wi.UNSIGNED_INT:case wi.FLOAT:case wi.UNSIGNED_INT_24_8:return 4}};wi.validate=function(e){return e===wi.UNSIGNED_BYTE||e===wi.UNSIGNED_SHORT||e===wi.UNSIGNED_INT||e===wi.FLOAT||e===wi.HALF_FLOAT||e===wi.UNSIGNED_INT_24_8||e===wi.UNSIGNED_SHORT_4_4_4_4||e===wi.UNSIGNED_SHORT_5_5_5_1||e===wi.UNSIGNED_SHORT_5_6_5};wi.getTypedArrayConstructor=function(e){let t=wi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===wi.FLOAT?Float32Array:Uint32Array};var Ge=Object.freeze(wi);var Ze={DEPTH_COMPONENT:ee.DEPTH_COMPONENT,DEPTH_STENCIL:ee.DEPTH_STENCIL,ALPHA:ee.ALPHA,RED:ee.RED,RG:ee.RG,RGB:ee.RGB,RGBA:ee.RGBA,RED_INTEGER:ee.RED_INTEGER,RG_INTEGER:ee.RG_INTEGER,RGB_INTEGER:ee.RGB_INTEGER,RGBA_INTEGER:ee.RGBA_INTEGER,LUMINANCE:ee.LUMINANCE,LUMINANCE_ALPHA:ee.LUMINANCE_ALPHA,RGB_DXT1:ee.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ee.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ee.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ee.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ee.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ee.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ee.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ee.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ee.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ee.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ee.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ee.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ee.COMPRESSED_RGBA_BPTC_UNORM};Ze.componentsLength=function(e){switch(e){case Ze.RGB:case Ze.RGB_INTEGER:return 3;case Ze.RGBA:case Ze.RGBA_INTEGER:return 4;case Ze.LUMINANCE_ALPHA:case Ze.RG:case Ze.RG_INTEGER:return 2;case Ze.ALPHA:case Ze.RED:case Ze.RED_INTEGER:case Ze.LUMINANCE:return 1;default:return 1}};Ze.validate=function(e){return e===Ze.DEPTH_COMPONENT||e===Ze.DEPTH_STENCIL||e===Ze.ALPHA||e===Ze.RED||e===Ze.RG||e===Ze.RGB||e===Ze.RGBA||e===Ze.RED_INTEGER||e===Ze.RG_INTEGER||e===Ze.RGB_INTEGER||e===Ze.RGBA_INTEGER||e===Ze.LUMINANCE||e===Ze.LUMINANCE_ALPHA||e===Ze.RGB_DXT1||e===Ze.RGBA_DXT1||e===Ze.RGBA_DXT3||e===Ze.RGBA_DXT5||e===Ze.RGB_PVRTC_4BPPV1||e===Ze.RGB_PVRTC_2BPPV1||e===Ze.RGBA_PVRTC_4BPPV1||e===Ze.RGBA_PVRTC_2BPPV1||e===Ze.RGBA_ASTC||e===Ze.RGB_ETC1||e===Ze.RGB8_ETC2||e===Ze.RGBA8_ETC2_EAC||e===Ze.RGBA_BC7};Ze.isColorFormat=function(e){return e===Ze.RED||e===Ze.ALPHA||e===Ze.RGB||e===Ze.RGBA||e===Ze.LUMINANCE||e===Ze.LUMINANCE_ALPHA};Ze.isDepthFormat=function(e){return e===Ze.DEPTH_COMPONENT||e===Ze.DEPTH_STENCIL};Ze.isCompressedFormat=function(e){return e===Ze.RGB_DXT1||e===Ze.RGBA_DXT1||e===Ze.RGBA_DXT3||e===Ze.RGBA_DXT5||e===Ze.RGB_PVRTC_4BPPV1||e===Ze.RGB_PVRTC_2BPPV1||e===Ze.RGBA_PVRTC_4BPPV1||e===Ze.RGBA_PVRTC_2BPPV1||e===Ze.RGBA_ASTC||e===Ze.RGB_ETC1||e===Ze.RGB8_ETC2||e===Ze.RGBA8_ETC2_EAC||e===Ze.RGBA_BC7};Ze.isDXTFormat=function(e){return e===Ze.RGB_DXT1||e===Ze.RGBA_DXT1||e===Ze.RGBA_DXT3||e===Ze.RGBA_DXT5};Ze.isPVRTCFormat=function(e){return e===Ze.RGB_PVRTC_4BPPV1||e===Ze.RGB_PVRTC_2BPPV1||e===Ze.RGBA_PVRTC_4BPPV1||e===Ze.RGBA_PVRTC_2BPPV1};Ze.isASTCFormat=function(e){return e===Ze.RGBA_ASTC};Ze.isETC1Format=function(e){return e===Ze.RGB_ETC1};Ze.isETC2Format=function(e){return e===Ze.RGB8_ETC2||e===Ze.RGBA8_ETC2_EAC};Ze.isBC7Format=function(e){return e===Ze.RGBA_BC7};Ze.compressedTextureSizeInBytes=function(e,t,n){switch(e){case Ze.RGB_DXT1:case Ze.RGBA_DXT1:case Ze.RGB_ETC1:case Ze.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case Ze.RGBA_DXT3:case Ze.RGBA_DXT5:case Ze.RGBA_ASTC:case Ze.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case Ze.RGB_PVRTC_4BPPV1:case Ze.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case Ze.RGB_PVRTC_2BPPV1:case Ze.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case Ze.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};Ze.textureSizeInBytes=function(e,t,n,i){let o=Ze.componentsLength(e);return Ge.isPacked(t)&&(o=1),o*Ge.sizeInBytes(t)*n*i};Ze.texture3DSizeInBytes=function(e,t,n,i,o){let r=Ze.componentsLength(e);return Ge.isPacked(t)&&(r=1),r*Ge.sizeInBytes(t)*n*i*o};Ze.alignmentInBytes=function(e,t,n){let i=Ze.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};Ze.createTypedArray=function(e,t,n,i){let o=Ge.getTypedArrayConstructor(t),r=Ze.componentsLength(e)*n*i;return new o(r)};Ze.flipY=function(e,t,n,i,o){if(o===1)return e;let r=Ze.createTypedArray(t,n,i,o),s=Ze.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let u=c*i*s,f=(o-c-1)*i*s;for(let h=0;h<a;++h)r[f+h]=e[u+h]}return r};Ze.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===Ze.DEPTH_STENCIL)return ee.DEPTH24_STENCIL8;if(e===Ze.DEPTH_COMPONENT){if(t===Ge.UNSIGNED_SHORT)return ee.DEPTH_COMPONENT16;if(t===Ge.UNSIGNED_INT)return ee.DEPTH_COMPONENT24}if(t===Ge.FLOAT)switch(e){case Ze.RGBA:return ee.RGBA32F;case Ze.RGB:return ee.RGB32F;case Ze.RG:return ee.RG32F;case Ze.RED:return ee.R32F}if(t===Ge.HALF_FLOAT)switch(e){case Ze.RGBA:return ee.RGBA16F;case Ze.RGB:return ee.RGB16F;case Ze.RG:return ee.RG16F;case Ze.RED:return ee.R16F}if(t===Ge.UNSIGNED_BYTE)switch(e){case Ze.RGBA:return ee.RGBA8;case Ze.RGB:return ee.RGB8;case Ze.RG:return ee.RG8;case Ze.RED:return ee.R8}if(t===Ge.INT)switch(e){case Ze.RGBA_INTEGER:return ee.RGBA32I;case Ze.RGB_INTEGER:return ee.RGB32I;case Ze.RG_INTEGER:return ee.RG32I;case Ze.RED_INTEGER:return ee.R32I}if(t===Ge.UNSIGNED_INT)switch(e){case Ze.RGBA_INTEGER:return ee.RGBA32UI;case Ze.RGB_INTEGER:return ee.RGB32UI;case Ze.RG_INTEGER:return ee.RG32UI;case Ze.RED_INTEGER:return ee.R32UI}return e};var qe=Object.freeze(Ze);var jr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(jr,{maximumCombinedTextureImageUnits:{get:function(){return jr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return jr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return jr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return jr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return jr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return jr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return jr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return jr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return jr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return jr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return jr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return jr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return jr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return jr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return jr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return jr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return jr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return jr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return jr._maximumColorAttachments}},maximumSamples:{get:function(){return jr._maximumSamples}},highpFloatSupported:{get:function(){return jr._highpFloatSupported}},highpIntSupported:{get:function(){return jr._highpIntSupported}}});var Ft=jr;function TY(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function az(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function ph(e){e=e??V.EMPTY_OBJECT;let n=e.context._gl,i=Ft.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;TY(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;az(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;TY(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;az(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;az(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;TY(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;az(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(ph.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)}}});ph.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};ph.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};ph.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};ph.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};ph.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};ph.prototype.getColorTexture=function(e){return this._colorTextures[e]};ph.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};ph.prototype.isDestroyed=function(){return!1};ph.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),de(this)};var os=ph;var cz={CLOCKWISE:ee.CW,COUNTER_CLOCKWISE:ee.CCW};cz.validate=function(e){return e===cz.CLOCKWISE||e===cz.COUNTER_CLOCKWISE};var ks=Object.freeze(cz);function yie(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]=yie(e[t]));return Object.freeze(e)}var SY=yie;function KA(e){let t=e??V.EMPTY_OBJECT,n=t.cull??V.EMPTY_OBJECT,i=t.polygonOffset??V.EMPTY_OBJECT,o=t.scissorTest??V.EMPTY_OBJECT,r=o.rectangle??V.EMPTY_OBJECT,s=t.depthRange??V.EMPTY_OBJECT,a=t.depthTest??V.EMPTY_OBJECT,c=t.colorMask??V.EMPTY_OBJECT,u=t.blending??V.EMPTY_OBJECT,f=u.color??V.EMPTY_OBJECT,h=t.stencilTest??V.EMPTY_OBJECT,m=h.frontOperation??V.EMPTY_OBJECT,g=h.backOperation??V.EMPTY_OBJECT,A=t.sampleCoverage??V.EMPTY_OBJECT,_=t.viewport;this.frontFace=t.frontFace??ks.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ee.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:Xe.clone(r)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??ee.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:u.enabled??!1,color:new G(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??ee.FUNC_ADD,equationAlpha:u.equationAlpha??ee.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??ee.ONE,functionSourceAlpha:u.functionSourceAlpha??ee.ONE,functionDestinationRgb:u.functionDestinationRgb??ee.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??ee.ZERO},this.stencilTest={enabled:h.enabled??!1,frontFunction:h.frontFunction??ee.ALWAYS,backFunction:h.backFunction??ee.ALWAYS,reference:h.reference??0,mask:h.mask??-1,frontOperation:{fail:m.fail??ee.KEEP,zFail:m.zFail??ee.KEEP,zPass:m.zPass??ee.KEEP},backOperation:{fail:g.fail??ee.KEEP,zFail:g.zFail??ee.KEEP,zPass:g.zPass??ee.KEEP}},this.sampleCoverage={enabled:A.enabled??!1,value:A.value??1,invert:A.invert??!1},this.viewport=l(_)?new Xe(_.x,_.y,_.width,_.height):void 0,this.id=0,this._applyFunctions=[]}var dRe=0,qA={};KA.fromCache=function(e){let t=JSON.stringify(e),n=qA[t];if(l(n))return++n.referenceCount,n.state;let i=new KA(e),o=JSON.stringify(i);return n=qA[o],l(n)||(i.id=dRe++,n={referenceCount:0,state:i},qA[o]=n),++n.referenceCount,qA[t]={referenceCount:1,state:n.state},n.state};KA.removeFromCache=function(e){let t=new KA(e),n=JSON.stringify(t),i=qA[n],o=JSON.stringify(e),r=qA[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete qA[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete qA[n]};KA.getCache=function(){return qA};KA.clearCache=function(){qA={}};function hE(e,t,n){n?e.enable(t):e.disable(t)}function Eie(e,t){e.frontFace(t.frontFace)}function Iie(e,t){let n=t.cull,i=n.enabled;hE(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function bie(e,t){e.lineWidth(t.lineWidth)}function xie(e,t){let n=t.polygonOffset,i=n.enabled;hE(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Tie(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(hE(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 Sie(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function Bie(e,t){let n=t.depthTest,i=n.enabled;hE(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function wie(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Die(e,t){e.depthMask(t.depthMask)}function vie(e,t){e.stencilMask(t.stencilMask)}function hRe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Pie(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;hE(e,e.BLEND,o),o&&(hRe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Rie(e,t){let n=t.stencilTest,i=n.enabled;if(hE(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,u=c.fail,f=c.zFail,h=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,h);let m=n.backOperation,g=m.fail,A=m.zFail,_=m.zPass;e.stencilOpSeparate(e.BACK,g,A,_)}}function Mie(e,t){let n=t.sampleCoverage,i=n.enabled;hE(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var ARe=new Xe;function Nie(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=ARe,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)}KA.apply=function(e,t,n){Eie(e,t),Iie(e,t),bie(e,t),xie(e,t),Sie(e,t),Bie(e,t),wie(e,t),Die(e,t),vie(e,t),Rie(e,t),Mie(e,t),Tie(e,t,n),Pie(e,t,n),Nie(e,t,n)};function mRe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(Eie),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Iie),e.lineWidth!==t.lineWidth&&n.push(bie),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(xie),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Sie),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Bie),(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(wie),e.depthMask!==t.depthMask&&n.push(Die),e.stencilMask!==t.stencilMask&&n.push(vie),(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(Rie),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Mie),n}KA.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=mRe(t,n),n._applyFunctions[t.id]=f);let h=f.length;for(let m=0;m<h;++m)f[m](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&Tie(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&Pie(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Nie(e,n,o)};KA.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:Xe.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:G.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)?Xe.clone(e.viewport):void 0}};var ze=KA;function nn(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}nn.packedLength=4;nn.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};nn.unpack=function(e,t,n){return t=t??0,l(n)||(n=new nn),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};nn.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)nn.pack(e[o],t,o*4);return t};nn.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]=nn.unpack(e,i,t[o])}return t};nn.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 nn(e[0],e[2],e[1],e[3])};nn.fromArray=nn.unpack;nn.fromColumnMajorArray=function(e,t){return nn.clone(e,t)};nn.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 nn(e[0],e[1],e[2],e[3])};nn.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new nn(e.x,0,0,e.y)};nn.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new nn(e,0,0,e)};nn.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 nn(n,-i,i,n)};nn.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]]};nn.getElementIndex=function(e,t){return e*2+t};nn.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};nn.setColumn=function(e,t,n,i){i=nn.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};nn.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};nn.setRow=function(e,t,n,i){return i=nn.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var pRe=new F;nn.setScale=function(e,t,n){let i=nn.getScale(e,pRe),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 gRe=new F;nn.setUniformScale=function(e,t,n){let i=nn.getScale(e,gRe),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 Lie=new F;nn.getScale=function(e,t){return t.x=F.magnitude(F.fromElements(e[0],e[1],Lie)),t.y=F.magnitude(F.fromElements(e[2],e[3],Lie)),t};var Oie=new F;nn.getMaximumScale=function(e){return nn.getScale(e,Oie),F.maximumComponent(Oie)};var _Re=new F;nn.setRotation=function(e,t,n){let i=nn.getScale(e,_Re);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 CRe=new F;nn.getRotation=function(e,t){let n=nn.getScale(e,CRe);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};nn.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};nn.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};nn.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};nn.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};nn.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};nn.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};nn.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};nn.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};nn.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};nn.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};nn.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]};nn.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]};nn.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};nn.IDENTITY=Object.freeze(new nn(1,0,0,1));nn.ZERO=Object.freeze(new nn(0,0,0,0));nn.COLUMN0ROW0=0;nn.COLUMN0ROW1=1;nn.COLUMN1ROW0=2;nn.COLUMN1ROW1=3;Object.defineProperties(nn.prototype,{length:{get:function(){return nn.packedLength}}});nn.prototype.clone=function(e){return nn.clone(this,e)};nn.prototype.equals=function(e){return nn.equals(this,e)};nn.prototype.equalsEpsilon=function(e,t){return nn.equalsEpsilon(this,e,t)};nn.prototype.toString=function(){return`(${this[0]}, ${this[2]})
(${this[1]}, ${this[3]})`};var zi=nn;function yRe(e,t,n,i){switch(t.type){case e.FLOAT:return new Fie(e,t,n,i);case e.FLOAT_VEC2:return new Qie(e,t,n,i);case e.FLOAT_VEC3:return new kie(e,t,n,i);case e.FLOAT_VEC4:return new Uie(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new lz(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new lz(e,t,n,i);case e.INT:case e.BOOL:return new Gie(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new zie(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Vie(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Hie(e,t,n,i);case e.FLOAT_MAT2:return new Yie(e,t,n,i);case e.FLOAT_MAT3:return new Wie(e,t,n,i);case e.FLOAT_MAT4:return new jie(e,t,n,i);default:throw new ue(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Fie(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Fie.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Qie(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}Qie.prototype.set=function(){let e=this.value;F.equals(e,this._value)||(F.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function kie(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}kie.prototype.set=function(){let e=this.value;l(e.red)?G.equals(e,this._value)||(this._value=G.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(d.equals(e,this._value)||(this._value=d.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function Uie(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Uie.prototype.set=function(){let e=this.value;l(e.red)?G.equals(e,this._value)||(this._value=G.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(se.equals(e,this._value)||(this._value=se.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function lz(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}lz.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};lz.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Gie(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Gie.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function zie(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}zie.prototype.set=function(){let e=this.value;F.equals(e,this._value)||(F.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Vie(e,t,n,i){this.name=n,this.value=void 0,this._value=new d,this._gl=e,this._location=i}Vie.prototype.set=function(){let e=this.value;d.equals(e,this._value)||(d.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Hie(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}Hie.prototype.set=function(){let e=this.value;se.equals(e,this._value)||(se.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var ERe=new Float32Array(4);function Yie(e,t,n,i){this.name=n,this.value=void 0,this._value=new zi,this._gl=e,this._location=i}Yie.prototype.set=function(){if(!zi.equalsArray(this.value,this._value,0)){zi.clone(this.value,this._value);let e=zi.toArray(this.value,ERe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var IRe=new Float32Array(9);function Wie(e,t,n,i){this.name=n,this.value=void 0,this._value=new X,this._gl=e,this._location=i}Wie.prototype.set=function(){if(!X.equalsArray(this.value,this._value,0)){X.clone(this.value,this._value);let e=X.toArray(this.value,IRe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var bRe=new Float32Array(16);function jie(e,t,n,i){this.name=n,this.value=void 0,this._value=new M,this._gl=e,this._location=i}jie.prototype.set=function(){if(!M.equalsArray(this.value,this._value,0)){M.clone(this.value,this._value);let e=M.toArray(this.value,bRe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var Fw=yRe;function xRe(e,t,n,i){switch(t.type){case e.FLOAT:return new qie(e,t,n,i);case e.FLOAT_VEC2:return new Kie(e,t,n,i);case e.FLOAT_VEC3:return new Jie(e,t,n,i);case e.FLOAT_VEC4:return new Xie(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new BY(e,t,n,i);case e.INT:case e.BOOL:return new Zie(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new $ie(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new eoe(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new toe(e,t,n,i);case e.FLOAT_MAT2:return new noe(e,t,n,i);case e.FLOAT_MAT3:return new ioe(e,t,n,i);case e.FLOAT_MAT4:return new ooe(e,t,n,i);default:throw new ue(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function qie(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]}qie.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 Kie(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]}Kie.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+=2}i&&this._gl.uniform2fv(this._location,n)};function Jie(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]}Jie.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)&&(d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function Xie(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]}Xie.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)?G.equalsArray(s,n,o)||(G.pack(s,n,o),i=!0):l(s.x)&&(se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function BY(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}BY.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)}};BY.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 Zie(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]}Zie.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 $ie(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]}$ie.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+=2}i&&this._gl.uniform2iv(this._location,n)};function eoe(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]}eoe.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];d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function toe(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]}toe.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];se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function noe(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]}noe.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];zi.equalsArray(s,n,o)||(zi.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function ioe(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]}ioe.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];X.equalsArray(s,n,o)||(X.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function ooe(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]}ooe.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+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var Qw=xRe;var TRe=0;function Cp(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=SRe(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=TRe++}Cp.fromCache=function(e){return e=e??V.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};Cp.replaceCache=function(e){return e=e??V.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Cp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return uz(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return uz(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return uz(this),this._uniformsByName}}});function roe(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 SRe(e,t){let n={};if(!Ft.highpFloatSupported||!Ft.highpIntSupported){let i,o,r,s,a=roe(e),c=roe(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;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 JA="[Cesium WebGL] ";function BRe(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 m in a)a.hasOwnProperty(m)&&e.bindAttribLocation(s,a[m],m);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(`${JA}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${JA}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${JA}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${JA}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${JA}Vertex shader compile log: ${c}`),console.error(`${JA} Vertex shader source:
${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${JA}Fragment shader compile log: ${c}`),console.error(`${JA} Fragment shader source:
${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ue(u);function h(m,g){if(!l(f))return;let A=f.getTranslatedShaderSource(m);if(A===""){console.error(`${JA}${g} shader translation failed.`);return}console.error(`${JA}Translated ${g} shaderSource:
${A}`)}}function wRe(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 DRe(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]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let h=Fw(e,a,u,f);n[u]=h,i.push(h),h._setSampler&&o.push(h)}}else{let f,h,m,g,A=u.indexOf("[");if(A>=0){if(f=n[u.slice(0,A)],!l(f))continue;h=f._locations,h.length<=1&&(m=f.value,g=e.getUniformLocation(t,u),g!==null&&(h.push(g),m.push(e.getUniform(t,g))))}else{h=[];for(let _=0;_<a.size;++_)g=e.getUniformLocation(t,`${u}[${_}]`),g!==null&&h.push(g);f=Qw(e,a,u,h),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function vRe(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=dp[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function PRe(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 uz(e){l(e._program)||soe(e)}function soe(e){let t=e._program,n=e._gl,i=BRe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=DRe(n,i),s=vRe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=wRe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=PRe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let h=e._vertexShaderText,m=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{soe(e),u(e._program)}catch(A){e._vertexShaderText=h,e._fragmentShaderText=m;let C=/(?:Compile|Link) error: ([^]*)/.exec(A.message);f(C?C[1]:A.message)}})}Cp.prototype._bind=function(){uz(this),this._gl.useProgram(this._program)};Cp.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)}};Cp.prototype.isDestroyed=function(){return!1};Cp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Cp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),de(this)};var sn=Cp;function fz(e){this._context=e}var kw,RRe=new et({primitiveType:Pe.TRIANGLES}),MRe=new ai({color:new G(0,0,0,0)});function NRe(e,t){return new os({context:e,colorTextures:[t],destroyAttachments:!1})}function LRe(e,t){return sn.fromCache({context:e,vertexShaderSource:dE,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function ORe(e,t){return(!l(kw)||kw.viewport.width!==e||kw.viewport.height!==t)&&(kw=ze.fromCache({viewport:new Xe(0,0,e,t)})),kw}fz.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:LRe(o,e.fragmentShaderSource),a=NRe(o,t),c=ORe(n,i),u=e.uniformMap,f=MRe;f.framebuffer=a,f.renderState=c,f.execute(o);let h=RRe;h.vertexArray=r,h.renderState=c,h.shaderProgram=s,h.uniformMap=u,h.framebuffer=a,h.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};fz.prototype.isDestroyed=function(){return!1};fz.prototype.destroy=function(){return de(this)};var Uw=fz;var Pn={BYTE:ee.BYTE,UNSIGNED_BYTE:ee.UNSIGNED_BYTE,SHORT:ee.SHORT,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,INT:ee.INT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,DOUBLE:ee.DOUBLE};Pn.getSizeInBytes=function(e){switch(e){case Pn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Pn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Pn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Pn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Pn.INT:return Int32Array.BYTES_PER_ELEMENT;case Pn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Pn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Pn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Pn.fromTypedArray=function(e){if(e instanceof Int8Array)return Pn.BYTE;if(e instanceof Uint8Array)return Pn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Pn.SHORT;if(e instanceof Uint16Array)return Pn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Pn.INT;if(e instanceof Uint32Array)return Pn.UNSIGNED_INT;if(e instanceof Float32Array)return Pn.FLOAT;if(e instanceof Float64Array)return Pn.DOUBLE};Pn.validate=function(e){return l(e)&&(e===Pn.BYTE||e===Pn.UNSIGNED_BYTE||e===Pn.SHORT||e===Pn.UNSIGNED_SHORT||e===Pn.INT||e===Pn.UNSIGNED_INT||e===Pn.FLOAT||e===Pn.DOUBLE)};Pn.createTypedArray=function(e,t){switch(e){case Pn.BYTE:return new Int8Array(t);case Pn.UNSIGNED_BYTE:return new Uint8Array(t);case Pn.SHORT:return new Int16Array(t);case Pn.UNSIGNED_SHORT:return new Uint16Array(t);case Pn.INT:return new Int32Array(t);case Pn.UNSIGNED_INT:return new Uint32Array(t);case Pn.FLOAT:return new Float32Array(t);case Pn.DOUBLE:return new Float64Array(t)}};Pn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/Pn.getSizeInBytes(e),e){case Pn.BYTE:return new Int8Array(t,n,i);case Pn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Pn.SHORT:return new Int16Array(t,n,i);case Pn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Pn.INT:return new Int32Array(t,n,i);case Pn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Pn.FLOAT:return new Float32Array(t,n,i);case Pn.DOUBLE:return new Float64Array(t,n,i)}};Pn.fromName=function(e){switch(e){case"BYTE":return Pn.BYTE;case"UNSIGNED_BYTE":return Pn.UNSIGNED_BYTE;case"SHORT":return Pn.SHORT;case"UNSIGNED_SHORT":return Pn.UNSIGNED_SHORT;case"INT":return Pn.INT;case"UNSIGNED_INT":return Pn.UNSIGNED_INT;case"FLOAT":return Pn.FLOAT;case"DOUBLE":return Pn.DOUBLE}};var q=Object.freeze(Pn);var FRe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Xf=Object.freeze(FRe);function wY(e){e=e??V.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Pe.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??Xf.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}wY.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 QRe=new he,kRe=new d,aoe=new M,URe=[new he,new he,new he],GRe=[new F,new F,new F],zRe=[new F,new F,new F],VRe=new d,HRe=new Qe,YRe=new M,WRe=new zi;wY._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ce.center(i,QRe),s=he.toCartesian(r,n,kRe),a=It.eastNorthUpToFixedFrame(s,n,aoe),c=M.inverse(a,aoe),u=GRe,f=URe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let h=VRe;for(o=0;o<3;o++)he.toCartesian(f[o],n,h),h=M.multiplyByPointAsVector(c,h,h),u[o].x=h.x,u[o].y=h.y;let m=Qe.fromAxisAngle(d.UNIT_Z,-t,HRe),g=X.fromQuaternion(m,YRe),A=e.length,_=Number.POSITIVE_INFINITY,C=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(o=0;o<A;o++)h=M.multiplyByPointAsVector(c,e[o],h),h=X.multiplyByVector(g,h,h),_=Math.min(_,h.x),C=Math.min(C,h.y),y=Math.max(y,h.x),E=Math.max(E,h.y);let I=zi.fromRotation(t,WRe),x=zRe;x[0].x=_,x[0].y=C,x[1].x=_,x[1].y=E,x[2].x=y,x[2].y=C;let S=u[0],w=u[2].x-S.x,v=u[1].y-S.y;for(o=0;o<3;o++){let b=x[o];zi.multiplyByVector(I,b,b),b.x=(b.x-S.x)/w,b.y=(b.y-S.y)/v}let P=x[0],N=x[1],L=x[2],p=new Array(6);return F.pack(P,p),F.pack(N,p,2),F.pack(L,p,4),p};var ht=wY;function jRe(e){e=e??V.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var ve=jRe;function ox(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(ox.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}}});ox.clone=function(e){if(l(e))return new ox(e._format,e._datatype,e._width,e._height,e._buffer)};ox.prototype.clone=function(){return ox.clone(this)};var Gw=ox;var coe=mr(Yu(),1);function loe(){if(!l(Va._canTransferArrayBuffer)){let e=PY("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Va._canTransferArrayBuffer=!1,Va._canTransferArrayBuffer}Va._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),Va._canTransferArrayBuffer=s}})}return Va._canTransferArrayBuffer}var vY=new _e;function DY(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 PY(e){let t=new coe.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(N_(e))s=e;else if(!n){let a=Zt(`${Va._workerModulePrefix}/${i}.js`);N_(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=DY(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=`
importScripts("${DY(CESIUM_WORKERS)}");
CesiumWorkers["${i}"]();
`;return r=DY(a),new Worker(r,o)}if(r=e,n||(r=Zt(`${Va._workerModulePrefix+i}.js`)),!zt.supportsEsmWebWorkers())throw new ue("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function qRe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!zt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new ue(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Zt(t.fallbackModulePath),n}n.wasmBinaryFile=Zt(t.wasmBinaryFile);let i=await Be.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function Va(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var KRe=(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 ue(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),vY.raiseEvent(s),i(s)}else vY.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},JRe=[];async function XRe(e,t,n){let i=await Promise.resolve(loe());l(n)?i||(n.length=0):n=JRe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",KRe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function ZRe(e,t,n){++e._activeTasks;try{let i=await XRe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Va.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=PY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return ZRe(this,e,t)};Va.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=PY(this._workerPath),i=await qRe(this,e),o=await Promise.resolve(loe()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new ue("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};Va.prototype.isDestroyed=function(){return!1};Va.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),de(this)};Va.taskCompletedEvent=vY;Va._defaultWorkerModulePrefix="Workers/";Va._workerModulePrefix=Va._defaultWorkerModulePrefix;Va._canTransferArrayBuffer=void 0;var qn=Va;function yp(){}yp._transcodeTaskProcessor=new qn("transcodeKTX2",Number.POSITIVE_INFINITY);yp._readyPromise=void 0;function $Re(){let e=yp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return yp._transcodeTaskProcessor;throw new ue("KTX2 transcoder could not be initialized.")});yp._readyPromise=e}yp.transcode=function(e,t){return l(yp._readyPromise)||$Re(),yp._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 Gw(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 zw=yp;var uoe;foe.setKTX2SupportedFormats=function(e,t,n,i,o,r){uoe={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function foe(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Be.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return zw.transcode(n,uoe)})}var su=foe;function eMe(e,t){this.start=e??0,this.stop=t??0}var qr=eMe;function Cn(e,t){this.center=d.clone(e??d.ZERO),this.radius=t??0}var NY=new d,LY=new d,OY=new d,FY=new d,QY=new d,kY=new d,UY=new d,Ha=new d,GY=new d,zY=new d,VY=new d,HY=new d,tMe=4/3*D.PI;Cn.fromPoints=function(e,t){if(l(t)||(t=new Cn),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=d.clone(e[0],UY),i=d.clone(n,NY),o=d.clone(n,LY),r=d.clone(n,OY),s=d.clone(n,FY),a=d.clone(n,QY),c=d.clone(n,kY),u=e.length,f;for(f=1;f<u;f++){d.clone(e[f],n);let P=n.x,N=n.y,L=n.z;P<i.x&&d.clone(n,i),P>s.x&&d.clone(n,s),N<o.y&&d.clone(n,o),N>a.y&&d.clone(n,a),L<r.z&&d.clone(n,r),L>c.z&&d.clone(n,c)}let h=d.magnitudeSquared(d.subtract(s,i,Ha)),m=d.magnitudeSquared(d.subtract(a,o,Ha)),g=d.magnitudeSquared(d.subtract(c,r,Ha)),A=i,_=s,C=h;m>C&&(C=m,A=o,_=a),g>C&&(C=g,A=r,_=c);let y=GY;y.x=(A.x+_.x)*.5,y.y=(A.y+_.y)*.5,y.z=(A.z+_.z)*.5;let E=d.magnitudeSquared(d.subtract(_,y,Ha)),I=Math.sqrt(E),x=zY;x.x=i.x,x.y=o.y,x.z=r.z;let S=VY;S.x=s.x,S.y=a.y,S.z=c.z;let w=d.midpoint(x,S,HY),v=0;for(f=0;f<u;f++){d.clone(e[f],n);let P=d.magnitude(d.subtract(n,w,Ha));P>v&&(v=P);let N=d.magnitudeSquared(d.subtract(n,y,Ha));if(N>E){let L=Math.sqrt(N);I=(I+L)*.5,E=I*I;let p=L-I;y.x=(I*y.x+p*n.x)/L,y.y=(I*y.y+p*n.y)/L,y.z=(I*y.z+p*n.z)/L}}return I<v?(d.clone(y,t.center),t.radius=I):(d.clone(w,t.center),t.radius=v),t};var doe=new Gi,nMe=new d,iMe=new d,RY=new he,MY=new he;Cn.fromRectangle2D=function(e,t,n){return Cn.fromRectangleWithHeights2D(e,t,0,0,n)};Cn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new Cn),!l(e))return o.center=d.clone(d.ZERO,o.center),o.radius=0,o;doe._ellipsoid=te.default,t=t??doe,ce.southwest(e,RY),RY.height=n,ce.northeast(e,MY),MY.height=i;let r=t.project(RY,nMe),s=t.project(MY,iMe),a=s.x-r.x,c=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var oMe=[];Cn.fromRectangle3D=function(e,t,n,i){if(t=t??te.default,n=n??0,l(i)||(i=new Cn),!l(e))return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;let o=ce.subsample(e,t,n,oMe);return Cn.fromPoints(o,i)};Cn.fromVertices=function(e,t,n,i){if(l(i)||(i=new Cn),!l(e)||e.length===0)return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;t=t??d.ZERO,n=n??3;let o=UY;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=d.clone(o,NY),s=d.clone(o,LY),a=d.clone(o,OY),c=d.clone(o,FY),u=d.clone(o,QY),f=d.clone(o,kY),h=e.length,m;for(m=0;m<h;m+=n){let L=e[m]+t.x,p=e[m+1]+t.y,b=e[m+2]+t.z;o.x=L,o.y=p,o.z=b,L<r.x&&d.clone(o,r),L>c.x&&d.clone(o,c),p<s.y&&d.clone(o,s),p>u.y&&d.clone(o,u),b<a.z&&d.clone(o,a),b>f.z&&d.clone(o,f)}let g=d.magnitudeSquared(d.subtract(c,r,Ha)),A=d.magnitudeSquared(d.subtract(u,s,Ha)),_=d.magnitudeSquared(d.subtract(f,a,Ha)),C=r,y=c,E=g;A>E&&(E=A,C=s,y=u),_>E&&(E=_,C=a,y=f);let I=GY;I.x=(C.x+y.x)*.5,I.y=(C.y+y.y)*.5,I.z=(C.z+y.z)*.5;let x=d.magnitudeSquared(d.subtract(y,I,Ha)),S=Math.sqrt(x),w=zY;w.x=r.x,w.y=s.y,w.z=a.z;let v=VY;v.x=c.x,v.y=u.y,v.z=f.z;let P=d.midpoint(w,v,HY),N=0;for(m=0;m<h;m+=n){o.x=e[m]+t.x,o.y=e[m+1]+t.y,o.z=e[m+2]+t.z;let L=d.magnitude(d.subtract(o,P,Ha));L>N&&(N=L);let p=d.magnitudeSquared(d.subtract(o,I,Ha));if(p>x){let b=Math.sqrt(p);S=(S+b)*.5,x=S*S;let T=b-S;I.x=(S*I.x+T*o.x)/b,I.y=(S*I.y+T*o.y)/b,I.z=(S*I.z+T*o.z)/b}}return S<N?(d.clone(I,i.center),i.radius=S):(d.clone(P,i.center),i.radius=N),i};Cn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new Cn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=d.clone(d.ZERO,n.center),n.radius=0,n;let i=UY;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=d.clone(i,NY),r=d.clone(i,LY),s=d.clone(i,OY),a=d.clone(i,FY),c=d.clone(i,QY),u=d.clone(i,kY),f=e.length,h;for(h=0;h<f;h+=3){let N=e[h]+t[h],L=e[h+1]+t[h+1],p=e[h+2]+t[h+2];i.x=N,i.y=L,i.z=p,N<o.x&&d.clone(i,o),N>a.x&&d.clone(i,a),L<r.y&&d.clone(i,r),L>c.y&&d.clone(i,c),p<s.z&&d.clone(i,s),p>u.z&&d.clone(i,u)}let m=d.magnitudeSquared(d.subtract(a,o,Ha)),g=d.magnitudeSquared(d.subtract(c,r,Ha)),A=d.magnitudeSquared(d.subtract(u,s,Ha)),_=o,C=a,y=m;g>y&&(y=g,_=r,C=c),A>y&&(y=A,_=s,C=u);let E=GY;E.x=(_.x+C.x)*.5,E.y=(_.y+C.y)*.5,E.z=(_.z+C.z)*.5;let I=d.magnitudeSquared(d.subtract(C,E,Ha)),x=Math.sqrt(I),S=zY;S.x=o.x,S.y=r.y,S.z=s.z;let w=VY;w.x=a.x,w.y=c.y,w.z=u.z;let v=d.midpoint(S,w,HY),P=0;for(h=0;h<f;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 N=d.magnitude(d.subtract(i,v,Ha));N>P&&(P=N);let L=d.magnitudeSquared(d.subtract(i,E,Ha));if(L>I){let p=Math.sqrt(L);x=(x+p)*.5,I=x*x;let b=p-x;E.x=(x*E.x+b*i.x)/p,E.y=(x*E.y+b*i.y)/p,E.z=(x*E.z+b*i.z)/p}}return x<P?(d.clone(E,n.center),n.radius=x):(d.clone(v,n.center),n.radius=P),n};Cn.fromCornerPoints=function(e,t,n){l(n)||(n=new Cn);let i=d.midpoint(e,t,n.center);return n.radius=d.distance(i,t),n};Cn.fromEllipsoid=function(e,t){return l(t)||(t=new Cn),d.clone(d.ZERO,t.center),t.radius=e.maximumRadius,t};var rMe=new d;Cn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new Cn),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return Cn.clone(e[0],t);if(n===2)return Cn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=Cn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,d.distance(r,a.center,rMe)+a.radius)}return t.radius=s,t};var sMe=new d,aMe=new d,cMe=new d;Cn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new Cn);let n=e.halfAxes,i=X.getColumn(n,0,sMe),o=X.getColumn(n,1,aMe),r=X.getColumn(n,2,cMe);return d.add(i,o,i),d.add(i,r,i),t.center=d.clone(e.center,t.center),t.radius=d.magnitude(i),t};var lMe=new d,uMe=new d;Cn.fromTransformation=function(e,t){l(t)||(t=new Cn);let n=M.getTranslation(e,lMe),i=M.getScale(e,uMe),o=.5*d.magnitude(i);return t.center=d.clone(n,t.center),t.radius=o,t};Cn.clone=function(e,t){if(l(e))return l(t)?(t.center=d.clone(e.center,t.center),t.radius=e.radius,t):new Cn(e.center,e.radius)};Cn.packedLength=4;Cn.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};Cn.unpack=function(e,t,n){t=t??0,l(n)||(n=new Cn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var fMe=new d,dMe=new d;Cn.union=function(e,t,n){l(n)||(n=new Cn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=d.subtract(r,i,fMe),c=d.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=d.multiplyByScalar(a,(-o+u)/c,dMe);return d.add(f,i,f),d.clone(f,n.center),n.radius=u,n};var hMe=new d;Cn.expand=function(e,t,n){n=Cn.clone(e,n);let i=d.magnitude(d.subtract(t,n.center,hMe));return i>n.radius&&(n.radius=i),n};Cn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=d.dot(o,n)+t.distance;return r<-i?qt.OUTSIDE:r<i?qt.INTERSECTING:qt.INSIDE};Cn.transform=function(e,t,n){return l(n)||(n=new Cn),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=M.getMaximumScale(t)*e.radius,n};var AMe=new d;Cn.distanceSquaredTo=function(e,t){let n=d.subtract(e.center,t,AMe),i=d.magnitude(n)-e.radius;return i<=0?0:i*i};Cn.transformWithoutScale=function(e,t,n){return l(n)||(n=new Cn),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var mMe=new d;Cn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new qr);let o=d.subtract(e.center,t,mMe),r=d.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var hoe=new d,pMe=new d,gMe=new d,_Me=new d,CMe=new d,yMe=new he,moe=new Array(8);for(let e=0;e<8;++e)moe[e]=new d;var Aoe=new Gi;Cn.projectTo2D=function(e,t,n){Aoe._ellipsoid=te.default,t=t??Aoe;let i=t.ellipsoid,o=e.center,r=e.radius,s;d.equals(o,d.ZERO)?s=d.clone(d.UNIT_X,hoe):s=i.geodeticSurfaceNormal(o,hoe);let a=d.cross(d.UNIT_Z,s,pMe);d.normalize(a,a);let c=d.cross(s,a,gMe);d.normalize(c,c),d.multiplyByScalar(s,r,s),d.multiplyByScalar(c,r,c),d.multiplyByScalar(a,r,a);let u=d.negate(c,CMe),f=d.negate(a,_Me),h=moe,m=h[0];d.add(s,c,m),d.add(m,a,m),m=h[1],d.add(s,c,m),d.add(m,f,m),m=h[2],d.add(s,u,m),d.add(m,f,m),m=h[3],d.add(s,u,m),d.add(m,a,m),d.negate(s,s),m=h[4],d.add(s,c,m),d.add(m,a,m),m=h[5],d.add(s,c,m),d.add(m,f,m),m=h[6],d.add(s,u,m),d.add(m,f,m),m=h[7],d.add(s,u,m),d.add(m,a,m);let g=h.length;for(let y=0;y<g;++y){let E=h[y];d.add(o,E,E);let I=i.cartesianToCartographic(E,yMe);t.project(I,E)}n=Cn.fromPoints(h,n),o=n.center;let A=o.x,_=o.y,C=o.z;return o.x=C,o.y=A,o.z=_,n};Cn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};Cn.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&e.radius===t.radius};Cn.prototype.intersectPlane=function(e){return Cn.intersectPlane(this,e)};Cn.prototype.distanceSquaredTo=function(e){return Cn.distanceSquaredTo(this,e)};Cn.prototype.computePlaneDistances=function(e,t,n){return Cn.computePlaneDistances(this,e,t,n)};Cn.prototype.isOccluded=function(e){return Cn.isOccluded(this,e)};Cn.prototype.equals=function(e){return Cn.equals(this,e)};Cn.prototype.clone=function(e){return Cn.clone(this,e)};Cn.prototype.volume=function(){let e=this.radius;return tMe*e*e*e};var le=Cn;function EMe(e){e=e??V.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 pn=EMe;var IMe={NONE:0,TOP:1,ALL:2},un=Object.freeze(IMe);function Us(e){e=e??V.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}Us.POSITION_ONLY=Object.freeze(new Us({position:!0}));Us.POSITION_AND_NORMAL=Object.freeze(new Us({position:!0,normal:!0}));Us.POSITION_NORMAL_AND_ST=Object.freeze(new Us({position:!0,normal:!0,st:!0}));Us.POSITION_AND_ST=Object.freeze(new Us({position:!0,st:!0}));Us.POSITION_AND_COLOR=Object.freeze(new Us({position:!0,color:!0}));Us.ALL=Object.freeze(new Us({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Us.DEFAULT=Us.POSITION_NORMAL_AND_ST;Us.packedLength=6;Us.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};Us.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Us),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};Us.clone=function(e,t){if(l(e))return l(t)||(t=new Us),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 Re=Us;var bMe=new d;function ju(e){e=e??V.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Re.DEFAULT;this._minimum=d.clone(t),this._maximum=d.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}ju.fromDimensions=function(e){e=e??V.EMPTY_OBJECT;let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new ju({minimum:d.negate(n,new d),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};ju.fromAxisAlignedBoundingBox=function(e){return new ju({minimum:e.minimum,maximum:e.maximum})};ju.packedLength=2*d.packedLength+Re.packedLength+1;ju.pack=function(e,t,n){return n=n??0,d.pack(e._minimum,t,n),d.pack(e._maximum,t,n+d.packedLength),Re.pack(e._vertexFormat,t,n+2*d.packedLength),t[n+2*d.packedLength+Re.packedLength]=e._offsetAttribute??-1,t};var goe=new d,_oe=new d,Coe=new Re,poe={minimum:goe,maximum:_oe,vertexFormat:Coe,offsetAttribute:void 0};ju.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,goe),o=d.unpack(e,t+d.packedLength,_oe),r=Re.unpack(e,t+2*d.packedLength,Coe),s=e[t+2*d.packedLength+Re.packedLength];return l(n)?(n._minimum=d.clone(i,n._minimum),n._maximum=d.clone(o,n._maximum),n._vertexFormat=Re.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(poe.offsetAttribute=s===-1?void 0:s,new ju(poe))};ju.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(d.equals(t,n))return;let o=new pn,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 ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:u})}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 ve({componentDatatype:q.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=d.subtract(n,t,bMe),c=d.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===un.NONE?0:1,h=new Uint8Array(u/3).fill(f);o.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new ht({attributes:o,indices:r,primitiveType:Pe.TRIANGLES,boundingSphere:new le(d.ZERO,c),offsetAttribute:e._offsetAttribute})};var YY;ju.getUnitBox=function(){return l(YY)||(YY=ju.createGeometry(ju.fromDimensions({dimensions:new d(1,1,1),vertexFormat:Re.POSITION_ONLY}))),YY};var mc=ju;var Co={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Co.getMathType=function(e){switch(e){case Co.SCALAR:return Number;case Co.VEC2:return F;case Co.VEC3:return d;case Co.VEC4:return se;case Co.MAT2:return zi;case Co.MAT3:return X;case Co.MAT4:return M}};Co.getNumberOfComponents=function(e){switch(e){case Co.SCALAR:return 1;case Co.VEC2:return 2;case Co.VEC3:return 3;case Co.VEC4:case Co.MAT2:return 4;case Co.MAT3:return 9;case Co.MAT4:return 16}};Co.getAttributeLocationCount=function(e){switch(e){case Co.SCALAR:case Co.VEC2:case Co.VEC3:case Co.VEC4:return 1;case Co.MAT2:return 2;case Co.MAT3:return 3;case Co.MAT4:return 4}};Co.getGlslType=function(e){switch(e){case Co.SCALAR:return"float";case Co.VEC2:return"vec2";case Co.VEC3:return"vec3";case Co.VEC4:return"vec4";case Co.MAT2:return"mat2";case Co.MAT3:return"mat3";case Co.MAT4:return"mat4"}};var Ut=Object.freeze(Co);var yoe=1/256,Eoe=256,Qo={};Qo.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))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(o)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};Qo.octEncode=function(e,t){return Qo.octEncodeInRange(e,255,t)};var Vw=new F,Ioe=new Uint8Array(1);function dz(e){return Ioe[0]=e,Ioe[0]}Qo.octEncodeToCartesian4=function(e,t){return Qo.octEncodeInRange(e,65535,Vw),t.x=dz(Vw.x*yoe),t.y=dz(Vw.x),t.z=dz(Vw.y*yoe),t.w=dz(Vw.y),t};Qo.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.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))*D.signNotZero(o),i.y=(1-Math.abs(o))*D.signNotZero(i.y)}return d.normalize(i,i)};Qo.octDecode=function(e,t,n){return Qo.octDecodeInRange(e,t,255,n)};Qo.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*Eoe+i,a=o*Eoe+r;return Qo.octDecodeInRange(s,a,65535,t)};Qo.octPackFloat=function(e){return 256*e.x+e.y};var jY=new F;Qo.octEncodeFloat=function(e){return Qo.octEncode(e,jY),Qo.octPackFloat(jY)};Qo.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return Qo.octDecode(i,o,t)};Qo.octPack=function(e,t,n,i){let o=Qo.octEncodeFloat(e),r=Qo.octEncodeFloat(t),s=Qo.octEncode(n,jY);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};Qo.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;Qo.octDecodeFloat(s,t),Qo.octDecodeFloat(c,n),Qo.octDecode(r,a,i)};Qo.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Qo.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 WY(e){return e>>1^-(e&1)}Qo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=WY(e[a]),r+=WY(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=WY(n[a]),n[a]=s)};Qo.dequantize=function(e,t,n,i){let o=Ut.getNumberOfComponents(n),r;switch(t){case q.BYTE:r=127;break;case q.UNSIGNED_BYTE:r=255;break;case q.SHORT:r=32767;break;case q.UNSIGNED_SHORT:r=65535;break;case q.INT:r=2147483647;break;case q.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 u=a*o+c;s[u]=Math.max(e[u]/r,-1)}return s};Qo.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],u=c>>11,f=c>>5&o,h=c&i,m=3*a;t[m]=u*r,t[m+1]=f*s,t[m+2]=h*r}return t};var bn=Qo;var boe=new d,xoe=new d,Toe=new d;function xMe(e,t,n,i,o){l(o)||(o=new d);let r,s,a,c,u,f,h,m;if(l(t.z)){if(d.equalsEpsilon(e,t,D.EPSILON14))return d.clone(d.UNIT_X,o);if(d.equalsEpsilon(e,n,D.EPSILON14))return d.clone(d.UNIT_Y,o);if(d.equalsEpsilon(e,i,D.EPSILON14))return d.clone(d.UNIT_Z,o);r=d.subtract(n,t,boe),s=d.subtract(i,t,xoe),a=d.subtract(e,t,Toe),c=d.dot(r,r),u=d.dot(r,s),f=d.dot(r,a),h=d.dot(s,s),m=d.dot(s,a)}else{if(F.equalsEpsilon(e,t,D.EPSILON14))return d.clone(d.UNIT_X,o);if(F.equalsEpsilon(e,n,D.EPSILON14))return d.clone(d.UNIT_Y,o);if(F.equalsEpsilon(e,i,D.EPSILON14))return d.clone(d.UNIT_Z,o);r=F.subtract(n,t,boe),s=F.subtract(i,t,xoe),a=F.subtract(e,t,Toe),c=F.dot(r,r),u=F.dot(r,s),f=F.dot(r,a),h=F.dot(s,s),m=F.dot(s,a)}o.y=h*f-u*m,o.z=c*m-u*f;let g=c*h-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var AE=xMe;function XA(){this.high=d.clone(d.ZERO),this.low=d.clone(d.ZERO)}XA.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 Ep={high:0,low:0};XA.fromCartesian=function(e,t){l(t)||(t=new XA);let n=t.high,i=t.low;return XA.encode(e.x,Ep),n.x=Ep.high,i.x=Ep.low,XA.encode(e.y,Ep),n.y=Ep.high,i.y=Ep.low,XA.encode(e.z,Ep),n.z=Ep.high,i.z=Ep.low,t};var qY=new XA;XA.writeElements=function(e,t,n){XA.fromCartesian(e,qY);let i=qY.high,o=qY.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 $n=XA;var KY={};KY.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Soe(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}KY.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),u=Math.abs(e);if(c<u&&c/u<D.EPSILON14)return[0,0];if(c>u&&u/c<D.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=Soe(o,-r,D.EPSILON14);if(s<0)return[];let a=-.5*Soe(t,D.sign(t)*Math.sqrt(s),D.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Al=KY;var XY={};XY.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 JY(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,h=s*s,m=o*s-f,g=o*a-r*s,A=r*a-h,_=4*m*A-g*g,C,y;if(_<0){let H,W,Z;f*u>=c*h?(H=o,W=m,Z=-2*r*m+o*g):(H=a,W=A,Z=-a*g+2*s*A);let $=-(Z<0?-1:1)*Math.abs(H)*Math.sqrt(-_);y=-Z+$;let K=y/2,fe=K<0?-Math.pow(-K,1/3):Math.pow(K,1/3),ge=y===$?-fe:-W/fe;return C=W<=0?fe+ge:-Z/(fe*fe+ge*ge+W),f*u>=c*h?[(C-r)/o]:[-a/(C+s)]}let E=m,I=-2*r*m+o*g,x=A,S=-a*g+2*s*A,w=Math.sqrt(_),v=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-I)/3);C=2*Math.sqrt(-E);let N=Math.cos(P);y=C*N;let L=C*(-N/2-v*Math.sin(P)),p=y+L>2*r?y-r:L-r,b=o,T=p/b;P=Math.abs(Math.atan2(a*w,-S)/3),C=2*Math.sqrt(-x),N=Math.cos(P),y=C*N,L=C*(-N/2-v*Math.sin(P));let B=-a,R=y+L<2*s?y+s:L+s,O=B/R,U=b*R,k=-p*R-b*B,z=p*B,Q=(s*k-r*z)/(-r*k+s*U);return T<=Q?T<=O?Q<=O?[T,Q,O]:[T,O,Q]:[O,T,Q]:T<=O?[Q,T,O]:Q<=O?[Q,O,T]:[O,Q,T]}XY.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Al.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=Al.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return JY(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):JY(e,t,0,i);if(i===0)return o=Al.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 JY(e,t,n,i)};var mE=XY;var ZY={};ZY.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,h=i*i,m=h*i,g=o*o,A=g*o;return a*u*h-4*c*m-4*e*f*h+18*e*t*n*m-27*r*h*h+256*s*A+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function gh(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=mE.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<D.EPSILON14){let h=Al.computeRealRoots(1,r,a);if(h.length===2){let m=h[0],g=h[1],A;if(m>=0&&g>=0){let _=Math.sqrt(m),C=Math.sqrt(g);return[u-C,u-_,u+_,u+C]}else{if(m>=0&&g<0)return A=Math.sqrt(m),[u-A,u+A];if(m<0&&g>=0)return A=Math.sqrt(g),[u-A,u+A]}}return[]}else if(f>0){let h=Math.sqrt(f),m=(r+f-s/h)/2,g=(r+f+s/h)/2,A=Al.computeRealRoots(1,h,m),_=Al.computeRealRoots(1,-h,g);return A.length!==0?(A[0]+=u,A[1]+=u,_.length!==0?(_[0]+=u,_[1]+=u,A[1]<=_[0]?[A[0],A[1],_[0],_[1]]:_[1]<=A[0]?[_[0],_[1],A[0],A[1]]:A[0]>=_[0]&&A[1]<=_[1]?[_[0],A[0],A[1],_[1]]:_[0]>=A[0]&&_[1]<=A[1]?[A[0],_[0],_[1],A[1]]:A[0]>_[0]&&A[0]<_[1]?[_[0],A[0],_[1],A[1]]:[A[0],_[0],A[1],_[1]]):A):_.length!==0?(_[0]+=u,_[1]+=u,_):[]}}return[]}function Hw(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,u=s*i-n*t*e+o,f=mE.computeRealRoots(1,a,c,u);if(f.length>0){let h=f[0],m=t-h,g=m*m,A=e/2,_=m/2,C=g-4*i,y=g+4*Math.abs(i),E=s-4*h,I=s+4*Math.abs(h),x,S;if(h<0||C*I<E*y){let b=Math.sqrt(E);x=b/2,S=b===0?0:(e*_-n)/b}else{let b=Math.sqrt(C);x=b===0?0:(e*_-n)/b,S=b/2}let w,v;A===0&&x===0?(w=0,v=0):D.sign(A)===D.sign(x)?(w=A+x,v=h/w):(v=A-x,w=h/v);let P,N;_===0&&S===0?(P=0,N=0):D.sign(_)===D.sign(S)?(P=_+S,N=i/P):(N=_-S,P=i/N);let L=Al.computeRealRoots(1,w,P),p=Al.computeRealRoots(1,v,N);if(L.length!==0)return p.length!==0?L[1]<=p[0]?[L[0],L[1],p[0],p[1]]:p[1]<=L[0]?[p[0],p[1],L[0],L[1]]:L[0]>=p[0]&&L[1]<=p[1]?[p[0],L[0],L[1],p[1]]:p[0]>=L[0]&&p[1]<=L[1]?[L[0],p[0],p[1],L[1]]:L[0]>p[0]&&L[0]<p[1]?[p[0],L[0],p[1],L[1]]:[L[0],p[0],L[1],p[1]]:L;if(p.length!==0)return p}return[]}ZY.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<D.EPSILON15)return mE.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return gh(r,s,a,c);case 1:return Hw(r,s,a,c);case 2:return Hw(r,s,a,c);case 3:return gh(r,s,a,c);case 4:return gh(r,s,a,c);case 5:return Hw(r,s,a,c);case 6:return gh(r,s,a,c);case 7:return gh(r,s,a,c);case 8:return Hw(r,s,a,c);case 9:return gh(r,s,a,c);case 10:return gh(r,s,a,c);case 11:return Hw(r,s,a,c);case 12:return gh(r,s,a,c);case 13:return gh(r,s,a,c);case 14:return gh(r,s,a,c);case 15:return gh(r,s,a,c);default:return}};var Yw=ZY;function hz(e,t){t=d.clone(t??d.ZERO),d.equals(t,d.ZERO)||d.normalize(t,t),this.origin=d.clone(e??d.ZERO),this.direction=t}hz.clone=function(e,t){if(l(e))return l(t)?(t.origin=d.clone(e.origin),t.direction=d.clone(e.direction),t):new hz(e.origin,e.direction)};hz.getPoint=function(e,t,n){return l(n)||(n=new d),n=d.multiplyByScalar(e.direction,t,n),d.add(e.origin,n,n)};var gn=hz;var $o={};$o.rayPlane=function(e,t,n){l(n)||(n=new d);let i=e.origin,o=e.direction,r=t.normal,s=d.dot(r,o);if(Math.abs(s)<D.EPSILON15)return;let a=(-t.distance-d.dot(r,i))/s;if(!(a<0))return n=d.multiplyByScalar(o,a,n),d.add(i,n,n)};var TMe=new d,SMe=new d,Noe=new d,Boe=new d,woe=new d;$o.rayTriangleParametric=function(e,t,n,i,o){o=o??!1;let r=e.origin,s=e.direction,a=d.subtract(n,t,TMe),c=d.subtract(i,t,SMe),u=d.cross(s,c,Noe),f=d.dot(a,u),h,m,g,A,_;if(o){if(f<D.EPSILON6||(h=d.subtract(r,t,Boe),g=d.dot(h,u),g<0||g>f)||(m=d.cross(h,a,woe),A=d.dot(s,m),A<0||g+A>f))return;_=d.dot(c,m)/f}else{if(Math.abs(f)<D.EPSILON6)return;let C=1/f;if(h=d.subtract(r,t,Boe),g=d.dot(h,u)*C,g<0||g>1||(m=d.cross(h,a,woe),A=d.dot(s,m)*C,A<0||g+A>1))return;_=d.dot(c,m)*C}return _};$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 d),d.multiplyByScalar(e.direction,s,r),d.add(e.origin,r,r)};var BMe=new gn;$o.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=BMe;d.clone(e,a.origin),d.subtract(t,e,a.direction),d.normalize(a.direction,a.direction);let c=$o.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>d.distance(e,t)))return l(s)||(s=new d),d.multiplyByScalar(a.direction,c,s),d.add(a.origin,s,s)};function wMe(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,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var DMe={root0:0,root1:0};function Loe(e,t,n){l(n)||(n=new qr);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=d.subtract(i,r,Noe),c=d.dot(o,o),u=2*d.dot(o,a),f=d.magnitudeSquared(a)-s,h=wMe(c,u,f,DMe);if(l(h))return n.start=h.root0,n.stop=h.root1,n}$o.raySphere=function(e,t,n){if(n=Loe(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var vMe=new gn;$o.lineSegmentSphere=function(e,t,n,i){let o=vMe;d.clone(e,o.origin);let r=d.subtract(t,e,o.direction),s=d.magnitude(r);if(d.normalize(r,r),i=Loe(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 PMe=new d,RMe=new d;$o.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=d.multiplyComponents(n,e.origin,PMe),o=d.multiplyComponents(n,e.direction,RMe),r=d.magnitudeSquared(i),s=d.dot(i,o),a,c,u,f,h;if(r>1){if(s>=0)return;let m=s*s;if(a=r-1,c=d.magnitudeSquared(o),u=c*a,m<u)return;if(m>u){f=s*s-u,h=-s+Math.sqrt(f);let A=h/c,_=a/h;return A<_?new qr(A,_):{start:_,stop:A}}let g=Math.sqrt(a/c);return new qr(g,g)}else if(r<1)return a=r-1,c=d.magnitudeSquared(o),u=c*a,f=s*s-u,h=-s+Math.sqrt(f),new qr(0,h/c);if(s<0)return c=d.magnitudeSquared(o),new qr(0,-s/c)};var MMe=new qr,NMe=new qr,LMe=new qr;$o.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new qr);let i=$Y(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,MMe),o=$Y(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,NMe),r=$Y(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,LMe);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 $Y(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 pE(e,t,n){let i=e+t;return D.sign(e)!==D.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[X.COLUMN1ROW1]-e[X.COLUMN2ROW2])*s,c=o*(i*pE(e[X.COLUMN1ROW0],e[X.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[X.COLUMN0ROW0]*r+e[X.COLUMN2ROW2]*s+i*t.x+n,f=s*pE(e[X.COLUMN2ROW1],e[X.COLUMN1ROW2],D.EPSILON15),h=o*(i*pE(e[X.COLUMN2ROW0],e[X.COLUMN0ROW2])+t.z),m,g=[];if(h===0&&f===0){if(m=Al.computeRealRoots(a,c,u),m.length===0)return g;let P=m[0],N=Math.sqrt(Math.max(1-P*P,0));if(g.push(new d(i,o*P,o*-N)),g.push(new d(i,o*P,o*N)),m.length===2){let L=m[1],p=Math.sqrt(Math.max(1-L*L,0));g.push(new d(i,o*L,o*-p)),g.push(new d(i,o*L,o*p))}return g}let A=h*h,_=f*f,C=a*a,y=h*f,E=C+_,I=2*(c*a+y),x=2*u*a+c*c-_+A,S=2*(u*c-y),w=u*u-A;if(E===0&&I===0&&x===0&&S===0)return g;m=Yw.computeRealRoots(E,I,x,S,w);let v=m.length;if(v===0)return g;for(let P=0;P<v;++P){let N=m[P],L=N*N,p=Math.max(1-L,0),b=Math.sqrt(p),T;D.sign(a)===D.sign(u)?T=pE(a*L+u,c*N,D.EPSILON12):D.sign(u)===D.sign(c*N)?T=pE(a*L,c*N+u,D.EPSILON12):T=pE(a*L+c*N,u,D.EPSILON12);let B=pE(f*N,h,D.EPSILON15),R=T*B;R<0?g.push(new d(i,o*N,o*b)):R>0?g.push(new d(i,o*N,o*-b)):b!==0?(g.push(new d(i,o*N,o*-b)),g.push(new d(i,o*N,o*b)),++P):g.push(new d(i,o*N,o*b))}return g};var eW=new d,Doe=new d,voe=new d,Az=new d,OMe=new d,FMe=new X,QMe=new X,kMe=new X,UMe=new X,GMe=new X,Poe=new X,Roe=new X,Moe=new d,zMe=new d,VMe=new he;$o.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!d.equals(n,d.ZERO)){let w=t.geodeticSurfaceNormal(n,eW);if(d.dot(i,w)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,eW),s=d.normalize(r,r),a=d.mostOrthogonalAxis(r,Az),c=d.normalize(d.cross(a,s,Doe),Doe),u=d.normalize(d.cross(s,c,voe),voe),f=FMe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let h=X.transpose(f,QMe),m=X.fromScale(t.radii,kMe),g=X.fromScale(t.oneOverRadii,UMe),A=GMe;A[0]=0,A[1]=-i.z,A[2]=i.y,A[3]=i.z,A[4]=0,A[5]=-i.x,A[6]=-i.y,A[7]=i.x,A[8]=0;let _=X.multiply(X.multiply(h,g,Poe),A,Poe),C=X.multiply(X.multiply(_,m,Roe),f,Roe),y=X.multiplyByVector(_,n,OMe),E=$o.quadraticVectorExpression(C,d.negate(y,eW),0,0,1),I,x,S=E.length;if(S>0){let w=d.clone(d.ZERO,zMe),v=Number.NEGATIVE_INFINITY;for(let N=0;N<S;++N){I=X.multiplyByVector(m,X.multiplyByVector(f,E[N],Moe),Moe);let L=d.normalize(d.subtract(I,n,Az),Az),p=d.dot(L,i);p>v&&(v=p,w=d.clone(I,w))}let P=t.cartesianToCartographic(w,VMe);return v=D.clamp(v,0,1),x=d.magnitude(d.subtract(w,n,Az))*Math.sqrt(1-v*v),x=o?-x:x,P.height=x,t.cartographicToCartesian(P,new d)}};var HMe=new d;$o.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new d);let o=d.subtract(t,e,HMe),r=n.normal,s=d.dot(r,o);if(Math.abs(s)<D.EPSILON6)return;let a=d.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return d.multiplyByScalar(o,c,i),d.add(e,i,i),i};$o.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=d.dot(o,e)+r<0,a=d.dot(o,t)+r<0,c=d.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,h;if((u===1||u===2)&&(f=new d,h=new d),u===1){if(s)return $o.lineSegmentPlane(e,t,i,f),$o.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return $o.lineSegmentPlane(t,n,i,f),$o.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return $o.lineSegmentPlane(n,e,i,f),$o.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return $o.lineSegmentPlane(e,n,i,f),$o.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}else return $o.lineSegmentPlane(n,t,i,f),$o.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};else return $o.lineSegmentPlane(t,e,i,f),$o.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,f,h],indices:[1,2,4,1,4,3,0,3,4]}};var ci=$o;function ga(e,t){this.normal=d.clone(e),this.distance=t}ga.fromPointNormal=function(e,t,n){let i=-d.dot(t,e);return l(n)?(d.clone(t,n.normal),n.distance=i,n):new ga(t,i)};var YMe=new d;ga.fromCartesian4=function(e,t){let n=d.fromCartesian4(e,YMe),i=e.w;return l(t)?(d.clone(n,t.normal),t.distance=i,t):new ga(n,i)};ga.getPointDistance=function(e,t){return d.dot(e.normal,t)+e.distance};var WMe=new d;ga.projectPointOntoPlane=function(e,t,n){l(n)||(n=new d);let i=ga.getPointDistance(e,t),o=d.multiplyByScalar(e.normal,i,WMe);return d.subtract(t,o,n)};var jMe=new M,qMe=new se,KMe=new d;ga.transform=function(e,t,n){let i=e.normal,o=e.distance,r=M.inverseTranspose(t,jMe),s=se.fromElements(i.x,i.y,i.z,o,qMe);s=M.multiplyByVector(r,s,s);let a=d.fromCartesian4(s,KMe);return s=se.divideByScalar(s,d.magnitude(a),s),ga.fromCartesian4(s,n)};ga.clone=function(e,t){return l(t)?(d.clone(e.normal,t.normal),t.distance=e.distance,t):new ga(e.normal,e.distance)};ga.equals=function(e,t){return e.distance===t.distance&&d.equals(e.normal,t.normal)};ga.ORIGIN_XY_PLANE=Object.freeze(new ga(d.UNIT_Z,0));ga.ORIGIN_YZ_PLANE=Object.freeze(new ga(d.UNIT_X,0));ga.ORIGIN_ZX_PLANE=Object.freeze(new ga(d.UNIT_Y,0));var rn=ga;var tW={};tW.calculateACMR=function(e){e=e??V.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)};tW.tipsify=function(e){e=e??V.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(p,b,T,B){for(;b.length>=1;){let R=b[b.length-1];if(b.splice(b.length-1,1),p[R].numLiveTriangles>0)return R}for(;o<B;){if(p[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(p,b,T,B,R,O,U){let k=-1,z,Q=-1,H=0;for(;H<T.length;){let W=T[H];B[W].numLiveTriangles&&(z=0,R-B[W].timeStamp+2*B[W].numLiveTriangles<=b&&(z=R-B[W].timeStamp),(z>Q||Q===-1)&&(Q=z,k=W)),++H}return k===-1?r(B,O,p,U):k}let a=t.length,c=0,u=0,f=t[u],h=a;if(l(n))c=n+1;else{for(;u<h;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let m=[],g;for(g=0;g<c;g++)m[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let A=0;for(;u<h;)m[t[u]].vertexTriangles.push(A),++m[t[u]].numLiveTriangles,m[t[u+1]].vertexTriangles.push(A),++m[t[u+1]].numLiveTriangles,m[t[u+2]].vertexTriangles.push(A),++m[t[u+2]].numLiveTriangles,++A,u+=3;let _=0,C=i+1;o=1;let y=[],E=[],I,x,S=0,w=[],v=a/3,P=[];for(g=0;g<v;g++)P[g]=!1;let N,L;for(;_!==-1;){y=[],x=m[_],L=x.vertexTriangles.length;for(let p=0;p<L;++p)if(A=x.vertexTriangles[p],!P[A]){P[A]=!0,u=A+A+A;for(let b=0;b<3;++b)N=t[u],y.push(N),E.push(N),w[S]=N,++S,I=m[N],--I.numLiveTriangles,C-I.timeStamp>i&&(I.timeStamp=C,++C),++u}_=s(t,i,y,m,C,E,c)}return w};var Ww=tW;var ml={};function Ez(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function JMe(e){let t=e.length,n=t/3*6,i=Fe.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)Ez(i,o,e[r],e[r+1],e[r+2]);return i}function XMe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Fe.createTypedArray(t,n);Ez(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)Ez(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function ZMe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Fe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)Ez(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}ml.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Pe.TRIANGLES:e.indices=JMe(t);break;case Pe.TRIANGLE_STRIP:e.indices=XMe(t);break;case Pe.TRIANGLE_FAN:e.indices=ZMe(t);break}e.primitiveType=Pe.LINES}return e};ml.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 f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new le(u.center,u.radius+n)),new ht({attributes:{position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Pe.LINES,boundingSphere:c})};ml.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};ml.reorderForPreVertexCache=function(e){let t=ht.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let m=0;m<t;m++)i[m]=-1;let o=n,r=o.length,s=Fe.createTypedArray(t,r),a=0,c=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[c]=f:(f=o[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let h=e.attributes;for(let m in h)if(h.hasOwnProperty(m)&&l(h[m])&&l(h[m].values)){let g=h[m],A=g.values,_=0,C=g.componentsPerAttribute,y=q.createTypedArray(g.componentDatatype,u*C);for(;_<t;){let E=i[_];if(E!==-1)for(let I=0;I<C;I++)y[C*E+I]=A[C*_+I];++_}g.values=y}}return e};ml.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Pe.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=Ww.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Ooe(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 ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function $Me(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])}}ml.fitToUnsignedShortIndices=function(e){let t=[],n=ht.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Ooe(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Pe.TRIANGLES?u=3:e.primitiveType===Pe.LINES?u=2:e.primitiveType===Pe.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let h=0;h<u;++h){let m=a[f+h],g=i[m];l(g)||(g=r++,i[m]=g,$Me(s,e.attributes,m)),o.push(g)}r+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new ht({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Ooe(e.attributes))}o.length!==0&&t.push(new ht({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Foe=new d,eNe=new he;ml.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Gi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let h=d.fromArray(a,f,Foe),m=s.cartesianToCartographic(h,eNe),g=o.project(m,Foe);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=r,e.attributes[i]=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var nW={high:0,low:0};ml.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 f=0;f<s;++f)$n.encode(r[f],nW),a[f]=nW.high,c[f]=nW.low;let u=o.componentsPerAttribute;return e.attributes[n]=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Ch=new d;function iW(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,Ch),M.multiplyByPoint(e,Ch,Ch),d.pack(Ch,n,o)}}function oW(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,Ch),X.multiplyByVector(e,Ch,Ch),Ch=d.normalize(Ch,Ch),d.pack(Ch,n,o)}}var mz=new M,pz=new X;ml.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;iW(t,n.position),iW(t,n.prevPosition),iW(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(M.inverse(t,mz),M.transpose(mz,mz),M.getMatrix3(mz,pz),oW(pz,n.normal),oW(pz,n.tangent),oW(pz,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=le.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function tNe(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 u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[r]=new ve({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:q.createTypedArray(s.componentDatatype,a)}))}return i}var nNe=new d;function rW(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=tNe(e,t),h,m,g;for(i in f)if(f.hasOwnProperty(i))for(h=f[i].values,s=0,o=0;o<n;++o)for(m=e[o][t].attributes[i].values,g=m.length,r=0;r<g;++r)h[s++]=m[r];let A;if(c){let E=0;for(o=0;o<n;++o)E+=e[o][t].indices.length;let I=ht.computeNumberOfVertices(new ht({attributes:f,primitiveType:Pe.POINTS})),x=Fe.createTypedArray(I,E),S=0,w=0;for(o=0;o<n;++o){let v=e[o][t].indices,P=v.length;for(s=0;s<P;++s)x[S++]=w+v[s];w+=ht.computeNumberOfVertices(e[o][t])}A=x}let _=new d,C=0,y;for(o=0;o<n;++o){if(y=e[o][t].boundingSphere,!l(y)){_=void 0;break}d.add(y.center,_,_)}if(l(_))for(d.divideByScalar(_,n,_),o=0;o<n;++o){y=e[o][t].boundingSphere;let E=d.magnitude(d.subtract(y.center,_,nNe))+y.radius;E>C&&(C=E)}return new ht({attributes:f,indices:A,primitiveType:u,boundingSphere:l(_)?new le(_,C):void 0})}ml.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(rW(t,"geometry")),n.length>0&&(o.push(rW(n,"westHemisphereGeometry")),o.push(rW(n,"eastHemisphereGeometry"))),o};var Zf=new d,jw=new d,rx=new d,sx=new d;ml.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),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let A=t[u],_=t[u+1],C=t[u+2],y=A*3,E=_*3,I=C*3;jw.x=i[y],jw.y=i[y+1],jw.z=i[y+2],rx.x=i[E],rx.y=i[E+1],rx.z=i[E+2],sx.x=i[I],sx.y=i[I+1],sx.z=i[I+2],s[A].count++,s[_].count++,s[C].count++,d.subtract(rx,jw,rx),d.subtract(sx,jw,sx),a[f]=d.cross(rx,sx,new d),f++}let h=0;for(u=0;u<o;u++)s[u].indexOffset+=h,h+=s[u].count;f=0;let m;for(u=0;u<r;u+=3){m=s[t[u]];let A=m.indexOffset+m.currentCount;c[A]=f,m.currentCount++,m=s[t[u+1]],A=m.indexOffset+m.currentCount,c[A]=f,m.currentCount++,m=s[t[u+2]],A=m.indexOffset+m.currentCount,c[A]=f,m.currentCount++,f++}let g=new Float32Array(o*3);for(u=0;u<o;u++){let A=u*3;if(m=s[u],d.clone(d.ZERO,Zf),m.count>0){for(f=0;f<m.count;f++)d.add(Zf,a[c[m.indexOffset+f]],Zf);d.equalsEpsilon(d.ZERO,Zf,D.EPSILON10)&&d.clone(a[c[m.indexOffset]],Zf)}d.equalsEpsilon(d.ZERO,Zf,D.EPSILON10)&&(Zf.z=1),d.normalize(Zf,Zf),g[A]=Zf.x,g[A+1]=Zf.y,g[A+2]=Zf.z}return e.attributes.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g}),e};var iNe=new d,Qoe=new d,oNe=new d;ml.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),u;for(u=0;u<c.length;u++)c[u]=0;let f,h,m;for(u=0;u<a;u+=3){let _=n[u],C=n[u+1],y=n[u+2];f=_*3,h=C*3,m=y*3;let E=_*2,I=C*2,x=y*2,S=i[f],w=i[f+1],v=i[f+2],P=r[E],N=r[E+1],L=r[I+1]-N,p=r[x+1]-N,b=1/((r[I]-P)*p-(r[x]-P)*L),T=(p*(i[h]-S)-L*(i[m]-S))*b,B=(p*(i[h+1]-w)-L*(i[m+1]-w))*b,R=(p*(i[h+2]-v)-L*(i[m+2]-v))*b;c[f]+=T,c[f+1]+=B,c[f+2]+=R,c[h]+=T,c[h+1]+=B,c[h+2]+=R,c[m]+=T,c[m+1]+=B,c[m+2]+=R}let g=new Float32Array(s*3),A=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,h=f+1,m=f+2;let _=d.fromArray(o,f,iNe),C=d.fromArray(c,f,oNe),y=d.dot(_,C);d.multiplyByScalar(_,y,Qoe),d.normalize(d.subtract(C,Qoe,C),C),g[f]=C.x,g[h]=C.y,g[m]=C.z,d.normalize(d.cross(_,C,C),C),A[f]=C.x,A[h]=C.y,A[m]=C.z}return e.attributes.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:A}),e};var qw=new F,_h=new d,koe=new d,Uoe=new d,gz=new F;ml.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let w=t.values;i=w.length/3;let v=new Float32Array(i*2),P=0;for(n=0;n<i;++n){if(d.fromArray(w,n*3,_h),d.equals(_h,d.ZERO)){P+=2;continue}gz=bn.octEncodeInRange(_h,65535,gz),v[P++]=gz.x,v[P++]=gz.y}return e.attributes.compressedAttributes=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:v}),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,u=e.attributes.bitangent,f=l(c),h=l(u),m,g,A,_;s&&(m=o.values),a&&(g=r.values),f&&(A=c.values),h&&(_=u.values),i=(s?m.length:g.length)/(s?3:2);let E=i,I=a&&s?2:1;I+=f||h?1:0,E*=I;let x=new Float32Array(E),S=0;for(n=0;n<i;++n){a&&(F.fromArray(g,n*2,qw),x[S++]=bn.compressTextureCoordinates(qw));let w=n*3;s&&l(A)&&l(_)?(d.fromArray(m,w,_h),d.fromArray(A,w,koe),d.fromArray(_,w,Uoe),bn.octPack(_h,koe,Uoe,qw),x[S++]=qw.x,x[S++]=qw.y):(s&&(d.fromArray(m,w,_h),x[S++]=bn.octEncodeFloat(_h)),f&&(d.fromArray(A,w,_h),x[S++]=bn.octEncodeFloat(_h)),h&&(d.fromArray(_,w,_h),x[S++]=bn.octEncodeFloat(_h)))}return e.attributes.compressedAttributes=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:I,values:x}),s&&delete e.attributes.normal,a&&delete e.attributes.st,h&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function rNe(e){if(l(e.indices))return e;let t=ht.computeNumberOfVertices(e),n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function sNe(e){let t=ht.computeNumberOfVertices(e),n=Fe.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=Pe.TRIANGLES,e}function aNe(e){let t=ht.computeNumberOfVertices(e),n=Fe.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=Pe.TRIANGLES,e}function cNe(e){if(l(e.indices))return e;let t=ht.computeNumberOfVertices(e),n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function lNe(e){let t=ht.computeNumberOfVertices(e),n=Fe.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=Pe.LINES,e}function uNe(e){let t=ht.computeNumberOfVertices(e),n=Fe.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=Pe.LINES,e}function fNe(e){switch(e.primitiveType){case Pe.TRIANGLE_FAN:return sNe(e);case Pe.TRIANGLE_STRIP:return aNe(e);case Pe.TRIANGLES:return rNe(e);case Pe.LINE_STRIP:return lNe(e);case Pe.LINE_LOOP:return uNe(e);case Pe.LINES:return cNe(e)}return e}function k_(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function dNe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){k_(e,e.y<0),k_(t,t.y<0),k_(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=D.sign(e.y):s=D.sign(n.y):o>r?s=D.sign(t.y):s=D.sign(n.y);let a=s<0;k_(e,a),k_(t,a),k_(n,a)}var Goe=new d;function $f(e,t,n,i){d.add(e,d.multiplyByScalar(d.subtract(t,e,Goe),e.y/(e.y-t.y),Goe),n),d.clone(n,i),k_(n,!0),k_(i,!1)}var gE=new d,_E=new d,CE=new d,yE=new d,sW={positions:new Array(7),indices:new Array(9)};function hNe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;dNe(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=sW.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?($f(e,t,gE,CE),$f(e,n,_E,yE),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?($f(t,n,gE,CE),$f(t,e,_E,yE),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&($f(n,e,gE,CE),$f(n,t,_E,yE),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||($f(n,e,gE,CE),$f(n,t,_E,yE),a[0]=0,a[1]=1,a[3]=0,a[6]=2):($f(t,n,gE,CE),$f(t,e,_E,yE),a[0]=2,a[1]=0,a[3]=2,a[6]=1):($f(e,t,gE,CE),$f(e,n,_E,yE),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=sW.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=gE,c[4]=_E,c[5]=CE,c[6]=yE,c.length=7),sW}function zoe(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=q.createTypedArray(r.componentDatatype,r.values)}let i=ht.computeNumberOfVertices(e);return e.indices=Fe.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function cx(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 ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ht({attributes:n,indices:[],primitiveType:e.primitiveType})}function uW(e,t,n){let i=l(e.geometry.boundingSphere);t=zoe(t,i),n=zoe(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 fW(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,h,m){let g=e.fromArray(u,r*t,n),A=e.fromArray(u,s*t,i),_=e.fromArray(u,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(A,c.y,A),e.multiplyByScalar(_,c.z,_);let C=e.add(g,A,g);e.add(C,_,C),m&&e.normalize(C,C),e.pack(C,f,h*t)}}var ANe=fW(se,4),yz=fW(d,3),qoe=fW(F,2),mNe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>D.EPSILON6?1:0},Kw=new d,aW=new d,cW=new d,pNe=new d;function _z(e,t,n,i,o,r,s,a,c,u,f,h,m,g,A,_){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let C=d.fromArray(o,e*3,Kw),y=d.fromArray(o,t*3,aW),E=d.fromArray(o,n*3,cW),I=AE(i,C,y,E,pNe);if(l(I)){if(l(r)&&yz(e,t,n,I,r,h.normal.values,_,!0),l(u)){let x=d.fromArray(u,e*3,Kw),S=d.fromArray(u,t*3,aW),w=d.fromArray(u,n*3,cW);d.multiplyByScalar(x,I.x,x),d.multiplyByScalar(S,I.y,S),d.multiplyByScalar(w,I.z,w);let v;!d.equals(x,d.ZERO)||!d.equals(S,d.ZERO)||!d.equals(w,d.ZERO)?(v=d.add(x,S,x),d.add(v,w,v),d.normalize(v,v)):(v=Kw,v.x=0,v.y=0,v.z=0),d.pack(v,h.extrudeDirection.values,_*3)}if(l(f)&&mNe(e,t,n,I,f,h.applyOffset.values,_),l(s)&&yz(e,t,n,I,s,h.tangent.values,_,!0),l(a)&&yz(e,t,n,I,a,h.bitangent.values,_,!0),l(c)&&qoe(e,t,n,I,c,h.st.values,_),g>0)for(let x=0;x<g;x++){let S=m[x];gNe(e,t,n,I,_,A[S],h[S])}}}function gNe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,u=s.values;switch(a){case 4:ANe(e,t,n,i,c,u,o,!1);break;case 3:yz(e,t,n,i,c,u,o,!1);break;case 2:qoe(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function ZA(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 _Ne={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Voe(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,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,h=[];for(let v in n)n.hasOwnProperty(v)&&!_Ne[v]&&l(n[v])&&h.push(v);let m=h.length,g=cx(t),A=cx(t),_,C,y,E,I,x=[];x.length=i.length/3;let S=[];for(S.length=i.length/3,I=0;I<x.length;++I)x[I]=-1,S[I]=-1;let w=f.length;for(I=0;I<w;I+=3){let v=f[I],P=f[I+1],N=f[I+2],L=d.fromArray(i,v*3),p=d.fromArray(i,P*3),b=d.fromArray(i,N*3),T=hNe(L,p,b);if(l(T)&&T.positions.length>3){let B=T.positions,R=T.indices,O=R.length;for(let U=0;U<O;++U){let k=R[U],z=B[k];z.y<0?(_=A.attributes,C=A.indices,y=x):(_=g.attributes,C=g.indices,y=S),E=ZA(_,C,y,f,k<3?I+k:-1,z),_z(v,P,N,z,i,o,s,r,a,c,u,_,h,m,n,E)}}else l(T)&&(L=T.positions[0],p=T.positions[1],b=T.positions[2]),L.y<0?(_=A.attributes,C=A.indices,y=x):(_=g.attributes,C=g.indices,y=S),E=ZA(_,C,y,f,I,L),_z(v,P,N,L,i,o,s,r,a,c,u,_,h,m,n,E),E=ZA(_,C,y,f,I+1,p),_z(v,P,N,p,i,o,s,r,a,c,u,_,h,m,n,E),E=ZA(_,C,y,f,I+2,b),_z(v,P,N,b,i,o,s,r,a,c,u,_,h,m,n,E)}uW(e,A,g)}var Koe=rn.fromPointNormal(d.ZERO,d.UNIT_Y),CNe=new d,yNe=new d;function ax(e,t,n,i,o,r,s){if(!l(s))return;let a=d.fromArray(i,e*3,Kw);d.equalsEpsilon(a,n,D.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function Hoe(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=cx(t),a=cx(t),c,u=r.length,f=[];f.length=i.length/3;let h=[];for(h.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,h[c]=-1;for(c=0;c<u;c+=2){let m=r[c],g=r[c+1],A=d.fromArray(i,m*3,Kw),_=d.fromArray(i,g*3,aW),C;Math.abs(A.y)<D.EPSILON6&&(A.y<0?A.y=-D.EPSILON6:A.y=D.EPSILON6),Math.abs(_.y)<D.EPSILON6&&(_.y<0?_.y=-D.EPSILON6:_.y=D.EPSILON6);let y=s.attributes,E=s.indices,I=h,x=a.attributes,S=a.indices,w=f,v=ci.lineSegmentPlane(A,_,Koe,cW);if(l(v)){let P=d.multiplyByScalar(d.UNIT_Y,5*D.EPSILON9,CNe);A.y<0&&(d.negate(P,P),y=a.attributes,E=a.indices,I=f,x=s.attributes,S=s.indices,w=h);let N=d.add(v,P,yNe);C=ZA(y,E,I,r,c,A),ax(m,g,A,i,C,y,o),C=ZA(y,E,I,r,-1,N),ax(m,g,N,i,C,y,o),d.negate(P,P),d.add(v,P,N),C=ZA(x,S,w,r,-1,N),ax(m,g,N,i,C,x,o),C=ZA(x,S,w,r,c+1,_),ax(m,g,_,i,C,x,o)}else{let P,N,L;A.y<0?(P=a.attributes,N=a.indices,L=f):(P=s.attributes,N=s.indices,L=h),C=ZA(P,N,L,r,c,A),ax(m,g,A,i,C,P,o),C=ZA(P,N,L,r,c+1,_),ax(m,g,_,i,C,P,o)}}uW(e,a,s)}var Yoe=new F,ENe=new F,Joe=new d,Xoe=new d,lW=new d,INe=new d,bNe=new d,xNe=new d,Woe=new se;function joe(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=d.unpack(n,s,Joe);if(a.x>0)continue;let c=d.unpack(i,s,Xoe);(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]):d.pack(a,i,s));let u=d.unpack(o,s,lW);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):d.pack(a,o,s))}}var TNe=5*D.EPSILON9,Cz=D.EPSILON6;function SNe(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,u=cx(t),f=cx(t),h,m,g,A=!1,_=i.length/3;for(h=0;h<_;h+=4){let C=h,y=h+2,E=d.fromArray(i,C*3,Joe),I=d.fromArray(i,y*3,Xoe);if(Math.abs(E.y)<Cz)for(E.y=Cz*(I.y<0?-1:1),i[h*3+1]=E.y,i[(h+1)*3+1]=E.y,m=C*3;m<C*3+12;m+=3)o[m]=i[h*3],o[m+1]=i[h*3+1],o[m+2]=i[h*3+2];if(Math.abs(I.y)<Cz)for(I.y=Cz*(E.y<0?-1:1),i[(h+2)*3+1]=I.y,i[(h+3)*3+1]=I.y,m=C*3;m<C*3+12;m+=3)r[m]=i[(h+2)*3],r[m+1]=i[(h+2)*3+1],r[m+2]=i[(h+2)*3+2];let x=u.attributes,S=u.indices,w=f.attributes,v=f.indices,P=ci.lineSegmentPlane(E,I,Koe,INe);if(l(P)){A=!0;let N=d.multiplyByScalar(d.UNIT_Y,TNe,bNe);E.y<0&&(d.negate(N,N),x=f.attributes,S=f.indices,w=u.attributes,v=u.indices);let L=d.add(P,N,xNe);x.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),x.position.values.push(L.x,L.y,L.z),x.position.values.push(L.x,L.y,L.z),x.prevPosition.values.push(o[C*3],o[C*3+1],o[C*3+2]),x.prevPosition.values.push(o[C*3+3],o[C*3+4],o[C*3+5]),x.prevPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),x.nextPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(L.x,L.y,L.z),d.negate(N,N),d.add(P,N,L),w.position.values.push(L.x,L.y,L.z),w.position.values.push(L.x,L.y,L.z),w.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.nextPosition.values.push(r[y*3],r[y*3+1],r[y*3+2]),w.nextPosition.values.push(r[y*3+3],r[y*3+4],r[y*3+5]);let p=F.fromArray(s,C*2,Yoe),b=Math.abs(p.y);x.expandAndWidth.values.push(-1,b,1,b),x.expandAndWidth.values.push(-1,-b,1,-b),w.expandAndWidth.values.push(-1,b,1,b),w.expandAndWidth.values.push(-1,-b,1,-b);let T=d.magnitudeSquared(d.subtract(P,E,lW));if(T/=d.magnitudeSquared(d.subtract(I,E,lW)),l(c)){let B=se.fromArray(c,C*4,Woe),R=se.fromArray(c,y*4,Woe),O=D.lerp(B.x,R.x,T),U=D.lerp(B.y,R.y,T),k=D.lerp(B.z,R.z,T),z=D.lerp(B.w,R.w,T);for(m=C*4;m<C*4+8;++m)x.color.values.push(c[m]);for(x.color.values.push(O,U,k,z),x.color.values.push(O,U,k,z),w.color.values.push(O,U,k,z),w.color.values.push(O,U,k,z),m=y*4;m<y*4+8;++m)w.color.values.push(c[m])}if(l(a)){let B=F.fromArray(a,C*2,Yoe),R=F.fromArray(a,(h+3)*2,ENe),O=D.lerp(B.x,R.x,T);for(m=C*2;m<C*2+4;++m)x.st.values.push(a[m]);for(x.st.values.push(O,B.y),x.st.values.push(O,R.y),w.st.values.push(O,B.y),w.st.values.push(O,R.y),m=y*2;m<y*2+4;++m)w.st.values.push(a[m])}g=x.position.values.length/3-4,S.push(g,g+2,g+1),S.push(g+1,g+2,g+3),g=w.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3)}else{let N,L;for(E.y<0?(N=f.attributes,L=f.indices):(N=u.attributes,L=u.indices),N.position.values.push(E.x,E.y,E.z),N.position.values.push(E.x,E.y,E.z),N.position.values.push(I.x,I.y,I.z),N.position.values.push(I.x,I.y,I.z),m=h*3;m<h*3+12;++m)N.prevPosition.values.push(o[m]),N.nextPosition.values.push(r[m]);for(m=h*2;m<h*2+8;++m)N.expandAndWidth.values.push(s[m]),l(a)&&N.st.values.push(a[m]);if(l(c))for(m=h*4;m<h*4+16;++m)N.color.values.push(c[m]);g=N.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}A&&(joe(f),joe(u)),uW(e,f,u)}ml.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||le.intersectPlane(n,rn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING))return e;if(t.geometryType!==Xf.NONE)switch(t.geometryType){case Xf.POLYLINES:SNe(e);break;case Xf.TRIANGLES:Voe(e);break;case Xf.LINES:Hoe(e);break}else fNe(t),t.primitiveType===Pe.TRIANGLES?Voe(e):t.primitiveType===Pe.LINES&&Hoe(e);return e};var Un=ml;function Jw(e,t,n,i,o,r,s,a,c,u,f){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=u,this._initialized=f}Object.defineProperties(Jw.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});Jw.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,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,h=this._size,m=this._pixelFormat,g=this._internalFormat,A=this._pixelDatatype,_=this._preMultiplyAlpha,C=this._flipY,y=4;l(f)&&(y=qe.alignmentInBytes(m,A,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,y),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let E=!1;if(!this._initialized){let I;t===0&&n===0&&r===h&&s===h?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),C&&(f=qe.flipY(f,m,A,h,h)),I=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,C),I=i),E=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),I=qe.createTypedArray(m,A,h,h)),a.texImage2D(u,0,g,h,h,0,m,Ge.toWebGLConstant(A,this._context),I),this._initialized=!0}E||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),C&&(f=qe.flipY(f,m,A,r,s)),a.texSubImage2D(u,0,t,n,r,s,m,Ge.toWebGLConstant(A,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,C),a.texSubImage2D(u,0,t,n,m,Ge.toWebGLConstant(A,this._context),i))),a.bindTexture(c,null)};Jw.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};Jw.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 Xw=Jw;var Iz={DONT_CARE:ee.DONT_CARE,FASTEST:ee.FASTEST,NICEST:ee.NICEST,validate:function(e){return e===Iz.DONT_CARE||e===Iz.FASTEST||e===Iz.NICEST}},ed=Object.freeze(Iz);var bz={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR};bz.validate=function(e){return e===bz.NEAREST||e===bz.LINEAR};var mi=Object.freeze(bz);var U_={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR,NEAREST_MIPMAP_NEAREST:ee.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ee.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ee.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ee.LINEAR_MIPMAP_LINEAR};U_.validate=function(e){return e===U_.NEAREST||e===U_.LINEAR||e===U_.NEAREST_MIPMAP_NEAREST||e===U_.LINEAR_MIPMAP_NEAREST||e===U_.NEAREST_MIPMAP_LINEAR||e===U_.LINEAR_MIPMAP_LINEAR};var Kt=Object.freeze(U_);var xz={CLAMP_TO_EDGE:ee.CLAMP_TO_EDGE,REPEAT:ee.REPEAT,MIRRORED_REPEAT:ee.MIRRORED_REPEAT,validate:function(e){return e===xz.CLAMP_TO_EDGE||e===xz.REPEAT||e===xz.MIRRORED_REPEAT}},En=Object.freeze(xz);function Zw(e){e=e??V.EMPTY_OBJECT;let{wrapR:t=En.CLAMP_TO_EDGE,wrapS:n=En.CLAMP_TO_EDGE,wrapT:i=En.CLAMP_TO_EDGE,minificationFilter:o=Kt.LINEAR,magnificationFilter:r=mi.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(Zw.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}}});Zw.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};Zw.NEAREST=Object.freeze(new Zw({wrapR:En.CLAMP_TO_EDGE,wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:Kt.NEAREST,magnificationFilter:mi.NEAREST}));var Jt=Zw;function BNe(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??q.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=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 $oe(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 Ip(e){e=e??V.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)BNe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let m=s[r];if(l(m.vertexBuffer)&&m.instanceDivisor===0){let g=m.strideInBytes||m.componentsPerAttribute*q.getSizeInBytes(m.componentDatatype);a=m.vertexBuffer.sizeInBytes/g;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(u=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),$oe(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=h,this._attributes=s,this._indexBuffer=o}function Zoe(e){return e.values.length/e.componentsPerAttribute}function wNe(e){return q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function DNe(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===q.DOUBLE&&(e[n].componentDatatype=q.FLOAT,e[n].values=q.createTypedArray(q.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=Zoe(e[o[0]]),t=1;t<s;++t){let u=Zoe(e[o[t]]);if(u!==r)throw new ue(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return q.getSizeInBytes(e[f].componentDatatype)-q.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=wNe(i);if(a>0){let u=q.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let h=r*a,m=new ArrayBuffer(h),g={};for(t=0;t<s;++t){n=o[t];let A=q.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:q.createTypedArray(e[n].componentDatatype,m),index:c[n]/A,strideInComponentType:a/A}}for(t=0;t<r;++t)for(let A=0;A<s;++A){n=o[A],i=e[n];let _=i.values,C=g[n],y=C.pointer,E=i.componentsPerAttribute;for(let I=0;I<E;++I)y[C.index+I]=_[t*E+I];C.index+=C.strideInComponentType}return{buffer:m,offsetsInBytes:c,vertexSizeInBytes:a}}}Ip.fromGeometry=function(e){e=e??V.EMPTY_OBJECT;let t=e.context,n=e.geometry??V.EMPTY_OBJECT,i=e.bufferUsage??Oe.DYNAMIC_DRAW,o=e.attributeLocations??V.EMPTY_OBJECT,r=e.interleave??!1,s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],h=n.attributes;if(r){let A=DNe(h);if(l(A)){u=ut.createVertexBuffer({context:t,typedArray:A.buffer,usage:i});let _=A.offsetsInBytes,C=A.vertexSizeInBytes;for(a in h)h.hasOwnProperty(a)&&l(h[a])&&(c=h[a],l(c.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:_[a],strideInBytes:C}):f.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 A=c.componentDatatype;A===q.DOUBLE&&(A=q.FLOAT);let _={};u=void 0,l(c.values)&&(u=ut.createVertexBuffer({context:t,typedArray:q.createTypedArray(A,c.values),usage:i}),_={index:o[a],vertexBuffer:u,value:c.value,componentDatatype:A,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=ut.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),_={index:o[a],vertexBuffer:u,value:void 0,componentDatatype:A,componentsPerAttribute:Ut.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(_)}let m,g=n.indices;return l(g)&&(ht.computeNumberOfVertices(n)>=D.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?m=ut.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Fe.UNSIGNED_INT}):m=ut.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Fe.UNSIGNED_SHORT})),new Ip({context:t,attributes:f,indexBuffer:m})};Object.defineProperties(Ip.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Ip.prototype.getAttribute=function(e){return this._attributes[e]};function vNe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Ft.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function PNe(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)}}Ip.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&vNe(this),this._hasConstantAttributes&&PNe(this,this._gl)):$oe(this._gl,this._attributes,this._indexBuffer)};Ip.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)}};Ip.prototype.isDestroyed=function(){return!1};Ip.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),de(this)};var oi=Ip;function _r(e){e=e??V.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=qe.RGBA,pixelDatatype:o=Ge.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Jt}=e,c=e.preMultiplyAlpha||i===qe.RGB||i===qe.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let h=u,m=qe.textureSizeInBytes(i,o,h,h)*6,g=qe.toInternalFormat(i,o,t),A=t._gl,_=A.TEXTURE_CUBE_MAP,C=A.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=_,this._texture=C,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=c,this._flipY=r;let y=l(n);function E(I){return new Xw(t,C,_,I,g,i,o,h,c,r,y)}this._positiveX=E(A.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=E(A.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=E(A.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=E(A.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=E(A.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=E(A.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,ere(this,a),A.activeTexture(A.TEXTURE0),A.bindTexture(_,C),s?A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,A.NONE):A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,A.BROWSER_DEFAULT_WEBGL);for(let I of _r.faceNames())dW(this[I],n?.[I],0);A.bindTexture(_,null)}_r.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new os({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};_r.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*RNe(){yield _r.FaceName.POSITIVEX,yield _r.FaceName.NEGATIVEX,yield _r.FaceName.POSITIVEY,yield _r.FaceName.NEGATIVEY,yield _r.FaceName.POSITIVEZ,yield _r.FaceName.NEGATIVEZ}_r.faceNames=function(){return RNe()};function dW(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,u=e._preMultiplyAlpha,f=e._context,h=f._gl;if(!l(t)){h.texImage2D(i,n,a,o,o,0,r,Ge.toWebGLConstant(s,f),null);return}let{arrayBufferView:m}=t,g=4;l(m)&&(g=qe.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,g),l(m)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),c&&(m=qe.flipY(m,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,Ge.toWebGLConstant(s,f),m)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),h.texImage2D(i,n,a,r,Ge.toWebGLConstant(s,f),t))}_r.loadFace=dW;Object.defineProperties(_r.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){ere(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}}});_r.getDirection=function(e,t){switch(e){case _r.FaceName.POSITIVEX:return d.clone(d.UNIT_X,t);case _r.FaceName.NEGATIVEX:return d.negate(d.UNIT_X,t);case _r.FaceName.POSITIVEY:return d.clone(d.UNIT_Y,t);case _r.FaceName.NEGATIVEY:return d.negate(d.UNIT_Y,t);case _r.FaceName.POSITIVEZ:return d.clone(d.UNIT_Z,t);case _r.FaceName.NEGATIVEZ:return d.negate(d.UNIT_Z,t)}};function ere(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ge.FLOAT&&!r.textureFloatLinear||s===Ge.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Kt.NEAREST_MIPMAP_NEAREST:Kt.NEAREST,i=mi.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)}_r.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 _r.faceNames())dW(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};_r.prototype.generateMipmap=function(e){e=e??ed.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)};_r.createVertexArray=function(e){let t=mc.createGeometry(mc.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Re.POSITION_ONLY})),n=this._attributeLocations=Un.createAttributeLocations(t);return oi.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Oe.STATIC_DRAW})};_r.prototype.isDestroyed=function(){return!1};_r.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=de(this._positiveX),this._negativeX=de(this._negativeX),this._positiveY=de(this._positiveY),this._negativeY=de(this._negativeY),this._positiveZ=de(this._positiveZ),this._negativeZ=de(this._negativeZ),de(this)};var Kr=_r;function MNe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Fc=MNe;var $w=`/**
* 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 eD=`/**
* 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 tD=`/**
* 0.1
*
* @name czm_epsilon1
* @glslConstant
*/
const float czm_epsilon1 = 0.1;
`;var nD=`/**
* 0.01
*
* @name czm_epsilon2
* @glslConstant
*/
const float czm_epsilon2 = 0.01;
`;var iD=`/**
* 0.001
*
* @name czm_epsilon3
* @glslConstant
*/
const float czm_epsilon3 = 0.001;
`;var oD=`/**
* 0.0001
*
* @name czm_epsilon4
* @glslConstant
*/
const float czm_epsilon4 = 0.0001;
`;var rD=`/**
* 0.00001
*
* @name czm_epsilon5
* @glslConstant
*/
const float czm_epsilon5 = 0.00001;
`;var sD=`/**
* 0.000001
*
* @name czm_epsilon6
* @glslConstant
*/
const float czm_epsilon6 = 0.000001;
`;var aD=`/**
* 0.0000001
*
* @name czm_epsilon7
* @glslConstant
*/
const float czm_epsilon7 = 0.0000001;
`;var cD=`/**
* 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 lD=`/**
* 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 uD=`/**
* 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 fD=`/**
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
*
* @name czm_passCesium3DTile
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCesium3DTile = 5.0;
`;var dD=`/**
* 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 hD=`/**
* 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 AD=`/**
* 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 mD=`/**
* The automatic GLSL constant for {@link Pass#CLASSIFICATION}
*
* @name czm_passClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passClassification = 7.0;
`;var pD=`/**
* The automatic GLSL constant for {@link Pass#COMPUTE}
*
* @name czm_passCompute
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCompute = 1.0;
`;var gD=`/**
* The automatic GLSL constant for {@link Pass#ENVIRONMENT}
*
* @name czm_passEnvironment
* @glslConstant
*
* @see czm_pass
*/
const float czm_passEnvironment = 0.0;
`;var _D=`/**
* The automatic GLSL constant for {@link Pass#GAUSSIAN_SPLATS}
*
* @name czm_passGaussianSplats
* @glslConstant
*
* @see czm_pass
*/
const float czm_passGaussianSplats = 11.0;
`;var CD=`/**
* The automatic GLSL constant for {@link Pass#GLOBE}
*
* @name czm_passGlobe
* @glslConstant
*
* @see czm_pass
*/
const float czm_passGlobe = 2.0;
`;var yD=`/**
* The automatic GLSL constant for {@link Pass#OPAQUE}
*
* @name czm_passOpaque
* @glslConstant
*
* @see czm_pass
*/
const float czm_passOpaque = 8.0;
`;var ED=`/**
* The automatic GLSL constant for {@link Pass#OVERLAY}
*
* @name czm_passOverlay
* @glslConstant
*
* @see czm_pass
*/
const float czm_passOverlay = 12.0;
`;var ID=`/**
* The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
*
* @name czm_passTerrainClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passTerrainClassification = 3.0;
`;var bD=`/**
* The automatic GLSL constant for {@link Pass#TRANSLUCENT}
*
* @name czm_passTranslucent
* @glslConstant
*
* @see czm_pass
*/
const float czm_passTranslucent = 9.0;
`;var xD=`/**
* The automatic GLSL constant for {@link Pass#VOXELS}
*
* @name czm_passVoxels
* @glslConstant
*
* @see czm_pass
*/
const float czm_passVoxels = 10.0;
`;var TD=`/**
* 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 SD=`/**
* 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 BD=`/**
* 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 wD=`/**
* 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 DD=`/**
* 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 vD=`/**
* 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 PD=`/**
* 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 RD=`/**
* 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 MD=`/**
* 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 ND=`/**
* 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 LD=`/**
* 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 OD=`/**
* 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 FD=`/**
* 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 QD=`/**
* 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 kD=`/**
* @name czm_depthRangeStruct
* @glslStruct
*/
struct czm_depthRangeStruct
{
float near;
float far;
};
`;var UD=`/**
* 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 GD=`/**
* 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 zD=`/**
* 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 VD=`/**
* 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 HD=`/**
* DOC_TBA
*
* @name czm_ray
* @glslStruct
*/
struct czm_ray
{
vec3 origin;
vec3 direction;
};
`;var YD=`/**
* 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 WD=`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 jD=`/**
* 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 qD=`/**
* 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 KD=`/**
* 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 JD=`/**
* 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 XD=`/**
* 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 ZD=`/**
* 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 $D=`// 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 ev=`/**
* @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 tv=`/**
* 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 nv=`/**
* 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 iv=`/**
* 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 ov=`/**
* 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 rv=`/**
* 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 sv=`/**
* 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 av=`
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 cv=`
uniform vec4 shadowMap_cascadeDistances;
float czm_cascadeDistance(vec4 weights)
{
return dot(shadowMap_cascadeDistances, weights);
}
`;var lv=`
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 uv=`
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 fv=`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 dv=`/**
* DOC_TBA
*
* @name czm_columbusViewMorph
* @glslFunction
*/
vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
{
// Just linear for now.
vec3 p = mix(position2D.xyz, position3D.xyz, time);
return vec4(p, 1.0);
}
`;var hv=`/**
* 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 Av=`/**
* 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 mv=`/**
* 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 pv=`/**
* 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 gv=`/**
* @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 _v=`/**
* 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 Cv=`// 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 yv=`/**
* 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 Ev=`/**
* 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 Iv=`/**
* 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 bv=`/**
* 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 xv=`/**
* 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 Tv=`/**
* 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 Sv=`/**
* 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 Bv=`/**
* 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 wv=`/**
* 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 Dv=`/**
* 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 vv=`/**
* 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 Pv=`/**
* 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 Rv=`/**
* 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 Mv=`/**
* 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 Nv=`/**
* @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 Lv=`/**
* 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 Ov=`/**
* 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 Fv=`/**
* 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 Qv=`/**
* 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 kv=`/**
* 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 Uv=`/**
* 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 Gv=`/**
* 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 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 Vv=`/**
* 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 Hv=`/**
* 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 Yv=`/**
* 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 Wv=`/**
* 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 jv=`/**
* 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 qv=` /**
* 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 Kv=`/**
* 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 Jv=`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 Xv=`// 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 Zv=`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 $v=`/**
* 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 eP=`/**
* 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 tP=`/**
* 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 nP=`/**
* 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 iP=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var oP=`/**
* 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 rP=`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 sP=`/**
* 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 aP=`/**
* 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 cP=`
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 lP=`
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 uP=`/**
* 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 fP=`/**
* 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 dP=`/**
* 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 hP=`/**
* 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 AP=`/**
* 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 mP=`/**
* 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 pP=`/**
* 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 gP=`/**
* @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 _P=`/**
* 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 CP=`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 yP=`/**
* 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 EP=`/**
* 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 IP=`/**
* 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 bP=`/**
* 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 xP=`#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 TP=`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 SP=`// 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 BP=`#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 wP=`/**
* 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 EE={czm_degreesPerRadian:$w,czm_depthRange:eD,czm_epsilon1:tD,czm_epsilon2:nD,czm_epsilon3:iD,czm_epsilon4:oD,czm_epsilon5:rD,czm_epsilon6:sD,czm_epsilon7:aD,czm_infinity:cD,czm_oneOverPi:lD,czm_oneOverTwoPi:uD,czm_passCesium3DTile:fD,czm_passCesium3DTileClassification:dD,czm_passCesium3DTileClassificationIgnoreShow:hD,czm_passCesium3DTileEdges:AD,czm_passClassification:mD,czm_passCompute:pD,czm_passEnvironment:gD,czm_passGaussianSplats:_D,czm_passGlobe:CD,czm_passOpaque:yD,czm_passOverlay:ED,czm_passTerrainClassification:ID,czm_passTranslucent:bD,czm_passVoxels:xD,czm_pi:TD,czm_piOverFour:SD,czm_piOverSix:BD,czm_piOverThree:wD,czm_piOverTwo:DD,czm_radiansPerDegree:vD,czm_sceneMode2D:PD,czm_sceneMode3D:RD,czm_sceneModeColumbusView:MD,czm_sceneModeMorphing:ND,czm_solarRadius:LD,czm_threePiOver2:OD,czm_twoPi:FD,czm_webMercatorMaxLatitude:QD,czm_depthRangeStruct:kD,czm_material:UD,czm_materialInput:GD,czm_modelMaterial:zD,czm_modelVertexOutput:VD,czm_ray:HD,czm_raySegment:YD,czm_shadowParameters:WD,czm_HSBToRGB:jD,czm_HSLToRGB:qD,czm_RGBToHSB:KD,czm_RGBToHSL:JD,czm_RGBToXYZ:XD,czm_XYZToRGB:ZD,czm_acesTonemapping:$D,czm_alphaWeight:ev,czm_antialias:tv,czm_applyHSBShift:nv,czm_approximateSphericalCoordinates:iv,czm_approximateTanh:ov,czm_backFacing:rv,czm_branchFreeTernary:sv,czm_cascadeColor:av,czm_cascadeDistance:cv,czm_cascadeMatrix:lv,czm_cascadeWeights:uv,czm_clipPolygons:fv,czm_columbusViewMorph:dv,czm_computeAtmosphereColor:hv,czm_computeGroundAtmosphereScattering:Av,czm_computePosition:mv,czm_computeScattering:pv,czm_cosineAndSine:gv,czm_decompressTextureCoordinates:_v,czm_depthClamp:Cv,czm_eastNorthUpToEyeCoordinates:yv,czm_ellipsoidContainsPoint:Ev,czm_ellipsoidTextureCoordinates:Iv,czm_equalsEpsilon:bv,czm_eyeOffset:xv,czm_eyeToWindowCoordinates:Tv,czm_fastApproximateAtan:Sv,czm_fog:Bv,czm_gammaCorrect:wv,czm_geodeticSurfaceNormal:Dv,czm_getDefaultMaterial:vv,czm_getDynamicAtmosphereLightDirection:Pv,czm_getLambertDiffuse:Rv,czm_getSpecular:Mv,czm_getWaterNoise:Nv,czm_hue:Lv,czm_inverseGamma:Ov,czm_isEmpty:Fv,czm_isFull:Qv,czm_latitudeToWebMercatorFraction:kv,czm_lineDistance:Uv,czm_linearToSrgb:Gv,czm_luminance:zv,czm_maximumComponent:Vv,czm_metersPerPixel:Hv,czm_modelToWindowCoordinates:Yv,czm_multiplyWithColorBalance:Wv,czm_nearFarScalar:jv,czm_octDecode:qv,czm_packDepth:Kv,czm_pbrLighting:Jv,czm_pbrNeutralTonemapping:Xv,czm_phong:Zv,czm_planeDistance:$v,czm_pointAlongRay:eP,czm_rayEllipsoidIntersectionInterval:tP,czm_raySphereIntersectionInterval:nP,czm_readDepth:iP,czm_readNonPerspective:oP,czm_reverseLogDepth:rP,czm_round:sP,czm_saturation:aP,czm_shadowDepthCompare:cP,czm_shadowVisibility:lP,czm_signNotZero:uP,czm_sphericalHarmonics:fP,czm_srgbToLinear:dP,czm_tangentToEyeSpaceMatrix:hP,czm_textureCube:AP,czm_transformPlane:mP,czm_translateRelativeToEye:pP,czm_translucentPhong:gP,czm_transpose:_P,czm_unpackClippingExtents:CP,czm_unpackDepth:yP,czm_unpackFloat:EP,czm_unpackUint:IP,czm_valueTransform:bP,czm_vertexLogDepth:xP,czm_windowToEyeCoordinates:TP,czm_writeDepthClamp:SP,czm_writeLogDepth:BP,czm_writeNonPerspective:wP};function NNe(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 DP=NNe;function tre(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 nre(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=tre(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function ire(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&&_a._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=nre(i,_a._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),ire(o,t)}}))}function LNe(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 ONe(e){let t=[],n=nre("main",e,t);ire(n,t),LNe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
`;return i.replace(n.glslSource,"")}function ore(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i<o;++i)r+=`
#line 0
${s[i]}`;r=tre(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(_,C){return a=C,`
`});let c=[];r=r.replace(/#extension.*\n/gm,function(_){return c.push(_),`
`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let u=e.pickColorQualifier;l(u)&&(r=_a.createPickFragmentShaderSource(r,u));let f="",h=c.length;for(i=0;i<h;i++)f+=c[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
precision highp int;
#else
precision mediump float;
precision mediump int;
#define highp mediump
#endif
`);let m=e.defines;if(l(m))for(i=0,o=m.length;i<o;++i){let _=m[i];_.length!==0&&(f+=`#define ${_}
`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear
`),n.floatingPointTexture&&(f+=`#define OES_texture_float
`);let g="";e.includeBuiltIns&&(g=ONe(r)),f+=`
#line 0
`;let A=g+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(A)&&!/czm_out_FragColor/g.test(A)&&/out_FragColor/g.test(A)&&(f+=`layout(location = 0) out vec4 out_FragColor;
`),f+=g,f+=r,n.webgl2?f=`#version 300 es
${f}`:f=DP(f,t),f}function _a(e){e=e??V.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}_a.prototype.clone=function(){return new _a({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};_a.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};_a.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(`
`);return`${t}:${n}:${i}:${o}`};_a.prototype.createCombinedVertexShader=function(e){return ore(this,!1,e)};_a.prototype.createCombinedFragmentShader=function(e){return ore(this,!0,e)};_a._czmBuiltinsAndUniforms={};for(let e in EE)EE.hasOwnProperty(e)&&(_a._czmBuiltinsAndUniforms[e]=EE[e]);for(let e in dp)if(dp.hasOwnProperty(e)){let t=dp[e];typeof t.getDeclaration=="function"&&(_a._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}_a.createPickVertexShaderSource=function(e){return`${_a.replaceMain(e,"czm_old_main")}
in vec4 pickColor;
out vec4 czm_pickColor;
void main()
{
czm_old_main();
czm_pickColor = pickColor;
}`};_a.createPickFragmentShaderSource=function(e,t){let n=_a.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 FNe(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 rre(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 sre(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(rre(e,o))return o}}var QNe=["v_normalEC","v_normal"];_a.findNormalVarying=function(e){return rre(e,"#ifdef HAS_NORMALS")?FNe(e,"HAS_NORMALS")?"v_normalEC":void 0:sre(e,QNe)};var kNe=["v_positionEC"];_a.findPositionVarying=function(e){return sre(e,kNe)};var We=_a;function yh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(yh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});yh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function UNe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}yh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new We({sources:[t]})),typeof n=="string"&&(n=new We({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?UNe(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),h=n.createCombinedFragmentShader(u),m=new sn({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});c={cache:this,shaderProgram:m,keyword:a,derivedKeywords:[],count:0},m._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};yh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){hW(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};yh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};yh.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 We({sources:[r]})),typeof s=="string"&&(s=new We({sources:[s]}));let c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),h=new sn({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),m={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=m,this._shaders[o]=m,h};function hW(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];hW(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}yh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];hW(this,n),--this._numberOfShaders}this._shadersToRelease={}};yh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return de(this)};var vP=yh;function Eh(e){e=e??V.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=qe.RGBA,pixelDatatype:o=Ge.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Jt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===qe.RGB||i===qe.LUMINANCE,h=qe.toInternalFormat(i,o,t),m=qe.isCompressedFormat(h),g=t._gl,A=m?qe.compressedTextureSizeInBytes(i,c,u):qe.textureSizeInBytes(i,o,c,u);this._id=e.id??jn(),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=u,this._dimensions=new F(c,u),this._hasMipmap=!1,this._sizeInBytes=A,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,ure(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)?qe.isCompressedFormat(h)?GNe(this,n):are(this,n):l(n.framebuffer)?VNe(this,n):cre(this,n),this._initialized=!0):lre(this),g.bindTexture(this._textureTarget,null)}function GNe(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,u=a;for(let f=0;f<t.mipLevels.length;++f)c=Tz(c),u=Tz(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function are(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,h=qe.alignmentInBytes(c,u,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:m}=t;if(f&&(m=qe.flipY(m,c,u,s,a)),i.texImage2D(o,0,r,s,a,0,c,Ge.toWebGLConstant(u,n),m),l(t.mipLevels)){let g=s,A=a;for(let _=0;_<t.mipLevels.length;++_)g=Tz(g),A=Tz(A),i.texImage2D(o,_+1,r,g,A,0,c,Ge.toWebGLConstant(u,n),t.mipLevels[_])}}function zNe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=qe.alignmentInBytes(c,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=qe.flipY(t,c,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,Ge.toWebGLConstant(u,s),t)}function VNe(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 cre(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,Ge.toWebGLConstant(e.pixelDatatype,n),t)}function HNe(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,Ge.toWebGLConstant(e.pixelDatatype,o),t)}function Tz(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function lre(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Ge.toWebGLConstant(e._pixelDatatype,t),null)}Eh.create=function(e){return new Eh(e)};Eh.fromFramebuffer=function(e){e=e??V.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=qe.RGB,framebufferXOffset:i=0,framebufferYOffset:o=0,width:r=t.drawingBufferWidth,height:s=t.drawingBufferHeight,framebuffer:a}=e;return new Eh({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(Eh.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){ure(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 ure(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ge.FLOAT&&!r.textureFloatLinear||a===Ge.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Kt.NEAREST_MIPMAP_NEAREST:Kt.NEAREST,i=mi.NEAREST),r.webgl2&&qe.isDepthFormat(s)&&(n=Kt.NEAREST,i=mi.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}Eh.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:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?are(this,i):cre(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),lre(this)),this._initialized=!0),f||(l(i.arrayBufferView)?zNe(this,i.arrayBufferView,t,n,c,u):HNe(this,i,t,n)),s.bindTexture(a,null)};Eh.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};Eh.prototype.generateMipmap=function(e){e=e??ed.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)};Eh.prototype.isDestroyed=function(){return!1};Eh.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),de(this)};var Bt=Eh;function IE(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(IE.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});IE.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};IE.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};IE.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={}};IE.prototype.isDestroyed=function(){return!1};IE.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return de(this)};var PP=IE;function td(e){this.planes=e??[]}var RP=[new d,new d,new d];d.clone(d.UNIT_X,RP[0]);d.clone(d.UNIT_Y,RP[1]);d.clone(d.UNIT_Z,RP[2]);var G_=new d,YNe=new d,fre=new rn(new d(1,0,0),0);td.fromBoundingSphere=function(e,t){l(t)||(t=new td);let n=RP.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=RP[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new se),l(f)||(f=i[s+1]=new se),d.multiplyByScalar(c,-r,G_),d.add(o,G_,G_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-d.dot(c,G_),d.multiplyByScalar(c,r,G_),d.add(o,G_,G_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-d.dot(d.negate(c,YNe),G_),s+=2}return t};td.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(rn.fromCartesian4(t[i],fre));if(r===qt.OUTSIDE)return qt.OUTSIDE;r===qt.INTERSECTING&&(n=!0)}return n?qt.INTERSECTING:qt.INSIDE};td.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===td.MASK_OUTSIDE||t===td.MASK_INSIDE)return t;let n=td.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(rn.fromCartesian4(i[o],fre));if(a===qt.OUTSIDE)return td.MASK_OUTSIDE;a===qt.INTERSECTING&&(n|=s)}return n};td.MASK_OUTSIDE=4294967295;td.MASK_INSIDE=0;td.MASK_INDETERMINATE=2147483647;var Gs=td;function $A(e){e=e??V.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 Gs,this._orthographicMatrix=new M}function dre(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=M.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties($A.prototype,{projectionMatrix:{get:function(){return dre(this),this._orthographicMatrix}}});var WNe=new d,jNe=new d,qNe=new d,AW=new d;$A.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,u=this.far,f=d.cross(t,n,WNe);d.normalize(f,f);let h=jNe;d.multiplyByScalar(t,c,h),d.add(e,h,h);let m=qNe;d.multiplyByScalar(f,a,m),d.add(h,m,m);let g=i[0];return l(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-d.dot(f,m),d.multiplyByScalar(f,s,m),d.add(h,m,m),g=i[1],l(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-d.dot(d.negate(f,AW),m),d.multiplyByScalar(n,r,m),d.add(h,m,m),g=i[2],l(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-d.dot(n,m),d.multiplyByScalar(n,o,m),d.add(h,m,m),g=i[3],l(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-d.dot(d.negate(n,AW),m),g=i[4],l(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-d.dot(t,h),d.multiplyByScalar(t,u,m),d.add(e,m,m),g=i[5],l(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-d.dot(d.negate(t,AW),m),this._cullingVolume};$A.prototype.getPixelDimensions=function(e,t,n,i,o){dre(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};$A.prototype.clone=function(e){return l(e)||(e=new $A),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};$A.prototype.equals=function(e){return l(e)&&e instanceof $A&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};$A.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof $A&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var rs=$A;function au(e){e=e??V.EMPTY_OBJECT,this._offCenterFrustum=new rs,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}au.packedLength=4;au.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};au.unpack=function(e,t,n){return t=t??0,l(n)||(n=new au),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function z_(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(au.prototype,{projectionMatrix:{get:function(){return z_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return z_(this),this._offCenterFrustum}}});au.prototype.computeCullingVolume=function(e,t,n){return z_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};au.prototype.getPixelDimensions=function(e,t,n,i,o){return z_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};au.prototype.clone=function(e){return l(e)||(e=new au),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};au.prototype.equals=function(e){return!l(e)||!(e instanceof au)?!1:(z_(this),z_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};au.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof au)?!1:(z_(this),z_(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var fn=au;var mW={};function KNe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var JNe=32.184,XNe=2451545;function Pre(e,t){t=J.addSeconds(e,JNe,t);let n=J.totalDays(t)-XNe;return t=J.addSeconds(t,KNe(n),t),t}var Sz=new J(2451545,0,ni.TAI),ZNe=1e3,nd=D.RADIANS_PER_DEGREE,qu=D.RADIANS_PER_ARCSECOND,pc=14959787e4,hre=new X;function Rre(e,t,n,i,o,r,s){n<0&&(n=-n,o+=D.PI);let a=e*(1-t),c=i-o,u=o,f=eLe(r-i,t),h=$Ne(t,0);rLe(c,n,u,hre);let m=a*(1+t),g=Math.cos(f),A=Math.sin(f),_=1+t*g,C=m/_;return l(s)?(s.x=C*g,s.y=C*A,s.z=0):s=new d(C*g,C*A,0),X.multiplyByVector(hre,s,s)}function $Ne(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function eLe(e,t){let n=iLe(e,t);return oLe(n,t)}var tLe=50,nLe=D.EPSILON8;function iLe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.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<tLe&&Math.abs(o-i)>nLe;++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*D.TWO_PI,o}function oLe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=D.zeroToTwoPi(r),e<0&&(r-=D.TWO_PI),r+=n*D.TWO_PI,r}function rLe(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),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new X(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var sLe=1.0000010178*pc,aLe=100.46645683*nd,cLe=129597742283429e-5*qu,Are=16002,mre=21863,pre=32004,gre=10931,_re=14529,Cre=16368,yre=15318,Ere=32794,lLe=64*1e-7*pc,uLe=-152*1e-7*pc,fLe=62*1e-7*pc,dLe=-8*1e-7*pc,hLe=32*1e-7*pc,ALe=-41*1e-7*pc,mLe=19*1e-7*pc,pLe=-11*1e-7*pc,gLe=-150*1e-7*pc,_Le=-46*1e-7*pc,CLe=68*1e-7*pc,yLe=54*1e-7*pc,ELe=14*1e-7*pc,ILe=24*1e-7*pc,bLe=-28*1e-7*pc,xLe=22*1e-7*pc,Ire=10,bre=16002,xre=21863,Tre=10931,Sre=1473,Bre=32004,wre=4387,Dre=73,TLe=-325*1e-7,SLe=-322*1e-7,BLe=-79*1e-7,wLe=232*1e-7,DLe=-52*1e-7,vLe=97*1e-7,PLe=55*1e-7,RLe=-41*1e-7,MLe=-105*1e-7,NLe=-137*1e-7,LLe=258*1e-7,OLe=35*1e-7,FLe=-116*1e-7,QLe=-88*1e-7,kLe=-112*1e-7,ULe=-80*1e-7,lx=new J(0,0,ni.TAI);function GLe(e,t){Pre(e,lx);let i=(lx.dayNumber-Sz.dayNumber+(lx.secondsOfDay-Sz.secondsOfDay)/ri.SECONDS_PER_DAY)/(ri.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=sLe+lLe*Math.cos(Are*o)+gLe*Math.sin(Are*o)+uLe*Math.cos(mre*o)+_Le*Math.sin(mre*o)+fLe*Math.cos(pre*o)+CLe*Math.sin(pre*o)+dLe*Math.cos(gre*o)+yLe*Math.sin(gre*o)+hLe*Math.cos(_re*o)+ELe*Math.sin(_re*o)+ALe*Math.cos(Cre*o)+ILe*Math.sin(Cre*o)+mLe*Math.cos(yre*o)+bLe*Math.sin(yre*o)+pLe*Math.cos(Ere*o)+xLe*Math.sin(Ere*o),s=aLe+cLe*i+TLe*Math.cos(Ire*o)+MLe*Math.sin(Ire*o)+SLe*Math.cos(bre*o)+NLe*Math.sin(bre*o)+BLe*Math.cos(xre*o)+LLe*Math.sin(xre*o)+wLe*Math.cos(Tre*o)+OLe*Math.sin(Tre*o)+DLe*Math.cos(Sre*o)+FLe*Math.sin(Sre*o)+vLe*Math.cos(Bre*o)+QLe*Math.sin(Bre*o)+PLe*Math.cos(wre*o)+kLe*Math.sin(wre*o)+RLe*Math.cos(Dre*o)+ULe*Math.sin(Dre*o),a=.0167086342-.0004203654*i,c=102.93734808*nd+11612.3529*qu*i,u=469.97289*qu*i,f=174.87317577*nd-8679.27034*qu*i;return Rre(r,a,u,c,f,s,t)}function Mre(e,t){Pre(e,lx);let i=(lx.dayNumber-Sz.dayNumber+(lx.secondsOfDay-Sz.secondsOfDay)/ri.SECONDS_PER_DAY)/ri.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*nd,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*nd,m=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*nd,A=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,_=218.31664563*nd,C=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,y=297.85019547*nd+qu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),E=93.27209062*nd+qu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),I=134.96340251*nd+qu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),x=357.52910918*nd+qu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),S=310.17137918*nd-qu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),w=2*y,v=4*y,P=6*y,N=2*I,L=3*I,p=4*I,b=2*E;a+=3400.4*Math.cos(w)-635.6*Math.cos(w-I)-235.6*Math.cos(I)+218.1*Math.cos(w-x)+181*Math.cos(w+I),c+=.014216*Math.cos(w-I)+.008551*Math.cos(w-N)-.001383*Math.cos(I)+.001356*Math.cos(w+I)-.001147*Math.cos(v-L)-914e-6*Math.cos(v-N)+869e-6*Math.cos(w-x-I)-627e-6*Math.cos(w)-394e-6*Math.cos(v-p)+282e-6*Math.cos(w-x-N)-279e-6*Math.cos(y-I)-236e-6*Math.cos(N)+231e-6*Math.cos(v)+229e-6*Math.cos(P-p)-201e-6*Math.cos(N-b),f+=486.26*Math.cos(w-b)-40.13*Math.cos(w)+37.51*Math.cos(b)+25.73*Math.cos(N-b)+19.97*Math.cos(w-x-b),m+=-55609*Math.sin(w-I)-34711*Math.sin(w-N)-9792*Math.sin(I)+9385*Math.sin(v-L)+7505*Math.sin(v-N)+5318*Math.sin(w+I)+3484*Math.sin(v-p)-3417*Math.sin(w-x-I)-2530*Math.sin(P-p)-2376*Math.sin(w)-2075*Math.sin(w-L)-1883*Math.sin(N)-1736*Math.sin(P-5*I)+1626*Math.sin(x)-1370*Math.sin(P-L),A+=-5392*Math.sin(w-b)-540*Math.sin(x)-441*Math.sin(w)+423*Math.sin(b)-288*Math.sin(N-b),C+=-3332.9*Math.sin(w)+1197.4*Math.sin(w-I)-662.5*Math.sin(x)+396.3*Math.sin(I)-218*Math.sin(w-x);let T=2*S,B=3*S;f+=46.997*Math.cos(S)*i-.614*Math.cos(w-b+S)*i+.614*Math.cos(w-b-S)*i-.0297*Math.cos(T)*o-.0335*Math.cos(S)*o+.0012*Math.cos(w-b+T)*o-16e-5*Math.cos(S)*r+4e-5*Math.cos(B)*r+4e-5*Math.cos(T)*r;let R=2.116*Math.sin(S)*i-.111*Math.sin(w-b-S)*i-.0015*Math.sin(S)*o;m+=R,C+=R,A+=-520.77*Math.sin(S)*i+13.66*Math.sin(w-b+S)*i+1.12*Math.sin(w-S)*i-1.06*Math.sin(b-S)*i+.66*Math.sin(T)*o+.371*Math.sin(S)*o-.035*Math.sin(w-b+T)*o-.015*Math.sin(w-b+S)*o+.0014*Math.sin(S)*r-.0011*Math.sin(B)*r-9e-4*Math.sin(T)*r,a*=ZNe;let O=u+f*qu,U=h+m*qu,k=_+C*qu,z=g+A*qu;return Rre(a,c,O,U,z,k,t)}var vre=.012300034,zLe=vre/(vre+1)*-1;function VLe(e,t){return t=Mre(e,t),d.multiplyByScalar(t,zLe,t)}var Nre=new X(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),MP=new d;mW.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=J.now()),l(t)||(t=new d),MP=GLe(e,MP),t=d.negate(MP,t),VLe(e,MP),d.subtract(t,MP,t),X.multiplyByVector(Nre,t,t),t};mW.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=J.now()),t=Mre(e,t),X.multiplyByVector(Nre,t,t),t};var V_=mW;var Bz={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};Bz.getMorphTime=function(e){return e===Bz.SCENE3D?1:e===Bz.MORPHING?void 0:0};var oe=Object.freeze(Bz);function HLe(e){e=e??V.EMPTY_OBJECT,this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??2}var bp=HLe;function ux(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Xe,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new F,this._currentFrustum=new F,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=X.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new X,this._viewRotation=new X,this._inverseViewRotation=new X,this._viewRotation3D=new X,this._inverseViewRotation3D=new X,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,this._normalDirty=!0,this._normal=new X,this._normal3DDirty=!0,this._normal3D=new X,this._inverseNormalDirty=!0,this._inverseNormal=new X,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new X,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new $n,this._cameraPosition=new d,this._sunPositionWC=new d,this._sunPositionColumbusView=new d,this._sunDirectionWC=new d,this._sunDirectionEC=new d,this._moonDirectionEC=new d,this._lightDirectionWC=new d,this._lightDirectionEC=new d,this._lightColor=new d,this._lightColorHdr=new d,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new d,this._cameraRight=new d,this._cameraUp=new d,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new F,this._eyeEllipsoidNormalEC=new d,this._eyeEllipsoidCurvature=new F,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new G,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 d,this._atmosphereRayleighScaleHeight=new d,this._atmosphereMieCoefficient=new d,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(ux.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Xe.equals(e,this._viewport)){Xe.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 Ore(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Ore(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.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,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),X.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return gW(this),this._view3D}},viewRotation:{get:function(){return gW(this),this._viewRotation}},viewRotation3D:{get:function(){return gW(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return kre(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return kre(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return tOe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return nOe(this),this._modelView}},modelView3D:{get:function(){return iOe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return lOe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return oOe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return rOe(this),this._inverseModelView3D}},viewProjection:{get:function(){return sOe(this),this._viewProjection}},inverseViewProjection:{get:function(){return aOe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return cOe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return uOe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return fOe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return dOe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return hOe(this),this._normal}},normal3D:{get:function(){return AOe(this),this._normal3D}},inverseNormal:{get:function(){return mOe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return pOe(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 Qre(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Qre(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??te.default}}});function YLe(e,t){M.clone(t,e._view),M.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 WLe(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function jLe(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function qLe(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Lre=new d,KLe=new M;function JLe(e,t){d.clone(t.positionWC,e._cameraPosition),d.clone(t.directionWC,e._cameraDirection),d.clone(t.rightWC,e._cameraRight),d.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=d.fromRadians(o.longitude,o.latitude,0,n,Lre)):(e._eyeHeight=-n.maximumRadius,d.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=d.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Lre)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=X.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=It.eastNorthUpToFixedFrame(i,n,KLe);e._enuToModel=M.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var pW=new X,XLe=new he;function ZLe(e,t){It.computeIcrfToCentralBodyFixedMatrix(t.time,pW);let n=V_.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);X.multiplyByVector(pW,n,n),d.normalize(n,e._sunDirectionWC),n=X.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),d.normalize(n,n),n=V_.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),X.multiplyByVector(pW,n,n),X.multiplyByVector(e.viewRotation3D,n,n),d.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,XLe);i.project(r,e._sunPositionColumbusView)}ux.prototype.updateCamera=function(e){YLe(this,e.viewMatrix),WLe(this,e.inverseViewMatrix),JLe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==oe.SCENE2D&&e.frustum instanceof fn};ux.prototype.updateFrustum=function(e){jLe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&qLe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.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};ux.prototype.updatePass=function(e){this._pass=e};var $Le=[],eOe=new bp;ux.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===oe.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),ZLe(this,e);let n=e.light??eOe;n instanceof bp?(this._lightDirectionWC=d.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=d.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=d.normalize(d.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=X.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=d.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=d.multiplyByScalar(o,n.intensity,o);let r=d.maximumComponent(o);r>1?d.divideByScalar(o,r,this._lightColor):d.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??$Le,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=d.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=d.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=d.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=It.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,h;l(u)?f.height>f.width?h=Math.tan(.5*u)*2/f.height:h=Math.tan(.5*u)*2/f.width:h=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,G.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Ore(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function tOe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function nOe(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function iOe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function oOe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function rOe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function sOe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function aOe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function cOe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function lOe(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 uOe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function fOe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function dOe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function hOe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),X.transpose(t,t)}}function AOe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),X.transpose(t,t)}}function mOe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),X.transpose(t,t)}}function pOe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),X.transpose(t,t)}}var Fre=new d;function Qre(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,Fre),$n.fromCartesian(Fre,e._encodedCameraPositionMC))}var gOe=new d,_Oe=new d,COe=new d,yOe=new d,EOe=new he,IOe=new d,bOe=new M;function xOe(e,t,n,i,o,r,s,a){let c=gOe;c.x=e.y,c.y=e.z,c.z=e.x;let u=_Oe;u.x=n.y,u.y=n.z,u.z=n.x;let f=COe;f.x=i.y,f.y=i.z,f.z=i.x;let h=yOe;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let m=s.unproject(c,EOe);m.longitude=D.clamp(m.longitude,-Math.PI,Math.PI),m.latitude=D.clamp(m.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let g=s.ellipsoid,A=g.cartographicToCartesian(m,IOe),_=It.eastNorthUpToFixedFrame(A,g,bOe);return M.multiplyByPointAsVector(_,u,u),M.multiplyByPointAsVector(_,f,f),M.multiplyByPointAsVector(_,h,h),l(a)||(a=new M),a[0]=u.x,a[1]=f.x,a[2]=-h.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-h.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-h.z,a[11]=0,a[12]=-d.dot(u,A),a[13]=-d.dot(f,A),a[14]=d.dot(h,A),a[15]=1,a}function gW(e){e._view3DDirty&&(e._mode===oe.SCENE3D?M.clone(e._view,e._view3D):xOe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function kre(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var NP=ux;function cu(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):TOe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new vP(this),this._textureCache=new PP;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Ft._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Ft._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Ft._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Ft._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Ft._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Ft._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Ft._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Ft._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Ft._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ft._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Ft._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Ft._minimumAliasedLineWidth=f[0],Ft._maximumAliasedLineWidth=f[1];let h=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Ft._minimumAliasedPointSize=h[0],Ft._maximumAliasedPointSize=h[1];let m=u.getParameter(u.MAX_VIEWPORT_DIMS);Ft._maximumViewportWidth=m[0],Ft._maximumViewportHeight=m[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Ft._highpFloatSupported=g.precision!==0;let A=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Ft._highpIntSupported=A.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Jr(u,["OES_standard_derivatives"]),this._blendMinmax=!!Jr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Jr(u,["OES_element_index_uint"]),this._depthTexture=!!Jr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Jr(u,["EXT_frag_depth"]),this._debugShaders=Jr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Jr(u,["OES_texture_float"]),this._textureHalfFloat=!!Jr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Jr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Jr(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Jr(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Jr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Jr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Jr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Jr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Jr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Jr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Jr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Jr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Jr(u,["EXT_texture_compression_bptc"]),su.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let _=r?Jr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=_,Ft._maximumTextureFilterAnisotropy=l(_)?u.getParameter(_.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let C,y,E,I,x,S,w,v,P,N;if(c){let T=this;C=function(){return T._gl.createVertexArray()},y=function(B){T._gl.bindVertexArray(B)},E=function(B){T._gl.deleteVertexArray(B)},I=function(B,R,O,U,k){u.drawElementsInstanced(B,R,O,U,k)},x=function(B,R,O,U){u.drawArraysInstanced(B,R,O,U)},S=function(B,R){u.vertexAttribDivisor(B,R)},w=function(B){u.drawBuffers(B)}}else v=Jr(u,["OES_vertex_array_object"]),l(v)&&(C=function(){return v.createVertexArrayOES()},y=function(T){v.bindVertexArrayOES(T)},E=function(T){v.deleteVertexArrayOES(T)}),P=Jr(u,["ANGLE_instanced_arrays"]),l(P)&&(I=function(T,B,R,O,U){P.drawElementsInstancedANGLE(T,B,R,O,U)},x=function(T,B,R,O){P.drawArraysInstancedANGLE(T,B,R,O)},S=function(T,B){P.vertexAttribDivisorANGLE(T,B)}),N=Jr(u,["WEBGL_draw_buffers"]),l(N)&&(w=function(T){N.drawBuffersWEBGL(T)});this.glCreateVertexArray=C,this.glBindVertexArray=y,this.glDeleteVertexArray=E,this.glDrawElementsInstanced=I,this.glDrawArraysInstanced=x,this.glVertexAttribDivisor=S,this.glDrawBuffers=w,this._vertexArrayObject=!!v,this._instancedArrays=!!P,this._drawBuffers=!!N,Ft._maximumDrawBuffers=this.drawBuffers?u.getParameter(ee.MAX_DRAW_BUFFERS):1,Ft._maximumColorAttachments=this.drawBuffers?u.getParameter(ee.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new G(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let L=new NP,p=new Fc(this),b=ze.fromCache();this._defaultPassState=p,this._defaultRenderState=b,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=L,this._currentRenderState=b,this._currentPassState=p,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let T=0;T<Ft._maximumVertexAttributes;T++)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={},ze.apply(u,b,p)}function TOe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new ue("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 ue("The browser supports WebGL, but initialization failed.");return r}function SOe(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 BOe(e,t,n,i){let o=`${SOe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function wOe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ue(BOe(e,t,n,i))}function DOe(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 vOe(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,DOe(e,o,t))}return i}function Jr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var POe={};Object.defineProperties(cu.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=vOe(this._originalGLContext,e?wOe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Bt({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 Bt({context:this,pixelFormat:qe.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 Bt({context:this,pixelFormat:qe.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 Kr({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 POe}}});function Ure(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,o,t,r,n,i)}var _W;typeof WebGLRenderingContext<"u"&&(_W=[ee.BACK]);function wz(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=_W;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var ROe=new ai;cu.prototype.clear=function(e,t){e=e??ROe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(G.equals(this._clearColor,o)||(G.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;Ure(this,a,t,!0);let c=e.framebuffer??t.framebuffer;wz(this,c),n.clear(i)};function MOe(e,t,n,i,o){wz(e,t),Ure(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function NOe(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??M.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.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()}cu.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,MOe(this,o,t,n,r),NOe(this,e,n,i)};cu.prototype.beginFrame=function(){};cu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=_W;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)};cu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??V.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=Ge.UNSIGNED_BYTE,c=qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=ut.createPixelBuffer({context:this,sizeInBytes:qe.textureSizeInBytes(c,a,o,r),usage:Oe.DYNAMIC_READ});return wz(this,s),u._bind(),t.readPixels(n,i,o,r,c,Ge.toWebGLConstant(a,this),0),u._unBind(),u};cu.prototype.readPixels=function(e){let t=this._gl;e=e??V.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=Ge.UNSIGNED_BYTE,c=qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=qe.createTypedArray(c,a,o,r);return wz(this,s),t.readPixels(n,i,o,r,qe.RGBA,Ge.toWebGLConstant(a,this),u),u};var Gre={position:0,textureCoordinates:1};cu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ht({attributes:{position:new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Pe.TRIANGLES});e=oi.fromGeometry({context:this,geometry:t,attributeLocations:Gre,bufferUsage:Oe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};cu.prototype.createViewportQuadCommand=function(e,t){return t=t??V.EMPTY_OBJECT,new et({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Pe.TRIANGLES,renderState:t.renderState,shaderProgram:sn.fromCache({context:this,vertexShaderSource:dE,fragmentShaderSource:e,attributeLocations:Gre}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};cu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};function CW(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(CW.prototype,{object:{get:function(){return this._pickObjects.get(this.key)},set:function(e){this._pickObjects.set(this.key,e)}}});CW.prototype.destroy=function(){this._pickObjects.delete(this.key)};cu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ue("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new CW(this._pickObjects,t,G.fromRgba(t))};cu.prototype.isDestroyed=function(){return!1};cu.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(),de(this)};var bE=cu;function fx(e){e=e??V.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 os({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new os({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}fx.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};fx.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};fx.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)};fx.prototype.isDestroyed=function(){return!1};fx.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),de(this)};var LP=fx;var lu={RGBA4:ee.RGBA4,RGBA8:ee.RGBA8,RGBA16F:ee.RGBA16F,RGBA32F:ee.RGBA32F,RGB5_A1:ee.RGB5_A1,RGB565:ee.RGB565,DEPTH_COMPONENT16:ee.DEPTH_COMPONENT16,STENCIL_INDEX8:ee.STENCIL_INDEX8,DEPTH_STENCIL:ee.DEPTH_STENCIL,DEPTH24_STENCIL8:ee.DEPTH24_STENCIL8,validate:function(e){return e===lu.RGBA4||e===lu.RGBA8||e===lu.RGBA16F||e===lu.RGBA32F||e===lu.RGB5_A1||e===lu.RGB565||e===lu.DEPTH_COMPONENT16||e===lu.STENCIL_INDEX8||e===lu.DEPTH_STENCIL||e===lu.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ee.FLOAT?lu.RGBA32F:e===ee.HALF_FLOAT_OES?lu.RGBA16F:lu.RGBA8}},pl=Object.freeze(lu);function OP(e){e=e??V.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ft.maximumRenderbufferSize,o=e.format??pl.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(OP.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});OP.prototype._getRenderbuffer=function(){return this._renderbuffer};OP.prototype.isDestroyed=function(){return!1};OP.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),de(this)};var Ku=OP;function ea(e){e=e??V.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(ea.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}}});ea.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])};ea.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ge.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??qe.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 Bt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:Jt.NEAREST}),this._numSamples>1){let a=pl.getColorFormat(o);this._colorRenderbuffers[s]=new Ku({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Bt({context:e,width:t,height:n,pixelFormat:qe.DEPTH_STENCIL,pixelDatatype:Ge.UNSIGNED_INT_24_8,sampler:Jt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Ku({context:e,width:t,height:n,format:pl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Ku({context:e,width:t,height:n,format:pl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Bt({context:e,width:t,height:n,pixelFormat:qe.DEPTH_COMPONENT,pixelDatatype:Ge.UNSIGNED_INT,sampler:Jt.NEAREST}):this._depthRenderbuffer=new Ku({context:e,width:t,height:n,format:pl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new LP({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 os({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};ea.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};ea.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ea.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};ea.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ea.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ea.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ea.prototype.getDepthTexture=function(){return this._depthTexture};ea.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ea.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ea.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ea.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ea.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ea.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ea.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ea.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ea.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 Ci=ea;var xE={VERTEX:0,FRAGMENT:1,BOTH:2};xE.includesVertexShader=function(e){return e===xE.VERTEX||e===xE.BOTH};xE.includesFragmentShader=function(e){return e===xE.FRAGMENT||e===xE.BOTH};var pe=Object.freeze(xE);function yW(e){this.name=e,this.fields=[]}yW.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};yW.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var FP=yW;function EW(e){this.signature=e,this.body=[]}EW.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}`)};EW.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var QP=EW;function LOe(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 ei=LOe;function gl(){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(gl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});gl.prototype.addDefine=function(e,t,n){n=n??pe.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),pe.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};gl.prototype.addStruct=function(e,t,n){this._structs[e]=new FP(t),pe.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};gl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};gl.prototype.addFunction=function(e,t,n){this._functions[e]=new QP(t),pe.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};gl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};gl.prototype.addUniform=function(e,t,n){n=n??pe.BOTH;let i=`uniform ${e} ${t};`;pe.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};gl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};gl.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+=FOe(e),i};gl.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}`)};gl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?ei(t,e):t.push(e)};gl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?ei(t,e):t.push(e)};gl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=OOe(this),i=QOe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
`),r=new We({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
`),a=new We({defines:this._fragmentShaderParts.defineLines,sources:[s]});return sn.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};gl.prototype.clone=function(){return Ve(this,!0)};function OOe(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(),ei(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),ei(n,a);return{vertexLines:t,fragmentLines:n}}function FOe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function QOe(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(),ei(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),ei(n,a);return{vertexLines:t,fragmentLines:n}}var xp=gl;function Dz(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new bE(this._canvas,Ve(e?.contextOptions)),this._canvases=[]}Dz.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,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},s=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){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,u,f)}}})};Dz.prototype.destroy=function(){this._context.destroy(),de(this)};Dz.prototype.isDestroyed=function(){return!1};var kP=Dz;function TE(e){e=e??V.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(ee.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}TE.create=function(e){return new TE(e)};TE.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ee.SYNC_STATUS)};TE.prototype.isDestroyed=function(){return!1};TE.prototype.destroy=function(){return this._gl.deleteSync(this._sync),de(this)};TE.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(o,r,s){return()=>{n.getStatus()===ee.SIGNALED?o():s<=0?r(new ue("Wait for signal timeout")):e(i(o,r,s-1))}}return new Promise((o,r)=>{e(i(o,r,t))})};var UP=TE;function SE(e){e=e??V.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=qe.RGBA,pixelDatatype:o=Ge.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Jt}=e;if(!t.webgl2)throw new Ae("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let h=e.preMultiplyAlpha||i===qe.RGB||i===qe.LUMINANCE,m=qe.toInternalFormat(i,o,t),g=qe.isCompressedFormat(m),A=t._gl,_=qe.texture3DSizeInBytes(i,o,c,u,f);if(this._id=e.id??jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=A.TEXTURE_3D,this._texture=A.createTexture(),this._internalFormat=m,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._depth=f,this._dimensions=new d(c,u,f),this._hasMipmap=!1,this._sizeInBytes=_,this._preMultiplyAlpha=h,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,zre(this,a),A.activeTexture(A.TEXTURE0),A.bindTexture(this._textureTarget,this._texture),l(n)){if(s?A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,A.NONE):A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,A.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new Ae("For Texture3D, options.source.arrayBufferView must be defined");kOe(this,n),this._initialized=!0}else UOe(this);A.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:u,pixelDatatype:f,flipY:h}=e,m=qe.alignmentInBytes(u,f,s);i.pixelStorei(i.UNPACK_ALIGNMENT,m),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 A=1;if(t.mipLevels&&t.mipLevels.length&&(A=t.mipLevels.length+1),i.texStorage3D(o,A,r,s,a,c),i.texSubImage3D(o,0,0,0,0,s,a,c,u,Ge.toWebGLConstant(f,n),g),A>1){let _=s,C=a,y=c;for(let E=0;E<t.mipLevels.length;++E)_=IW(_),C=IW(C),y=IW(y),i.texSubImage3D(o,E+1,0,0,0,_,C,y,u,Ge.toWebGLConstant(f,n),t.mipLevels[E])}}function IW(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function UOe(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,Ge.toWebGLConstant(e._pixelDatatype,t),null)}SE.create=function(e){return new SE(e)};Object.defineProperties(SE.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){zre(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 zre(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ge.FLOAT&&!r.textureFloatLinear||a===Ge.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Kt.NEAREST_MIPMAP_NEAREST:Kt.NEAREST,i=mi.NEAREST),qe.isDepthFormat(s)&&(n=Kt.NEAREST,i=mi.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}SE.prototype.generateMipmap=function(e){e=e??ed.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)};SE.prototype.isDestroyed=function(){return!1};SE.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),de(this)};var bW=SE;function GP({x:e,y:t,width:n,height:i}){this.rectangle=new Xe(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function xW({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new GP({x:n,y:n,width:e-2*n,height:t-2*n})}xW.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};xW.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 GP({x:i.x,y:i.y,width:t,height:r});let f=s-c;return f>0&&(e.childNode2=new GP({x:i.x+t+c,y:i.y,width:f,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new GP({x:i.x,y:i.y,width:o,height:n});let u=a-c;return u>0&&(e.childNode2=new GP({x:i.x,y:i.y+n+c,width:o,height:u})),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 dx=xW;var Vre=16;function _l(e){e=e??V.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new F(Vre,Vre);this._pixelFormat=e.pixelFormat??qe.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=jn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(_l.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}}});_l.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new Xe),!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,u=i.y,f=this._subRegions.get(e);if(l(f)){let h=this._rectangles[f];c+=h.x,u+=h.y}return t.x=c/o,t.y=u/r,t.width=s/o,t.height=a/r,t};_l.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new Bt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,c=s._textureTarget,u=this._texture,f=new os({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),f._bind();let h=this.rectangles,m=this._subRegions;for(let g=0;g<h.length;++g){let A=i[g],_=h[g];if(!l(A)||!l(_)||l(m.get(g)))continue;let{x:C,y,width:E,height:I}=A;a.copyTexSubImage2D(c,0,C,y,_.x,_.y,E,I)}return a.bindTexture(c,null),s._initialized=!0,f._unBind(),f.destroy(),s};_l.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,u=i.map((E,I)=>new Hre({index:I,image:E})).filter((E,I)=>l(E.image)&&!l(c.get(I))),f=0,h=0,m=0;for(let E=t;E<o.length;++E){let{width:I,height:x}=o[E].image;f=Math.max(f,I),h=Math.max(h,x),m+=I*x,u.push(o[E])}s=Math.max(f,s),a=Math.max(h,a),e.webgl2||(s=D.nextPowerOfTwo(s),a=D.nextPowerOfTwo(a));let g=m,A=1;for(;g/s/a>=1;)A*=2,s>a?a*=A:s*=A;u.sort(({image:E},{image:I})=>I.height*I.width-E.height*E.width);let _=new Array(this._nextIndex);for(let E of this._subRegions.keys())l(c.get(E))&&(_[E]=i[E]);let C,y=!1;for(;!y;){C=new dx({height:a,width:s,borderPadding:n});let E;for(E=0;E<u.length;++E){let{index:I,image:x}=u[E];if(!l(x))continue;let S=C.pack(I,x);if(!l(S)){s>a?a*=2:s*=2;break}_[I]=S.rectangle}y=E===u.length}this._texturePacker=C,this._texture=this._copyFromTexture(e,s,a,_),r.destroy(),this._rectangles=_,this._guid=jn()};_l.prototype.getImageIndex=function(e){return this._indexById.get(e)};_l.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 Hre({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}_l.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new Hre({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};_l.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};_l.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 Bt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new dx({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function GOe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof Be)&&(e=Be.createIfNeeded(e).fetchImage()),e}_l.prototype.addImage=function(e,t,n,i){let o=this._indexPromiseById.get(e),r=this._indexById.get(e);return l(o)?o:l(r)?Promise.resolve(r):(r=this._nextIndex++,this._indexById.set(e,r),o=(async()=>{let a=await GOe(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)};_l.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};_l.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new ue(`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}))};_l.prototype.isDestroyed=function(){return!1};_l.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),de(this)};var BE=_l;function Ca(e,t,n,i){let o=Ca._verifyAttributes(t);n=n??0;let r=[],s={},a,c,u=o.length;for(let h=0;h<u;++h){let m=o[h];if(m.vertexBuffer){r.push(m);continue}c=m.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(m)}function f(h,m){return q.getSizeInBytes(m.componentDatatype)-q.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let h=Ca._vertexSizeInBytes(a),m=a[0].usage,g={vertexSizeInBytes:h,vertexBuffer:void 0,usage:m,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ca._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)}Ca._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??q.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Oe.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};Ca._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*q.getSizeInBytes(a.componentDatatype)}let i=n>0?q.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ca._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/q.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*q.getSizeInBytes(a)}return n};Ca.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];Ca._resize(o,this._size),Ca._appendWriters(this.writers,o)}TW(this)};Ca._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=q.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var zOe=[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}}];Ca._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]=zOe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ca.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=VOe(this,i)||t;if(t||!l(this.va)){TW(this);let s=this.va=[],a=D.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=u*(i.vertexSizeInBytes*a);Ca._appendAttributes(f,i,h,this._instanced)}f=f.concat(this._precreated),s.push({va:new oi({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function VOe(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=ut.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ca._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})}};Ca.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)HOe(n[i],e,t)};function HOe(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)}}Ca.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function TW(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}Ca.prototype.isDestroyed=function(){return!1};Ca.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 TW(this),de(this)};var Tp=Ca;function YOe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Be.createIfNeeded(t.positiveX).fetchImage(i),Be.createIfNeeded(t.negativeX).fetchImage(i),Be.createIfNeeded(t.positiveY).fetchImage(i),Be.createIfNeeded(t.negativeY).fetchImage(i),Be.createIfNeeded(t.positiveZ).fetchImage(i),Be.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Kr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var zP=YOe;function H_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new _e,this.setValue(e)}Object.defineProperties(H_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});H_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};H_.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))}};H_.prototype.equals=function(e){return this===e||e instanceof H_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};H_.prototype.valueOf=function(){return this._value};H_.prototype.toString=function(){return String(this._value)};var li=H_;function WOe(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 jOe(e){return new li(e)}function qOe(e,t,n){return WOe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??jOe)}var me=qOe;function VP(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(VP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),image:me("image"),scale:me("scale"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),color:me("color"),rotation:me("rotation"),alignedAxis:me("alignedAxis"),sizeInMeters:me("sizeInMeters"),width:me("width"),height:me("height"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),imageSubRegion:me("imageSubRegion"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});VP.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 VP(this)};VP.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 Qc=VP;function wE(){this._array=[],this._hash={}}Object.defineProperties(wE.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});wE.prototype.contains=function(e){return l(this._hash[e])};wE.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};wE.prototype.get=function(e){return this._hash[e]};wE.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};wE.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Pt=wE;function Ju(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Ju.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}}});Ju.packedLength=2;Ju.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Ju.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ju),n.near=e[t++],n.far=e[t],n};Ju.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Ju.clone=function(e,t){if(l(e))return l(t)||(t=new Ju),t.near=e.near,t.far=e.far,t};Ju.prototype.clone=function(e){return Ju.clone(this,e)};Ju.prototype.equals=function(e){return Ju.equals(this,e)};var Qt=Ju;function id(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}id.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 id(e.near,e.nearValue,e.far,e.farValue)};id.packedLength=4;id.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};id.unpack=function(e,t,n){return t=t??0,l(n)||(n=new id),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};id.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};id.prototype.clone=function(e){return id.clone(this,e)};id.prototype.equals=function(e){return id.equals(this,e)};var Ht=id;var DE={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},$e=Object.freeze(DE);function od(e){return e===DE.CLAMP_TO_GROUND||e===DE.CLAMP_TO_3D_TILE||e===DE.CLAMP_TO_TERRAIN}function hx(e){return e===DE.RELATIVE_TO_GROUND||e===DE.RELATIVE_TO_3D_TILE||e===DE.RELATIVE_TO_TERRAIN}var KOe={CENTER:0,LEFT:1,RIGHT:-1},Mi=Object.freeze(KOe);var JOe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Gn=Object.freeze(JOe);var XOe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),mt=XOe;function Ih(){Ae.throwInstantiationError()}Object.defineProperties(Ih.prototype,{isConstant:{get:Ae.throwInstantiationError},definitionChanged:{get:Ae.throwInstantiationError}});Ih.prototype.getValue=Ae.throwInstantiationError;Ih.prototype.equals=Ae.throwInstantiationError;Ih.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Ih.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(!Ih.equals(e[i],t[i]))return!1;return!0};Ih.isConstant=function(e){return!l(e)||e.isConstant};Ih.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Ih.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Ih.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var j=Ih;var ZOe={LEFT:-1,NONE:0,RIGHT:1},Lr=Object.freeze(ZOe);var $Oe=G.WHITE,e1e=d.ZERO,t1e=$e.NONE,n1e=F.ZERO,i1e=1,o1e=0,r1e=d.ZERO,s1e=Mi.CENTER,a1e=Gn.CENTER,c1e=!1,l1e=Lr.NONE,u1e=new d,f1e=new G,d1e=new d,h1e=new F,A1e=new Ht,m1e=new Ht,p1e=new Ht,g1e=new Xe,_1e=new Qt;function Yre(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Y_(e,t){t.collectionChanged.addEventListener(Y_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Pt,this._onCollectionChanged(t,t.values,[],[])}Y_.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,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),h;if(f&&(h=j.getValueOrUndefined(s._position,e,u1e),c=j.getValueOrUndefined(a._image,e),f=l(h)&&l(c)),!f){SW(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,r.billboard=u,r.textureValue=void 0),u.show=f,u.position=h,u.color=j.getValueOrDefault(a._color,e,$Oe,f1e),u.eyeOffset=j.getValueOrDefault(a._eyeOffset,e,e1e,d1e),u.heightReference=j.getValueOrDefault(a._heightReference,e,t1e),u.pixelOffset=j.getValueOrDefault(a._pixelOffset,e,n1e,h1e),u.scale=j.getValueOrDefault(a._scale,e,i1e),u.rotation=j.getValueOrDefault(a._rotation,e,o1e),u.alignedAxis=j.getValueOrDefault(a._alignedAxis,e,r1e),u.horizontalOrigin=j.getValueOrDefault(a._horizontalOrigin,e,s1e),u.verticalOrigin=j.getValueOrDefault(a._verticalOrigin,e,a1e),u.width=j.getValueOrUndefined(a._width,e),u.height=j.getValueOrUndefined(a._height,e),u.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,A1e),u.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,m1e),u.pixelOffsetScaleByDistance=j.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,p1e),u.sizeInMeters=j.getValueOrDefault(a._sizeInMeters,e,c1e),u.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,_1e),u.disableDepthTestDistance=j.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=j.getValueOrDefault(a._splitDirection,e,l1e),r.textureValue!==c&&(u.image=c,r.textureValue=c);let m=j.getValueOrUndefined(a._imageSubRegion,e,g1e);l(m)&&u.setImageSubRegion(u.image,m)}return!0};Y_.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return mt.FAILED;let i=n.billboard;if(i.heightReference===$e.NONE)t.center=d.clone(i.position,t.center);else{if(!l(i._clampedPosition))return mt.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,mt.DONE};Y_.prototype.isDestroyed=function(){return!1};Y_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Y_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return de(this)};Y_.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 Yre(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 Yre(r)):(SW(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],SW(s.get(r.id),r,a),s.remove(r.id)};function SW(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var HP=Y_;var C1e=new d;function em(e){e=e??V.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=d.clone(t),this._max=d.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}em.fromDimensions=function(e){e=e??V.EMPTY_OBJECT;let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new em({minimum:d.negate(n,new d),maximum:n,offsetAttribute:e.offsetAttribute})};em.fromAxisAlignedBoundingBox=function(e){return new em({minimum:e.minimum,maximum:e.maximum})};em.packedLength=2*d.packedLength+1;em.pack=function(e,t,n){return n=n??0,d.pack(e._min,t,n),d.pack(e._max,t,n+d.packedLength),t[n+d.packedLength*2]=e._offsetAttribute??-1,t};var jre=new d,qre=new d,Wre={minimum:jre,maximum:qre,offsetAttribute:void 0};em.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,jre),o=d.unpack(e,t+d.packedLength,qre),r=e[t+d.packedLength*2];return l(n)?(n._min=d.clone(i,n._min),n._max=d.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Wre.offsetAttribute=r===-1?void 0:r,new em(Wre))};em.createGeometry=function(e){let t=e._min,n=e._max;if(d.equals(t,n))return;let i=new pn,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 ve({componentDatatype:q.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=d.subtract(n,t,C1e),a=d.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===un.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new ht({attributes:i,indices:o,primitiveType:Pe.LINES,boundingSphere:new le(d.ZERO,a),offsetAttribute:e._offsetAttribute})};var bh=em;function Ax(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([G.floatToByte(e),G.floatToByte(t),G.floatToByte(n),G.floatToByte(i)])}Object.defineProperties(Ax.prototype,{componentDatatype:{get:function(){return q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});Ax.fromColor=function(e){return new Ax(e.red,e.green,e.blue,e.alpha)};Ax.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};Ax.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 Xt=Ax;function YP(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(YP.prototype,{componentDatatype:{get:function(){return q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});YP.fromDistanceDisplayCondition=function(e){return new YP(e.near,e.far)};YP.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Kn=YP;function y1e(e){e=e??V.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Rt=y1e;function Cr(e){e=e??V.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(Cr.prototype,{isEmpty:{get:function(){let e=J.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var mx={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Cr.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):(mx.start=i,mx.stop=o,mx.isStartIncluded=r,mx.isStopIncluded=s,mx.data=a,new Cr(mx))};Cr.toIso8601=function(e,t){return`${J.toIso8601(e.start,t)}/${J.toIso8601(e.stop,t)}`};Cr.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 Cr(e)};Cr.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)))};Cr.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)))};Cr.intersect=function(e,t,n,i){if(!l(t))return Cr.clone(Cr.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=J.greaterThanOrEquals(s,o)&&J.greaterThanOrEquals(r,s),u=!c&&J.lessThanOrEquals(s,o)&&J.lessThanOrEquals(o,a);if(!c&&!u)return Cr.clone(Cr.EMPTY,n);let f=e.isStartIncluded,h=e.isStopIncluded,m=t.isStartIncluded,g=t.isStopIncluded,A=J.lessThan(r,a);return l(n)||(n=new Cr),n.start=c?s:o,n.isStartIncluded=f&&m||!J.equals(s,o)&&(c&&m||u&&f),n.stop=A?r:a,n.isStopIncluded=A?h:h&&g||!J.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};Cr.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};Cr.prototype.clone=function(e){return Cr.clone(this,e)};Cr.prototype.equals=function(e,t){return Cr.equals(this,e,t)};Cr.prototype.equalsEpsilon=function(e,t,n){return Cr.equalsEpsilon(this,e,t,n)};Cr.prototype.toString=function(){return Cr.toIso8601(this)};Cr.EMPTY=Object.freeze(new Cr({start:new J,stop:new J,isStartIncluded:!1,isStopIncluded:!1}));var wn=Cr;var Kre=Object.freeze(J.fromIso8601("0000-01-01T00:00:00Z")),Jre=Object.freeze(J.fromIso8601("9999-12-31T24:00:00Z")),E1e=Object.freeze(new wn({start:Kre,stop:Jre})),I1e={MINIMUM_VALUE:Kre,MAXIMUM_VALUE:Jre,MAXIMUM_INTERVAL:E1e},Ke=I1e;function WP(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(WP.prototype,{componentDatatype:{get:function(){return q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});WP.fromCartesian3=function(e){return new WP(e.x,e.y,e.z)};WP.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 po=WP;function vz(e){e=e??!0,this.value=vz.toValue(e)}Object.defineProperties(vz.prototype,{componentDatatype:{get:function(){return q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});vz.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var xn=vz;var jP=`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 qP=`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 KP=`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 JP=`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 XP=`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 ZP=`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 b1e={ADD:ee.FUNC_ADD,SUBTRACT:ee.FUNC_SUBTRACT,REVERSE_SUBTRACT:ee.FUNC_REVERSE_SUBTRACT,MIN:ee.MIN,MAX:ee.MAX},gc=Object.freeze(b1e);var x1e={ZERO:ee.ZERO,ONE:ee.ONE,SOURCE_COLOR:ee.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ee.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ee.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ee.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ee.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ee.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ee.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ee.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ee.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ee.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ee.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ee.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ee.SRC_ALPHA_SATURATE},Wo=Object.freeze(x1e);var T1e={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:gc.ADD,equationAlpha:gc.ADD,functionSourceRgb:Wo.SOURCE_ALPHA,functionSourceAlpha:Wo.ONE,functionDestinationRgb:Wo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Wo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:gc.ADD,equationAlpha:gc.ADD,functionSourceRgb:Wo.ONE,functionSourceAlpha:Wo.ONE,functionDestinationRgb:Wo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Wo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:gc.ADD,equationAlpha:gc.ADD,functionSourceRgb:Wo.SOURCE_ALPHA,functionSourceAlpha:Wo.ONE,functionDestinationRgb:Wo.ONE,functionDestinationAlpha:Wo.ONE})},dn=Object.freeze(T1e);var S1e={FRONT:ee.FRONT,BACK:ee.BACK,FRONT_AND_BACK:ee.FRONT_AND_BACK},Ni=Object.freeze(S1e);function px(e){e=e??V.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(px.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}}});px.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(`
`)};px.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};px.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ve(this.renderState,!1);return e?(t.depthMask=!1,t.blending=dn.ALPHA_BLEND):t.depthMask=!0,t};px.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=dn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Ni.BACK}),l(n)&&(i=St(n,i,!0)),i};var yo=px;var $P=`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 eR=`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 tR=`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 nR=`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 iR=`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 oR=`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 rR=`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 sR=`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 aR=`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 cR=`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 lR=`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 uR=`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 fR=`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 dR=`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 hR=`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 AR=`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 mR=`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 pR=`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 gR=`// 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 Je(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??Kt.LINEAR,this._magnificationFilter=e.magnificationFilter??mi.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,B1e(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(Je._uniformList[this.type])||(Je._uniformList[this.type]=Object.keys(this._uniforms))}Je._uniformList={};Je.fromType=function(e,t){let n=new Je({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Je.fromTypeAsync=async function(e,t){let n=[],i=new Je({fabric:{type:e,uniforms:t}});if($re(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function $re(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];$re(o,t)}}Je.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};Je.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 u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(_){return _.bufferView}),u=u[0]);let h=new Jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),m;l(u.internalFormat)?m=new Bt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:h}):m=new Bt({context:e,source:u,sampler:h});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=m;let A=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(A)){let _=this.uniforms[A];_.x=m._width,_.y=m._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 u=c.images,f=new Kr({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}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)};Je.prototype.isDestroyed=function(){return!1};Je.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 de(this)};function B1e(e,t){e=e??V.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Ve(e.fabric??V.EMPTY_OBJECT),t.fabric=Ve(e.fabric??V.EMPTY_OBJECT),t._template.uniforms=Ve(t._template.uniforms??V.EMPTY_OBJECT),t._template.materials=Ve(t._template.materials??V.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Je._materialCache.getMaterial(t.type);if(l(i)){let r=Ve(i.fabric,!0);t._template=St(t._template,r,!0),n=i.translucent}P1e(t),M1e(t),F1e(t),k1e(t),l(i)||Je._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 BW(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 Xre(e,t){}function w1e(e,t){}var D1e=["type","materials","uniforms","components","source"],v1e=["diffuse","specular","shininess","normal","emission","alpha"];function P1e(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;BW(t,D1e,Xre,!0),BW(o,v1e,Xre,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);BW(n,r,w1e,!1)}function R1e(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 M1e(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&&R1e(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 Zre={mat2:zi,mat3:X,mat4:M},N1e=/\.ktx2$/i;function L1e(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===Je.DefaultImageId;t=r;let c=n._textures[e],u,f;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 Jt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Bt({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 Bt&&r!==c){n._texturePaths[e]=void 0;let h=n._textures[e];l(h)&&h!==n._defaultTexture&&h.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.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,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.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}ese(n,e)}}}function ese(e,t){let i=e.uniforms[t];if(i===Je.DefaultImageId)return Promise.resolve();let o=Be.createIfNeeded(i);if(!(o instanceof Be))return Promise.resolve();let r=Be.createIfNeeded(e._texturePaths[t]);if(!(!l(r)||r.url!==o.url))return Promise.resolve();let a;return N1e.test(o.url)?a=su(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 u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function O1e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Kr){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),tse(t,e)}}function tse(e,t){let i=e.uniforms[t];if(i===Je.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=[Be.createIfNeeded(i.positiveX).fetchImage(),Be.createIfNeeded(i.negativeX).fetchImage(),Be.createIfNeeded(i.positiveY).fetchImage(),Be.createIfNeeded(i.negativeY).fetchImage(),Be.createIfNeeded(i.positiveZ).fetchImage(),Be.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 F1e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&nse(e,n)}function nse(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=Q1e(o),s;if(r==="channels")s=_R(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;U1e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},nse(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=_R(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(L1e(t)),e._initializationPromises.push(ese(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(O1e(t)),e._initializationPromises.push(tse(e,t));else if(r.indexOf("mat")!==-1){let u=new Zre[r];e._uniforms[c]=function(){return Zre[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Q1e(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 Be||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Je.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 k1e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Je({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=St(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;_R(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=_R(e,i,a)}}function _R(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,u,f){return u||f?c:(o+=1,n)}),o}function U1e(e,t,n){return _R(e,t,t,n)}Je._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Je.DefaultImageId="czm_defaultImage";Je.DefaultCubeMapId="czm_defaultCubeMap";Je.ColorType="Color";Je._materialCache.addMaterial(Je.ColorType,{fabric:{type:Je.ColorType,uniforms:{color:new G(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Je.ImageType="Image";Je._materialCache.addMaterial(Je.ImageType,{fabric:{type:Je.ImageType,uniforms:{image:Je.DefaultImageId,repeat:new F(1,1),color:new G(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}});Je.DiffuseMapType="DiffuseMap";Je._materialCache.addMaterial(Je.DiffuseMapType,{fabric:{type:Je.DiffuseMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",repeat:new F(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Je.AlphaMapType="AlphaMap";Je._materialCache.addMaterial(Je.AlphaMapType,{fabric:{type:Je.AlphaMapType,uniforms:{image:Je.DefaultImageId,channel:"a",repeat:new F(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Je.SpecularMapType="SpecularMap";Je._materialCache.addMaterial(Je.SpecularMapType,{fabric:{type:Je.SpecularMapType,uniforms:{image:Je.DefaultImageId,channel:"r",repeat:new F(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Je.EmissionMapType="EmissionMap";Je._materialCache.addMaterial(Je.EmissionMapType,{fabric:{type:Je.EmissionMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",repeat:new F(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Je.BumpMapType="BumpMap";Je._materialCache.addMaterial(Je.BumpMapType,{fabric:{type:Je.BumpMapType,uniforms:{image:Je.DefaultImageId,channel:"r",strength:.8,repeat:new F(1,1)},source:eR},translucent:!1});Je.NormalMapType="NormalMap";Je._materialCache.addMaterial(Je.NormalMapType,{fabric:{type:Je.NormalMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",strength:.8,repeat:new F(1,1)},source:cR},translucent:!1});Je.GridType="Grid";Je._materialCache.addMaterial(Je.GridType,{fabric:{type:Je.GridType,uniforms:{color:new G(0,1,0,1),cellAlpha:.1,lineCount:new F(8,8),lineThickness:new F(1,1),lineOffset:new F(0,0)},source:aR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Je.StripeType="Stripe";Je._materialCache.addMaterial(Je.StripeType,{fabric:{type:Je.StripeType,uniforms:{horizontal:!0,evenColor:new G(1,1,1,.5),oddColor:new G(0,0,1,.5),offset:0,repeat:5},source:mR},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Je.CheckerboardType="Checkerboard";Je._materialCache.addMaterial(Je.CheckerboardType,{fabric:{type:Je.CheckerboardType,uniforms:{lightColor:new G(1,1,1,.5),darkColor:new G(0,0,0,.5),repeat:new F(5,5)},source:tR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Je.DotType="Dot";Je._materialCache.addMaterial(Je.DotType,{fabric:{type:Je.DotType,uniforms:{lightColor:new G(1,1,0,.75),darkColor:new G(0,1,1,.75),repeat:new F(5,5)},source:nR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Je.WaterType="Water";Je._materialCache.addMaterial(Je.WaterType,{fabric:{type:Je.WaterType,uniforms:{baseWaterColor:new G(.2,.3,.6,1),blendColor:new G(0,1,.699,1),specularMap:Je.DefaultImageId,normalMap:Je.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:gR},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Je.RimLightingType="RimLighting";Je._materialCache.addMaterial(Je.RimLightingType,{fabric:{type:Je.RimLightingType,uniforms:{color:new G(1,0,0,.7),rimColor:new G(1,1,1,.4),width:.3},source:hR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Je.FadeType="Fade";Je._materialCache.addMaterial(Je.FadeType,{fabric:{type:Je.FadeType,uniforms:{fadeInColor:new G(1,0,0,1),fadeOutColor:new G(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new F(.5,.5)},source:sR},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Je.PolylineArrowType="PolylineArrow";Je._materialCache.addMaterial(Je.PolylineArrowType,{fabric:{type:Je.PolylineArrowType,uniforms:{color:new G(1,1,1,1)},source:lR},translucent:!0});Je.PolylineDashType="PolylineDash";Je._materialCache.addMaterial(Je.PolylineDashType,{fabric:{type:Je.PolylineDashType,uniforms:{color:new G(1,0,1,1),gapColor:new G(0,0,0,0),dashLength:16,dashPattern:255},source:uR},translucent:!0});Je.PolylineGlowType="PolylineGlow";Je._materialCache.addMaterial(Je.PolylineGlowType,{fabric:{type:Je.PolylineGlowType,uniforms:{color:new G(0,.5,1,1),glowPower:.25,taperPower:1},source:fR},translucent:!0});Je.PolylineOutlineType="PolylineOutline";Je._materialCache.addMaterial(Je.PolylineOutlineType,{fabric:{type:Je.PolylineOutlineType,uniforms:{color:new G(1,1,1,1),outlineColor:new G(1,0,0,1),outlineWidth:1},source:dR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Je.ElevationContourType="ElevationContour";Je._materialCache.addMaterial(Je.ElevationContourType,{fabric:{type:Je.ElevationContourType,uniforms:{spacing:100,color:new G(1,0,0,1),width:1},source:oR},translucent:!1});Je.ElevationRampType="ElevationRamp";Je._materialCache.addMaterial(Je.ElevationRampType,{fabric:{type:Je.ElevationRampType,uniforms:{image:Je.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:rR},translucent:!1});Je.SlopeRampMaterialType="SlopeRamp";Je._materialCache.addMaterial(Je.SlopeRampMaterialType,{fabric:{type:Je.SlopeRampMaterialType,uniforms:{image:Je.DefaultImageId},source:AR},translucent:!1});Je.AspectRampMaterialType="AspectRamp";Je._materialCache.addMaterial(Je.AspectRampMaterialType,{fabric:{type:Je.AspectRampMaterialType,uniforms:{image:Je.DefaultImageId},source:$P},translucent:!1});Je.ElevationBandType="ElevationBand";Je._materialCache.addMaterial(Je.ElevationBandType,{fabric:{type:Je.ElevationBandType,uniforms:{heights:Je.DefaultImageId,colors:Je.DefaultImageId},source:iR},translucent:!0});Je.WaterMaskType="WaterMask";Je._materialCache.addMaterial(Je.WaterMaskType,{fabric:{type:Je.WaterMaskType,source:pR,uniforms:{waterColor:new G(1,1,1,1),landColor:new G(0,0,0,0)}},translucent:!1});var uo=Je;function vE(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??vE.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:uo.fromType(uo.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=yo.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(vE.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}}});vE.prototype.getFragmentShaderSource=yo.prototype.getFragmentShaderSource;vE.prototype.isTranslucent=yo.prototype.isTranslucent;vE.prototype.getRenderState=yo.prototype.getRenderState;vE.MaterialSupport={BASIC:Object.freeze({vertexFormat:Re.POSITION_AND_NORMAL,vertexShaderSource:JP,fragmentShaderSource:KP}),TEXTURED:Object.freeze({vertexFormat:Re.POSITION_NORMAL_AND_ST,vertexShaderSource:ZP,fragmentShaderSource:XP}),ALL:Object.freeze({vertexFormat:Re.ALL,vertexShaderSource:qP,fragmentShaderSource:jP})};var xo=vE;var CR=`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 yR=`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 PE=`in vec4 v_color;
void main()
{
out_FragColor = czm_gammaCorrect(v_color);
}
`;var ER=`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 Sp(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?ER:yR,r=i?PE:CR,s=i?Sp.FLAT_VERTEX_FORMAT:Sp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=yo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Sp.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}}});Sp.VERTEX_FORMAT=Re.POSITION_AND_NORMAL;Sp.FLAT_VERTEX_FORMAT=Re.POSITION_ONLY;Sp.prototype.getFragmentShaderSource=yo.prototype.getFragmentShaderSource;Sp.prototype.isTranslucent=yo.prototype.isTranslucent;Sp.prototype.getRenderState=yo.prototype.getRenderState;var hn=Sp;function gx(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(gx.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});gx.prototype.getType=function(e){return"Color"};var G1e=new J;gx.prototype.getValue=function(e,t){return l(e)||(e=J.now(G1e)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,G.WHITE,t.color),t};gx.prototype.equals=function(e){return this===e||e instanceof gx&&j.equals(this._color,e._color)};var jt=gx;function W_(e){e=e??V.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._rectangle=e.rectangle??ce.MAX_VALUE,this._projection=new Gi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(W_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});W_.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};W_.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};W_.prototype.rectangleToNativeRectangle=function(e,t){let n=D.toDegrees(e.west),i=D.toDegrees(e.south),o=D.toDegrees(e.east),r=D.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ce(n,i,o,r)};W_.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=D.toDegrees(o.west),o.south=D.toDegrees(o.south),o.east=D.toDegrees(o.east),o.north=D.toDegrees(o.north),o};W_.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,u=(e+1)*a+o.west,f=o.height/s,h=o.north-t*f,m=o.north-(t+1)*f;return l(i)||(i=new ce(c,m,u,h)),i.west=c,i.south=m,i.east=u,i.north=h,i};W_.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.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+=D.TWO_PI);let u=(c-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new F(u,f)};var Vi=W_;var ise=new d,ose=new d,rse=new he,wW=new d,z1e=new d,sse=new le,V1e=new Vi,IR=[new he,new he,new he,new he],bR=new F,Ts={};Ts.initialize=function(){let e=Ts._initPromise;return l(e)||(e=Be.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){Ts._terrainHeights=t}),Ts._initPromise=e),e};Ts.getMinimumMaximumHeights=function(e,t){t=t??te.default;let n=ase(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(ce.northeast(e,rse),ise),t.cartographicToCartesian(ce.southwest(e,rse),ose),d.midpoint(ose,ise,wW);let a=t.scaleToGeodeticSurface(wW,z1e);if(l(a)){let c=d.distance(wW,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??te.default;let n=ase(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=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,sse),le.union(o,sse,o)};function ase(e){he.fromRadians(e.east,e.north,0,IR[0]),he.fromRadians(e.west,e.north,0,IR[1]),he.fromRadians(e.east,e.south,0,IR[2]),he.fromRadians(e.west,e.south,0,IR[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 u=IR[c];if(V1e.positionToTileXY(u,s,bR),c===0)i=bR.x,o=bR.y;else if(i!==bR.x||o!==bR.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 Si=Ts;function Ya(e,t,n){this.minimum=d.clone(e??d.ZERO),this.maximum=d.clone(t??d.ZERO),l(n)?n=d.clone(n):n=d.midpoint(this.minimum,this.maximum,new d),this.center=n}Ya.fromCorners=function(e,t,n){return l(n)||(n=new Ya),n.minimum=d.clone(e,n.minimum),n.maximum=d.clone(t,n.maximum),n.center=d.midpoint(e,t,n.center),n};Ya.fromPoints=function(e,t){if(l(t)||(t=new Ya),!l(e)||e.length===0)return t.minimum=d.clone(d.ZERO,t.minimum),t.maximum=d.clone(d.ZERO,t.maximum),t.center=d.clone(d.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 m=e[h],g=m.x,A=m.y,_=m.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(A,i),s=Math.max(A,s),o=Math.min(_,o),a=Math.max(_,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=d.midpoint(u,f,t.center),t};Ya.clone=function(e,t){if(l(e))return l(t)?(t.minimum=d.clone(e.minimum,t.minimum),t.maximum=d.clone(e.maximum,t.maximum),t.center=d.clone(e.center,t.center),t):new Ya(e.minimum,e.maximum,e.center)};Ya.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&d.equals(e.minimum,t.minimum)&&d.equals(e.maximum,t.maximum)};var Pz=new d;Ya.intersectPlane=function(e,t){Pz=d.subtract(e.maximum,e.minimum,Pz);let n=d.multiplyByScalar(Pz,.5,Pz),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=d.dot(e.center,i)+t.distance;return r-o>0?qt.INSIDE:r+o<0?qt.OUTSIDE:qt.INTERSECTING};Ya.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};Ya.prototype.clone=function(e){return Ya.clone(this,e)};Ya.prototype.intersectPlane=function(e){return Ya.intersectPlane(this,e)};Ya.prototype.intersectAxisAlignedBoundingBox=function(e){return Ya.intersectAxisAlignedBoundingBox(this,e)};Ya.prototype.equals=function(e){return Ya.equals(this,e)};var Xu=Ya;var DW=new se;function tm(e,t){t=t??te.default,e=t.scaleToGeodeticSurface(e);let n=It.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=d.fromCartesian4(M.getColumn(n,0,DW)),this._yAxis=d.fromCartesian4(M.getColumn(n,1,DW));let i=d.fromCartesian4(M.getColumn(n,2,DW));this._plane=rn.fromPointNormal(e,i)}Object.defineProperties(tm.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 H1e=new Xu;tm.fromPoints=function(e,t){let n=Xu.fromPoints(e,H1e);return new tm(n.center,t)};var cse=new gn,Rz=new d;tm.prototype.projectPointOntoPlane=function(e,t){let n=cse;n.origin=e,d.normalize(e,n.direction);let i=ci.rayPlane(n,this._plane,Rz);if(l(i)||(d.negate(n.direction,n.direction),i=ci.rayPlane(n,this._plane,Rz)),l(i)){let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new F(r,s)}};tm.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};tm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new F);let n=cse;n.origin=e,d.clone(this._plane.normal,n.direction);let i=ci.rayPlane(n,this._plane,Rz);l(i)||(d.negate(n.direction,n.direction),i=ci.rayPlane(n,this._plane,Rz));let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return t.x=r,t.y=s,t};tm.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 Y1e=new d;tm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new d);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=Y1e;return d.multiplyByScalar(o,e.x,s),t=d.add(i,s,t),d.multiplyByScalar(r,e.y,s),d.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};tm.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=tm;function Zi(e,t){this.center=d.clone(e??d.ZERO),this.halfAxes=X.clone(t??X.ZERO)}Zi.packedLength=d.packedLength+X.packedLength;Zi.pack=function(e,t,n){return n=n??0,d.pack(e.center,t,n),X.pack(e.halfAxes,t,n+d.packedLength),t};Zi.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Zi),d.unpack(e,t,n.center),X.unpack(e,t+d.packedLength,n.halfAxes),n};var W1e=new d,j1e=new d,q1e=new d,K1e=new d,J1e=new d,X1e=new d,Z1e=new X,$1e={unitary:new X,diagonal:new X};Zi.fromPoints=function(e,t){if(l(t)||(t=new Zi),!l(e)||e.length===0)return t.halfAxes=X.ZERO,t.center=d.ZERO,t;let n,i=e.length,o=d.clone(e[0],W1e);for(n=1;n<i;n++)d.add(o,e[n],o);let r=1/i;d.multiplyByScalar(o,r,o);let s=0,a=0,c=0,u=0,f=0,h=0,m;for(n=0;n<i;n++)m=d.subtract(e[n],o,j1e),s+=m.x*m.x,a+=m.x*m.y,c+=m.x*m.z,u+=m.y*m.y,f+=m.y*m.z,h+=m.z*m.z;s*=r,a*=r,c*=r,u*=r,f*=r,h*=r;let g=Z1e;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=h;let A=X.computeEigenDecomposition(g,$1e),_=X.clone(A.unitary,t.halfAxes),C=X.getColumn(_,0,K1e),y=X.getColumn(_,1,J1e),E=X.getColumn(_,2,X1e),I=-Number.MAX_VALUE,x=-Number.MAX_VALUE,S=-Number.MAX_VALUE,w=Number.MAX_VALUE,v=Number.MAX_VALUE,P=Number.MAX_VALUE;for(n=0;n<i;n++)m=e[n],I=Math.max(d.dot(C,m),I),x=Math.max(d.dot(y,m),x),S=Math.max(d.dot(E,m),S),w=Math.min(d.dot(C,m),w),v=Math.min(d.dot(y,m),v),P=Math.min(d.dot(E,m),P);C=d.multiplyByScalar(C,.5*(w+I),C),y=d.multiplyByScalar(y,.5*(v+x),y),E=d.multiplyByScalar(E,.5*(P+S),E);let N=d.add(C,y,t.center);d.add(N,E,N);let L=q1e;return L.x=I-w,L.y=x-v,L.z=S-P,d.multiplyByScalar(L,.5,L),X.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var Ase=new d,eFe=new d;function lse(e,t,n,i,o,r,s,a,c,u,f){l(f)||(f=new Zi);let h=f.halfAxes;X.setColumn(h,0,t,h),X.setColumn(h,1,n,h),X.setColumn(h,2,i,h);let m=Ase;m.x=(o+r)/2,m.y=(s+a)/2,m.z=(c+u)/2;let g=eFe;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(u-c)/2;let A=f.center;return m=X.multiplyByVector(h,m,m),d.add(e,m,A),X.multiplyByScale(h,g,h),f}var use=new he,tFe=new d,nFe=new he,iFe=new he,oFe=new he,rFe=new he,sFe=new he,aFe=new d,fse=new d,cFe=new d,dse=new d,lFe=new d,uFe=new F,fFe=new F,dFe=new F,hFe=new F,AFe=new F,mFe=new d,pFe=new d,gFe=new d,_Fe=new d,CFe=new F,yFe=new d,EFe=new d,IFe=new d,bFe=new rn(d.UNIT_X,0);Zi.fromRectangle=function(e,t,n,i,o){t=t??0,n=n??0,i=i??te.default;let r,s,a,c,u,f,h;if(e.width<=D.PI){let v=ce.center(e,use),P=i.cartographicToCartesian(v,tFe),N=new Ss(P,i);h=N.plane;let L=v.longitude,p=e.south<0&&e.north>0?0:v.latitude,b=he.fromRadians(L,e.north,n,nFe),T=he.fromRadians(e.west,e.north,n,iFe),B=he.fromRadians(e.west,p,n,oFe),R=he.fromRadians(e.west,e.south,n,rFe),O=he.fromRadians(L,e.south,n,sFe),U=i.cartographicToCartesian(b,aFe),k=i.cartographicToCartesian(T,fse),z=i.cartographicToCartesian(B,cFe),Q=i.cartographicToCartesian(R,dse),H=i.cartographicToCartesian(O,lFe),W=N.projectPointToNearestOnPlane(U,uFe),Z=N.projectPointToNearestOnPlane(k,fFe),Y=N.projectPointToNearestOnPlane(z,dFe),$=N.projectPointToNearestOnPlane(Q,hFe),K=N.projectPointToNearestOnPlane(H,AFe);return r=Math.min(Z.x,Y.x,$.x),s=-r,c=Math.max(Z.y,W.y),a=Math.min($.y,K.y),T.height=R.height=t,k=i.cartographicToCartesian(T,fse),Q=i.cartographicToCartesian(R,dse),u=Math.min(rn.getPointDistance(h,k),rn.getPointDistance(h,Q)),f=n,lse(N.origin,N.xAxis,N.yAxis,N.zAxis,r,s,a,c,u,f,o)}let m=e.south>0,g=e.north<0,A=m?e.south:g?e.north:0,_=ce.center(e,use).longitude,C=d.fromRadians(_,A,n,i,mFe);C.z=0;let E=Math.abs(C.x)<D.EPSILON10&&Math.abs(C.y)<D.EPSILON10?d.UNIT_X:d.normalize(C,pFe),I=d.UNIT_Z,x=d.cross(E,I,gFe);h=rn.fromPointNormal(C,E,bFe);let S=d.fromRadians(_+D.PI_OVER_TWO,A,n,i,_Fe);s=d.dot(rn.projectPointOntoPlane(h,S,CFe),x),r=-s,c=d.fromRadians(0,e.north,g?t:n,i,yFe).z,a=d.fromRadians(0,e.south,m?t:n,i,EFe).z;let w=d.fromRadians(e.east,A,n,i,IFe);return u=rn.getPointDistance(h,w),f=0,lse(C,x,I,E,r,s,a,c,u,f,o)};Zi.fromTransformation=function(e,t){return l(t)||(t=new Zi),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=X.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Zi.clone=function(e,t){if(l(e))return l(t)?(d.clone(e.center,t.center),X.clone(e.halfAxes,t.halfAxes),t):new Zi(e.center,e.halfAxes)};Zi.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[X.COLUMN0ROW0]+s*o[X.COLUMN0ROW1]+a*o[X.COLUMN0ROW2])+Math.abs(r*o[X.COLUMN1ROW0]+s*o[X.COLUMN1ROW1]+a*o[X.COLUMN1ROW2])+Math.abs(r*o[X.COLUMN2ROW0]+s*o[X.COLUMN2ROW1]+a*o[X.COLUMN2ROW2]),u=d.dot(i,n)+t.distance;return u<=-c?qt.OUTSIDE:u>=c?qt.INSIDE:qt.INTERSECTING};var mse=new d,pse=new d,gse=new d,xFe=new d,hse=new d,TFe=new d;Zi.distanceSquaredTo=function(e,t){let n=d.subtract(t,e.center,Ase),i=e.halfAxes,o=X.getColumn(i,0,mse),r=X.getColumn(i,1,pse),s=X.getColumn(i,2,gse),a=d.magnitude(o),c=d.magnitude(r),u=d.magnitude(s),f=!0,h=!0,m=!0;a>0?d.divideByScalar(o,a,o):f=!1,c>0?d.divideByScalar(r,c,r):h=!1,u>0?d.divideByScalar(s,u,s):m=!1;let g=!f+!h+!m,A,_,C;if(g===1){let x=o;A=r,_=s,h?m||(x=s,_=o):(x=r,A=o),C=d.cross(A,_,hse),x===o?o=C:x===r?r=C:x===s&&(s=C)}else if(g===2){A=o,h?A=r:m&&(A=s);let x=d.UNIT_Y;x.equalsEpsilon(A,D.EPSILON3)&&(x=d.UNIT_X),_=d.cross(A,x,xFe),d.normalize(_,_),C=d.cross(A,_,hse),d.normalize(C,C),A===o?(r=_,s=C):A===r?(s=_,o=C):A===s&&(o=_,r=C)}else g===3&&(o=d.UNIT_X,r=d.UNIT_Y,s=d.UNIT_Z);let y=TFe;y.x=d.dot(n,o),y.y=d.dot(n,r),y.z=d.dot(n,s);let E=0,I;return y.x<-a?(I=y.x+a,E+=I*I):y.x>a&&(I=y.x-a,E+=I*I),y.y<-c?(I=y.y+c,E+=I*I):y.y>c&&(I=y.y-c,E+=I*I),y.z<-u?(I=y.z+u,E+=I*I):y.z>u&&(I=y.z-u,E+=I*I),E};var SFe=new d,BFe=new d;Zi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new qr);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=X.getColumn(a,0,mse),u=X.getColumn(a,1,pse),f=X.getColumn(a,2,gse),h=d.add(c,u,SFe);d.add(h,f,h),d.add(h,s,h);let m=d.subtract(h,t,BFe),g=d.dot(n,m);return o=Math.min(g,o),r=Math.max(g,r),d.add(s,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,m),g=d.dot(n,m),o=Math.min(g,o),r=Math.max(g,r),d.add(s,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,m),g=d.dot(n,m),o=Math.min(g,o),r=Math.max(g,r),d.add(s,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,m),g=d.dot(n,m),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,c,h),d.add(h,u,h),d.add(h,f,h),d.subtract(h,t,m),g=d.dot(n,m),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,m),g=d.dot(n,m),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,m),g=d.dot(n,m),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,m),g=d.dot(n,m),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var wFe=new d,DFe=new d,vFe=new d;Zi.computeCorners=function(e,t){l(t)||(t=[new d,new d,new d,new d,new d,new d,new d,new d]);let n=e.center,i=e.halfAxes,o=X.getColumn(i,0,wFe),r=X.getColumn(i,1,DFe),s=X.getColumn(i,2,vFe);return d.clone(n,t[0]),d.subtract(t[0],o,t[0]),d.subtract(t[0],r,t[0]),d.subtract(t[0],s,t[0]),d.clone(n,t[1]),d.subtract(t[1],o,t[1]),d.subtract(t[1],r,t[1]),d.add(t[1],s,t[1]),d.clone(n,t[2]),d.subtract(t[2],o,t[2]),d.add(t[2],r,t[2]),d.subtract(t[2],s,t[2]),d.clone(n,t[3]),d.subtract(t[3],o,t[3]),d.add(t[3],r,t[3]),d.add(t[3],s,t[3]),d.clone(n,t[4]),d.add(t[4],o,t[4]),d.subtract(t[4],r,t[4]),d.subtract(t[4],s,t[4]),d.clone(n,t[5]),d.add(t[5],o,t[5]),d.subtract(t[5],r,t[5]),d.add(t[5],s,t[5]),d.clone(n,t[6]),d.add(t[6],o,t[6]),d.add(t[6],r,t[6]),d.subtract(t[6],s,t[6]),d.clone(n,t[7]),d.add(t[7],o,t[7]),d.add(t[7],r,t[7]),d.add(t[7],s,t[7]),t};var PFe=new X;Zi.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=X.multiplyByUniformScale(e.halfAxes,2,PFe);return M.fromRotationTranslation(i,n,t)};var RFe=new le;Zi.isOccluded=function(e,t){let n=le.fromOrientedBoundingBox(e,RFe);return!t.isBoundingSphereVisible(n)};Zi.prototype.intersectPlane=function(e){return Zi.intersectPlane(this,e)};Zi.prototype.distanceSquaredTo=function(e){return Zi.distanceSquaredTo(this,e)};Zi.prototype.computePlaneDistances=function(e,t,n){return Zi.computePlaneDistances(this,e,t,n)};Zi.prototype.computeCorners=function(e){return Zi.computeCorners(this,e)};Zi.prototype.computeTransformation=function(e){return Zi.computeTransformation(this,e)};Zi.prototype.isOccluded=function(e){return Zi.isOccluded(this,e)};Zi.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&X.equals(e.halfAxes,t.halfAxes)};Zi.prototype.clone=function(e){return Zi.clone(this,e)};Zi.prototype.equals=function(e){return Zi.equals(this,e)};var $t=Zi;var Mz={};Mz.getHeight=function(e,t,n){return(e-n)*t+n};var MFe=new he;Mz.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,MFe);if(!l(r))return d.clone(e,o);let s=Mz.getHeight(r.height,n,i);return d.fromRadians(r.longitude,r.latitude,s,t,o)};var Eo=Mz;var xR=`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 j_=`#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 _se={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};_se.NUMBER_OF_CLASSIFICATION_TYPES=3;var Jn=Object.freeze(_se);var NFe={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS},Wa=Object.freeze(NFe);function LFe(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 TR=LFe;function Bp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=OFe(t),o=e.floatingPointTexture,r=i===Ge.FLOAT&&!o,s=FFe(t,r),a=QFe(s,t,r),c=Math.floor(Ft.maximumTextureSize/a),u=Math.min(n,c),f=a*u,h=Math.ceil(n/u),m=1/f,g=m*.5,A=1/h,_=A*.5;this._textureDimensions=new F(f,h),this._textureStep=new se(m,g,A,_),this._pixelDatatype=r?Ge.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let C=4*f*h;this._batchValues=i===Ge.FLOAT&&!r?new Float32Array(C):new Uint8Array(C),this._batchValuesDirty=!1}Object.defineProperties(Bp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function OFe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==q.UNSIGNED_BYTE){t=!0;break}return t?Ge.FLOAT:Ge.UNSIGNED_BYTE}function yse(e,t){let n=e[t].componentsPerAttribute;return n===2?F:n===3?d:n===4?se:Number}function FFe(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!==q.UNSIGNED_BYTE&&t?i+=4:++i}return n}function QFe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==q.UNSIGNED_BYTE&&n?o+4:o+1}var SR=new se;function kFe(e,t,n){let i=se.unpack(e,t,SR),o=se.unpackFloat(i);i=se.unpack(e,t+4,SR);let r=se.unpackFloat(i);i=se.unpack(e,t+8,SR);let s=se.unpackFloat(i);i=se.unpack(e,t+12,SR);let a=se.unpackFloat(i);return se.fromElements(o,r,s,a,n)}function UFe(e,t,n){let i=se.packFloat(e.x,SR);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var Cse=new se;Bp.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!==Ge.UNSIGNED_BYTE?a=kFe(this._batchValues,s,Cse):a=se.unpack(this._batchValues,s,Cse);let c=yse(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var GFe=[void 0,void 0,new F,new d,new se],zFe=new se;Bp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=GFe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=yse(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=zFe;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 u=this._offsets[t],h=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Ge.UNSIGNED_BYTE?UFe(c,this._batchValues,h):se.pack(c,this._batchValues,h),this._batchValuesDirty=!0};function VFe(e,t){let n=e._textureDimensions;e._texture=new Bt({context:t,pixelFormat:qe.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Jt.NEAREST,flipY:!1})}function HFe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Bp.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||VFe(this,e.context),HFe(this))};Bp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:St(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function YFe(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 WFe(e){return e===1?"float":`vec${e}`}function jFe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function qFe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=WFe(o),a=jFe(o),c=e._offsets[t],u=`${s} ${r}(float batchId)
{
vec2 st = computeSt(batchId);
st.x += batchTextureStep.x * float(${c});
`;return e._packFloats&&i.componentDatatype!==Ge.UNSIGNED_BYTE?u+=`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)));
`:u+=` vec4 textureValue = texture(batchTexture, st);
`,u+=` ${s} value = textureValue${a};
`,e._pixelDatatype===Ge.UNSIGNED_BYTE&&i.componentDatatype===q.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0;
`:e._pixelDatatype===Ge.FLOAT&&i.componentDatatype===q.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0;
`),u+=` return value;
}
`,u}Bp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
`;t+=`${YFe(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=qFe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
${t}
${s}`}};Bp.prototype.isDestroyed=function(){return!1};Bp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),de(this)};var RE=Bp;function uu(e){this._ellipsoid=e??te.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(uu.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});uu.mercatorAngleToGeodeticLatitude=function(e){return D.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};uu.geodeticLatitudeToMercatorAngle=function(e){e>uu.MaximumLatitude?e=uu.MaximumLatitude:e<-uu.MaximumLatitude&&(e=-uu.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};uu.MaximumLatitude=uu.mercatorAngleToGeodeticLatitude(Math.PI);uu.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=uu.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};uu.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=uu.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var ui=uu;function KFe(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(!M.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Un.transformToWorldCoordinates(e[r]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function vW(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function JFe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?vW(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(vW(i.westHemisphereGeometry,n),vW(i.eastHemisphereGeometry,n))}}function XFe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,h=t.length;for(c=0;c<h;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(KFe(t,a,o),!o)for(c=0;c<h;++c)l(t[c].geometry)&&Un.splitLongitude(t[c]);if(JFe(t),r)for(c=0;c<h;++c){let g=t[c];l(g.geometry)?(Un.reorderForPostVertexCache(g.geometry),Un.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Un.reorderForPostVertexCache(g.westHemisphereGeometry),Un.reorderForPreVertexCache(g.westHemisphereGeometry),Un.reorderForPostVertexCache(g.eastHemisphereGeometry),Un.reorderForPreVertexCache(g.eastHemisphereGeometry))}let m=Un.combineInstances(t);for(h=m.length,c=0;c<h;++c){u=m[c];let g=u.attributes;if(o)for(let A in g)g.hasOwnProperty(A)&&g[A].componentDatatype===q.DOUBLE&&Un.encodeAttribute(u,A,`${A}3DHigh`,`${A}3DLow`);else for(let A in g)if(g.hasOwnProperty(A)&&g[A].componentDatatype===q.DOUBLE){let _=`${A}3D`,C=`${A}2D`;Un.projectTo2D(u,A,_,C,n),l(u.boundingSphere)&&A==="position"&&(u.boundingSphereCV=le.fromVertices(u.attributes.position2D.values)),Un.encodeAttribute(u,_,`${_}High`,`${_}Low`),Un.encodeAttribute(u,C,`${C}High`,`${C}Low`)}s&&Un.compressVertices(u)}if(!i){let g=[];for(h=m.length,c=0;c<h;++c)u=m[c],g=g.concat(Un.fitToUnsignedShortIndices(u));m=g}return m}function PW(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let h=e[u][t];if(!l(h))continue;let m=h.indices.length;o+m>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:m}),o+=m}}function ZFe(e,t){let n=[];return PW(e,"geometry",t,n),PW(e,"westHemisphereGeometry",t,n),PW(e,"eastHemisphereGeometry",t,n),n}var wp={};wp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=XFe(e),t.length>0&&(n=Un.createAttributeLocations(t[0]),e.createPickOffsets&&(r=ZFe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let h=i[f],m=h.geometry;l(m)&&(c[f]=m.boundingSphere,u[f]=m.boundingSphereCV,a&&(s[f]=h.geometry.offsetAttribute));let g=h.eastHemisphereGeometry,A=h.westHemisphereGeometry;l(g)&&l(A)&&(l(g.boundingSphere)&&l(A.boundingSphere)&&(c[f]=le.union(g.boundingSphere,A.boundingSphere)),l(g.boundingSphereCV)&&l(A.boundingSphereCV)&&(u[f]=le.union(g.boundingSphereCV,A.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function $Fe(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 eQe(e,t){let n=e.length;for(let i=0;i<n;++i)$Fe(e[i],t)}function tQe(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*le.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}wp.packCreateGeometryResults=function(e,t){let n=new Float64Array(tQe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&le.pack(c.boundingSphere,n,s),s+=le.packedLength;let h=l(c.boundingSphereCV)?1:0;n[s++]=h,h&&le.pack(c.boundingSphereCV,n,s),s+=le.packedLength;let m=c.attributes,g=[];for(let _ in m)m.hasOwnProperty(_)&&l(m[_])&&(g.push(_),l(o[_])||(o[_]=i.length,i.push(_)));n[s++]=g.length;for(let _=0;_<g.length;_++){let C=g[_],y=m[C];n[s++]=o[C],n[s++]=y.componentDatatype,n[s++]=y.componentsPerAttribute,n[s++]=y.normalize?1:0,n[s++]=y.values.length,n.set(y.values,s),s+=y.values.length}let A=l(c.indices)?c.indices.length:0;n[s++]=A,A>0&&(n.set(c.indices,s),s+=A)}return t.push(n.buffer),{stringTable:i,packedData:n}};wp.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++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let h,m;n[s++]===1&&(h=le.unpack(n,s)),s+=le.packedLength,n[s++]===1&&(m=le.unpack(n,s)),s+=le.packedLength;let _,C,y,E=new pn,I=n[s++];for(i=0;i<I;i++){let S=t[n[s++]],w=n[s++];y=n[s++];let v=n[s++]!==0;_=n[s++],C=q.createTypedArray(w,_);for(let P=0;P<_;P++)C[P]=n[s++];E[S]=new ve({componentDatatype:w,componentsPerAttribute:y,normalize:v,values:C})}let x;if(_=n[s++],_>0){let S=C.length/y;for(x=Fe.createTypedArray(S,_),i=0;i<_;i++)x[i]=n[s++]}o[r++]=new ht({primitiveType:c,geometryType:u,boundingSphere:h,boundingSphereCV:m,indices:x,attributes:E,offsetAttribute:f})}return o};function nQe(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(M.pack(s.modelMatrix,i,o),o+=M.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 iQe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=M.unpack(t,o),s;o+=M.packedLength,l(t[o])&&(s={offset:new po(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}wp.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:nQe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Gi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};wp.unpackCombineGeometryParameters=function(e){let t=iQe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=wp.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let h=c[f],m=t[o];m.geometry=h,++o}}let r=te.clone(e.ellipsoid),s=e.isGeographic?new Gi(r):new ui(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:M.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Ese(e){let t=e.length,n=1+(le.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,le.pack(e[r],i,o)):i[o++]=0,o+=le.packedLength}return i}function Ise(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=le.unpack(e,i)),++n,i+=le.packedLength;return t}wp.packCombineGeometryResults=function(e,t){l(e.geometries)&&eQe(e.geometries,t);let n=Ese(e.boundingSpheres),i=Ese(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}};wp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Ise(e.boundingSpheres),boundingSpheresCV:Ise(e.boundingSpheresCV)}};var ME=wp;var oQe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Xr=Object.freeze(oQe);var Zu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Zu.NUMBER_OF_SHADOW_MODES=4;Zu.castShadows=function(e){return e===Zu.ENABLED||e===Zu.CAST_ONLY};Zu.receiveShadows=function(e){return e===Zu.ENABLED||e===Zu.RECEIVE_ONLY};Zu.fromCastReceive=function(e,t){return e&&t?Zu.ENABLED:e?Zu.CAST_ONLY:t?Zu.RECEIVE_ONLY:Zu.DISABLED};var Tn=Object.freeze(Zu);function Zr(e){e=e??V.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=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,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??Tn.DISABLED,this._translucent=void 0,this._state=Xr.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(Zr.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 rQe(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 sQe=new F,aQe=new d,Pse=new se;function Rse(e){let t=e.length;if(t===1)return e[0];if(t===2)return F.unpack(e,0,sQe);if(t===3)return d.unpack(e,0,aQe);if(t===4)return se.unpack(e,0,Pse)}function cQe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=rQe(i),s=r.length,a=[],c={},u={},f,m=i[0].attributes,g,A,_;for(g=0;g<s;++g)A=r[g],_=m[A],c[A]=g,a.push({functionName:`czm_batchTable_${A}`,componentDatatype:_.componentDatatype,componentsPerAttribute:_.componentsPerAttribute,normalize:_.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:q.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:q.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let C=a.length,y=new RE(t,a,o);for(g=0;g<o;++g){let E=i[g];m=E.attributes;for(let v=0;v<s;++v){A=r[v],_=m[A];let P=Rse(_.value),N=c[A];y.setBatchedAttribute(g,N,P)}let I={primitive:E.pickPrimitive??e};l(E.id)&&(I.id=E.id);let x=t.createPickId(I);e._pickIds.push(x);let S=x.color,w=Pse;w.x=G.floatToByte(S.red),w.y=G.floatToByte(S.green),w.z=G.floatToByte(S.blue),w.w=G.floatToByte(S.alpha),y.setBatchedAttribute(g,C-1,w)}e._batchTable=y,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function lQe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new ve({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function uQe(e){let t=e.attributes,n=new pn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=lQe(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 ht({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:le.clone(e.boundingSphere)})}function fQe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var dQe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Zr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=dQe.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(`
`)};Zr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${We.replaceMain(t,"czm_non_show_main")}
void main()
{
czm_non_show_main();
gl_Position *= czm_batchTable_show(batchId);
}`:t};Zr._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 bse(e){return`${We.replaceMain(e,"czm_non_pick_main")}
out vec4 v_pickColor;
void main()
{
czm_non_pick_main();
v_pickColor = czm_batchTable_pickColor(batchId);
}`}function xse(e){return`in vec4 v_pickColor;
${e}`}Zr._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};Zr._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};Zr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=We.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 Tse(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",u=`in ${a} ${c};`,f="",h="";if(i){f+=`vec2 st;
`;let A=s>1?`${c}.x`:c;h+=` st = czm_decompressTextureCoordinates(${A});
`}n&&o&&r?(f+=`vec3 normal;
vec3 tangent;
vec3 bitangent;
`,h+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
`):(n&&(f+=`vec3 normal;
`,h+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""});
`),o&&(f+=`vec3 tangent;
`,h+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`),r&&(f+=`vec3 bitangent;
`,h+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`));let m=t;m=m.replace(/in\s+vec3\s+normal;/g,""),m=m.replace(/in\s+vec2\s+st;/g,""),m=m.replace(/in\s+vec3\s+tangent;/g,""),m=m.replace(/in\s+vec3\s+bitangent;/g,""),m=We.replaceMain(m,"czm_non_compressed_main");let g=`void main()
{
${h} czm_non_compressed_main();
}`;return[u,f,m,g].join(`
`)}function hQe(e){let t=We.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
czm_non_depth_clamp_main();
gl_Position = czm_depthClamp(gl_Position);}
`,t}function AQe(e){let t=We.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 Sse(e,t){let n=e.vertexAttributes}function mQe(e,t){return function(){return e[t]}}var RW=Math.max(zt.hardwareConcurrency-1,1),Nz,pQe=new qn("combineGeometry");function gQe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Xr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(Nz))for(Nz=new Array(RW),o=0;o<RW;o++)Nz[o]=new qn("createGeometry");let f;for(u=TR(u,RW),o=0;o<u.length;o++){let h=0,m=u[o],g=m.length;for(r=0;r<g;++r)f=m[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=h,h+=i.constructor.packedLength??i.packedLength);let A;if(h>0){let _=new Float64Array(h);for(A=[_.buffer],r=0;r<g;++r)f=m[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,_,f.offset),f.geometry=_)}c.push(Nz[o].scheduleTask({subTasks:u[o]},A))}e._state=Xr.CREATING,Promise.all(c).then(function(h){e._createGeometryResults=h,e._state=Xr.CREATED}).catch(function(h){wR(e,t,Xr.FAILED,h)})}else if(e._state===Xr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=pQe.scheduleTask(ME.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,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=Xr.COMBINING,Promise.resolve(f).then(function(h){let m=ME.unpackCombineGeometryResults(h);e._geometries=m.geometries,e._attributeLocations=m.attributeLocations,e.modelMatrix=M.clone(m.modelMatrix,e.modelMatrix),e._pickOffsets=m.pickOffsets,e._offsetInstanceExtend=m.offsetInstanceExtend,e._instanceBoundingSpheres=m.boundingSpheres,e._instanceBoundingSpheresCV=m.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Xr.COMBINED):wR(e,t,Xr.FAILED,void 0)}).catch(function(h){wR(e,t,Xr.FAILED,h)})}}function _Qe(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 m=s.geometry,g;l(m.attributes)&&l(m.primitiveType)?g=uQe(m):g=m.constructor.createGeometry(m),o[c++]=fQe(s,g),r.push(s.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,h=ME.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=M.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=Xr.COMBINED):wR(e,t,Xr.FAILED,void 0)}function CQe(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 le;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let _=a[i],C=e._batchTable.getBatchedAttribute(i,n,new d);_=r[i].clone(_),Ose(_,C,o[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let _=a[i];_.center.x-_.radius>0||le.intersectPlane(_,rn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING?c.push(_):(u.push(_),f.push(_))}let h=c[0],m=f[0],g=u[0];for(i=1;i<c.length;i++)h=le.union(h,c[i]);for(i=1;i<f.length;i++)m=le.union(m,f[i]);for(i=1;i<u.length;i++)g=le.union(g,u[i]);let A=[];for(l(h)&&A.push(h),l(m)&&A.push(m),l(g)&&A.push(g),i=0;i<A.length;i++){let _=A[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=_,e._boundingSphereCV[i]=le.projectTo2D(_,t.mapProjection,e._boundingSphereCV[i])}Zr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Bse=new $n,Mse=new he,Nse=new d,Lse=new le;function yQe(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,u=t.mapProjection,f=u.ellipsoid,h=e._batchTable,m=e._instanceBoundingSpheres,g=m.length;for(let A=0;A<g;++A){let _=m[A];if(!l(_))continue;let C=e.modelMatrix;l(C)&&(_=le.transform(_,C,Lse));let y=_.center,E=_.radius,I=$n.fromCartesian(y,Bse);if(h.setBatchedAttribute(A,o,I.high),h.setBatchedAttribute(A,r,I.low),!t.scene3DOnly){let x=f.cartesianToCartographic(y,Mse),S=u.project(x,Nse);I=$n.fromCartesian(S,Bse),h.setBatchedAttribute(A,s,I.high),h.setBatchedAttribute(A,a,I.low)}h.setBatchedAttribute(A,c,E)}e._batchTableBoundingSpheresUpdated=!0}var MW=new d,EQe=new d;function wse(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 u=0;u<c;++u){let f=a[u];if(!l(f))continue;let h=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(d.equals(h,d.ZERO)){s.setBatchedAttribute(u,i,d.ZERO);continue}let m=e.modelMatrix;l(m)&&(f=le.transform(f,m,Lse));let g=f.center;g=r.scaleToGeodeticSurface(g,EQe);let A=r.cartesianToCartographic(g,Mse),_=o.project(A,Nse),C=d.add(h,g,MW);A=r.cartesianToCartographic(C,A);let y=o.project(A,MW),E=d.subtract(y,_,MW),I=E.x;E.x=E.z,E.z=E.y,E.y=I,s.setBatchedAttribute(u,i,E)}e._batchTableOffsetsUpdated=!0}function IQe(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 u=i[c];if(s.push(oi.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Oe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(le.clone(u.boundingSphere)),e._boundingSphereWC.push(new le),!o){let f=u.boundingSphereCV.center,h=f.x,m=f.y,g=f.z;f.x=g,f.y=h,f.z=m,e._boundingSphereCV.push(le.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new le),e._boundingSphereMorph.push(new le)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,wR(e,t,Xr.COMPLETE,void 0)}function bQe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ve(o,!1),r.cull={enabled:!0,face:Ni.BACK},e._frontFaceRS=ze.fromCache(r),r.cull.face=Ni.FRONT,e._backFaceRS=ze.fromCache(r)):(e._frontFaceRS=ze.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ve(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ve(o,!1),r.depthTest.func=Wa.GREATER,i?(r.cull={enabled:!0,face:Ni.BACK},e._frontFaceDepthFailRS=ze.fromCache(r),r.cull.face=Ni.FRONT,e._backFaceDepthFailRS=ze.fromCache(r)):(e._frontFaceDepthFailRS=ze.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function xQe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Zr._appendOffsetToShader(e,r),r=Zr._appendShowToShader(e,r),r=Zr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=bse(r),r=Zr._updateColorAttribute(e,r,!1),r=Tse(e,r),r=Zr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=xse(s),e._sp=sn.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Sse(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Zr._appendShowToShader(e,r),r=Zr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=bse(r),r=Zr._updateColorAttribute(e,r,!0),r=Tse(e,r),r=Zr._modifyShaderPosition(e,r,t.scene3DOnly),r=hQe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=xse(s),s=AQe(s),e._spDepthFail=sn.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Sse(e._spDepthFail,o))}var BR=new M,Dse=new d;function vse(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]=mQe(s,c));let a=St(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return M.multiply(c,e._modelMatrix,BR),M.multiplyByPoint(BR,e.rtcCenter,Dse),M.setTranslation(BR,Dse,BR),BR}),a}function TQe(e,t,n,i,o,r,s,a){let c=vse(e,t,n,a),u;l(e._depthFailAppearance)&&(u=vse(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?we.TRANSLUCENT:we.OPAQUE,h=o?2:1;h*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let m=r.length,g=0;for(let A=0;A<m;++A){let _;o&&(_=r[A],l(_)||(_=r[A]=new et({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[g],_.renderState=e._backFaceRS,_.shaderProgram=e._sp,_.uniformMap=c,_.pass=f,++A),_=r[A],l(_)||(_=r[A]=new et({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[g],_.renderState=e._frontFaceRS,_.shaderProgram=e._sp,_.uniformMap=c,_.pass=f,l(e._depthFailAppearance)&&(o&&(++A,_=r[A],l(_)||(_=r[A]=new et({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[g],_.renderState=e._backFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=u,_.pass=f),++A,_=r[A],l(_)||(_=r[A]=new et({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[g],_.renderState=e._frontFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=u,_.pass=f),++g}}Zr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!M.equals(n,e._modelMatrix))for(M.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=le.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=le.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphereMorph[o]=le.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],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function SQe(e,t,n,i,o,r,s,a){Zr._updateBoundingVolumes(e,t,o);let c;t.mode===oe.SCENE3D?c=e._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===oe.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let h=e.allowPicking,m=Tn.castShadows(e.shadows),g=Tn.receiveShadows(e.shadows),A=n.length,_=a?2:1;_*=l(e._depthFailAppearance)?2:1;for(let C=0;C<A;++C){let y=Math.floor(C/_),E=n[C];E.modelMatrix=o,E.boundingVolume=c[y],E.cull=r,E.debugShowBoundingVolume=s,E.castShadows=m,E.receiveShadows=g,h?E.pickId="v_pickColor":E.pickId=void 0,u.push(E)}}}Zr.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!==oe.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Xr.FAILED)return;let t=e.context;if(l(this._batchTable)||cQe(this,t),this._batchTable.attributes.length>0){if(Ft.maximumVertexTextureImageUnits===0)throw new ue("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!==Xr.COMPLETE&&this._state!==Xr.COMBINED&&(this.asynchronous?gQe(this,e):_Qe(this,e)),this._state===Xr.COMBINED&&(yQe(this,e),wse(this,e),IQe(this,e)),!this.show||this._state!==Xr.COMPLETE)return;this._batchTableOffsetsUpdated||wse(this,e),this._recomputeBoundingSpheres&&CQe(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 u=n.closed&&c;o&&(this._createRenderStatesFunction??bQe)(this,t,n,u),r&&(this._createShaderProgramFunction??xQe)(this,e,n),(o||r)&&(this._createCommandsFunction??TQe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??SQe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var BQe=new le,wQe=new le;function Ose(e,t,n){if(n===un.TOP){let i=le.clone(e,BQe),o=le.clone(e,wQe);o.center=d.add(o.center,t,o.center),e=le.union(i,o,e)}else n===un.ALL&&(e.center=d.add(e.center,t,e.center));return e}function DQe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=q.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function vQe(e,t,n,i,o){return function(r){let s=Rse(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var PQe=new d;function RQe(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)&&Ose(i,d.fromArray(r.get(),0,PQe),e._offsetInstanceExtend[n]),l(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function MQe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Zr.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 u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:DQe(s,n,f),set:vQe(s,n,f,this,u)}}return RQe(this,c,n),MQe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Zr.prototype.isDestroyed=function(){return!1};Zr.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,de(this)};function wR(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===Xr.COMPLETE||e._state===Xr.FAILED,!0})}var Ln=Zr;function NQe(e){e=e??V.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var kc=NQe;var _x=`#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 rd(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new NW;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new NW;if(o.requiresTextureCoordinates=e,n instanceof hn)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}rd.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 hn&&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 hn||(o=t.material.shaderSource),new We({defines:i,sources:[o,_x]})};rd.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 We({defines:n,sources:[_x],pickColorQualifier:"in"})};rd.prototype.createVertexShader=function(e,t,n,i){return Hse(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};rd.prototype.createPickVertexShader=function(e,t,n,i){return Hse(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Fse=new d,Qse=new he,kse={high:0,low:0};function Hse(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=Qse;u.longitude=D.PI,u.latitude=0,u.height=0;let f=s.project(u,Fse),h=$n.encode(f.x,kse);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 m=Qse;m.longitude=-D.PI,m.latitude=0,m.height=0;let g=s.project(m,Fse);h=$n.encode(g.x,kse),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 hn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new We({defines:c,sources:[o]})}function NW(){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(NW.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 Use(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)/F.distance(t,e)}var LQe=[new F,new F,new F,new F];function Yse(e,t){let n=LQe,i=F.unpack(t,0,n[0]),o=F.unpack(t,2,n[1]),r=F.unpack(t,4,n[2]);e.uMaxVmax=new kc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Use(i,o,r),a=1/Use(i,r,o);e.uvMinAndExtents=new kc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Wse=new he,jse=new d,OQe=new d,FQe=new d,Lz={high:0,low:0};function qse(e,t,n){let i=Wse;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,jse);i.latitude=e.north;let r=t.project(i,OQe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,FQe),a=[0,0,0,0],c=[0,0,0,0],u=$n.encode(o.x,Lz);a[0]=u.high,c[0]=u.low,u=$n.encode(o.y,Lz),a[1]=u.high,c[1]=u.low,u=$n.encode(r.y,Lz),a[2]=u.high,c[2]=u.low,u=$n.encode(s.x,Lz),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new kc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new kc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var QQe=new M,kQe=new M,Gse=new d,UQe=new he,GQe=[new he,new he,new he,new he,new he,new he,new he,new he];function zQe(e,t,n,i,o,r){let s=ce.center(e,UQe);s.height=n;let a=he.toCartesian(s,t,Gse),c=It.eastNorthUpToFixedFrame(a,t,QQe),u=M.inverse(c,kQe),f=e.west,h=e.east,m=e.north,g=e.south,A=GQe;A[0].latitude=g,A[0].longitude=f,A[1].latitude=m,A[1].longitude=f,A[2].latitude=m,A[2].longitude=h,A[3].latitude=g,A[3].longitude=h;let _=(f+h)*.5,C=(m+g)*.5;A[4].latitude=g,A[4].longitude=_,A[5].latitude=m,A[5].longitude=_,A[6].latitude=C,A[6].longitude=f,A[7].latitude=C,A[7].longitude=h;let y=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,I=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){A[P].height=n;let N=he.toCartesian(A[P],t,Gse);M.multiplyByPoint(u,N,N),N.z=0,y=Math.min(y,N.x),E=Math.max(E,N.x),I=Math.min(I,N.y),x=Math.max(x,N.y)}let S=i;S.x=y,S.y=I,S.z=0,M.multiplyByPoint(c,S,S);let w=o;w.x=E,w.y=I,w.z=0,M.multiplyByPoint(c,w,w),d.subtract(w,S,o);let v=r;v.x=y,v.y=x,v.z=0,M.multiplyByPoint(c,v,v),d.subtract(v,S,r)}var VQe=new d,HQe=new d,YQe=new $n;rd.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=jse,s=VQe,a=HQe;zQe(e,n,o??0,r,s,a);let c={};Yse(c,t);let u=$n.fromCartesian(r,YQe);return c.southWest_HIGH=new kc({componentDatatype:q.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.high,[0,0,0])}),c.southWest_LOW=new kc({componentDatatype:q.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.low,[0,0,0])}),c.eastward=new kc({componentDatatype:q.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(s,[0,0,0])}),c.northward=new kc({componentDatatype:q.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(a,[0,0,0])}),qse(e,i,c),c};var WQe=new d;function zse(e,t,n,i){let o=Wse;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,WQe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=D.fastApproximateAtan2(s,r.z),c=D.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var Vse=new F;rd.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=zse(e.south,e.west,n,Vse),r=o.x,s=o.y,a=zse(e.north,e.east,n,Vse),c=a.x,u=a.y,f=0;s>u&&(f=D.PI-s,s=-D.PI,u+=f),r-=D.EPSILON5,s-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let h=1/(u-s),m=1/(c-r),g={sphericalExtents:new kc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,m,h]}),longitudeRotation:new kc({componentDatatype:q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Yse(g,t),qse(e,i,g),g};rd.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)};rd.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 jQe(e){return Math.max(e.width,e.height)>rd.MAX_WIDTH_FOR_PLANAR_EXTENTS}rd.shouldUseSphericalCoordinates=function(e){return jQe(e)};rd.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var $u=rd;var qQe={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS},Xn=Object.freeze(qQe);var KQe={ZERO:ee.ZERO,KEEP:ee.KEEP,REPLACE:ee.REPLACE,INCREMENT:ee.INCR,DECREMENT:ee.DECR,INVERT:ee.INVERT,INCREMENT_WRAP:ee.INCR_WRAP,DECREMENT_WRAP:ee.DECR_WRAP},yt=Object.freeze(KQe);var Oz={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};Oz.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Xn.ALWAYS,frontOperation:{fail:yt.KEEP,zFail:yt.KEEP,zPass:yt.REPLACE},backFunction:Xn.ALWAYS,backOperation:{fail:yt.KEEP,zFail:yt.KEEP,zPass:yt.REPLACE},reference:Oz.CESIUM_3D_TILE_MASK,mask:Oz.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(Oz);function NE(e){e=e??V.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Jn.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(NE.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}}});NE.isSupported=function(e){return e.context.stencilBuffer};function Cx(e,t){let n=t?Xn.EQUAL:Xn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:yt.KEEP,zFail:yt.DECREMENT_WRAP,zPass:yt.KEEP},backFunction:n,backOperation:{fail:yt.KEEP,zFail:yt.INCREMENT_WRAP,zPass:yt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},depthMask:!1}}function OW(e){return{stencilTest:{enabled:e,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND}}var JQe={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function XQe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(Cx(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(Cx(o,!0)),e._rsColorPass=ze.fromCache(OW(o,!1)),e._rsPickPass=ze.fromCache(JQe)}function ZQe(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=We.replaceMain(s,"czm_non_compressed_main");let a=`void main()
{
${r} czm_non_compressed_main();
}`;return[i,o,s,a].join(`
`)}}function $Qe(e,t){let n=t.context,i=e._primitive,o=xR;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Ln._appendDistanceDisplayConditionToShader(i,o),o=Ln._modifyShaderPosition(e,o,t.scene3DOnly),o=Ln._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=ZQe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new We({defines:[a],sources:[o]}),u=new We({sources:[j_]}),f=e._primitive._attributeLocations,h=new $u(s,r,e.appearance);if(e._spStencil=sn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let A=We.createPickVertexShaderSource(o);A=Ln._appendShowToShader(i,A),A=Ln._updatePickColorAttribute(A);let _=h.createPickFragmentShader(!1),C=h.createPickVertexShader([a],A,!1,t.mapProjection);if(e._spPick=sn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:C,fragmentShaderSource:_,attributeLocations:f}),s){let y=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(y)){let E=h.createPickFragmentShader(!0),I=h.createPickVertexShader([a],A,!0,t.mapProjection);y=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:I,fragmentShaderSource:E,attributeLocations:f})}e._spPick2D=y}}else e._spPick=sn.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=Ln._appendShowToShader(i,o),c=new We({defines:[a],sources:[o]}),e._sp=sn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let m=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=sn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:f}),s){let A=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(A)){let _=h.createFragmentShader(!0),C=h.createVertexShader([a],o,!0,t.mapProjection);A=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:C,fragmentShaderSource:_,attributeLocations:f})}e._spColor2D=A}}function e2e(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),u=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],l(r)||(r=t[o]=new et({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=we.TERRAIN_CLASSIFICATION,s=et.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new et({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=we.TERRAIN_CLASSIFICATION;let _=e.appearance.material;if(l(_)&&(c=St(c,_._uniforms)),r.uniformMap=c,s=et.shallowClone(r,r.derivedCommands.tileset),s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let C=et.shallowClone(r,r.derivedCommands.appearance2D);C.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=C,C=et.shallowClone(s,s.derivedCommands.appearance2D),C.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=C}}let f=e._commandsIgnoreShow,h=e._spStencil,m=0;i=f.length=i/2;for(let g=0;g<i;++g){let A=f[g]=et.shallowClone(t[m],f[g]);A.shaderProgram=h,A.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,m+=2}}function t2e(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,u,f,h=0,m=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<o;c+=2){let A=i._va[h++];if(n&&(a=r[s++],A=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=A,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=m,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=et.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=A,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=m,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=et.shallowClone(u,u.derivedCommands.tileset),f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let _=et.shallowClone(u,u.derivedCommands.pick2D);_.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=_,_=et.shallowClone(f,f.derivedCommands.pick2D),_.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=_}}}function n2e(e,t,n,i,o,r,s){e2e(e,r),t2e(e,s)}function Kse(e,t){return Math.floor(e%t/2)}function LW(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Jse(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function i2e(e,t,n,i,o,r,s,a){let c=e._primitive;Ln._updateBoundingVolumes(c,t,o);let u;t.mode===oe.SCENE3D?u=c._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===oe.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,h=f!==Jn.CESIUM_3D_TILE,m=f!==Jn.TERRAIN,g=t.passes,A,_,C;if(g.render){let y=n.length;for(A=0;A<y;++A)_=u[Kse(A,y)],h&&(C=n[A],LW(C,t,o,r,_,s)),m&&(C=n[A].derivedCommands.tileset,LW(C,t,o,r,_,s));if(t.invertClassification){let E=e._commandsIgnoreShow,I=E.length;for(A=0;A<I;++A)_=u[A],C=E[A],LW(C,t,o,r,_,s)}}if(g.pick){let y=i.length,E=c._pickOffsets;for(A=0;A<y;++A){let I=E[Kse(A,y)];_=u[I.index],h&&(C=i[A],Jse(C,t,o,r,_)),m&&(C=i[A].derivedCommands.tileset,Jse(C,t,o,r,_))}}}NE.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,u=!1,f=!0,h,m=!1,g=!1;for(r>0&&(c=o[0].attributes,m=$u.hasAttributesForSphericalExtents(c),g=$u.hasAttributesForTextureCoordinatePlanes(c),h=c.color),s=0;s<r;s++){a=o[s];let _=a.attributes.color;l(_)&&(u=!0),f=f&&l(_)&&Xt.equals(h,_)}if(!f&&!m&&!g)throw new Ae("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new hn({flat:!0}),this.appearance=t),this._usePickOffsets=!m&&!g,this._hasSphericalExtentsAttribute=m,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let A=new Array(r);for(s=0;s<r;++s)a=o[s],A[s]=new Rt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=A,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(_,C){n._createBoundingVolumeFunction(_,C)}),i._createRenderStatesFunction=function(_,C,y,E){XQe(n,C)},i._createShaderProgramFunction=function(_,C,y){$Qe(n,C)},i._createCommandsFunction=function(_,C,y,E,I,x,S){n2e(n,void 0,void 0,!0,!1,x,S)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(_,C,y,E,I,x,S,w){n._updateAndQueueCommandsFunction(_,C,y,E,I,x,S,w)}:i._updateAndQueueCommandsFunction=function(_,C,y,E,I,x,S,w){i2e(n,C,y,E,I,x,S,w)},this._primitive=new Ln(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ze.fromCache(Cx(!1,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(Cx(!1,!0)),this._rsColorPass=ze.fromCache(OW(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ze.fromCache(Cx(!0,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(Cx(!0,!0)),this._rsColorPass=ze.fromCache(OW(!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))})};NE.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};NE.prototype.isDestroyed=function(){return!1};NE.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,de(this)};var yx=NE;var o2e={u_globeMinimumAltitude:function(){return 55e3}};function fu(e){e=e??V.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 hn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??Jn.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=Si._defaultMaxTerrainHeight,this._minTerrainHeight=Si._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:o2e}}Object.defineProperties(fu.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}}});fu.isSupported=yx.isSupported;function Xse(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Zse(e){return function(t,n){return e._minHeight}}var r2e=new d,s2e=new d,a2e=new d,c2e=new he,l2e=new ce;function Fz(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,u=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let m=d.unpack(i,h,r2e),g=d.unpack(o,h,s2e),A=d.add(m,g,a2e),_=n.cartesianToCartographic(A,c2e),C=_.latitude,y=_.longitude;s=Math.min(s,C),a=Math.min(a,y),c=Math.max(c,C),u=Math.max(u,y)}let f=l2e;return f.north=c,f.south=s,f.east=u,f.west=a,f}function u2e(e,t,n){let i=Si.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function f2e(e,t,n){let i=t.mapProjection.ellipsoid,o=Fz(t,n),r=$t.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=le.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);d.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function FW(e,t){return Math.floor(e%t/2)}function QW(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==oe.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 $se(e,t,n,i,o,r){let s=e._primitive;n.mode!==oe.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 d2e(e,t,n,i,o,r,s,a){let c;t.mode===oe.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==Jn.CESIUM_3D_TILE,h=u!==Jn.TERRAIN,m=t.passes,g=e._primitive,A,_,C;if(m.render){let y=n.length;for(A=0;A<y;++A)_=c[FW(A,y)],f&&(C=n[A],QW(e,C,t,o,r,_,s)),h&&(C=n[A].derivedCommands.tileset,QW(e,C,t,o,r,_,s));if(t.invertClassification){let E=g._commandsIgnoreShow,I=E.length;for(A=0;A<I;++A)_=c[A],C=E[A],QW(e,C,t,o,r,_,s)}}if(m.pick){let y=i.length,E;for(e._useFragmentCulling||(E=g._primitive._pickOffsets),A=0;A<y;++A){if(_=c[FW(A,y)],!e._useFragmentCulling){let I=E[FW(A,y)];_=c[I.index]}f&&(C=i[A],$se(e,C,t,o,r,_)),h&&(C=i[A].derivedCommands.tileset,$se(e,C,t,o,r,_))}}}fu.initializeTerrainHeights=function(){return Si.initialize()};fu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Si.initialized){fu.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,u=new Array(c),f,h;for(f=0;f<c;++f){o=a[f],r=o.geometry;let _=Fz(e,r);l(h)?l(_)&&ce.union(h,_,h):h=ce.clone(_);let C=o.id;if(l(C)&&l(_)){let y=Si.getBoundingSphere(_,i);this._boundingSpheresKeys.push(C),this._boundingSpheres.push(y)}s=r.constructor,!l(s)||l(s.createShadowVolume)}u2e(this,h,i);let m=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Eo.getHeight(this._minTerrainHeight,m,g),this._maxHeight=Eo.getHeight(this._maxTerrainHeight,m,g);let A=fu._supportsMaterials(e.context);if(this._useFragmentCulling=A,A){let _,C=!0;for(f=0;f<c;++f)if(o=a[f],r=o.geometry,h=Fz(e,r),$u.shouldUseSphericalCoordinates(h)){C=!1;break}for(f=0;f<c;++f){o=a[f],r=o.geometry,s=r.constructor;let y=Fz(e,r),E=r.textureCoordinateRotationPoints;C?_=$u.getPlanarTextureCoordinateAttributes(y,E,i,e.mapProjection,this._maxHeight):_=$u.getSphericalExtentGeometryInstanceAttributes(y,E,i,e.mapProjection);let I=o.attributes;for(let x in I)I.hasOwnProperty(x)&&(_[x]=I[x]);u[f]=new Rt({geometry:s.createShadowVolume(r,Zse(this),Xse(this)),attributes:_,id:o.id})}}else for(f=0;f<c;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new Rt({geometry:s.createShadowVolume(r,Zse(this),Xse(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(_,C){f2e(t,_,C)},n._updateAndQueueCommandsFunction=function(_,C,y,E,I,x,S,w){d2e(t,C,y,E,I,x,S,w)},this._primitive=new yx(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))})};fu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};fu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};fu.prototype.isDestroyed=function(){return!1};fu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};fu._supportsMaterials=function(e){return e.depthTexture};fu.supportsMaterials=function(e){return fu._supportsMaterials(e.frameState.context)};var Cl=fu;function Ex(){Ae.throwInstantiationError()}Object.defineProperties(Ex.prototype,{isConstant:{get:Ae.throwInstantiationError},definitionChanged:{get:Ae.throwInstantiationError}});Ex.prototype.getType=Ae.throwInstantiationError;Ex.prototype.getValue=Ae.throwInstantiationError;Ex.prototype.equals=Ae.throwInstantiationError;var h2e=new J;Ex.getValue=function(e,t,n){let i;return l(e)||(e=J.now(h2e)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=uo.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==uo.ColorType)&&(n=uo.fromType(uo.ColorType)),G.clone(G.WHITE,n.uniforms.color),n)};var yr=Ex;function LE(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}LE.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!j.getValueOrDefault(t.show,n,!0)};LE.prototype._setOptions=Ae.throwInstantiationError;LE.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 u=t.fillMaterialProperty,f=u instanceof jt,h,m=t._getIsClosed(c);if(f)h=new hn({closed:m,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=yr.getValue(e,u,this._material);this._material=g,h=new xo({material:g,translucent:g.isTranslucent(),closed:m})}if(n)c.vertexFormat=hn.VERTEX_FORMAT,this._primitive=o.add(new Cl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),j.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Ln({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=j.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Ln({geometryInstances:u,appearance:new hn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};LE.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))?(le.clone(o.boundingSphere,e),mt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),mt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?mt.PENDING:mt.FAILED};LE.prototype.isDestroyed=function(){return!1};LE.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),de(this)};var yi=LE;var eae={};function DR(e,t){l(eae[e])||(eae[e]=!0,console.warn(t??e))}DR.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.";DR.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";DR.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";DR.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var At=DR;var A2e={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Dp=Object.freeze(A2e);var m2e={NONE:0,GEODESIC:1,RHUMB:2},an=Object.freeze(m2e);var tae=D.EPSILON10;function p2e(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,u,f=0,h=-1;for(s=1;s<r;++s)c=e[s],t(a,c,tae)?(l(u)||(u=e.slice(0,s),f=s-1,h=0),o&&i.push(s)):(l(u)&&(u.push(c),f=s,o&&(h=i.length)),a=c);return n&&t(e[0],e[r-1],tae)&&(o&&(l(u)?i.splice(h,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Uo=p2e;function g2e(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),u=c*a,f=Math.atan2(a,r),h=c*s,m=h*h,g=1-m,A=Math.sqrt(g),_=t/4,C=_*_,y=C*_,E=C*C,I=1+_-3*C/4+5*y/4-175*E/64,x=1-_+15*C/8-35*y/8,S=1-3*_+35*C/4,w=1-5*_,v=I*f-x*Math.sin(2*f)*_/2-S*Math.sin(4*f)*C/16-w*Math.sin(6*f)*y/48-Math.sin(8*f)*5*E/512,P=e._constants;P.a=n,P.b=i,P.f=o,P.cosineHeading=r,P.sineHeading=s,P.tanU=a,P.cosineU=c,P.sineU=u,P.sigma=f,P.sineAlpha=h,P.sineSquaredAlpha=m,P.cosineSquaredAlpha=g,P.cosineAlpha=A,P.u2Over4=_,P.u4Over16=C,P.u6Over64=y,P.u8Over256=E,P.a0=I,P.a1=x,P.a2=S,P.a3=w,P.distanceRatio=v}function _2e(e,t){return e*t*(4+e*(4-3*t))/16}function nae(e,t,n,i,o,r,s){let a=_2e(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function C2e(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),h=Math.cos(u),m=Math.sin(u),g=Math.cos(f),A=Math.sin(f),_=h*g,C=h*A,y=m*A,E=m*g,I=c,x=D.TWO_PI,S=Math.cos(I),w=Math.sin(I),v,P,N,L,p;do{S=Math.cos(I),w=Math.sin(I);let Q=C-E*S;N=Math.sqrt(g*g*w*w+Q*Q),P=y+_*S,v=Math.atan2(N,P);let H;N===0?(H=0,L=1):(H=_*w/N,L=1-H*H),x=I,p=P-2*y/L,isFinite(p)||(p=0),I=c+nae(a,H,L,v,N,P,p)}while(Math.abs(I-x)>D.EPSILON12);let b=L*(t*t-n*n)/(n*n),T=1+b*(4096+b*(b*(320-175*b)-768))/16384,B=b*(256+b*(b*(74-47*b)-128))/1024,R=p*p,O=B*N*(p+B*(P*(2*R-1)-B*p*(4*N*N-3)*(4*R-3)/6)/4),U=n*T*(v-O),k=Math.atan2(g*w,C-E*S),z=Math.atan2(h*w,C*S-E);e._distance=U,e._startHeading=k,e._endHeading=z,e._uSquared=b}var y2e=new d,kW=new d;function iae(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,kW),y2e),r=d.normalize(i.cartographicToCartesian(n,kW),kW);C2e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,g2e(e)}function vR(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&iae(this,e,t,i)}Object.defineProperties(vR.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}}});vR.prototype.setEndPoints=function(e,t){iae(this,e,t,this._ellipsoid)};vR.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};vR.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),u=Math.sin(6*i),f=Math.sin(8*i),h=i*i,m=i*h,g=n.u8Over256,A=n.u2Over4,_=n.u6Over64,C=n.u4Over16,y=2*m*g*o/3+i*(1-A+7*C/4-15*_/4+579*g/64-(C-15*_/4+187*g/16)*o-(5*_/4-115*g/16)*r-29*g*s/16)+(A/2-C+71*_/32-85*g/16)*a+(5*C/16-5*_/4+383*g/96)*c-h*((_-11*g/2)*a+5*g*c/2)+(29*_/96-29*g/16)*u+539*g*f/1536,E=Math.asin(Math.sin(y)*n.cosineAlpha),I=Math.atan(n.a/n.b*Math.tan(E));y=y-n.sigma;let x=Math.cos(2*n.sigma+y),S=Math.sin(y),w=Math.cos(y),v=n.cosineU*w,P=n.sineU*S,L=Math.atan2(S*n.sineHeading,v-P*n.cosineHeading)-nae(n.f,n.sineAlpha,n.cosineSquaredAlpha,y,S,w,x);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=I,t.height=0,t):new he(this._start.longitude+L,I,0)};var vp=vR;function GW(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,u=n,f=Math.sin(2*u),h=Math.sin(4*u),m=Math.sin(6*u),g=Math.sin(8*u),A=Math.sin(10*u),_=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(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)*m+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*A+1001*c/8388608*_)}function E2e(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,u=c*c,f=u*c,h=f*c,m=h*c,g=m*c,A=Math.sin(2*i),_=Math.cos(2*i),C=Math.sin(4*i),y=Math.cos(4*i),E=Math.sin(6*i),I=Math.cos(6*i),x=Math.sin(8*i),S=Math.cos(8*i),w=Math.sin(10*i),v=Math.cos(10*i),P=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*h/16384+1515*i*m/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*h/4096-i*(232*o-1677)*m/16384+i*(399985-90560*o+512*s)*g/5242880)*_+(21*i*f/256+483*i*h/4096-i*(224*o-1969)*m/16384-i*(33152*o-112599)*g/1048576)*y+(151*i*h/4096+4681*i*m/65536+1479*i*g/16384-453*r*g/32768)*I+(1097*i*m/65536+42783*i*g/1048576)*S+8011*i*g/1048576*v+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*h/4096-33*o*h/512+20861*m/524288-33*o*m/512+s*m/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*A+(21*u/256+21*f/256+533*h/8192-21*o*h/512+197*m/4096-315*o*m/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*C+(151*f/6144+151*h/4096+5019*m/131072-453*o*m/16384+26965*g/786432-8607*o*g/131072)*E+(1097*h/131072+1097*m/65536+225797*g/10485760-1097*o*g/65536)*x+(8011*m/2621440+8011*g/1048576)*w+293393*g/251658240*P}function Ix(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function I2e(e,t,n,i,o){let r=Ix(e._ellipticity,n),s=Ix(e._ellipticity,o);return Math.atan2(D.negativePiToPi(i-t),s-r)}function b2e(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(D.equalsEpsilon(Math.abs(a),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(o)*D.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=GW(e._ellipticity,t,o);u=(GW(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var x2e=new d,UW=new d;function oae(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,UW),x2e),r=d.normalize(i.cartographicToCartesian(n,UW),UW),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=I2e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=b2e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function rae(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=GW(o,i,e.latitude),h=n*Math.cos(t),m=f+h;if(c=E2e(m,o,i),Math.abs(t)<D.EPSILON10)a=D.negativePiToPi(e.longitude);else{let g=Ix(o,e.latitude),A=Ix(o,c);u=Math.tan(t)*(A-g),a=D.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*h*h)}u=n/f,t>0?a=D.negativePiToPi(e.longitude+u):a=D.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new he(a,c,0)}function Pp(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&oae(this,e,t,i)}Object.defineProperties(Pp.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}}});Pp.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??te.default,s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=D.negativePiToPi(t);let h=rae(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new Pp(e,h,r):(o.setEndPoints(e,h),o)};Pp.prototype.setEndPoints=function(e,t){oae(this,e,t,this._ellipsoid)};Pp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Pp.prototype.interpolateUsingSurfaceDistance=function(e,t){return rae(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Pp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(r.longitude)*Math.PI),l(t)||(t=new he),Math.abs(D.PI_OVER_TWO-o)<=D.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-o),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,r.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(D.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,h;do{h=f;let m=n*Math.sin(h),g=(1+m)/(1-m);f=2*Math.atan(c*Math.pow(g/u,n/2))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,h,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};Pp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let r=Ix(n,o.latitude),s=Ix(n,e),a=Math.tan(i)*(s-r),c=D.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var _c=Pp;var KW=[Gi,ui],T2e=KW.length,Tae=Math.cos(D.toRadians(30)),sae=Math.cos(D.toRadians(150)),Sae=0,Bae=1e3;function K_(e){e=e??V.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??an.GEODESIC,this._ellipsoid=te.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(K_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+te.packedLength+1+1}}});K_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<T2e;i++)if(t instanceof KW[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var S2e=new d,aae=new d,cae=new d;function qW(e,t,n,i,o){let r=yl(i,e,0,S2e),s=yl(i,e,n,aae),a=yl(i,t,0,cae),c=Rp(s,r,aae),u=Rp(a,r,cae);return d.cross(u,c,o),d.normalize(o,o)}var B2e=new he,w2e=new d,D2e=new d,v2e=new d;function zW(e,t,n,i,o,r,s,a,c,u,f){if(o===0)return;let h;r===an.GEODESIC?h=new vp(e,t,s):r===an.RHUMB&&(h=new _c(e,t,s));let m=h.surfaceDistance;if(m<o)return;let g=qW(e,t,i,s,v2e),A=Math.ceil(m/o),_=m/A,C=_,y=A-1,E=a.length;for(let I=0;I<y;I++){let x=h.interpolateUsingSurfaceDistance(C,B2e),S=yl(s,x,n,w2e),w=yl(s,x,i,D2e);d.pack(g,a,E),d.pack(S,c,E),d.pack(w,u,E),f.push(x.latitude),f.push(x.longitude),E+=3,C+=_}}var VW=new he;function yl(e,t,n,i){return he.clone(t,VW),VW.height=n,he.toCartesian(VW,e,i)}K_.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];d.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,te.pack(e._ellipsoid,t,i),i+=te.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};K_.unpack=function(e,t,n){let i=t??0,o=e[i++],r=new Array(o);for(let m=0;m<o;m++)r[m]=d.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=te.unpack(e,i);i+=te.packedLength;let f=e[i++],h=e[i++]===1;return l(n)||(n=new K_({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=h,n};function Rp(e,t,n){return d.subtract(e,t,n),d.normalize(n,n),n}function lae(e,t,n,i){return i=Rp(e,t,i),i=d.cross(i,n,i),i=d.normalize(i,i),i=d.cross(n,i,i),i}var P2e=new d,R2e=new d,M2e=new d,wae=new d,N2e=0,L2e=-1;function HW(e,t,n,i,o){let r=Rp(n,t,wae),s=lae(e,t,r,P2e),a=lae(i,t,r,R2e);if(D.equalsEpsilon(d.dot(s,a),L2e,D.EPSILON5))return o=d.cross(r,s,o),o=d.normalize(o,o),o;o=d.add(a,s,o),o=d.normalize(o,o);let c=d.cross(r,o,M2e);return d.dot(a,c)<N2e&&(o=d.negate(o,o)),o}var Gz=rn.fromPointNormal(d.ZERO,d.UNIT_Y),O2e=new d,F2e=new d,Q2e=new d,k2e=new d,U2e=new d,Qz=new d,kz=new he,uae=new he,fae=new he;K_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new KW[e._projectionIndex](i),a=Sae,c=Bae,u,f,h=e._positions,m=h.length;m===2&&(n=!1);let g,A,_,C,y=new _c(void 0,void 0,i),E,I,x,S=[h[0]];for(f=0;f<m-1;f++)g=h[f],A=h[f+1],E=ci.lineSegmentPlane(g,A,Gz,Qz),l(E)&&!d.equalsEpsilon(E,g,D.EPSILON7)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&(e.arcType===an.GEODESIC?S.push(d.clone(E)):e.arcType===an.RHUMB&&(x=i.cartesianToCartographic(E,kz).longitude,_=i.cartesianToCartographic(g,kz),C=i.cartesianToCartographic(A,uae),y.setEndPoints(_,C),I=y.findIntersectionWithLongitude(x,fae),E=i.cartographicToCartesian(I,Qz),l(E)&&!d.equalsEpsilon(E,g,D.EPSILON7)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&S.push(d.clone(E)))),S.push(A);n&&(g=h[m-1],A=h[0],E=ci.lineSegmentPlane(g,A,Gz,Qz),l(E)&&!d.equalsEpsilon(E,g,D.EPSILON7)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&(e.arcType===an.GEODESIC?S.push(d.clone(E)):e.arcType===an.RHUMB&&(x=i.cartesianToCartographic(E,kz).longitude,_=i.cartesianToCartographic(g,kz),C=i.cartesianToCartographic(A,uae),y.setEndPoints(_,C),I=y.findIntersectionWithLongitude(x,fae),E=i.cartographicToCartesian(I,Qz),l(E)&&!d.equalsEpsilon(E,g,D.EPSILON7)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&S.push(d.clone(E)))));let w=S.length,v=new Array(w);for(f=0;f<w;f++){let W=he.fromCartesian(S[f],i);W.height=0,v[f]=W}if(v=Uo(v,he.equalsEpsilon),w=v.length,w<2)return;let P=[],N=[],L=[],p=[],b=O2e,T=F2e,B=Q2e,R=k2e,O=U2e,U=v[0],k=v[1],z=v[w-1];for(b=yl(i,z,a,b),R=yl(i,k,a,R),T=yl(i,U,a,T),B=yl(i,U,c,B),n?O=HW(b,T,B,R,O):O=qW(U,k,c,i,O),d.pack(O,N,0),d.pack(T,L,0),d.pack(B,p,0),P.push(U.latitude),P.push(U.longitude),zW(U,k,a,c,o,r,i,N,L,p,P),f=1;f<w-1;++f){b=d.clone(T,b),T=d.clone(R,T);let W=v[f];yl(i,W,c,B),yl(i,v[f+1],a,R),HW(b,T,B,R,O),u=N.length,d.pack(O,N,u),d.pack(T,L,u),d.pack(B,p,u),P.push(W.latitude),P.push(W.longitude),zW(v[f],v[f+1],a,c,o,r,i,N,L,p,P)}let Q=v[w-1],H=v[w-2];if(T=yl(i,Q,a,T),B=yl(i,Q,c,B),n){let W=v[0];b=yl(i,H,a,b),R=yl(i,W,a,R),O=HW(b,T,B,R,O)}else O=qW(H,Q,c,i,O);if(u=N.length,d.pack(O,N,u),d.pack(T,L,u),d.pack(B,p,u),P.push(Q.latitude),P.push(Q.longitude),n){for(zW(Q,U,a,c,o,r,i,N,L,p,P),u=N.length,f=0;f<3;++f)N[u+f]=N[f],L[u+f]=L[f],p[u+f]=p[f];P.push(U.latitude),P.push(U.longitude)}return dke(n,s,L,p,N,P,t)};var G2e=new d,z2e=new X,V2e=new Qe;function dae(e,t,n,i){let o=Rp(n,t,G2e),r=d.dot(o,e);if(r>Tae||r<sae){let s=Rp(i,n,wae),a=r<sae?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Qe.fromAxisAngle(s,a,V2e),u=X.fromQuaternion(c,z2e);return X.multiplyByVector(u,e,e),!0}return!1}var hae=new he,H2e=new d,Aae=new d;function PR(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,H2e),s=d.add(r,n,Aae),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,hae);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(a=!0,s=d.subtract(r,n,Aae),u=c.cartesianToCartographic(s,hae)),u.height=0;let f=e.project(u,o);return o=d.subtract(f,i,o),o.z=0,o=d.normalize(o,o),a&&d.negate(o,o),o}var Y2e=new d,mae=new d;function pae(e,t,n,i,o,r){let s=d.subtract(t,e,Y2e);d.normalize(s,s);let a=n-Sae,c=d.multiplyByScalar(s,a,mae);d.add(e,c,o);let u=i-Bae;c=d.multiplyByScalar(s,u,mae),d.add(t,c,r)}var W2e=new d;function Uz(e,t){let n=rn.getPointDistance(Gz,e),i=rn.getPointDistance(Gz,t),o=W2e;D.equalsEpsilon(n,0,D.EPSILON2)?(o=Rp(t,e,o),d.multiplyByScalar(o,D.EPSILON2,o),d.add(e,o,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(o=Rp(e,t,o),d.multiplyByScalar(o,D.EPSILON2,o),d.add(t,o,t))}function j2e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let o=D.sign(t.longitude);return e.longitude=o*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let o=D.sign(e.longitude);return t.longitude=o*(i-D.EPSILON11),2}return 0}var Dae=new he,vae=new he,gae=new d,YW=new d,_ae=new d,Cae=new d,q2e=new d,yae=new d,K2e=[Dae,vae],J2e=new ce,X2e=new d,Z2e=new d,$2e=new d,eke=new d,tke=new d,nke=new d,WW=new d,jW=new d,ike=new d,oke=new d,rke=new d,Eae=new d,ske=new d,ake=new d,cke=new $n,lke=new $n,Iae=new d,uke=new d,bae=new d,fke=[new le,new le],Pae=[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],xae=Pae.length;function dke(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,h=f*8,m=h*4,g=f*36,A=h>65535?new Uint32Array(g):new Uint16Array(g),_=new Float64Array(h*3),C=new Float32Array(m),y=new Float32Array(m),E=new Float32Array(m),I=new Float32Array(m),x=new Float32Array(m),S,w,v,P;s&&(S=new Float32Array(m),w=new Float32Array(m),v=new Float32Array(m),P=new Float32Array(h*2));let N=r.length/2,L=0,p=Dae;p.height=0;let b=vae;b.height=0;let T=gae,B=YW;if(s)for(c=0,a=1;a<N;a++)p.latitude=r[c],p.longitude=r[c+1],b.latitude=r[c+2],b.longitude=r[c+3],T=t.project(p,T),B=t.project(b,B),L+=d.distance(T,B),c+=2;let R=i.length/3;B=d.unpack(i,0,B);let O=0;for(c=3,a=1;a<R;a++)T=d.clone(B,T),B=d.unpack(i,c,B),O+=d.distance(T,B),c+=3;let U;c=3;let k=0,z=0,Q=0,H=0,W=!1,Z=d.unpack(n,0,Cae),Y=d.unpack(i,0,YW),$=d.unpack(o,0,yae);if(e){let be=d.unpack(n,n.length-6,_ae);dae($,be,Z,Y)&&($=d.negate($,$))}let K=0,fe=0,ge=0;for(a=0;a<f;a++){let be=d.clone(Z,_ae),Ne=d.clone(Y,gae),ke=d.clone($,q2e);W&&(ke=d.negate(ke,ke)),Z=d.unpack(n,c,Cae),Y=d.unpack(i,c,YW),$=d.unpack(o,c,yae),W=dae($,be,Z,Y),p.latitude=r[k],p.longitude=r[k+1],b.latitude=r[k+2],b.longitude=r[k+3];let Ue,He,Et,Ye;if(s){let vn=j2e(p,b);Ue=t.project(p,tke),He=t.project(b,nke);let Ho=Rp(He,Ue,Iae);Ho.y=Math.abs(Ho.y),Et=WW,Ye=jW,vn===0||d.dot(Ho,d.UNIT_Y)>Tae?(Et=PR(t,p,ke,Ue,WW),Ye=PR(t,b,$,He,jW)):vn===1?(Ye=PR(t,b,$,He,jW),Et.x=0,Et.y=D.sign(p.longitude-Math.abs(b.longitude)),Et.z=0):(Et=PR(t,p,ke,Ue,WW),Ye.x=0,Ye.y=D.sign(p.longitude-b.longitude),Ye.z=0)}let nt=d.distance(Ne,Y),Ct=$n.fromCartesian(be,cke),Wt=d.subtract(Z,be,ike),Qn=d.normalize(Wt,Eae),on=d.subtract(Ne,be,oke);on=d.normalize(on,on);let lt=d.cross(Qn,on,Eae);lt=d.normalize(lt,lt);let Nt=d.cross(on,ke,ske);Nt=d.normalize(Nt,Nt);let Mn=d.subtract(Y,Z,rke);Mn=d.normalize(Mn,Mn);let at=d.cross($,Mn,ake);at=d.normalize(at,at);let fi=nt/O,ro=K/O,Ao=0,ii,so,ao,Ui=0,Pi=0;if(s){Ao=d.distance(Ue,He),ii=$n.fromCartesian(Ue,lke),so=d.subtract(He,Ue,Iae),ao=d.normalize(so,uke);let vn=ao.x;ao.x=ao.y,ao.y=-vn,Ui=Ao/L,Pi=fe/L}for(U=0;U<8;U++){let vn=H+U*4,Ho=z+U*2,Yo=vn+3,Xs=U<4?1:-1,Ri=U===2||U===3||U===6||U===7?1:-1;d.pack(Ct.high,C,vn),C[Yo]=Wt.x,d.pack(Ct.low,y,vn),y[Yo]=Wt.y,d.pack(Nt,E,vn),E[Yo]=Wt.z,d.pack(at,I,vn),I[Yo]=fi*Xs,d.pack(lt,x,vn);let Po=ro*Ri;Po===0&&Ri<0&&(Po=9),x[Yo]=Po,s&&(S[vn]=ii.high.x,S[vn+1]=ii.high.y,S[vn+2]=ii.low.x,S[vn+3]=ii.low.y,v[vn]=-Et.y,v[vn+1]=Et.x,v[vn+2]=Ye.y,v[vn+3]=-Ye.x,w[vn]=so.x,w[vn+1]=so.y,w[vn+2]=ao.x,w[vn+3]=ao.y,P[Ho]=Ui*Xs,Po=Pi*Ri,Po===0&&Ri<0&&(Po=9),P[Ho+1]=Po)}let Vn=$2e,co=eke,Vo=X2e,hr=Z2e,Rr=ce.fromCartographicArray(K2e,J2e),Js=Si.getMinimumMaximumHeights(Rr,u),Is=Js.minimumTerrainHeight,ka=Js.maximumTerrainHeight;ge+=Math.abs(Is),ge+=Math.abs(ka),pae(be,Ne,Is,ka,Vn,Vo),pae(Z,Y,Is,ka,co,hr);let mo=d.multiplyByScalar(lt,D.EPSILON5,bae);d.add(Vn,mo,Vn),d.add(co,mo,co),d.add(Vo,mo,Vo),d.add(hr,mo,hr),Uz(Vn,co),Uz(Vo,hr),d.pack(Vn,_,Q),d.pack(co,_,Q+3),d.pack(hr,_,Q+6),d.pack(Vo,_,Q+9),mo=d.multiplyByScalar(lt,-2*D.EPSILON5,bae),d.add(Vn,mo,Vn),d.add(co,mo,co),d.add(Vo,mo,Vo),d.add(hr,mo,hr),Uz(Vn,co),Uz(Vo,hr),d.pack(Vn,_,Q+12),d.pack(co,_,Q+15),d.pack(hr,_,Q+18),d.pack(Vo,_,Q+21),k+=2,c+=3,z+=16,Q+=24,H+=32,K+=nt,fe+=Ao}c=0;let ne=0;for(a=0;a<f;a++){for(U=0;U<xae;U++)A[c+U]=Pae[U]+ne;ne+=8,c+=xae}let Ce=fke;le.fromVertices(n,d.ZERO,3,Ce[0]),le.fromVertices(i,d.ZERO,3,Ce[1]);let ye=le.fromBoundingSpheres(Ce);ye.radius+=ge/(f*2);let De={position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,normalize:!1,values:_}),startHiAndForwardOffsetX:q_(C),startLoAndForwardOffsetY:q_(y),startNormalAndForwardOffsetZ:q_(E),endNormalAndTextureCoordinateNormalizationX:q_(I),rightNormalAndTextureCoordinateNormalizationY:q_(x)};return s&&(De.startHiLo2D=q_(S),De.offsetAndRight2D=q_(w),De.startEndNormals2D=q_(v),De.texcoordNormalization2D=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new ht({attributes:De,indices:A,boundingSphere:ye})}function q_(e){return new ve({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}K_._projectNormal=PR;var OE=K_;var RR=`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 MR=`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 NR=`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 LR=`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 OR=`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 ef=`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 JW=`${ef}
${OR}`,hke=PE;zt.isInternetExplorer()||(JW=`#define CLIP_POLYLINE
${JW}`);function FE(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=FE.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??JW,this._fragmentShaderSource=e.fragmentShaderSource??hke,this._renderState=yo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(FE.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}}});FE.VERTEX_FORMAT=Re.POSITION_ONLY;FE.prototype.getFragmentShaderSource=yo.prototype.getFragmentShaderSource;FE.prototype.isTranslucent=yo.prototype.isTranslucent;FE.prototype.getRenderState=yo.prototype.getRenderState;var Bs=FE;var FR=`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 QE=`#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 XW=`${ef}
${FR}`,Ake=QE;zt.isInternetExplorer()||(XW=`#define CLIP_POLYLINE
${XW}`);function kE(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=kE.VERTEX_FORMAT;this.material=l(e.material)?e.material:uo.fromType(uo.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??XW,this._fragmentShaderSource=e.fragmentShaderSource??Ake,this._renderState=yo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(kE.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}}});kE.VERTEX_FORMAT=Re.POSITION_AND_ST;kE.prototype.getFragmentShaderSource=yo.prototype.getFragmentShaderSource;kE.prototype.isTranslucent=yo.prototype.isTranslucent;kE.prototype.getRenderState=yo.prototype.getRenderState;var ja=kE;function Mp(e){e=e??V.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new ja),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Jn.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=Rae(!1),this._renderState3DTiles=Rae(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:Ni.FRONT},depthTest:{enabled:!0},blending:dn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Mp.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}}});Mp.initializeTerrainHeights=function(){return Si.initialize()};function mke(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(LR);s=Ln._appendShowToShader(o,s),s=Ln._appendDistanceDisplayConditionToShader(o,s),s=Ln._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(NR);a=Ln._appendShowToShader(o,a),a=Ln._appendDistanceDisplayConditionToShader(o,a),a=Ln._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(RR),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",h="";l(n.material)?(h=l(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let m=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new We({defines:u,sources:[s]}),A=new We({defines:m,sources:[h,c]});e._sp=sn.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:A,attributeLocations:r});let _=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(_)){let y=new We({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:y,fragmentShaderSource:A,attributeLocations:r})}e._sp2D=_;let C=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(C)){let y=new We({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Si._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(MR);let E=new We({defines:m,sources:[h,c]});C=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:y,fragmentShaderSource:E,attributeLocations:r})}e._spMorph=C}function Rae(e){return ze.fromCache({cull:{enabled:!0},blending:dn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Xn.EQUAL,frontOperation:{fail:yt.KEEP,zFail:yt.KEEP,zPass:yt.KEEP},backFunction:Xn.EQUAL,backOperation:{fail:yt.KEEP,zFail:yt.KEEP,zPass:yt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function pke(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof Bs?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let h=0;h<a;h++){let m=s._va[h],g=o[h];l(g)||(g=o[h]=new et({owner:e,primitiveType:s._primitiveType})),g.vertexArray=m,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=we.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let A=et.shallowClone(g,g.derivedCommands.tileset);A.renderState=e._renderState3DTiles,A.pass=we.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=A;let _=et.shallowClone(g,g.derivedCommands.color2D);_.shaderProgram=e._sp2D,g.derivedCommands.color2D=_;let C=et.shallowClone(A,A.derivedCommands.color2D);C.shaderProgram=e._sp2D,A.derivedCommands.color2D=C;let y=et.shallowClone(g,g.derivedCommands.colorMorph);y.renderState=e._renderStateMorph,y.shaderProgram=e._spMorph,y.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=y}}function Mae(e,t,n,i,o,r,s){n.mode===oe.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==oe.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function gke(e,t,n,i,o,r,s){let a=e._primitive;Ln._updateBoundingVolumes(a,t,o);let c;t.mode===oe.SCENE3D?c=a._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===oe.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===oe.MORPHING,f=e.classificationType,h=f!==Jn.CESIUM_3D_TILE,m=f!==Jn.TERRAIN&&!u,g,A=t.passes;if(A.render||A.pick&&a.allowPicking){let _=n.length;for(let C=0;C<_;++C){let y=c[C];h&&(g=n[C],Mae(e,g,t,o,r,y,s)),m&&(g=n[C].derivedCommands.tileset,Mae(e,g,t,o,r,y,s))}}}Mp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Si.initialized){Mp.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 u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new kc({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,OE.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Rt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){mke(n,u,f)},i._createCommandsFunction=function(c,u,f,h,m,g,A){pke(n,u,f,h,g,A)},i._updateAndQueueCommandsFunction=function(c,u,f,h,m,g,A,_){gke(n,u,f,h,m,g,A)},this._primitive=new Ln(i)}if(this.appearance instanceof Bs&&!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))})};Mp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Mp.isSupported=function(e){return e.frameState.context.depthTexture};Mp.prototype.isDestroyed=function(){return!1};Mp.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,de(this)};var xh=Mp;var _ke=new F(1,1),Cke=!1,yke=G.WHITE;function bx(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(bx.prototype,{isConstant:{get:function(){return j.isConstant(this._image)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:me("image"),repeat:me("repeat"),color:me("color"),transparent:me("transparent")});bx.prototype.getType=function(e){return"Image"};var Eke=new J;bx.prototype.getValue=function(e,t){return l(e)||(e=J.now(Eke)),l(t)||(t={}),t.image=j.getValueOrUndefined(this._image,e),t.repeat=j.getValueOrClonedDefault(this._repeat,e,_ke,t.repeat),t.color=j.getValueOrClonedDefault(this._color,e,yke,t.color),j.getValueOrDefault(this._transparent,e,Cke)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};bx.prototype.equals=function(e){return this===e||e instanceof bx&&j.equals(this._image,e._image)&&j.equals(this._repeat,e._repeat)&&j.equals(this._color,e._color)&&j.equals(this._transparent,e._transparent)};var J_=bx;function Ike(e){if(e instanceof G)return new jt(e);if(typeof e=="string"||e instanceof Be||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new J_;return t.image=e,t}}function bke(e,t){return me(e,t,Ike)}var er=bke;function QR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(QR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});QR.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 QR(this)};QR.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 UE=QR;var xke={FIXED:0,INERTIAL:1},$i=Object.freeze(xke);function xx(){Ae.throwInstantiationError()}Object.defineProperties(xx.prototype,{isConstant:{get:Ae.throwInstantiationError},definitionChanged:{get:Ae.throwInstantiationError},referenceFrame:{get:Ae.throwInstantiationError}});xx.prototype.getValue=Ae.throwInstantiationError;xx.prototype.getValueInReferenceFrame=Ae.throwInstantiationError;xx.prototype.equals=Ae.throwInstantiationError;var Nae=new X;xx.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new d),n===i)return d.clone(t,o);let r=It.computeIcrfToCentralBodyFixedMatrix(e,Nae);if(n===$i.INERTIAL)return X.multiplyByVector(r,t,o);if(n===$i.FIXED)return X.multiplyByVector(X.transpose(r,Nae),t,o)};var Th=xx;function GE(e,t){this._definitionChanged=new _e,this._value=d.clone(e),this._referenceFrame=t??$i.FIXED}Object.defineProperties(GE.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===$i.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Tke=new J;GE.prototype.getValue=function(e,t){return l(e)||(e=J.now(Tke)),this.getValueInReferenceFrame(e,$i.FIXED,t)};GE.prototype.setValue=function(e,t){let n=!1;d.equals(this._value,e)||(n=!0,this._value=d.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};GE.prototype.getValueInReferenceFrame=function(e,t,n){return Th.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};GE.prototype.equals=function(e){return this===e||e instanceof GE&&d.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var El=GE;function kR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(kR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});kR.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 kR(this)};kR.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 zE=kR;function Ske(e){return e}function Bke(e,t){return me(e,t,Ske)}var Il=Bke;function UR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(UR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),length:me("length"),topRadius:me("topRadius"),bottomRadius:me("bottomRadius"),heightReference:me("heightReference"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});UR.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 UR(this)};UR.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 VE=UR;function GR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(GR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),semiMajorAxis:me("semiMajorAxis"),semiMinorAxis:me("semiMinorAxis"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});GR.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 GR(this)};GR.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 HE=GR;function zR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(zR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),radii:me("radii"),innerRadii:me("innerRadii"),minimumClock:me("minimumClock"),maximumClock:me("maximumClock"),minimumCone:me("minimumCone"),maximumCone:me("maximumCone"),heightReference:me("heightReference"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),stackPartitions:me("stackPartitions"),slicePartitions:me("slicePartitions"),subdivisions:me("subdivisions"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});zR.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 zR(this)};zR.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 YE=zR;function VR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(VR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),text:me("text"),font:me("font"),style:me("style"),scale:me("scale"),showBackground:me("showBackground"),backgroundColor:me("backgroundColor"),backgroundPadding:me("backgroundPadding"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),fillColor:me("fillColor"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),scaleByDistance:me("scaleByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance")});VR.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 VR(this)};VR.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 Sh=VR;var wke=new d(1,1,1),Dke=d.ZERO,vke=Qe.IDENTITY;function Lae(e,t,n){this.translation=d.clone(e??Dke),this.rotation=Qe.clone(t??vke),this.scale=d.clone(n??wke)}Lae.prototype.equals=function(e){return this===e||l(e)&&d.equals(this.translation,e.translation)&&Qe.equals(this.rotation,e.rotation)&&d.equals(this.scale,e.scale)};var X_=Lae;var ZW=new X_;function HR(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(HR.prototype,{isConstant:{get:function(){return j.isConstant(this._translation)&&j.isConstant(this._rotation)&&j.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:me("translation"),rotation:me("rotation"),scale:me("scale")});var Pke=new J;HR.prototype.getValue=function(e,t){return l(e)||(e=J.now(Pke)),l(t)||(t=new X_),t.translation=j.getValueOrClonedDefault(this._translation,e,ZW.translation,t.translation),t.rotation=j.getValueOrClonedDefault(this._rotation,e,ZW.rotation,t.rotation),t.scale=j.getValueOrClonedDefault(this._scale,e,ZW.scale,t.scale),t};HR.prototype.equals=function(e){return this===e||e instanceof HR&&j.equals(this._translation,e._translation)&&j.equals(this._rotation,e._rotation)&&j.equals(this._scale,e._scale)};var WE=HR;function Np(e,t){this._propertyNames=[],this._definitionChanged=new _e,l(e)&&this.merge(e,t)}Object.defineProperties(Np.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(!j.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Np.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function Rke(e){return new li(e)}Np.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??Rke)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Np.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var Mke=new J;Np.prototype.getValue=function(e,t){l(e)||(e=J.now(Mke)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=j.getValueOrUndefined(this[r],e,t[r])}return t};Np.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 Nke(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||!j.equals(e[s],t[s]))return!1}return!0}Np.prototype.equals=function(e){return this===e||e instanceof Np&&Nke(this,e)};var bl=Np;function Oae(e){return new WE(e)}function Lke(e){return new bl(e,Oae)}function Oke(e){return new bl(e)}function Fke(e){return new bl(e)}function YR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(YR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),scale:me("scale"),enableVerticalExaggeration:me("enableVerticalExaggeration"),minimumPixelSize:me("minimumPixelSize"),maximumScale:me("maximumScale"),incrementallyLoadTextures:me("incrementallyLoadTextures"),runAnimations:me("runAnimations"),clampAnimations:me("clampAnimations"),shadows:me("shadows"),heightReference:me("heightReference"),silhouetteColor:me("silhouetteColor"),silhouetteSize:me("silhouetteSize"),color:me("color"),colorBlendMode:me("colorBlendMode"),colorBlendAmount:me("colorBlendAmount"),imageBasedLightingFactor:me("imageBasedLightingFactor"),environmentMapOptions:me("environmentMapOptions",void 0,Fke),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,Lke),articulations:me("articulations",void 0,Oke),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});YR.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 YR(this)};YR.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 bl(t,Oae)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new bl(n)}};var Lp=YR;function WR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(WR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});WR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new WR(this)};WR.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var jE=WR;function jR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(jR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:er("material"),distanceDisplayCondition:me("distanceDisplayCondition")});jR.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 jR(this)};jR.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 Op=jR;function qR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(qR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});qR.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 qR(this)};qR.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 KR=qR;function JR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(JR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),pixelSize:me("pixelSize"),heightReference:me("heightReference"),color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});JR.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 JR(this)};JR.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 qE=JR;function Qke(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Cc=Qke;function kke(e){return Array.isArray(e)&&(e=new Cc(e)),new li(e)}function XR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(XR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,kke),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),perPositionHeight:me("perPositionHeight"),closeTop:me("closeTop"),closeBottom:me("closeBottom"),arcType:me("arcType"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex"),textureCoordinates:me("textureCoordinates")});XR.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 XR(this)};XR.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 Bh=XR;function ZR(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(ZR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:er("material"),depthFailMaterial:er("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});ZR.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 ZR(this)};ZR.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 Uc=ZR;function $R(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties($R.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),shape:me("shape"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});$R.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 $R(this)};$R.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 KE=$R;function eM(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(eM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),coordinates:me("coordinates"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});eM.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 eM(this)};eM.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 wh=eM;function tM(e){this._definitionChanged=new _e,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??V.EMPTY_OBJECT)}Object.defineProperties(tM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),minimumHeights:me("minimumHeights"),maximumHeights:me("maximumHeights"),granularity:me("granularity"),fill:me("fill"),material:er("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});tM.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 tM(this)};tM.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 Fp=tM;var Uke=new he,$W=[];function Gke(e){return new El(e)}function zke(e){return me(e,void 0,Gke)}function ya(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function sd(e){e=e??V.EMPTY_OBJECT;let t=e.id;l(t)||(t=jn()),this._availability=void 0,this._id=t,this._definitionChanged=new _e,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??Dp.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",...$W],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 ej(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)&&ej(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(sd.prototype,{availability:Il("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Il("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&&ej(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Il("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&&ej(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:ya("billboard",Qc),box:ya("box",UE),corridor:ya("corridor",zE),cylinder:ya("cylinder",VE),description:me("description"),ellipse:ya("ellipse",HE),ellipsoid:ya("ellipsoid",YE),label:ya("label",Sh),model:ya("model",Lp),tileset:ya("tileset",jE),orientation:me("orientation"),path:ya("path",Op),plane:ya("plane",KR),point:ya("point",qE),polygon:ya("polygon",Bh),polyline:ya("polyline",Uc),polylineVolume:ya("polylineVolume",KE),properties:ya("properties",bl),position:zke("position"),rectangle:ya("rectangle",wh),viewFrom:me("viewFrom"),wall:ya("wall",Fp)});sd.registerEntityType=function(e,t){Object.defineProperties(sd.prototype,{[e]:ya(e,t)}),$W.includes(e)||$W.push(e)};sd.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};sd.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Il(e,!0))};sd.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};sd.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 Fae=new X,Qae=new d,kae=new Qe;sd.prototype.computeModelMatrix=function(e,t){let n=j.getValueOrUndefined(this._position,e,Qae);if(!l(n))return;let i=j.getValueOrUndefined(this._orientation,e,kae);return l(i)?t=M.fromRotationTranslation(X.fromQuaternion(i,Fae),n,t):t=It.eastNorthUpToFixedFrame(n,void 0,t),t};sd.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=j.getValueOrDefault(t,e,$e.NONE),s=j.getValueOrUndefined(this._position,e,Qae);if(r===$e.NONE||!l(s)||d.equalsEpsilon(s,d.ZERO,D.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,Uke);od(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=j.getValueOrUndefined(this._orientation,e,kae);return l(c)?o=M.fromRotationTranslation(X.fromQuaternion(c,Fae),s,o):o=It.eastNorthUpToFixedFrame(s,void 0,o),o};sd.supportsMaterialsforEntitiesOnTerrain=function(e){return Cl.supportsMaterials(e)};sd.supportsPolylinesOnTerrain=function(e){return xh.isSupported(e)};var Er=sd;var Vke=new jt(G.WHITE),Hke=new li(!0),Yke=new li(!0),Wke=new li(!1),jke=new li(G.BLACK),qke=new li(Tn.DISABLED),Kke=new li(new Qt),Jke=new li(Jn.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 _e,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=Er.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)&&j.isConstant(this._showProperty)&&j.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)&&j.isConstant(this._showProperty)&&j.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(){de(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 u=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??Vke,this._fillProperty=r??Yke,this._showProperty=u??Hke,this._showOutlineProperty=o.outline??Wke,this._outlineColorProperty=c?o.outlineColor??jke:void 0,this._shadowsProperty=o.shadows??qke,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??Kke,this._classificationTypeProperty=o.classificationType??Jke,this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof jt);if(c&&f&&(At(At.geometryOutlines),c=!1),this._onTerrain=f,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;function Tx(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(Tx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var Xke=new J;Tx.prototype.getValue=function(e,t){return l(e)||(e=J.now(Xke)),this._callback(e,t)};Tx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Tx.prototype.equals=function(e){return this===e||e instanceof Tx&&this._callback===e._callback&&this._isConstant===e._isConstant};var Dh=Tx;var Uae=new d;function Sx(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new d,this._cartographicPosition=new he,this._normal=new d,this._definitionChanged=new _e,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,Uae);if(!l(r)||d.equals(r,d.ZERO)||!l(e.globe))return;this._position=d.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(Sx.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});Sx.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(d.equals(t,d.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 Zke=new J;Sx.prototype.getValue=function(e,t){l(e)||(e=J.now(Zke));let n=j.getValueOrDefault(this._heightReference,e,$e.NONE),i=j.getValueOrDefault(this._extrudedHeightReference,e,$e.NONE);if(n===$e.NONE&&!hx(i))return this._position=d.clone(d.ZERO,this._position),d.clone(d.ZERO,t);if(this._positionProperty.isConstant)return d.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Uae);if(!l(r)||d.equals(r,d.ZERO)||!l(o.globe))return d.clone(d.ZERO,t);if(d.equalsEpsilon(this._position,r,D.EPSILON10))return d.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=d.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return d.multiplyByScalar(s,this._terrainHeight,t)};Sx.prototype.isDestroyed=function(){return!1};Sx.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),de(this)};var JE=Sx;function $ke(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 Dh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new JE(this._scene,s,r)}}var Qp=$ke;var Gae=d.ZERO,zae=new d,e3e=new d,Vae=new G;function t3e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function tf(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new t3e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(tf.prototype=Object.create(Ei.prototype),tf.prototype.constructor=tf);Object.defineProperties(tf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});tf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof jt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Vae)),l(a)||(a=G.WHITE),s.color=Xt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Gae,zae))),new Rt({id:t,geometry:mc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};tf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Vae),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Gae,zae))),new Rt({id:t,geometry:bh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};tf.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};tf.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Ei.prototype._isHidden.call(this,e,t)};tf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};tf.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,$e.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof jt?hn.VERTEX_FORMAT:xo.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ke.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==$e.NONE?un.ALL:void 0};tf.prototype._onEntityPropertyChanged=Qp;tf.DynamicGeometryUpdater=Bx;function Bx(e,t,n){yi.call(this,e,t,n)}l(Object.create)&&(Bx.prototype=Object.create(yi.prototype),Bx.prototype.constructor=Bx);Bx.prototype._isHidden=function(e,t,n){let i=j.getValueOrUndefined(e.position,n,e3e),o=this._options.dimensions;return!l(i)||!l(o)||yi.prototype._isHidden.call(this,e,t,n)};Bx.prototype._setOptions=function(e,t,n){let i=j.getValueOrDefault(t.heightReference,n,$e.NONE),o=this._options;o.dimensions=j.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==$e.NONE?un.ALL:void 0};var nM=tf;function XE(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??$i.FIXED,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(XE.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var n3e=new J;XE.prototype.getValue=function(e,t){return l(e)||(e=J.now(n3e)),this.getValueInReferenceFrame(e,$i.FIXED,t)};XE.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};XE.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Th.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};XE.prototype.equals=function(e){return this===e||e instanceof XE&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var iM=XE;/*! @license DOMPurify 3.3.0 | (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.0/LICENSE */var{entries:Zae,setPrototypeOf:Hae,isFrozen:i3e,getPrototypeOf:o3e,getOwnPropertyDescriptor:r3e}=Object,{freeze:Sl,seal:ad,create:aj}=Object,{apply:cj,construct:lj}=typeof Reflect<"u"&&Reflect;Sl||(Sl=function(t){return t});ad||(ad=function(t){return t});cj||(cj=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)});lj||(lj=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 zz=Bl(Array.prototype.forEach),s3e=Bl(Array.prototype.lastIndexOf),Yae=Bl(Array.prototype.pop),oM=Bl(Array.prototype.push),a3e=Bl(Array.prototype.splice),Hz=Bl(String.prototype.toLowerCase),tj=Bl(String.prototype.toString),nj=Bl(String.prototype.match),rM=Bl(String.prototype.replace),c3e=Bl(String.prototype.indexOf),l3e=Bl(String.prototype.trim),vh=Bl(Object.prototype.hasOwnProperty),Tl=Bl(RegExp.prototype.test),sM=u3e(TypeError);function Bl(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 cj(e,t,i)}}function u3e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return lj(e,n)}}function Hi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hz;Hae&&Hae(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(i3e(t)||(t[i]=r),o=r)}e[o]=!0}return e}function f3e(e){for(let t=0;t<e.length;t++)vh(e,t)||(e[t]=null);return e}function kp(e){let t=aj(null);for(let[n,i]of Zae(e))vh(e,n)&&(Array.isArray(i)?t[n]=f3e(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=kp(i):t[n]=i);return t}function aM(e,t){for(;e!==null;){let i=r3e(e,t);if(i){if(i.get)return Bl(i.get);if(typeof i.value=="function")return Bl(i.value)}e=o3e(e)}function n(){return null}return n}var Wae=Sl(["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"]),ij=Sl(["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"]),oj=Sl(["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"]),d3e=Sl(["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"]),rj=Sl(["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"]),h3e=Sl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),jae=Sl(["#text"]),qae=Sl(["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"]),sj=Sl(["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"]),Kae=Sl(["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"]),Vz=Sl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),A3e=ad(/\{\{[\w\W]*|[\w\W]*\}\}/gm),m3e=ad(/<%[\w\W]*|[\w\W]*%>/gm),p3e=ad(/\$\{[\w\W]*/gm),g3e=ad(/^data-[\-\w.\u00B7-\uFFFF]+$/),_3e=ad(/^aria-[\-\w]+$/),$ae=ad(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),C3e=ad(/^(?:\w+script|data):/i),y3e=ad(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ece=ad(/^html$/i),E3e=ad(/^[a-z][.\w]*(-[.\w]+)+$/i),Jae=Object.freeze({__proto__:null,ARIA_ATTR:_3e,ATTR_WHITESPACE:y3e,CUSTOM_ELEMENT:E3e,DATA_ATTR:g3e,DOCTYPE_NAME:ece,ERB_EXPR:m3e,IS_ALLOWED_URI:$ae,IS_SCRIPT_OR_DATA:C3e,MUSTACHE_EXPR:A3e,TMPLIT_EXPR:p3e}),cM={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},I3e=function(){return typeof window>"u"?null:window},b3e=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}},Xae=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function tce(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I3e(),t=An=>tce(An);if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==cM.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:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:g}=e,A=c.prototype,_=aM(A,"cloneNode"),C=aM(A,"remove"),y=aM(A,"nextSibling"),E=aM(A,"childNodes"),I=aM(A,"parentNode");if(typeof s=="function"){let An=n.createElement("template");An.content&&An.content.ownerDocument&&(n=An.content.ownerDocument)}let x,S="",{implementation:w,createNodeIterator:v,createDocumentFragment:P,getElementsByTagName:N}=n,{importNode:L}=i,p=Xae();t.isSupported=typeof Zae=="function"&&typeof I=="function"&&w&&w.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:b,ERB_EXPR:T,TMPLIT_EXPR:B,DATA_ATTR:R,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:z}=Jae,{IS_ALLOWED_URI:Q}=Jae,H=null,W=Hi({},[...Wae,...ij,...oj,...rj,...jae]),Z=null,Y=Hi({},[...qae,...sj,...Kae,...Vz]),$=Object.seal(aj(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}})),K=null,fe=null,ge=Object.seal(aj(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ne=!0,Ce=!0,ye=!1,De=!0,be=!1,Ne=!0,ke=!1,Ue=!1,He=!1,Et=!1,Ye=!1,nt=!1,Ct=!0,Wt=!1,Qn="user-content-",on=!0,lt=!1,Nt={},Mn=null,at=Hi({},["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,ro=Hi({},["audio","video","img","source","image","track"]),Ao=null,ii=Hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),so="http://www.w3.org/1998/Math/MathML",ao="http://www.w3.org/2000/svg",Ui="http://www.w3.org/1999/xhtml",Pi=Ui,Vn=!1,co=null,Vo=Hi({},[so,ao,Ui],tj),hr=Hi({},["mi","mo","mn","ms","mtext"]),Rr=Hi({},["annotation-xml"]),Js=Hi({},["title","style","font","a","script"]),Is=null,ka=["application/xhtml+xml","text/html"],mo="text/html",vn=null,Ho=null,Yo=n.createElement("form"),Xs=function(Se){return Se instanceof RegExp||Se instanceof Function},Ri=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ho&&Ho===Se)){if((!Se||typeof Se!="object")&&(Se={}),Se=kp(Se),Is=ka.indexOf(Se.PARSER_MEDIA_TYPE)===-1?mo:Se.PARSER_MEDIA_TYPE,vn=Is==="application/xhtml+xml"?tj:Hz,H=vh(Se,"ALLOWED_TAGS")?Hi({},Se.ALLOWED_TAGS,vn):W,Z=vh(Se,"ALLOWED_ATTR")?Hi({},Se.ALLOWED_ATTR,vn):Y,co=vh(Se,"ALLOWED_NAMESPACES")?Hi({},Se.ALLOWED_NAMESPACES,tj):Vo,Ao=vh(Se,"ADD_URI_SAFE_ATTR")?Hi(kp(ii),Se.ADD_URI_SAFE_ATTR,vn):ii,fi=vh(Se,"ADD_DATA_URI_TAGS")?Hi(kp(ro),Se.ADD_DATA_URI_TAGS,vn):ro,Mn=vh(Se,"FORBID_CONTENTS")?Hi({},Se.FORBID_CONTENTS,vn):at,K=vh(Se,"FORBID_TAGS")?Hi({},Se.FORBID_TAGS,vn):kp({}),fe=vh(Se,"FORBID_ATTR")?Hi({},Se.FORBID_ATTR,vn):kp({}),Nt=vh(Se,"USE_PROFILES")?Se.USE_PROFILES:!1,ne=Se.ALLOW_ARIA_ATTR!==!1,Ce=Se.ALLOW_DATA_ATTR!==!1,ye=Se.ALLOW_UNKNOWN_PROTOCOLS||!1,De=Se.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=Se.SAFE_FOR_TEMPLATES||!1,Ne=Se.SAFE_FOR_XML!==!1,ke=Se.WHOLE_DOCUMENT||!1,Et=Se.RETURN_DOM||!1,Ye=Se.RETURN_DOM_FRAGMENT||!1,nt=Se.RETURN_TRUSTED_TYPE||!1,He=Se.FORCE_BODY||!1,Ct=Se.SANITIZE_DOM!==!1,Wt=Se.SANITIZE_NAMED_PROPS||!1,on=Se.KEEP_CONTENT!==!1,lt=Se.IN_PLACE||!1,Q=Se.ALLOWED_URI_REGEXP||$ae,Pi=Se.NAMESPACE||Ui,hr=Se.MATHML_TEXT_INTEGRATION_POINTS||hr,Rr=Se.HTML_INTEGRATION_POINTS||Rr,$=Se.CUSTOM_ELEMENT_HANDLING||{},Se.CUSTOM_ELEMENT_HANDLING&&Xs(Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&Xs(Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&typeof Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),be&&(Ce=!1),Ye&&(Et=!0),Nt&&(H=Hi({},jae),Z=[],Nt.html===!0&&(Hi(H,Wae),Hi(Z,qae)),Nt.svg===!0&&(Hi(H,ij),Hi(Z,sj),Hi(Z,Vz)),Nt.svgFilters===!0&&(Hi(H,oj),Hi(Z,sj),Hi(Z,Vz)),Nt.mathMl===!0&&(Hi(H,rj),Hi(Z,Kae),Hi(Z,Vz))),Se.ADD_TAGS&&(typeof Se.ADD_TAGS=="function"?ge.tagCheck=Se.ADD_TAGS:(H===W&&(H=kp(H)),Hi(H,Se.ADD_TAGS,vn))),Se.ADD_ATTR&&(typeof Se.ADD_ATTR=="function"?ge.attributeCheck=Se.ADD_ATTR:(Z===Y&&(Z=kp(Z)),Hi(Z,Se.ADD_ATTR,vn))),Se.ADD_URI_SAFE_ATTR&&Hi(Ao,Se.ADD_URI_SAFE_ATTR,vn),Se.FORBID_CONTENTS&&(Mn===at&&(Mn=kp(Mn)),Hi(Mn,Se.FORBID_CONTENTS,vn)),on&&(H["#text"]=!0),ke&&Hi(H,["html","head","body"]),H.table&&(Hi(H,["tbody"]),delete K.tbody),Se.TRUSTED_TYPES_POLICY){if(typeof Se.TRUSTED_TYPES_POLICY.createHTML!="function")throw sM('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Se.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw sM('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=Se.TRUSTED_TYPES_POLICY,S=x.createHTML("")}else x===void 0&&(x=b3e(g,o)),x!==null&&typeof S=="string"&&(S=x.createHTML(""));Sl&&Sl(Se),Ho=Se}},Po=Hi({},[...ij,...oj,...d3e]),dc=Hi({},[...rj,...h3e]),Zs=function(Se){let wt=I(Se);(!wt||!wt.tagName)&&(wt={namespaceURI:Pi,tagName:"template"});let mn=Hz(Se.tagName),Ar=Hz(wt.tagName);return co[Se.namespaceURI]?Se.namespaceURI===ao?wt.namespaceURI===Ui?mn==="svg":wt.namespaceURI===so?mn==="svg"&&(Ar==="annotation-xml"||hr[Ar]):!!Po[mn]:Se.namespaceURI===so?wt.namespaceURI===Ui?mn==="math":wt.namespaceURI===ao?mn==="math"&&Rr[Ar]:!!dc[mn]:Se.namespaceURI===Ui?wt.namespaceURI===ao&&!Rr[Ar]||wt.namespaceURI===so&&!hr[Ar]?!1:!dc[mn]&&(Js[mn]||!Po[mn]):!!(Is==="application/xhtml+xml"&&co[Se.namespaceURI]):!1},Mr=function(Se){oM(t.removed,{element:Se});try{I(Se).removeChild(Se)}catch{C(Se)}},Nr=function(Se,wt){try{oM(t.removed,{attribute:wt.getAttributeNode(Se),from:wt})}catch{oM(t.removed,{attribute:null,from:wt})}if(wt.removeAttribute(Se),Se==="is")if(Et||Ye)try{Mr(wt)}catch{}else try{wt.setAttribute(Se,"")}catch{}},uh=function(Se){let wt=null,mn=null;if(He)Se="<remove></remove>"+Se;else{let bs=nj(Se,/^[\r\n\t ]+/);mn=bs&&bs[0]}Is==="application/xhtml+xml"&&Pi===Ui&&(Se='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Se+"</body></html>");let Ar=x?x.createHTML(Se):Se;if(Pi===Ui)try{wt=new m().parseFromString(Ar,Is)}catch{}if(!wt||!wt.documentElement){wt=w.createDocument(Pi,"template",null);try{wt.documentElement.innerHTML=Vn?S:Ar}catch{}}let Ga=wt.body||wt.documentElement;return Se&&mn&&Ga.insertBefore(n.createTextNode(mn),Ga.childNodes[0]||null),Pi===Ui?N.call(wt,ke?"html":"body")[0]:ke?wt.documentElement:Ga},Fs=function(Se){return v.call(Se.ownerDocument||Se,Se,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ua=function(Se){return Se instanceof h&&(typeof Se.nodeName!="string"||typeof Se.textContent!="string"||typeof Se.removeChild!="function"||!(Se.attributes instanceof f)||typeof Se.removeAttribute!="function"||typeof Se.setAttribute!="function"||typeof Se.namespaceURI!="string"||typeof Se.insertBefore!="function"||typeof Se.hasChildNodes!="function")},zA=function(Se){return typeof a=="function"&&Se instanceof a};function Ro(An,Se,wt){zz(An,mn=>{mn.call(t,Se,wt,Ho)})}let eu=function(Se){let wt=null;if(Ro(p.beforeSanitizeElements,Se,null),Ua(Se))return Mr(Se),!0;let mn=vn(Se.nodeName);if(Ro(p.uponSanitizeElement,Se,{tagName:mn,allowedTags:H}),Ne&&Se.hasChildNodes()&&!zA(Se.firstElementChild)&&Tl(/<[/\w!]/g,Se.innerHTML)&&Tl(/<[/\w!]/g,Se.textContent)||Se.nodeType===cM.progressingInstruction||Ne&&Se.nodeType===cM.comment&&Tl(/<[/\w]/g,Se.data))return Mr(Se),!0;if(!(ge.tagCheck instanceof Function&&ge.tagCheck(mn))&&(!H[mn]||K[mn])){if(!K[mn]&&Aa(mn)&&($.tagNameCheck instanceof RegExp&&Tl($.tagNameCheck,mn)||$.tagNameCheck instanceof Function&&$.tagNameCheck(mn)))return!1;if(on&&!Mn[mn]){let Ar=I(Se)||Se.parentNode,Ga=E(Se)||Se.childNodes;if(Ga&&Ar){let bs=Ga.length;for(let Dc=bs-1;Dc>=0;--Dc){let zu=_(Ga[Dc],!0);zu.__removalCount=(Se.__removalCount||0)+1,Ar.insertBefore(zu,y(Se))}}}return Mr(Se),!0}return Se instanceof c&&!Zs(Se)||(mn==="noscript"||mn==="noembed"||mn==="noframes")&&Tl(/<\/no(script|embed|frames)/i,Se.innerHTML)?(Mr(Se),!0):(be&&Se.nodeType===cM.text&&(wt=Se.textContent,zz([b,T,B],Ar=>{wt=rM(wt,Ar," ")}),Se.textContent!==wt&&(oM(t.removed,{element:Se.cloneNode()}),Se.textContent=wt)),Ro(p.afterSanitizeElements,Se,null),!1)},tu=function(Se,wt,mn){if(Ct&&(wt==="id"||wt==="name")&&(mn in n||mn in Yo))return!1;if(!(Ce&&!fe[wt]&&Tl(R,wt))){if(!(ne&&Tl(O,wt))){if(!(ge.attributeCheck instanceof Function&&ge.attributeCheck(wt,Se))){if(!Z[wt]||fe[wt]){if(!(Aa(Se)&&($.tagNameCheck instanceof RegExp&&Tl($.tagNameCheck,Se)||$.tagNameCheck instanceof Function&&$.tagNameCheck(Se))&&($.attributeNameCheck instanceof RegExp&&Tl($.attributeNameCheck,wt)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(wt,Se))||wt==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&Tl($.tagNameCheck,mn)||$.tagNameCheck instanceof Function&&$.tagNameCheck(mn))))return!1}else if(!Ao[wt]){if(!Tl(Q,rM(mn,k,""))){if(!((wt==="src"||wt==="xlink:href"||wt==="href")&&Se!=="script"&&c3e(mn,"data:")===0&&fi[Se])){if(!(ye&&!Tl(U,rM(mn,k,"")))){if(mn)return!1}}}}}}}return!0},Aa=function(Se){return Se!=="annotation-xml"&&nj(Se,z)},Mo=function(Se){Ro(p.beforeSanitizeAttributes,Se,null);let{attributes:wt}=Se;if(!wt||Ua(Se))return;let mn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0},Ar=wt.length;for(;Ar--;){let Ga=wt[Ar],{name:bs,namespaceURI:Dc,value:zu}=Ga,w_=vn(bs),gw=zu,ma=bs==="value"?gw:l3e(gw);if(mn.attrName=w_,mn.attrValue=ma,mn.keepAttr=!0,mn.forceKeepAttr=void 0,Ro(p.uponSanitizeAttribute,Se,mn),ma=mn.attrValue,Wt&&(w_==="id"||w_==="name")&&(Nr(bs,Se),ma=Qn+ma),Ne&&Tl(/((--!?|])>)|<\/(style|title|textarea)/i,ma)){Nr(bs,Se);continue}if(w_==="attributename"&&nj(ma,"href")){Nr(bs,Se);continue}if(mn.forceKeepAttr)continue;if(!mn.keepAttr){Nr(bs,Se);continue}if(!De&&Tl(/\/>/i,ma)){Nr(bs,Se);continue}be&&zz([b,T,B],xG=>{ma=rM(ma,xG," ")});let bG=vn(Se.nodeName);if(!tu(bG,w_,ma)){Nr(bs,Se);continue}if(x&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Dc)switch(g.getAttributeType(bG,w_)){case"TrustedHTML":{ma=x.createHTML(ma);break}case"TrustedScriptURL":{ma=x.createScriptURL(ma);break}}if(ma!==gw)try{Dc?Se.setAttributeNS(Dc,bs,ma):Se.setAttribute(bs,ma),Ua(Se)?Mr(Se):Yae(t.removed)}catch{Nr(bs,Se)}}Ro(p.afterSanitizeAttributes,Se,null)},nu=function An(Se){let wt=null,mn=Fs(Se);for(Ro(p.beforeSanitizeShadowDOM,Se,null);wt=mn.nextNode();)Ro(p.uponSanitizeShadowNode,wt,null),eu(wt),Mo(wt),wt.content instanceof r&&An(wt.content);Ro(p.afterSanitizeShadowDOM,Se,null)};return t.sanitize=function(An){let Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},wt=null,mn=null,Ar=null,Ga=null;if(Vn=!An,Vn&&(An="<!-->"),typeof An!="string"&&!zA(An))if(typeof An.toString=="function"){if(An=An.toString(),typeof An!="string")throw sM("dirty is not a string, aborting")}else throw sM("toString is not a function");if(!t.isSupported)return An;if(Ue||Ri(Se),t.removed=[],typeof An=="string"&&(lt=!1),lt){if(An.nodeName){let zu=vn(An.nodeName);if(!H[zu]||K[zu])throw sM("root node is forbidden and cannot be sanitized in-place")}}else if(An instanceof a)wt=uh("<!---->"),mn=wt.ownerDocument.importNode(An,!0),mn.nodeType===cM.element&&mn.nodeName==="BODY"||mn.nodeName==="HTML"?wt=mn:wt.appendChild(mn);else{if(!Et&&!be&&!ke&&An.indexOf("<")===-1)return x&&nt?x.createHTML(An):An;if(wt=uh(An),!wt)return Et?null:nt?S:""}wt&&He&&Mr(wt.firstChild);let bs=Fs(lt?An:wt);for(;Ar=bs.nextNode();)eu(Ar),Mo(Ar),Ar.content instanceof r&&nu(Ar.content);if(lt)return An;if(Et){if(Ye)for(Ga=P.call(wt.ownerDocument);wt.firstChild;)Ga.appendChild(wt.firstChild);else Ga=wt;return(Z.shadowroot||Z.shadowrootmode)&&(Ga=L.call(i,Ga,!0)),Ga}let Dc=ke?wt.outerHTML:wt.innerHTML;return ke&&H["!doctype"]&&wt.ownerDocument&&wt.ownerDocument.doctype&&wt.ownerDocument.doctype.name&&Tl(ece,wt.ownerDocument.doctype.name)&&(Dc="<!DOCTYPE "+wt.ownerDocument.doctype.name+`>
`+Dc),be&&zz([b,T,B],zu=>{Dc=rM(Dc,zu," ")}),x&&nt?x.createHTML(Dc):Dc},t.setConfig=function(){let An=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ri(An),Ue=!0},t.clearConfig=function(){Ho=null,Ue=!1},t.isValidAttribute=function(An,Se,wt){Ho||Ri({});let mn=vn(An),Ar=vn(Se);return tu(mn,Ar,wt)},t.addHook=function(An,Se){typeof Se=="function"&&oM(p[An],Se)},t.removeHook=function(An,Se){if(Se!==void 0){let wt=s3e(p[An],Se);return wt===-1?void 0:a3e(p[An],wt,1)[0]}return Yae(p[An])},t.removeHooks=function(An){p[An]=[]},t.removeAllHooks=function(){p=Xae()},t}var nce=tce();var x3e=0,uj={};function nm(e,t){let n,i=e;l(uj[i])?n=uj[i]:(n=x3e++,uj[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(nm.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=nce.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}}});nm.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};nm.prototype.equals=function(e){return nm.equals(this,e)};nm.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};nm.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new nm(e.html,t)};nm.clone=function(e){if(l(e))return new nm(e.html,e.showOnScreen)};var pt=nm;function T3e(e,t){At(e,t)}var Ea=T3e;function ZE(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 _e}Object.defineProperties(ZE.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}}});ZE.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function fj(e){e._cubeMapBuffers=void 0}ZE.prototype.update=function(e){let{context:t}=e;if(!ZE.isSupported(t))return;if(l(this._texture)){fj(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(fj(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;su(this._url).then(function(h){f._cubeMapBuffers=h,f._loading=!1}).catch(function(h){f.isDestroyed()||f._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?Ge.HALF_FLOAT:Ge.FLOAT);let o=qe.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(Kr.FaceName).forEach(h=>{f[h]=void 0});for(let h=r;h<a;h++)n.push(f)}let c=new Jt({minificationFilter:Kt.LINEAR_MIPMAP_LINEAR}),u=new Kr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};ZE.prototype.isDestroyed=function(){return!1};ZE.prototype.destroy=function(){return fj(this),this._texture=this._texture&&this._texture.destroy(),de(this)};var Ph=ZE;function lM(e){e=e??V.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?F.clone(e.imageBasedLightingFactor):new F(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=F.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(lM.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=F.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=F.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 S3e(e,t){if(Ph.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Ph(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}lM.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;F.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=F.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&&(S3e(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)};lM.prototype.isDestroyed=function(){return!1};lM.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),de(this)};var $E=lM;var hj=mr(Yu(),1);var dj,ice="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxYTBmZmMzNy02NzcxLTRiMjUtYTllZS1hZmJjY2RkYjVhY2UiLCJpZCI6MjU5LCJpYXQiOjE3NjQ2MDU5OTB9.Nefln7pgRwDffoCJRJ8aaZn5iQzIPQrboLwKD2-ArDU",Yz={};Yz.defaultAccessToken=ice;Yz.defaultServer=new Be({url:"https://api.cesium.com/"});Yz.getDefaultTokenCredit=function(e){if(e===ice){if(!l(dj)){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>`;dj=new pt(t,!0)}return dj}};var Rh=Yz;function wl(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:B3e};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ue("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Be.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new hj.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)&&(wl.prototype=Object.create(Be.prototype),wl.prototype.constructor=wl);wl.fromAssetId=function(e,t){let n=wl._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new wl(i,n)})};Object.defineProperties(wl.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=wl.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});wl.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(pt.getIonCredit),i=Rh.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(pt.clone(i)),n};wl.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new wl(t._ionEndpoint,t._ionEndpointResource)),e=Be.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};wl.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Be.prototype.fetchImage.call(this,e)};wl.prototype._makeRequest=function(e){return this._isExternal||new hj.default(this.url).authority()!==this._ionEndpointDomain?Be.prototype._makeRequest.call(this,e):(e.headers=oce(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,Be.prototype._makeRequest.call(this,e))};wl._createEndpointResource=function(e,t){t=t??V.EMPTY_OBJECT;let n=t.server??Rh.defaultServer,i=t.accessToken??Rh.defaultAccessToken;n=Be.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=oce(o.headers),n.getDerivedResource(o)};function oce(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}function B3e(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 ss=wl;function im(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(im.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}}});im.prototype.get=function(e){return this._array[e]};im.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};im.prototype.peek=function(){return this._array[this._length-1]};im.prototype.push=function(e){let t=this.length++;this._array[t]=e};im.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};im.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};im.prototype.resize=function(e){this.length=e};im.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Dl=im;var Up={X:0,Y:1,Z:2};Up.Y_UP_TO_Z_UP=M.fromRotationTranslation(X.fromArray([1,0,0,0,0,1,0,-1,0]));Up.Z_UP_TO_Y_UP=M.fromRotationTranslation(X.fromArray([1,0,0,0,0,-1,0,1,0]));Up.X_UP_TO_Z_UP=M.fromRotationTranslation(X.fromArray([0,0,1,0,1,0,-1,0,0]));Up.Z_UP_TO_X_UP=M.fromRotationTranslation(X.fromArray([0,0,-1,0,1,0,1,0,0]));Up.X_UP_TO_Y_UP=M.fromRotationTranslation(X.fromArray([0,1,0,-1,0,0,0,0,1]));Up.Y_UP_TO_X_UP=M.fromRotationTranslation(X.fromArray([0,-1,0,1,0,0,0,0,1]));Up.fromName=function(e){return Up[e]};var eo=Object.freeze(Up);function rce(e){e=e??V.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(rce.prototype,{metadata:{get:function(){return this._metadata}}});var eI=rce;function Z_(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),Z_.decode(e)}Z_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};Z_.decodeWithFromCharCode=function(e){let t="",n=w3e(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 uM(e,t,n){return t<=e&&e<=n}function w3e(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(uM(u,0,127)){s.push(u);continue}if(uM(u,194,223)){i=1,t=u&31;continue}if(uM(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(uM(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new ue("String decoding failed.")}if(!uM(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?Z_.decode=Z_.decodeWithTextDecoder:Z_.decode=Z_.decodeWithFromCharCode;var du=Z_;function D3e(e,t){return t=t??0,du(e,t,Math.min(4,e.length))}var Mh=D3e;function cd(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(cd.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 fM=Uint32Array.BYTES_PER_ELEMENT;cd.fromTileType=async function(e,t,n,i,o,r){o=o??0;let s=new Uint8Array(i),a=new DataView(i);o+=fM;let c=a.getUint32(o,!0);if(c!==1)throw new ue(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=fM,o+=fM;let u=a.getUint32(o,!0);o+=fM;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let h=[];h.length=u;for(let A=0;A<u;++A){let _=Mh(s,o),C=a.getUint32(o+fM*2,!0),y=r[_],E=`${f}${A}`,I=n.getDerivedResource({queryParameters:{compositeIndex:E}});if(l(y))h[A]=Promise.resolve(y(e,t,I,i,o));else throw new ue(`Unknown tile content type, ${_}, inside Composite tile`);o+=C}let m=await Promise.all(h);return new cd(e,t,n,m)};cd.prototype.hasProperty=function(e,t){return!1};cd.prototype.getFeature=function(e){};cd.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};cd.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};cd.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)};cd.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 u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};cd.prototype.isDestroyed=function(){return!1};cd.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var dM=cd;function v3e(e,t,n){return JSON.parse(du(e,t,n))}var Ir=v3e;function Gc(e){this._id=jn();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,Ft.maximumTextureSize),r=Math.ceil(t/Ft.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new F(o,r),i=new se(s,a,c,u)}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(Gc.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}}});Gc.DEFAULT_COLOR_VALUE=G.WHITE;Gc.DEFAULT_SHOW_VALUE=!0;function sce(e){let t=e._textureDimensions;return t.x*t.y*4}function ace(e){if(!l(e._batchValues)){let t=sce(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function cce(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Gc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=cce(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=ace(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Gc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Gc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var P3e=new Array(4);Gc.prototype.setColor=function(e,t){if(G.equals(t,Gc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(P3e),i=n[3],o=ace(this),r=e*4,s=cce(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,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Gc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Gc.prototype.getColor=function(e,t){if(!l(this._batchValues))return G.clone(Gc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return G.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Gc.prototype.getPickColor=function(e){return this._pickIds[e]};function lce(e,t,n){let i=e._textureDimensions;return new Bt({context:t,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Jt.NEAREST})}function R3e(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=sce(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,h=c*4;r[h]=G.floatToByte(f.red),r[h+1]=G.floatToByte(f.green),r[h+2]=G.floatToByte(f.blue),r[h+3]=G.floatToByte(f.alpha)}e._pickTexture=lce(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function M3e(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Gc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&R3e(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=lce(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),M3e(this))};Gc.prototype.isDestroyed=function(){return!1};Gc.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 de(this)};var vl=Gc;var N3e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},L3e={SCALAR:void 0,VEC2:F,VEC3:d,VEC4:se,MAT2:zi,MAT3:X,MAT4:M};function O3e(e){let t=e.componentType,n;typeof t=="string"?n=q.fromName(t):n=t;let i=N3e[e.type],o=L3e[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return q.createArrayBufferView(n,r,s,i*a)}}}var ld=O3e;function Gp(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,F3e(this,e.extension,e.binaryBody)}Object.defineProperties(Gp.prototype,{byteLength:{get:function(){return this._byteLength}}});function F3e(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,h=s,m=0;l(c.byteOffset)&&(c.componentType=c.componentType??q.UNSIGNED_SHORT,c.type=Ut.SCALAR,r=ld(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),m+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??q.UNSIGNED_SHORT,u.type=Ut.SCALAR,r=ld(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),m+=u.byteLength),g=new Uint16Array(s),h=0,i=0;i<s;++i)g[i]=h,h+=u[i];m+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??q.UNSIGNED_SHORT,f.type=Ut.SCALAR,r=ld(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,h),m+=f.byteLength);let A=a.length;for(i=0;i<A;++i){let y=a[i].length,E=a[i].instances,I=Nh.getBinaryProperties(y,E,n);m+=Q3e(I),a[i].instances=St(I,E)}let _=new Array(A).fill(0),C=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],C[i]=_[o],++_[o];m+=C.byteLength,e._classes=a,e._classIds=c,e._classIndexes=C,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=m}function Q3e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var k3e=[],U3e=[],G3e=0;function z3e(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=k3e;c.length=Math.max(c.length,a);let u=++G3e,f=U3e;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let h=n(e,t);if(l(h))return h;let m=o[t],g=s[t];for(let A=0;A<m;++A){let _=r[g+A];_!==t&&f.push(_)}}}function V3e(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 hM(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return z3e(e,t,n)}else return n(e,t);return V3e(e,t,n)}Gp.prototype.hasProperty=function(e,t){let n=hM(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};Gp.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};Gp.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,hM(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};Gp.prototype.getProperty=function(e,t){return hM(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)?H3e(a,s):Ve(a[s],!0)})};function H3e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Gp.prototype.setProperty=function(e,t,n){let i=hM(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],u=a.instances[t];if(l(u))return l(u.typedArray)?Y3e(u,c,n):u[c]=Ve(n,!0),!0});return l(i)};function Y3e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Gp.prototype.isClass=function(e,t){let n=hM(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};Gp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var tI=Gp;var W3e={HIGHLIGHT:0,REPLACE:1,MIX:2},hu=Object.freeze(W3e);var Aj=vl.DEFAULT_COLOR_VALUE,mj=vl.DEFAULT_SHOW_VALUE;function Go(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=r??{};let s=j3e(n);this._properties=s,this._batchTableHierarchy=q3e(this,n,i);let a=fce(t,s,i);this._binaryPropertiesByteLength=K3e(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new vl({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}Go._deprecationWarning=Ea;Object.defineProperties(Go.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function j3e(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ve(e[n],!0));return t}function q3e(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(Go._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 tI({extension:i,binaryBody:n})}function fce(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 ue("componentType is required.");if(!l(c))throw new ue("type is required.");if(!l(n))throw new ue(`Property ${o} requires a batch table binary.`);let u=ld(r),f=u.componentsPerAttribute,h=u.classType,m=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:m,componentCount:f,type:h}}}return i}function K3e(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Go.getBinaryProperties=function(e,t,n){return fce(e,t,n)};Go.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Go.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Go.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Go.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Go.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Go.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Go.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var J3e=new G;Go.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Aj),this.setAllShow(mj);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,J3e)??Aj:Aj,s=l(e.show)?e.show.evaluate(o)??mj:mj;this.setColor(i,r),this.setShow(i,s)}};function X3e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Z3e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Go.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Go.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Go.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Go.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Go.prototype.hasPropertyBySemantic=function(){return!1};Go.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(ei(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);ei(t,i)}return t};Go.prototype.getPropertyBySemantic=function(e,t){};Go.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return X3e(i,e)}let n=this._properties[t];if(l(n))return Ve(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Go.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){Z3e(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]=Ve(n,!0)};function $3e(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));
}
`}Go.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=dce(o,n,!1),s;return Ft.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}
${$3e(i)}${s}`}};function uce(e,t){return e=We.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 eUe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+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 dce(e,t,n){if(!l(t))return uce(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return uce(e,n);let r=o[0],s=o[2];e=We.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);
`,u;if(s==="vec3"||s==="vec4"){let f=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),u=` vec4 source = ${f};
tile_diffuse = tile_diffuse_final(source, tile_featureColor);
tile_main();
`}else s==="sampler2D"&&(e=eUe(e,t),u=` 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)
{
${u}`,n&&(e+=c),e+=`}
`,e}Go.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=dce(i,t,!0),Ft.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 tUe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===hu.HIGHLIGHT)return 0;if(n===hu.REPLACE)return 1;if(n===hu.MIX)return D.clamp(i,D.EPSILON4,1)}Go.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return St(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 tUe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Go.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var $_={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Go.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=nUe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===we.COMPUTE)continue;let h=f.derivedCommands.tileset;(!l(h)||f.dirty)&&(h={},f.derivedCommands.tileset=h,h.originalCommand=iUe(f),f.dirty=!1);let m=h.originalCommand;c!==$_.ALL_OPAQUE&&f.pass!==we.TRANSLUCENT&&(l(h.translucent)||(h.translucent=oUe(m))),c!==$_.ALL_TRANSLUCENT&&f.pass!==we.TRANSLUCENT&&(l(h.opaque)||(h.opaque=rUe(m)),a&&(r||(l(h.zback)||(h.zback=aUe(e.context,m)),s._backfaceCommands.push(h.zback)),(!l(h.stencil)||o._selectionDepth!==lUe(h.stencil))&&(f.renderState.depthMask?h.stencil=cUe(m,o._selectionDepth):h.stencil=h.opaque)));let g=a?h.stencil:h.opaque,A=h.translucent;f.pass!==we.TRANSLUCENT?(c===$_.ALL_OPAQUE&&(n[u]=g),c===$_.ALL_TRANSLUCENT&&(n[u]=A),c===$_.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(A))):n[u]=m}};function nUe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?$_.ALL_OPAQUE:t===e.featuresLength?$_.ALL_TRANSLUCENT:$_.OPAQUE_AND_TRANSLUCENT}function iUe(e){let t=et.shallowClone(e),n=t.pass===we.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function oUe(e){let t=et.shallowClone(e);return t.pass=we.TRANSLUCENT,t.renderState=uUe(e.renderState),t}function rUe(e){let t=et.shallowClone(e);return t.renderState=fUe(e.renderState),t}function sUe(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 aUe(e,t){let n=et.shallowClone(t),i=Ve(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Ni.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK,n.renderState=ze.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ve(t.uniformMap);let o=new F(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=sUe(e,t.shaderProgram),n}function cUe(e,t){let n=et.shallowClone(e),i=Ve(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Yt.SKIP_LOD_MASK,i.stencilTest.reference=Yt.CESIUM_3D_TILE_MASK|t<<Yt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Xn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=yt.REPLACE,i.stencilTest.backFunction=Xn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=yt.REPLACE,i.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,n.renderState=ze.fromCache(i),n}function lUe(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function uUe(e){let t=Ve(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=dn.ALPHA_BLEND,t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function fUe(e){let t=Ve(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}Go.prototype.update=function(e,t){this._batchTexture.update(e,t)};Go.prototype.isDestroyed=function(){return!1};Go.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),de(this)};var Nh=Go;function dUe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var om=dUe;var wx=`in vec3 position;
in float a_batchId;
uniform mat4 u_modifiedModelViewProjection;
void main()
{
gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;function ud(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(ud.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 G),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)}}});ud.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ud.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ud.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ud.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 u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};ud.prototype.getPropertyInherited=function(e){return ud.getPropertyInherited(this._content,this._batchId,e)};ud.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ud.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ud.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ud.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ia=ud;var pj=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)})}},gj=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)})}},Au=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,u;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)},u=n;let f=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&f(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 "+u),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)}}},hUe=new pj;Object.assign(Au,{hooks:hUe,plugins:new gj(Au),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"});Au.max_unop_len=Au.getMaxKeyLen(Au.unary_ops);Au.max_binop_len=Au.getMaxKeyLen(Au.binary_ops);var eC=e=>new Au(e).parse(),AUe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Au).filter(e=>!AUe.includes(e)&&eC[e]===void 0).forEach(e=>{eC[e]=Au[e]});eC.Jsep=Au;var mUe="ConditionalExpression",pUe={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:mUe,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 :")}})}};eC.plugins.register(pUe);var gUe={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},bt=Object.freeze(gUe);function Lh(e,t){this._expression=e,e=vUe(e,t),e=RUe(PUe(e)),eC.addBinaryOp("=~",0),eC.addBinaryOp("!~",0);let n;try{n=eC(e)}catch(i){throw new ue(i)}this._runtimeAst=Fi(this,n)}Object.defineProperties(Lh.prototype,{expression:{get:function(){return this._expression}}});var kn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new F],cartesian3Array:[new d],cartesian4Array:[new se],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 F),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new d),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};Lh.prototype.evaluate=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof G&&n instanceof se?G.fromCartesian4(n,t):n instanceof F||n instanceof d||n instanceof se?n.clone(t):n};Lh.prototype.evaluateColor=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return G.fromCartesian4(n,t)};Lh.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
{
return ${o};
}
`,o};Lh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Lh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var _Ue=["!","-","+"],hce=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],AM=/\${(.*?)}/g,CUe=/\\/g,yUe="@#%",EUe=/@#%/g,qz=new G,Kz={abs:ba(Math.abs),sqrt:ba(Math.sqrt),cos:ba(Math.cos),sin:ba(Math.sin),tan:ba(Math.tan),acos:ba(Math.acos),asin:ba(Math.asin),atan:ba(Math.atan),radians:ba(D.toRadians),degrees:ba(D.toDegrees),sign:ba(D.sign),floor:ba(Math.floor),ceil:ba(Math.ceil),round:ba(Math.round),exp:ba(Math.exp),exp2:ba(bUe),log:ba(Math.log),log2:ba(xUe),fract:ba(IUe),length:TUe,normalize:SUe},Jz={atan2:Wz(Math.atan2,!1),pow:Wz(Math.pow,!1),min:Wz(Math.min,!0),max:Wz(Math.max,!0),distance:BUe,dot:wUe,cross:DUe},yj={clamp:Ace(D.clamp,!0),mix:Ace(D.lerp,!0)};function IUe(e){return e-Math.floor(e)}function bUe(e){return Math.pow(2,e)}function xUe(e){return D.log2(e)}function ba(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof F)return F.fromElements(e(n.x),e(n.y),kn.getCartesian2());if(n instanceof d)return d.fromElements(e(n.x),e(n.y),e(n.z),kn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),kn.getCartesian4());throw new ue(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function Wz(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof F)return F.fromElements(e(i.x,o),e(i.y,o),kn.getCartesian2());if(i instanceof d)return d.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),kn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),kn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof F&&o instanceof F)return F.fromElements(e(i.x,o.x),e(i.y,o.y),kn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),kn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),kn.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Ace(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 F&&o instanceof F)return F.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),kn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),kn.getCartesian3());if(i instanceof se&&o instanceof se)return se.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),kn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof F&&o instanceof F&&r instanceof F)return F.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),kn.getCartesian2());if(i instanceof d&&o instanceof d&&r instanceof d)return d.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),kn.getCartesian3());if(i instanceof se&&o instanceof se&&r instanceof se)return se.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),kn.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function TUe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof F)return F.magnitude(t);if(t instanceof d)return d.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function SUe(e,t){if(typeof t=="number")return 1;if(t instanceof F)return F.normalize(t,kn.getCartesian2());if(t instanceof d)return d.normalize(t,kn.getCartesian3());if(t instanceof se)return se.normalize(t,kn.getCartesian4());throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function BUe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof F&&n instanceof F)return F.distance(t,n);if(t instanceof d&&n instanceof d)return d.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function wUe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof F&&n instanceof F)return F.dot(t,n);if(t instanceof d&&n instanceof d)return d.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function DUe(e,t,n){if(t instanceof d&&n instanceof d)return d.cross(t,n,kn.getCartesian3());throw new ue(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Dt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,zUe(this)}function vUe(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 PUe(e){return e.replace(CUe,yUe)}function Cj(e){return e.replace(EUe,"\\")}function RUe(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 ue("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function MUe(e){let t=typeof e.value;if(e.value===null)return new Dt(bt.LITERAL_NULL,null);if(t==="boolean")return new Dt(bt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Dt(bt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Dt(bt.VARIABLE_IN_STRING,e.value):new Dt(bt.LITERAL_STRING,Cj(e.value))}function NUe(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 ue(`${o} is not a function.`);return i===0?o==="test"?new Dt(bt.LITERAL_BOOLEAN,!1):new Dt(bt.LITERAL_NULL,null):(s=Fi(e,c),a=Fi(e,n[0]),new Dt(bt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Fi(e,c),new Dt(bt.FUNCTION_CALL,o,r);throw new ue(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Dt(bt.LITERAL_COLOR,o);if(r=Fi(e,n[0]),l(n[1])){let c=Fi(e,n[1]);return new Dt(bt.LITERAL_COLOR,o,[r,c])}return new Dt(bt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ue(`${o} requires three arguments.`);return r=[Fi(e,n[0]),Fi(e,n[1]),Fi(e,n[2])],new Dt(bt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ue(`${o} requires four arguments.`);return r=[Fi(e,n[0]),Fi(e,n[1]),Fi(e,n[2]),Fi(e,n[3])],new Dt(bt.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]=Fi(e,n[c]);return new Dt(bt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Dt(bt.LITERAL_BOOLEAN,!0):new Dt(bt.LITERAL_BOOLEAN,!1):(r=Fi(e,n[0]),new Dt(bt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ue(`${o} requires exactly one argument.`);return r=Fi(e,n[0]),new Dt(bt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ue(`${o} does not take any argument.`);return new Dt(bt.UNARY,o)}else if(l(Kz[o])){if(i!==1)throw new ue(`${o} requires exactly one argument.`);return r=Fi(e,n[0]),new Dt(bt.UNARY,o,r)}else if(l(Jz[o])){if(i!==2)throw new ue(`${o} requires exactly two arguments.`);return s=Fi(e,n[0]),a=Fi(e,n[1]),new Dt(bt.BINARY,o,s,a)}else if(l(yj[o])){if(i!==3)throw new ue(`${o} requires exactly three arguments.`);s=Fi(e,n[0]),a=Fi(e,n[1]);let c=Fi(e,n[2]);return new Dt(bt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Dt(bt.LITERAL_BOOLEAN,!1):(r=Fi(e,n[0]),new Dt(bt.UNARY,o,r));if(o==="Number")return i===0?new Dt(bt.LITERAL_NUMBER,0):(r=Fi(e,n[0]),new Dt(bt.UNARY,o,r));if(o==="String")return i===0?new Dt(bt.LITERAL_STRING,""):(r=Fi(e,n[0]),new Dt(bt.UNARY,o,r));if(o==="regExp")return LUe(e,t)}}throw new ue(`Unexpected function call "${o}".`)}function LUe(e,t){let n=t.arguments;if(n.length===0)return new Dt(bt.LITERAL_REGEX,new RegExp);let i=Fi(e,n[0]),o;if(n.length>1){let r=Fi(e,n[1]);if(_j(i)&&_j(r)){try{o=new RegExp(Cj(String(i._value)),r._value)}catch(s){throw new ue(s)}return new Dt(bt.LITERAL_REGEX,o)}return new Dt(bt.REGEX,i,r)}if(_j(i)){try{o=new RegExp(Cj(String(i._value)))}catch(r){throw new ue(r)}return new Dt(bt.LITERAL_REGEX,o)}return new Dt(bt.REGEX,i)}function OUe(e){if(UUe(e.name)){let t=GUe(e.name);return t.substr(0,8)==="tiles3d_"?new Dt(bt.BUILTIN_VARIABLE,t):new Dt(bt.VARIABLE,t)}else{if(e.name==="NaN")return new Dt(bt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Dt(bt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Dt(bt.LITERAL_UNDEFINED,void 0)}throw new ue(`${e.name} is not defined.`)}function FUe(e){let t=e.property.name;if(t==="PI")return new Dt(bt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Dt(bt.LITERAL_NUMBER,Math.E)}function QUe(e){if(e.property.name==="POSITIVE_INFINITY")return new Dt(bt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function kUe(e,t){if(t.object.name==="Math")return FUe(t);if(t.object.name==="Number")return QUe(t);let n,i=Fi(e,t.object);return t.computed?(n=Fi(e,t.property),new Dt(bt.MEMBER,"brackets",i,n)):(n=new Dt(bt.LITERAL_STRING,t.property.name),new Dt(bt.MEMBER,"dot",i,n))}function _j(e){return e._type>=bt.LITERAL_NULL}function UUe(e){return e.substr(0,4)==="czm_"}function GUe(e){return e.substr(4)}function Fi(e,t){let n,i,o,r;if(t.type==="Literal")n=MUe(t);else if(t.type==="CallExpression")n=NUe(e,t);else if(t.type==="Identifier")n=OUe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Fi(e,t.argument);if(_Ue.indexOf(i)>-1)n=new Dt(bt.UNARY,i,s);else throw new ue(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Fi(e,t.left),r=Fi(e,t.right),hce.indexOf(i)>-1)n=new Dt(bt.BINARY,i,o,r);else throw new ue(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Fi(e,t.left),r=Fi(e,t.right),hce.indexOf(i)>-1&&(n=new Dt(bt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Fi(e,t.test);o=Fi(e,t.consequent),r=Fi(e,t.alternate),n=new Dt(bt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=kUe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Fi(e,t.elements[a]);n=new Dt(bt.ARRAY,s)}else throw t.type==="Compound"?new ue("Provide exactly one expression."):new ue("Cannot parse expression.");return n}function zUe(e){e._type===bt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===bt.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===bt.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(Kz[e._value])&&(e.evaluate=HUe(e._value)):e._type===bt.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(Jz[e._value])&&(e.evaluate=YUe(e._value)):e._type===bt.TERNARY?e.evaluate=WUe(e._value):e._type===bt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===bt.ARRAY?e.evaluate=e._evaluateArray:e._type===bt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===bt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===bt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===bt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===bt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===bt.REGEX?e.evaluate=e._evaluateRegExp:e._type===bt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=VUe):e.evaluate=e._evaluateLiteral}function VUe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function HUe(e){let t=Kz[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function YUe(e){let t=Jz[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function WUe(e){let t=yj[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 Xz(e,t){if(l(e))return e.getPropertyInherited(t)}Dt.prototype._evaluateLiteral=function(){return this._value};Dt.prototype._evaluateLiteralColor=function(e){let t=qz,n=this._left;if(this._value==="color")l(n)?n.length>1?(G.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):G.fromCssColorString(n[0].evaluate(e),t):G.fromBytes(255,255,255,255,t);else if(this._value==="rgb")G.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;G.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,kn.getCartesian4())};Dt.prototype._evaluateLiteralVector=function(e){let t=kn.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 F)t.push(c.x,c.y);else if(c instanceof d)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new ue(`${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 ue(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new ue(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ue(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return F.fromArray(t,0,kn.getCartesian2());if(n==="vec3")return d.fromArray(t,0,kn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,kn.getCartesian4())};Dt.prototype._evaluateLiteralString=function(){return this._value};Dt.prototype._evaluateVariableString=function(e){let t=this._value,n=AM.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=Xz(e,o);l(r)||(r=""),t=t.replace(i,r),AM.lastIndex+=r.length-i.length,n=AM.exec(t)}return t};Dt.prototype._evaluateVariable=function(e){return Xz(e,this._value)};function nI(e){return e._value==="feature"}Dt.prototype._evaluateMemberDot=function(e){if(nI(this._left))return Xz(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof F||t instanceof d||t instanceof se){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]};Dt.prototype._evaluateMemberBrackets=function(e){if(nI(this._left))return Xz(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof F||t instanceof d||t instanceof se){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]};Dt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Dt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Dt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof F)return F.negate(t,kn.getCartesian2());if(t instanceof d)return d.negate(t,kn.getCartesian3());if(t instanceof se)return se.negate(t,kn.getCartesian4());if(typeof t=="number")return-t;throw new ue(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Dt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof F||t instanceof d||t instanceof se||typeof t=="number"))throw new ue(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Dt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Dt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Dt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Dt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Dt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ue(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Dt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ue(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Dt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof F&&t instanceof F)return F.add(t,n,kn.getCartesian2());if(n instanceof d&&t instanceof d)return d.add(t,n,kn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,kn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ue(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Dt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof F&&t instanceof F)return F.subtract(t,n,kn.getCartesian2());if(n instanceof d&&t instanceof d)return d.subtract(t,n,kn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ue(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Dt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof F&&t instanceof F)return F.multiplyComponents(t,n,kn.getCartesian2());if(n instanceof F&&typeof t=="number")return F.multiplyByScalar(n,t,kn.getCartesian2());if(t instanceof F&&typeof n=="number")return F.multiplyByScalar(t,n,kn.getCartesian2());if(n instanceof d&&t instanceof d)return d.multiplyComponents(t,n,kn.getCartesian3());if(n instanceof d&&typeof t=="number")return d.multiplyByScalar(n,t,kn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.multiplyByScalar(t,n,kn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,kn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,kn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ue(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Dt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof F&&t instanceof F)return F.divideComponents(t,n,kn.getCartesian2());if(t instanceof F&&typeof n=="number")return F.divideByScalar(t,n,kn.getCartesian2());if(n instanceof d&&t instanceof d)return d.divideComponents(t,n,kn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.divideByScalar(t,n,kn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,kn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ue(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Dt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof F&&t instanceof F)return F.fromElements(t.x%n.x,t.y%n.y,kn.getCartesian2());if(n instanceof d&&t instanceof d)return d.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,kn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ue(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Dt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof F&&t instanceof F||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?t.equals(n):t===n};Dt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof F&&t instanceof F||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Dt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ue(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Dt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Dt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Dt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Dt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Dt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Dt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Dt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Dt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Dt.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 ue(o)}return i};Dt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ue(`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)};Dt.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 ue(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Dt.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 ue(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Dt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ue(`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};Dt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof F||t instanceof d||t instanceof se)return String(t);throw new ue(`Unexpected function call "${this._value}".`)};function mce(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==bt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return G.fromHsl(i,o,r,s,qz)}function pce(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==bt.LITERAL_NUMBER)return;let i=qz;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 tC(e){return e%1===0?e.toFixed(1):e.toString()}function jUe(e){let t=tC(e.red),n=tC(e.green),i=tC(e.blue);return`vec3(${t}, ${n}, ${i})`}function jz(e){let t=tC(e.red),n=tC(e.green),i=tC(e.blue),o=tC(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function gce(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 _ce(e,t){return l(t[e])?t[e]:Lh.NULL_SENTINEL}Lh.NULL_SENTINEL="czm_infinity";Dt.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=gce(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=gce(this._value,e,t,this));let u,f,h;switch(a){case bt.VARIABLE:return nI(this)?void 0:_ce(c,e);case bt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(Kz[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 ue(`Error generating style shader: "${c}" is not supported.`);return c+o;case bt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(Jz[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case bt.TERNARY:if(l(yj[c]))return`${c}(${o}, ${r}, ${s})`;break;case bt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case bt.MEMBER:return nI(this._left)?_ce(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 bt.FUNCTION_CALL:throw new ue(`Error generating style shader: "${c}" is not supported.`);case bt.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 ue("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case bt.REGEX:throw new ue("Error generating style shader: Regular expressions are not supported.");case bt.VARIABLE_IN_STRING:throw new ue("Error generating style shader: Converting a variable to a string is not supported.");case bt.LITERAL_NULL:return Lh.NULL_SENTINEL;case bt.LITERAL_BOOLEAN:return c?"true":"false";case bt.LITERAL_NUMBER:return tC(c);case bt.LITERAL_STRING:if(l(n)&&n._type===bt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||nI(n._left)))return c;if(i=G.fromCssColorString(c,qz),l(i))return jUe(i);throw new ue("Error generating style shader: String literals are not supported.");case bt.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let m=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${m}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=pce(this),l(i)?jz(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=pce(this),l(i)?jz(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=mce(this),l(i)?jz(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=mce(this),l(i)?(i.alpha!==1&&(t.translucent=!0),jz(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case bt.LITERAL_VECTOR:f=o.length,h=`${c}(`;for(let m=0;m<f;++m)h+=o[m],m<f-1&&(h+=", ");return h+=")",h;case bt.LITERAL_REGEX:throw new ue("Error generating style shader: Regular expressions are not supported.");case bt.LITERAL_UNDEFINED:return Lh.NULL_SENTINEL;case bt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Dt.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 bt.VARIABLE:nI(this)||e.push(s);break;case bt.VARIABLE_IN_STRING:for(a=AM.exec(s);a!==null;)e.push(a[1]),a=AM.exec(s);break;case bt.LITERAL_STRING:l(t)&&t._type===bt.MEMBER&&nI(t._left)&&e.push(s);break}};var fd=Lh;function zp(e){e=e??V.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??d.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=G.clone(G.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??Jn.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(zp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var qUe={position:0,a_batchId:1};function KUe(e,t){if(l(e._va))return;let n=ut.createVertexBuffer({context:t,typedArray:e._positions,usage:Oe.STATIC_DRAW}),i=ut.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Oe.STATIC_DRAW}),o=ut.createIndexBuffer({context:t,typedArray:e._indices,usage:Oe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:q.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:q.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new oi({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new oi({context:t,attributes:r,indexBuffer:ut.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Oe.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function JUe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??qUe,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=sn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=We.replaceMain(s,"czm_non_pick_main"),s=`${s}void main()
{
czm_non_pick_main();
out_FragColor = ${o};
}
`,e._spPick=sn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(wx),c=n.getFragmentShaderCallback(!1,void 0,!0)(j_);o=n.getPickId();let u=new We({sources:[a]}),f=new We({defines:["VECTOR_TILE"],sources:[c]});e._sp=sn.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new We({sources:[wx]}),f=new We({defines:["VECTOR_TILE"],sources:[j_]}),e._spStencil=sn.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=We.replaceMain(c,"czm_non_pick_main"),c=`${c}
void main()
{
czm_non_pick_main();
out_FragColor = ${o};
}
`;let h=new We({sources:[a]}),m=new We({defines:["VECTOR_TILE"],sources:[c]});e._spPick=sn.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:m,attributeLocations:i})}function Cce(e){let t=e?Xn.EQUAL:Xn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:yt.KEEP,zFail:yt.DECREMENT_WRAP,zPass:yt.KEEP},backFunction:t,backOperation:{fail:yt.KEEP,zFail:yt.INCREMENT_WRAP,zPass:yt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},depthMask:!1}}var XUe={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND},ZUe={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function $Ue(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ze.fromCache(Cce(!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(Cce(!0)),e._rsColorPass=ze.fromCache(XUe),e._rsPickPass=ze.fromCache(ZUe))}var iI=new M,yce=new d;function eGe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return M.clone(i,iI),M.multiplyByPoint(iI,e._center,yce),M.setTranslation(iI,yce,iI),M.multiply(o,iI,iI),iI},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function Ej(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=s[f],m=i[h],g=o[h],A=new e.constructor(e.buffer,a*m,g);t.set(A,n),i[h]=n,n+=g}return n}function tGe(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],u=Ej(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(G.equals(f.color,a.color))u=Ej(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let h=u;u=Ej(n,s,u,i,o,f.batchIds,r),f.offset=h,f.count=u-h,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function Ij(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=s[f],m=i[h],g=o[h];t.copyFromBuffer(e,m*a,n*a,g*a),i[h]=n,n+=g}return n}function nGe(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,u=Ij(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let h=t.pop();if(G.equals(h.color,r.color))u=Ij(a,c,u,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=u-r.offset;else{let m=u;u=Ij(a,c,u,n,i,h.batchIds,o),h.offset=m,h.count=u-m,s.push(h),r=h}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function iGe(e,t){return t.color.toRgba()-e.color.toRgba()}function oGe(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(iGe),t.webgl2?nGe(e,n):tGe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function rGe(e,t){let n=oGe(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,u=e._modelMatrix??M.IDENTITY,f=e._uniformMap,h=e._boundingVolume;for(let m=0;m<r;++m){let g=o[m].offset,A=o[m].count,_=i[m*2];l(_)||(_=i[m*2]=new et({owner:e})),_.vertexArray=a,_.modelMatrix=u,_.offset=g,_.count=A,_.renderState=e._rsStencilDepthPass,_.shaderProgram=c,_.uniformMap=f,_.boundingVolume=h,_.cull=!1,_.pass=we.TERRAIN_CLASSIFICATION;let C=et.shallowClone(_,_.derivedCommands.tileset);C.renderState=e._rsStencilDepthPass3DTiles,C.pass=we.CESIUM_3D_TILE_CLASSIFICATION,_.derivedCommands.tileset=C;let y=i[m*2+1];l(y)||(y=i[m*2+1]=new et({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=A,y.renderState=e._rsColorPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=h,y.cull=!1,y.pass=we.TERRAIN_CLASSIFICATION;let E=et.shallowClone(y,y.derivedCommands.tileset);E.pass=we.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=E}e._commandsDirty=!0}function sGe(e,t){if(e.classificationType===Jn.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 u=i[c]=et.shallowClone(n[a],i[c]);u.shaderProgram=o,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function aGe(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??M.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],h=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,m=n[c*2];l(m)||(m=n[c*2]=new et({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsStencilDepthPass,m.shaderProgram=o,m.uniformMap=a,m.boundingVolume=h,m.pass=we.TERRAIN_CLASSIFICATION;let g=et.shallowClone(m,m.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=we.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=g;let A=n[c*2+1];l(A)||(A=n[c*2+1]=new et({owner:e,pickOnly:!0})),A.vertexArray=i,A.modelMatrix=s,A.offset=u,A.count=f,A.renderState=e._rsPickPass,A.shaderProgram=r,A.uniformMap=a,A.boundingVolume=h,A.pass=we.TERRAIN_CLASSIFICATION;let _=et.shallowClone(A,A.derivedCommands.tileset);_.pass=we.CESIUM_3D_TILE_CLASSIFICATION,A.derivedCommands.tileset=_}e._pickCommandsDirty=!1}zp.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 Ia(e,r)}};zp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function cGe(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=G.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=G.clone(G.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var lGe=new G,uGe=G.WHITE,fGe=!0,dGe=/\$/;zp.prototype.applyStyle=function(e,t){if(!l(e)){cGe(this,t);return}let n=e.color,i=n instanceof fd&&!dGe.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,lGe):uGe,c.show=l(e.show)?e.show.evaluate(c):fGe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=G.clone(G.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};zp.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,u=c.length,f;for(f=0;f<u;++f){let _=c[f].offset,C=c[f].count;if(s>=_&&s<_+C)break}c.push(new om({color:G.clone(t),offset:s,count:a,batchIds:[e]}));let h=[],m=[],g=c[f].batchIds,A=g.length;for(let _=0;_<A;++_){let C=g[_];if(C===e)continue;let y=n[C];o[y]<s?h.push(C):m.push(C)}m.length!==0&&c.push(new om({color:G.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:m})),h.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=h):c.splice(f,1),this._batchDirty=!0};function Ece(e,t,n,i){let o=e.classificationType,r=o!==Jn.CESIUM_3D_TILE,s=o!==Jn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=we.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function hGe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=we.OPAQUE,n.push(r)}}function AGe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=ze.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Pe.LINES):(n=e._rsColorPass,i=Pe.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}zp.prototype.update=function(e){let t=e.context;KUe(this,t),JUe(this,t),$Ue(this),eGe(this,t);let n=e.passes;n.render&&(rGe(this,t),sGe(this,e),AGe(this),this._debugWireframe?hGe(e,this._commands):Ece(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(aGe(this),Ece(this,e,this._pickCommands))};zp.prototype.isDestroyed=function(){return!1};zp.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(),de(this)};var oI=zp;function nf(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=d.clone(this._boundingVolume.center):this._center=d.clone(d.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=Jn.BOTH}Object.defineProperties(nf.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}}});nf.packedBoxLength=M.packedLength+d.packedLength;nf.packedCylinderLength=M.packedLength+2;nf.packedEllipsoidLength=M.packedLength+d.packedLength;nf.packedSphereLength=d.packedLength+1;function mGe(e){let t=new Float64Array(M.packedLength+d.packedLength),n=0;return d.pack(e._center,t,n),n+=d.packedLength,M.pack(e._modelMatrix,t,n),t}function pGe(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]=le.unpack(t,n),n+=le.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=G.unpack(t,n);n+=G.packedLength;let f=t[n++],h=t[n++],m=t[n++],g=new Array(m);for(let A=0;A<m;++A)g[A]=t[n++];a[c]=new om({color:u,offset:f,count:h,batchIds:g})}return i}var gGe=new qn("createVectorTileGeometries",5),_Ge=new G;function CGe(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,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let A=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),A+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),A+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),A+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),A+=c.length),u=e._batchTableColors=new Uint32Array(A);let _=e._batchTable;for(let C=0;C<A;++C){let y=_.getColor(C,_Ge);u[C]=y.toRgba()}f=e._packedBuffer=mGe(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(u.buffer,f.buffer);let m={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:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=gGe.scheduleTask(m,h);return l(g)?g.then(function(A){if(e.isDestroyed())return;let _=new Float64Array(A.packedBuffer);pGe(e,_)===2?e._indices=new Uint16Array(A.indices):e._indices=new Uint32Array(A.indices),e._indexOffsets=new Uint32Array(A.indexOffsets),e._indexCounts=new Uint32Array(A.indexCounts),e._positions=new Float32Array(A.positions),e._vertexBatchIds=new Uint16Array(A.vertexBatchIds),e._batchIds=new Uint16Array(A.batchIds),yGe(e),e._ready=!0}).catch(A=>{e.isDestroyed()||(e._error=A)}):void 0}}function yGe(e){l(e._primitive)||(e._primitive=new oI({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)}nf.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};nf.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};nf.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};nf.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};nf.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=CGe(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)};nf.prototype.isDestroyed=function(){return!1};nf.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var Vp=nf;function rm(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,bGe(this,i,o)}Object.defineProperties(rm.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 EGe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function IGe(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let A=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,A,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let A=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,A,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let A=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,A,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let A=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,A,f)}let h=l(n)||l(i)||l(o)||l(r),m=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(h&&m)throw new ue("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 A=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=A++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=A++;if(!l(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=A++;if(!l(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=A++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var rI=Uint32Array.BYTES_PER_ELEMENT;function bGe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=rI;let r=o.getUint32(n,!0);if(r!==1)throw new ue(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=rI;let s=o.getUint32(n,!0);if(n+=rI,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=rI,a===0)throw new ue("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=rI;let u=o.getUint32(n,!0);n+=rI;let f=o.getUint32(n,!0);n+=rI;let h=Ir(i,n,a);n+=a;let m=new Uint8Array(t,n,c);n+=c;let g,A;u>0&&(g=Ir(i,n,u),n+=u,f>0&&(A=new Uint8Array(t,n,f),A=new Uint8Array(A)));let _=h.BOXES_LENGTH??0,C=h.CYLINDERS_LENGTH??0,y=h.ELLIPSOIDS_LENGTH??0,E=h.SPHERES_LENGTH??0,I=_+C+y+E,x=new Nh(e,I,g,A,EGe(e));if(e._batchTable=x,I===0)return;let S=e.tile.computedTransform,w;l(h.RTC_CENTER)&&(w=d.unpack(h.RTC_CENTER),M.multiplyByPoint(S,w,w));let v=IGe(h,m);if(_>0||C>0||y>0||E>0){let P,N,L,p;if(_>0){let b=m.byteOffset+h.BOXES.byteOffset;P=new Float32Array(m.buffer,b,Vp.packedBoxLength*_)}if(C>0){let b=m.byteOffset+h.CYLINDERS.byteOffset;N=new Float32Array(m.buffer,b,Vp.packedCylinderLength*C)}if(y>0){let b=m.byteOffset+h.ELLIPSOIDS.byteOffset;L=new Float32Array(m.buffer,b,Vp.packedEllipsoidLength*y)}if(E>0){let b=m.byteOffset+h.SPHERES.byteOffset;p=new Float32Array(m.buffer,b,Vp.packedSphereLength*E)}return e._geometries=new Vp({boxes:P,boxBatchIds:v.boxes,cylinders:N,cylinderBatchIds:v.cylinders,ellipsoids:L,ellipsoidBatchIds:v.ellipsoids,spheres:p,sphereBatchIds:v.spheres,center:w,modelMatrix:S,batchTable:x,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Ice(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}}rm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};rm.prototype.getFeature=function(e){return Ice(this),this._features[e]};rm.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};rm.prototype.applyStyle=function(e){Ice(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};rm.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)};rm.prototype.pick=function(e,t,n){};rm.prototype.isDestroyed=function(){return!1};rm.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};var mM=rm;var bj={};bj.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),bce(i,o,r,s);return c};bj.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)),bce(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function bce(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 Dx=bj;var sI=30,xGe=1<<sI,TGe=1<<sI+1>>>0,xj=2*sI+1,nC=4,Sce=[],Bce=[],SGe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],iC=1,vx=2,Zz=[iC,0,0,iC|vx];function ws(e){if(!zt.supportsBigInt())throw new ue("S2 required BigInt support");this._cellId=e,this._level=ws.getLevel(e)}ws.fromToken=function(e){return new ws(ws.getIdFromToken(e))};ws.isValidId=function(e){return!(e<=0||e>>BigInt(xj)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ws.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ws.isValidId(ws.getIdFromToken(e)):!1};ws.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ws.getTokenFromId=function(e){let t=Math.floor(OGe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ws.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return sI-(t>>1)};ws.prototype.getChild=function(e){let t=vce(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ws(n)};ws.prototype.getParent=function(){let e=vce(this._cellId)<<BigInt(2);return new ws(this._cellId&~e+BigInt(1)|e)};ws.prototype.getParentAtLevel=function(e){let t=NGe(e);return new ws(this._cellId&-t|t)};ws.prototype.getCenter=function(e){e=e??te.WGS84;let t=BGe(this._cellId,this._level);t=d.normalize(t,t);let n=new he.fromCartesian(t,te.UNIT_SPHERE);return he.toCartesian(n,e,new d)};ws.prototype.getVertex=function(e,t){t=t??te.WGS84;let n=wGe(this._cellId,this._level,e);n=d.normalize(n,n);let i=new he.fromCartesian(n,te.UNIT_SPHERE);return he.toCartesian(i,t,new d)};ws.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(xj-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new ws(a)};function BGe(e,t){let n=DGe(e,t);return vGe(n[0],n[1],n[2])}function wGe(e,t,n){let i=wce(e,t),o=PGe([i[1],i[2]],t),r=n>>1&1;return Dce(i[0],o[0][r^n&1],o[1][r])}function DGe(e,t){let n=wce(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,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function wce(e){Sce.length===0&&MGe();let t=Number(e>>BigInt(xj)),n=t&iC,i=(1<<nC)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?sI-7*nC:nC))-1;n+=Number(e>>BigInt(s*2*nC+1)&BigInt(c))<<2,n=Bce[n];let u=s*nC;o+=n>>nC+2<<u,r+=(n>>2&i)<<u,n&=iC|vx}return[t,o,r]}function vGe(e,t,n){let i=xce(t),o=xce(n),r=$z(i),s=$z(o);return Dce(e,r,s)}function Dce(e,t,n){switch(e){case 0:return new d(1,t,n);case 1:return new d(-t,1,n);case 2:return new d(-t,-n,1);case 3:return new d(-1,-n,-t);case 4:return new d(n,-1,-t);default:return new d(n,t,-1)}}function $z(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function xce(e){return 1/TGe*e}function PGe(e,t){let n=[[],[]],i=RGe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=$z(Tce(r)),n[o][1]=$z(Tce(s))}return n}function RGe(e){return 1<<sI-e>>>0}function Tce(e){return 1/xGe*e}function oC(e,t,n,i,o,r){if(e===nC){let s=(t<<nC)+n;Sce[(s<<2)+i]=(o<<2)+r,Bce[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=SGe[r];oC(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^Zz[0]),oC(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^Zz[1]),oC(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^Zz[2]),oC(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^Zz[3])}}function MGe(){oC(0,0,0,0,0,0),oC(0,0,0,iC,0,iC),oC(0,0,0,vx,0,vx),oC(0,0,0,iC|vx,0,iC|vx)}function vce(e){return e&~e+BigInt(1)}function NGe(e){return BigInt(1)<<BigInt(2*(sI-e))}var LGe=[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 OGe(e){return LGe[(-e&e)%BigInt(67)]}var Hp=ws;function FGe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var Ii=FGe;function Tj(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 ue(`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=QGe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function QGe(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(Tj.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});Tj.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 Px=Tj;function Yp(e){e=e??V.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(Yp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Yp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Yp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Yp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Yp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Yp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Yp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Yp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var Rx=Yp;var eV={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};eV.getBranchingFactor=function(e){switch(e){case eV.OCTREE:return 8;case eV.QUADTREE:return 4}};var Ds=Object.freeze(eV);function qa(){}Object.defineProperties(qa.prototype,{class:{get:function(){Ae.throwInstantiationError()}}});qa.prototype.hasProperty=function(e){Ae.throwInstantiationError()};qa.prototype.hasPropertyBySemantic=function(e){Ae.throwInstantiationError()};qa.prototype.getPropertyIds=function(e){Ae.throwInstantiationError()};qa.prototype.getProperty=function(e){Ae.throwInstantiationError()};qa.prototype.setProperty=function(e,t){Ae.throwInstantiationError()};qa.prototype.getPropertyBySemantic=function(e){Ae.throwInstantiationError()};qa.prototype.setPropertyBySemantic=function(e,t){Ae.throwInstantiationError()};qa.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))};qa.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};qa.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};qa.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=Ve(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};qa.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};qa.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return qa.getProperty(o.id,t,n)};qa.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?qa.setProperty(r.id,t,n,i):!1};var Yn=qa;function Wp(e){e=e??V.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(Wp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Wp.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Wp.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Wp.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Wp.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};Wp.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};Wp.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};Wp.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var pM=Wp;var Gt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Gt.getMinimum=function(e){switch(e){case Gt.INT8:return-128;case Gt.UINT8:return 0;case Gt.INT16:return-32768;case Gt.UINT16:return 0;case Gt.INT32:return-2147483648;case Gt.UINT32:return 0;case Gt.INT64:return zt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Gt.UINT64:return zt.supportsBigInt()?BigInt(0):0;case Gt.FLOAT32:return-34028234663852886e22;case Gt.FLOAT64:return-Number.MAX_VALUE}};Gt.getMaximum=function(e){switch(e){case Gt.INT8:return 127;case Gt.UINT8:return 255;case Gt.INT16:return 32767;case Gt.UINT16:return 65535;case Gt.INT32:return 2147483647;case Gt.UINT32:return 4294967295;case Gt.INT64:return zt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Gt.UINT64:return zt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Gt.FLOAT32:return 34028234663852886e22;case Gt.FLOAT64:return Number.MAX_VALUE}};Gt.isIntegerType=function(e){switch(e){case Gt.INT8:case Gt.UINT8:case Gt.INT16:case Gt.UINT16:case Gt.INT32:case Gt.UINT32:case Gt.INT64:case Gt.UINT64:return!0;default:return!1}};Gt.isUnsignedIntegerType=function(e){switch(e){case Gt.UINT8:case Gt.UINT16:case Gt.UINT32:case Gt.UINT64:return!0;default:return!1}};Gt.isVectorCompatible=function(e){switch(e){case Gt.INT8:case Gt.UINT8:case Gt.INT16:case Gt.UINT16:case Gt.INT32:case Gt.UINT32:case Gt.FLOAT32:case Gt.FLOAT64:return!0;default:return!1}};Gt.normalize=function(e,t){return Math.max(Number(e)/Number(Gt.getMaximum(t)),-1)};Gt.unnormalize=function(e,t){let n=Gt.getMaximum(t),i=Gt.isUnsignedIntegerType(t)?0:-n;return e=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Gt.INT64||t===Gt.UINT64)&&zt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Gt.applyValueTransform=function(e,t,n){return n*e+t};Gt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Gt.getSizeInBytes=function(e){switch(e){case Gt.INT8:case Gt.UINT8:return 1;case Gt.INT16:case Gt.UINT16:return 2;case Gt.INT32:case Gt.UINT32:return 4;case Gt.INT64:case Gt.UINT64:return 8;case Gt.FLOAT32:return 4;case Gt.FLOAT64:return 8}};Gt.fromComponentDatatype=function(e){switch(e){case q.BYTE:return Gt.INT8;case q.UNSIGNED_BYTE:return Gt.UINT8;case q.SHORT:return Gt.INT16;case q.UNSIGNED_SHORT:return Gt.UINT16;case q.INT:return Gt.INT32;case q.UNSIGNED_INT:return Gt.UINT32;case q.FLOAT:return Gt.FLOAT32;case q.DOUBLE:return Gt.FLOAT64}};Gt.toComponentDatatype=function(e){switch(e){case Gt.INT8:return q.BYTE;case Gt.UINT8:return q.UNSIGNED_BYTE;case Gt.INT16:return q.SHORT;case Gt.UINT16:return q.UNSIGNED_SHORT;case Gt.INT32:return q.INT;case Gt.UINT32:return q.UNSIGNED_INT;case Gt.FLOAT32:return q.FLOAT;case Gt.FLOAT64:return q.DOUBLE}};var kt=Object.freeze(Gt);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 F;case sr.VEC3:return d;case sr.VEC4:return se;case sr.MAT2:return zi;case sr.MAT3:return X;case sr.MAT4:return M;default:return}};var _t=Object.freeze(sr);function yc(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&kt.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=Ve(e.min,!0),this._max=Ve(e.max,!0),this._normalized=r;let s=Ve(e.offset,!0),a=Ve(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ve(e.noData,!0),this._default=Ve(e.default,!0),this._required=e.required??!0,this._extras=Ve(e.extras,!0),this._extensions=Ve(e.extensions,!0)}yc.fromJson=function(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.property,i=kGe(n),o=UGe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new yc({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(yc.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 kGe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===_t.SCALAR||_t.isMatrixType(t)||_t.isVectorType(t))return!1;if(l(kt[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 UGe(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===_t.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===_t.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===_t.SCALAR||_t.isMatrixType(n)||_t.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===_t.BOOLEAN||n===_t.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===_t.BOOLEAN||i===_t.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(kt[i]))return{type:_t.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(kt[n]))return{type:_t.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}yc.prototype.normalize=function(e){return this._normalized?Sj(e,this._valueType,kt.normalize):e};yc.prototype.unnormalize=function(e){return this._normalized?Sj(e,this._valueType,kt.unnormalize):e};yc.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:yc.valueTransformInPlace(e,this._offset,this._scale,kt.applyValueTransform)};yc.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:yc.valueTransformInPlace(e,this._offset,this._scale,kt.unapplyValueTransform)};yc.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=_t.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)};yc.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Nce(e,t))return e};function Nce(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(!Nce(e[n],t[n]))return!1;return!0}yc.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=_t.getMathType(this._type),i=this._isArray,o=_t.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};yc.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=_t.getMathType(this._type),i=this._isArray,o=_t.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};yc.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?GGe(this,e):Lce(this,e)};function GGe(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=Lce(e,t[i]);if(l(o))return o}}function Lce(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return _t.isVectorType(n)?zGe(t,n,i):_t.isMatrixType(n)?VGe(t,n,i):n===_t.STRING?HGe(t):n===_t.BOOLEAN?YGe(t):n===_t.ENUM?WGe(t,o):jGe(t,i,r)}function zGe(e,t,n){if(!kt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===_t.VEC2&&!(e instanceof F))return`vector value ${e} must be a Cartesian2`;if(t===_t.VEC3&&!(e instanceof d))return`vector value ${e} must be a Cartesian3`;if(t===_t.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function VGe(e,t,n){if(!kt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===_t.MAT2&&!(e instanceof zi))return`matrix value ${e} must be a Matrix2`;if(t===_t.MAT3&&!(e instanceof X))return`matrix value ${e} must be a Matrix3`;if(t===_t.MAT4&&!(e instanceof M))return`matrix value ${e} must be a Matrix4`}function HGe(e){if(typeof e!="string")return tV(e,_t.STRING)}function YGe(e){if(typeof e!="boolean")return tV(e,_t.BOOLEAN)}function WGe(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 jGe(e,t,n){let i=typeof e;switch(t){case kt.INT8:case kt.UINT8:case kt.INT16:case kt.UINT16:case kt.INT32:case kt.UINT32:case kt.FLOAT32:case kt.FLOAT64:return i!=="number"?tV(e,t):isFinite(e)?Rce(e,t,n):Mce(e,t);case kt.INT64:case kt.UINT64:return i!=="number"&&i!=="bigint"?tV(e,t):i==="number"&&!isFinite(e)?Mce(e,t):Rce(e,t,n)}}function tV(e,t){return`value ${e} does not match type ${t}`}function Pce(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Rce(e,t,n){if(n){let i=kt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Pce(e,t,n):void 0}if(e<kt.getMinimum(t)||e>kt.getMaximum(t))return Pce(e,t,n)}function Mce(e,t){return`value ${e} of type ${t} must be finite`}function Sj(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=Sj(e[i],t,n);return e}yc.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]=yc.valueTransformInPlace(e[o],t[o],n[o],i);return e};var sm=yc;function gM(e){e=e??V.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,u=i.enumType,f=r===_t.STRING,h=r===_t.BOOLEAN,m=0,g;if(a){let p=n.arrayOffsetType??n.offsetType;p=kt[p]??kt.UINT32;let b=n.arrayOffsets??n.arrayOffsetBufferView;g=new Bj(o[b],p,t+1),m+=g.typedArray.byteLength}let A=_t.getComponentCount(r),_;a?_=g.get(t)-g.get(0):s?_=t*i.arrayLength:_=t;let C=A*_,y;if(f){let p=n.stringOffsetType??n.offsetType;p=kt[p]??kt.UINT32;let b=n.stringOffsets??n.stringOffsetBufferView;y=new Bj(o[b],p,C+1),m+=y.typedArray.byteLength}(f||h)&&(c=kt.UINT8);let E;f?E=y.get(C)-y.get(0):h?E=Math.ceil(C/8):E=C;let I=n.values??n.bufferView,x=new Bj(o[I],c,E);m+=x.typedArray.byteLength;let S=n.offset,w=n.scale,v=i.hasValueTransform||l(S)||l(w);S=S??i.offset,w=w??i.scale,S=Oce(S),w=Oce(w);let P,N,L=this;f?P=function(p){return JGe(p,L._values,L._stringOffsets)}:h?(P=function(p){return XGe(p,L._values)},N=function(p,b){ZGe(p,L._values,b)}):l(u)?(P=function(p){let b=L._values.get(p);return u.namesByValue[b]},N=function(p,b){let T=u.valuesByName[b];L._values.set(p,T)}):(P=function(p){return L._values.get(p)},N=function(p,b){L._values.set(p,b)}),this._arrayOffsets=g,this._stringOffsets=y,this._values=x,this._classProperty=i,this._count=t,this._vectorComponentCount=A,this._min=n.min,this._max=n.max,this._offset=S,this._scale=w,this._hasValueTransform=v,this._getValue=P,this._setValue=N,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=m}Object.defineProperties(gM.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}}});gM.prototype.get=function(e){let t=qGe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=sze(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};gM.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=aze(this,t),t=n.unnormalize(t),KGe(this,e,t)};gM.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Oce(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?ei(t,i):t.push(i)}return t}function qGe(e,t){Qce(e)&&kce(e);let n=e._classProperty,i=n.isArray,o=n.type,r=_t.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ve(s,!0):s}return!i&&r===1?e._getValue(t):Fce(e,n,t)}function Fce(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=_t.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 KGe(e,t,n){oze(e,t,n)&&kce(e);let i=e._classProperty,o=i.isArray,r=i.type,s=_t.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ve(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 f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function JGe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return du(t.typedArray,i,o)}function XGe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function ZGe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function $Ge(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 eze(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 tze(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 nze(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 ize(e){switch(e){case kt.INT8:return q.BYTE;case kt.UINT8:return q.UNSIGNED_BYTE;case kt.INT16:return q.SHORT;case kt.UINT16:return q.UNSIGNED_SHORT;case kt.INT32:return q.INT;case kt.UINT32:return q.UNSIGNED_INT;case kt.FLOAT32:return q.FLOAT;case kt.FLOAT64:return q.DOUBLE}}function Qce(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===_t.STRING||i===kt.INT64&&!zt.supportsBigInt64Array()||i===kt.UINT64&&!zt.supportsBigUint64Array()}function oze(e,t,n){if(Qce(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 kce(e){e._unpackedValues=rze(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function rze(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=_t.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]=Fce(e,i,a);return n}function sze(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:sm.valueTransformInPlace(t,e._offset,e._scale,kt.applyValueTransform)}function aze(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:sm.valueTransformInPlace(t,e._offset,e._scale,kt.unapplyValueTransform)}function Bj(e,t,n){let i=this,o,r,s;if(t===kt.INT64)zt.supportsBigInt()?zt.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 eze(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 $Ge(a,i)});else if(t===kt.UINT64)zt.supportsBigInt()?zt.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 nze(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 tze(a,i)});else{let a=ize(t);o=q.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}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 _M=gM;function Oh(e){e=e??V.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 _M({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(Oh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Oh.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Oh.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Oh.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Oh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=cze(this._class,t),i};Oh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Oh.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)};Oh.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};Oh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Oh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function cze(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=Ve(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var dd=Oh;function rC(){}Object.defineProperties(rC.prototype,{cacheKey:{get:function(){Ae.throwInstantiationError()}}});rC.prototype.load=function(){Ae.throwInstantiationError()};rC.prototype.unload=function(){};rC.prototype.process=function(e){return!1};rC.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=`
${t.message}`);let n=new ue(e);return l(t)&&(n.stack=`Original stack:
${t.stack}
Handler stack:
${n.stack}`),n};rC.prototype.isDestroyed=function(){return!1};rC.prototype.destroy=function(){return this.unload(),de(this)};var Yi=rC;var lze={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},dt=Object.freeze(lze);function jp(e){e=e??V.EMPTY_OBJECT;let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=dt.UNLOADED,this._promise=void 0}l(Object.create)&&(jp.prototype=Object.create(Yi.prototype),jp.prototype.constructor=jp);Object.defineProperties(jp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});jp.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=uze(this),this._promise)};async function uze(e){let t=e._resource;e._state=dt.LOADING;try{let n=await jp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=dt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=dt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}jp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};jp.prototype.unload=function(){this._typedArray=void 0};var aI=jp;var Yce=mr(Rj(),1);function cI(e){e=e??V.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,u=a.byteOffset,f=a.byteLength,h=!1,m,g,A,_;if(Ii(a,"EXT_meshopt_compression")){let y=a.extensions.EXT_meshopt_compression;c=y.buffer,u=y.byteOffset??0,f=y.byteLength,h=!0,m=y.byteStride,g=y.count,A=y.mode,_=y.filter??"NONE"}let C=n.buffers[c];this._hasMeshopt=h,this._meshoptByteStride=m,this._meshoptCount=g,this._meshoptMode=A,this._meshoptFilter=_,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=C,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=dt.UNLOADED,this._promise=void 0}l(Object.create)&&(cI.prototype=Object.create(Yi.prototype),cI.prototype.constructor=cI);Object.defineProperties(cI.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function mze(e){try{let t=pze(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);Yce.MeshoptDecoder.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=dt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=dt.FAILED,e.getError("Failed to load buffer view",t)}}cI.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=dt.LOADING,this._promise=mze(this),this._promise)};function pze(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})}cI.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var Mx=cI;function as(){}as._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);as._decoderTaskProcessor=void 0;as._taskProcessorReady=!1;as._error=void 0;as._getDecoderTaskProcessor=function(){if(!l(as._decoderTaskProcessor)){let e=new qn("decodeDraco",as._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?as._taskProcessorReady=!0:as._error=new ue("Draco decoder could not be initialized.")}).catch(t=>{as._error=t}),as._decoderTaskProcessor=e}return as._decoderTaskProcessor};as.decodePointCloud=function(e){let t=as._getDecoderTaskProcessor();if(l(as._error))throw as._error;if(as._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};as.decodeBufferView=function(e){let t=as._getDecoderTaskProcessor();if(l(as._error))throw as._error;if(as._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var qp=as;var zn={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 gze(e){switch(e){case zn.POSITION:return"positionMC";case zn.NORMAL:return"normalMC";case zn.TANGENT:return"tangentMC";case zn.TEXCOORD:return"texCoord";case zn.COLOR:return"color";case zn.JOINTS:return"joints";case zn.WEIGHTS:return"weights";case zn.FEATURE_ID:return"featureId";case zn.SCALE:return"scale";case zn.ROTATION:return"rotation"}}zn.hasSetIndex=function(e){switch(e){case zn.POSITION:case zn.NORMAL:case zn.TANGENT:return!1;case zn.TEXCOORD:case zn.COLOR:case zn.JOINTS:case zn.WEIGHTS:case zn.FEATURE_ID:case zn.SCALE:case zn.ROTATION:return!0}};zn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return zn.POSITION;case"NORMAL":return zn.NORMAL;case"TANGENT":return zn.TANGENT;case"TEXCOORD":return zn.TEXCOORD;case"COLOR":return zn.COLOR;case"JOINTS":return zn.JOINTS;case"WEIGHTS":return zn.WEIGHTS;case"_FEATURE_ID":return zn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return zn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return zn.ROTATION}};zn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return zn.POSITION;case"RGBA":case"RGB":case"RGB565":return zn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return zn.NORMAL;case"BATCH_ID":return zn.FEATURE_ID}};zn.getGlslType=function(e){switch(e){case zn.POSITION:case zn.NORMAL:case zn.TANGENT:return"vec3";case zn.TEXCOORD:return"vec2";case zn.COLOR:return"vec4";case zn.JOINTS:return"ivec4";case zn.WEIGHTS:return"vec4";case zn.FEATURE_ID:return"int";case zn.SCALE:return"vec3";case zn.ROTATION:return"vec4";case zn.OPACITY:return"float"}};zn.getVariableName=function(e,t){let n=gze(e);return l(t)&&(n+=`_${t}`),n};var rt=Object.freeze(zn);function sC(e){e=e??V.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=dt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(sC.prototype=Object.create(Yi.prototype),sC.prototype.constructor=sC);Object.defineProperties(sC.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function _ze(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=dt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Wce(e,n)}}sC.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=dt.LOADING,this._promise=_ze(this),this._promise)};function Wce(e,t){throw e.unload(),e._state=dt.FAILED,e.getError("Failed to load Draco",t)}async function Cze(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=dt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var lI={};lI[rt.POSITION]="POSITION";lI[rt.NORMAL]="NORMAL";lI[rt.COLOR]="COLOR";lI[rt.TEXCOORD]="TEX_COORD";function yze(e){for(let t in lI)if(lI.hasOwnProperty(t)&&e.startsWith(t))return lI[t]}sC.prototype.process=function(e){if(this._state===dt.READY)return!0;if(this._state!==dt.PROCESSING||(l(this._dracoError)&&Wce(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 m=yze(h);l(m)&&i.accessors[n.attributes[h]].componentType===q.FLOAT&&(c.includes(m)||c.push(m))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:c},f=qp.decodeBufferView(u);if(!l(f))return!1;this._decodePromise=Cze(this,f)};sC.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 Nx=sC;function Eze(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 Be.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Be.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Be({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 Kp=Eze;function Jp(e){e=e??V.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,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=dt.UNLOADED,this._promise=void 0}l(Object.create)&&(Jp.prototype=Object.create(Yi.prototype),Jp.prototype.constructor=Jp);Object.defineProperties(Jp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Jp.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=Ize(this),this._promise):(this._promise=bze(this),this._promise)};function jce(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 Ize(e){e._state=dt.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 Tze(i);if(e.isDestroyed())return;let r=jce(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=dt.READY,e}catch(n){return e.isDestroyed()?void 0:qce(e,n,"Failed to load embedded image")}}async function bze(e){e._state=dt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await Bze(i);if(e.isDestroyed())return;let r=jce(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=dt.READY,e}catch(o){return e.isDestroyed()?void 0:qce(e,o,`Failed to load image: ${n}`)}}function qce(e,t,n){return e.unload(),e._state=dt.FAILED,Promise.reject(e.getError(n,t))}function xze(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 ue("Image format is not recognized")}async function Tze(e){let t=xze(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return su(n)}return Jp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var Sze=/(^data:image\/ktx2)|(\.ktx2$)/i;function Bze(e){let t=e.getUrlComponent(!1,!0);return Sze.test(t)?su(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Jp.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};Jp._loadImageFromTypedArray=Kp;var Lx=Jp;var wze={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Ec=Object.freeze(wze);function aC(e){e=e??V.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,u=e.asynchronous??!0,f=e.loadBuffer??!1,h=e.loadTypedArray??!1,m=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=m,this._primitive=s,this._draco=a,this._cacheKey=c,this._asynchronous=u,this._loadBuffer=f,this._loadTypedArray=h,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=dt.UNLOADED,this._promise=void 0}l(Object.create)&&(aC.prototype=Object.create(Yi.prototype),aC.prototype.constructor=aC);Object.defineProperties(aC.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 Dze=new Nj;aC.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=vze(this),this._promise):(this._promise=Pze(this),this._promise)};async function vze(e){e._state=dt.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=dt.LOADED,e)}catch(n){if(e.isDestroyed())return;Mj(e,n)}}async function Pze(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=dt.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=Rze(e,a),e._state=dt.PROCESSING,e}catch(s){if(e.isDestroyed())return;Mj(e,s)}}function Rze(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Fe.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let h=r*a,m=new Uint8Array(c,u,h);c=new Uint8Array(m).buffer,u=0,Ea("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Fe.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):s===Fe.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):s===Fe.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function Mj(e,t){throw e.unload(),e._state=dt.FAILED,e.getError("Failed to load index buffer",t)}function Nj(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}Nj.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};Nj.prototype.execute=function(){this.buffer=Kce(this.typedArray,this.indexDatatype,this.context)};function Kce(e,t,n){let i=ut.createIndexBuffer({typedArray:e,context:n,usage:Oe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}aC.prototype.process=function(e){if(this._state===dt.READY)return!0;if(this._state!==dt.LOADED&&this._state!==dt.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=q.fromTypedArray(t),this._indexDatatype=n)}catch(o){Mj(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=Dze;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Ec.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=Kce(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=dt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};aC.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 Ox=aC;function Mze(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 ta=Mze;function Nze(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Or=Nze;function tn(){}tn.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}}};tn.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}}};tn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?tn.objectLegacy(i,n):tn.object(i,n)};tn.accessor=function(e,t){return tn.topLevel(e,"accessors",t)};tn.accessorWithSemantic=function(e,t,n){let i={};return tn.mesh(e,function(o){return tn.meshPrimitive(o,function(r){let s=tn.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:tn.meshPrimitiveTarget(r,function(a){return tn.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};tn.accessorContainingVertexAttributeData=function(e,t){let n={};return tn.mesh(e,function(i){return tn.meshPrimitive(i,function(o){let r=tn.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:tn.meshPrimitiveTarget(o,function(s){return tn.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};tn.accessorContainingIndexData=function(e,t){let n={};return tn.mesh(e,function(i){return tn.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}})})};tn.animation=function(e,t){return tn.topLevel(e,"animations",t)};tn.animationChannel=function(e,t){let n=e.channels;return tn.object(n,t)};tn.animationSampler=function(e,t){let n=e.samplers;return tn.object(n,t)};tn.buffer=function(e,t){return tn.topLevel(e,"buffers",t)};tn.bufferView=function(e,t){return tn.topLevel(e,"bufferViews",t)};tn.camera=function(e,t){return tn.topLevel(e,"cameras",t)};tn.image=function(e,t){return tn.topLevel(e,"images",t)};tn.material=function(e,t){return tn.topLevel(e,"materials",t)};tn.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}};tn.mesh=function(e,t){return tn.topLevel(e,"meshes",t)};tn.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}}};tn.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}};tn.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}}};tn.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}};tn.node=function(e,t){return tn.topLevel(e,"nodes",t)};tn.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 u=a.children;if(l(u)&&(c=tn.nodeInTree(e,u,n),l(c)))return c}}}};tn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return tn.nodeInTree(e,i,n)};tn.program=function(e,t){return Or(e,"KHR_techniques_webgl")?tn.object(e.extensions.KHR_techniques_webgl.programs,t):tn.topLevel(e,"programs",t)};tn.sampler=function(e,t){return tn.topLevel(e,"samplers",t)};tn.scene=function(e,t){return tn.topLevel(e,"scenes",t)};tn.shader=function(e,t){return Or(e,"KHR_techniques_webgl")?tn.object(e.extensions.KHR_techniques_webgl.shaders,t):tn.topLevel(e,"shaders",t)};tn.skin=function(e,t){return tn.topLevel(e,"skins",t)};tn.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}}};tn.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}};tn.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}};tn.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}};tn.technique=function(e,t){return Or(e,"KHR_techniques_webgl")?tn.object(e.extensions.KHR_techniques_webgl.techniques,t):tn.topLevel(e,"techniques",t)};tn.texture=function(e,t){return tn.topLevel(e,"textures",t)};var Me=tn;function Lze(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 of=Lze;function Oze(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 q.getSizeInBytes(t.componentType)*of(t.type)}var mu=Oze;function Fze(e){Me.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Me.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Me.mesh(e,function(n){Me.meshPrimitive(n,function(i){if(i.mode=i.mode??ee.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=ta(e.materials,o)}})}),Me.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=mu(e,i),r.target=ee.ARRAY_BUFFER}}),Me.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ee.ELEMENT_ARRAY_BUFFER}}),Me.material(e,function(n){let i=n.extensions??{},o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.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)&&Me.materialValue(n,function(c){l(c.index)&&uI(c)}),uI(n.emissiveTexture),uI(n.normalTexture),uI(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,uI(s.baseColorTexture),uI(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,uI(a.specularGlossinessTexture))}),Me.animation(e,function(n){Me.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=Qze(e);return Me.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]}),Me.sampler(e,function(n){n.wrapS=n.wrapS??ee.REPEAT,n.wrapT=n.wrapT??ee.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function Qze(e){let t={};return Me.animation(e,function(n){Me.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 uI(e){l(e)&&(e.texCoord=e.texCoord??0)}var bM=Fze;function kze(e){return Me.shader(e,function(t){sV(t)}),Me.buffer(e,function(t){sV(t)}),Me.image(e,function(t){sV(t)}),sV(e),e}function sV(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var cC=kze;function Uze(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 xM=Uze;function Gze(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),xM(e,t),n.length===0&&delete e.extensionsUsed}}var fI=Gze;var zze=4;function Vze(e){if(Mh(e)!=="glTF")throw new ue("File is not valid binary glTF");let n=Jce(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ue("Binary glTF version is not 1 or 2");return i===1?Hze(e,n):Yze(e,n)}function Jce(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*zze,!0);return o}function Hze(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new ue("Binary glTF scene format is not JSON");let r=20,s=r+i,a=du(e,r,i),c=JSON.parse(a);cC(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let h=f.binary_glTF??f.KHR_binary_glTF;l(h)&&(h.extras._pipeline.source=u,delete h.uri)}return fI(c,"KHR_binary_glTF"),c}function Yze(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Jce(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=du(u);o=JSON.parse(f),cC(o)}else c===5130562&&(r=u)}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 dI=Vze;function Wze(e){return Me.shader(e,function(t){aV(t)}),Me.buffer(e,function(t){aV(t)}),Me.image(e,function(t){aV(t)}),aV(e),e}function aV(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var TM=Wze;function jze(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),ta(n,t,!0)}var hd=jze;function qze(e){switch(e){case q.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case q.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case q.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case q.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 q.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case q.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 q.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case q.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var Xp=qze;function Kze(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=of(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],u=c.buffer,h=i[u].extras._pipeline.source,m=t.count,g=mu(e,t),A=t.byteOffset+c.byteOffset+h.byteOffset,_=t.componentType,C=q.getSizeInBytes(_),y=new DataView(h.buffer),E=new Array(r),I=Xp(_);for(let x=0;x<m;x++){I(y,A,r,C,E);for(let S=0;S<r;S++){let w=E[S];s[S]=Math.min(s[S],w),a[S]=Math.max(a[S],w)}A+=g}return{min:s,max:a}}var hI=Kze;var Jze=[ee.FUNC_ADD,ee.FUNC_ADD],Xze=[ee.ONE,ee.ZERO,ee.ONE,ee.ZERO];function Xce(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var Zze=[ee.ZERO,ee.ONE,ee.SRC_COLOR,ee.ONE_MINUS_SRC_COLOR,ee.SRC_ALPHA,ee.ONE_MINUS_SRC_ALPHA,ee.DST_ALPHA,ee.ONE_MINUS_DST_ALPHA,ee.DST_COLOR,ee.ONE_MINUS_DST_COLOR];function $ze(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(Zze.indexOf(e[n])===-1)return t;return e}function eVe(e){let t={},n={},i=e.techniques;return l(i)&&(Me.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Xce(s,ee.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??Jze,blendFactors:$ze(c.blendFuncSeparate,Xze)})}Xce(s,ee.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),hd(e,"KHR_blend")),Me.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Me.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 SM=eVe;function tVe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),ta(n,t,!0),hd(e,t)}var BM=tVe;function nVe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Me.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Me.techniqueAttribute(a,function(h,m){f=a.parameters[h],u.attributes[m]={semantic:f.semantic}}),Me.techniqueUniform(a,function(h,m){f=a.parameters[h],u.uniforms[m]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][h]=m}),l(o[a.program]))u.program=o[a.program];else{let h=e.programs[a.program],m={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[h.fragmentShader];m.fragmentShader=ta(r.shaders,g,!0);let A=e.shaders[h.vertexShader];m.vertexShader=ta(r.shaders,A,!0),u.program=ta(r.programs,m),o[a.program]=u.program}i[c]=ta(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,hd(e,"KHR_techniques_webgl"),BM(e,"KHR_techniques_webgl"))}return Me.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Me.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=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 wM=nVe;function iVe(e,t){Fo.typeOf.object("material",e),Fo.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,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:u}=s;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:u,emission:f,specular:h}=a.values;if(l(c)&&l(c.index)){let m=t(c.index,c);if(l(m))return m}if(l(u)&&l(u.index)){let m=t(u.index,u);if(l(m))return m}if(l(f)&&l(f.index)){let m=t(f.index,f);if(l(m))return m}if(l(h)&&l(h.index)){let m=t(h.index,h);if(l(m))return m}}}let o=Me.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 Fx=iVe;var Zce=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function oVe(e,t){return t=t??Zce,Zce.forEach(function(n){t.indexOf(n)>-1&&sVe(e,n)}),e}var rVe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function sVe(e,t){let n=rVe[t],i=e[n];if(l(i)){let o=0,r=cm[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(am[t](e,a-o),o++)}}function am(){}am.accessor=function(e,t){e.accessors.splice(t,1),Me.mesh(e,function(i){Me.meshPrimitive(i,function(o){Me.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Me.meshPrimitiveTarget(o,function(a){Me.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});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})}),Me.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Me.animation(e,function(i){Me.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};am.buffer=function(e,t){e.buffers.splice(t,1),Me.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--})};am.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Me.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Me.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Me.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Or(e,"KHR_draco_mesh_compression")&&Me.mesh(e,function(i){Me.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--})}),Or(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 u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(Or(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 u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};am.image=function(e,t){e.images.splice(t,1),Me.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})};am.mesh=function(e,t){e.meshes.splice(t,1),Me.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};am.node=function(e,t){e.nodes.splice(t,1),Me.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})}),Me.animation(e,function(i){Me.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Me.technique(e,function(i){Me.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Me.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}))}),Me.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};am.material=function(e,t){e.materials.splice(t,1),Me.mesh(e,function(i){Me.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};am.sampler=function(e,t){e.samplers.splice(t,1),Me.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};am.texture=function(e,t){if(e.textures.splice(t,1),Me.material(e,function(i){Fx(i,function(o,r){r.index>t&&--r.index})}),Or(e,"EXT_feature_metadata")){Me.mesh(e,function(r){Me.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let h=0;h<f;++h){let g=u[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 f=a[c].texture;f.index>t&&--f.index}}}}if(Or(e,"EXT_mesh_features")&&Me.mesh(e,function(i){Me.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 u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Or(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 u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function cm(){}cm.accessor=function(e){let t={};return Me.mesh(e,function(n){Me.meshPrimitive(n,function(i){Me.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Me.meshPrimitiveTarget(i,function(r){Me.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Me.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Me.animation(e,function(n){Me.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Or(e,"EXT_mesh_gpu_instancing")&&Me.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})}),Or(e,"CESIUM_primitive_outline")&&Me.mesh(e,function(n){Me.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};cm.buffer=function(e){let t={};return Me.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};cm.bufferView=function(e){let t={};if(Me.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Me.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Me.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Or(e,"KHR_draco_mesh_compression")&&Me.mesh(e,function(n){Me.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Or(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(Or(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 u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};cm.image=function(e){let t={};return Me.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};cm.mesh=function(e){let t={};return Me.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 $ce(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!$ce(e,o,n)}).length===0}cm.node=function(e){let t={};return Me.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Me.skinJoint(n,function(i){t[i]=!0})}),Me.animation(e,function(n){Me.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Me.technique(e,function(n){Me.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Me.node(e,function(n,i){$ce(e,i,t)||(t[i]=!0)}),t};cm.material=function(e){let t={};return Me.mesh(e,function(n){Me.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};cm.texture=function(e){let t={};if(Me.material(e,function(n){Fx(n,function(i){t[i]=!0})}),Or(e,"EXT_feature_metadata")){Me.mesh(e,function(o){Me.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 u=c.length;for(let f=0;f<u;++f){let m=c[f].featureIds.texture;t[m.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 u=s[a].texture;t[u.index]=!0}}}}if(Or(e,"EXT_mesh_features")&&Me.mesh(e,function(n){Me.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 u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),Or(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 u=a[c];t[u.index]=!0}}}}return t};cm.sampler=function(e){let t={};return Me.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var DM=oVe;function aVe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:ta(e.buffers,n),byteOffset:0,byteLength:t.length};return ta(e.bufferViews,o)}var vM=aVe;function cVe(e,t){let n=mu(e,t),i=q.getSizeInBytes(t.componentType),o=of(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,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),h=new Array(o),m=Xp(t.componentType);for(let g=0;g<r;++g){m(f,u,o,i,h);for(let A=0;A<o;++A)s[g*o+A]=h[A];u+=n}return s}var PM=cVe;function lVe(e){let t;return Me.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?cV(e,i,q.UNSIGNED_BYTE):t!==ee.UNSIGNED_BYTE&&t!==ee.UNSIGNED_SHORT&&cV(e,i,q.UNSIGNED_SHORT)}),Me.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?cV(e,i,q.UNSIGNED_BYTE):t===ee.SHORT&&cV(e,i,q.UNSIGNED_SHORT)}),e}function cV(e,t,n){let i=q.createTypedArray(n,PM(e,t)),o=new Uint8Array(i.buffer);t.bufferView=vM(e,o),t.componentType=n,t.byteOffset=0}var RM=lVe;function uVe(e,t){return fI(e,t),t==="CESIUM_RTC"&&fVe(e),Lj(e,t)}function fVe(e){Me.technique(e,function(t){Me.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function Lj(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)Lj(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)&&Lj(e[o],t);return i}}var AI=uVe;var lV={.8:gVe,"1.0":QVe,"2.0":void 0};function dVe(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(lV,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(lV,i)||(i="1.0"));let o=lV[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=lV[i];return t.keepLegacyExtensions||(GVe(e,t),zVe(e)),e}function nle(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 hVe(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??ee.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function AVe(e){let t=e.nodes,n=new d,i=new Qe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;d.fromArray(a,0,n),Qe.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 mVe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new d,a=new Qe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,h=u.parameters,m=u.samplers;if(l(f)){let g=f.length;for(let A=0;A<g;++A){let _=f[A];if(_.target.path==="rotation"){let C=h[m[_.sampler].output];if(l(r[C]))continue;r[C]=!0;let y=n[C],E=i[y.bufferView],x=o[E.buffer].extras._pipeline.source,S=x.byteOffset+E.byteOffset+y.byteOffset,w=y.componentType,v=y.count,P=of(y.type),N=y.count*P,L=q.createArrayBufferView(w,x.buffer,S,N);for(let p=0;p<v;p++){let b=p*P;d.unpack(L,b,s);let T=L[b+3];Qe.fromAxisAngle(s,T,a),Qe.pack(a,L,b)}}}}}}function pVe(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 gVe(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,nle(e),hVe(e),AVe(e),mVe(e),pVe(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,hd(e,"KHR_materials_common")}}function _Ve(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 ele(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 CVe(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]=ele(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]),Me.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Me.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Me.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}}),Me.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Me.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Me.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]})})}),Me.mesh(e,function(s){Me.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Me.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Me.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,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},h=ta(e.nodes,f);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 f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Me.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Me.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]]}}),Me.animation(e,function(s){let a={};s.samplers=ele(s.samplers,a),Me.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Me.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Me.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Me.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Me.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Me.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}}),Me.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function yVe(e){Me.animation(e,function(t){Me.animationSampler(t,function(n){delete n.name})})}function EVe(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]}Me.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function IVe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var bVe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function xVe(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(bVe[o])&&e.extensionsRequired.push(o)}}}function TVe(e){Me.buffer(e,function(t){delete t.type})}function SVe(e){Me.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function BVe(e){Me.mesh(e,function(t){Me.meshPrimitive(t,function(n){Me.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})}),Me.technique(e,function(t){Me.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var wVe={POSITION:!0,NORMAL:!0,TANGENT:!0},DVe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function vVe(e){let t={};Me.mesh(e,function(n){Me.meshPrimitive(n,function(i){Me.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 u,f=DVe[a];l(f)?(u=f+c,t[r]=u):l(wVe[a])||(u=`_${r}`,t[r]=u)}});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)}})}),Me.technique(e,function(n){Me.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function PVe(e){Me.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 Fj(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:mu(e,t)}function RVe(e){Me.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Me.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=Fj(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function MVe(e){let t,n,i,o=e.bufferViews,r={};Me.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Me.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(m,g){return m.byteOffset-g.byteOffset});let u=0,f=0,h=c.length;for(t=0;t<h;++t){let m=c[t],g=Fj(e,m),A=m.byteOffset,_=m.count*g;delete m.byteStride;let C=t<h-1,y=C?Fj(e,c[t+1]):void 0;if(g!==y){let E=Ve(i,!0);r[a]&&(E.byteStride=g),E.byteOffset+=u,E.byteLength=A+_-u;let I=ta(o,E);for(n=f;n<=t;++n)m=c[n],m.bufferView=I,m.byteOffset=m.byteOffset-u;u=C?c[t+1].byteOffset:void 0,f=t+1}}}DM(e,["accessor","bufferView","buffer"])}function NVe(e){Me.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=hI(e,n);n.min=i.min,n.max=i.max}})}function ile(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)||d.fromArray(e.translation).equals(d.ZERO))&&(!l(e.scale)||d.fromArray(e.scale).equals(new d(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||M.fromColumnMajorArray(e.matrix).equals(M.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function ole(e,t){Me.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}}}),Me.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),ile(n)&&ole(e,i))}}),delete e.nodes[t]}function LVe(e){return Me.node(e,function(t,n){ile(t)&&ole(e,n)}),e}function OVe(e){Me.animation(e,function(t){Me.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=hI(e,i);i.min=o.min,i.max=o.max}})})}function FVe(e){Me.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=hI(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function QVe(e){e.asset=e.asset??{},e.asset.version="2.0",nle(e),_Ve(e),LVe(e),CVe(e),yVe(e),IVe(e),xVe(e),RVe(e),MVe(e),NVe(e),OVe(e),FVe(e),TVe(e),SVe(e),BVe(e),vVe(e),RM(e),PVe(e),SM(e),wM(e),EVe(e)}var kVe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],UVe=["u_diffuse","u_diffuse_mat"];function Qj(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function kj(e){return l(e.index)}function Uj(e){return Array.isArray(e)&&e.length===4}function rle(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??kVe,i=t.baseColorFactorNames??UVe;Me.material(e,function(o){Me.materialValue(o,function(r,s){n.indexOf(s)!==-1&&kj(r)?(Qj(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&Uj(r)&&(Qj(o),o.pbrMetallicRoughness.baseColorFactor=rle(r))})}),AI(e,"KHR_techniques_webgl"),AI(e,"KHR_blend")}function Oj(e,t){l(t)&&(Uj(t)?e.pbrMetallicRoughness.baseColorFactor=rle(t):kj(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function tle(e,t){l(t)&&(Uj(t)?e.emissiveFactor=t.slice(0,3):kj(t)&&(e.emissiveTexture=t))}function zVe(e){Me.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,u=n.transparent;Qj(t),n.technique==="CONSTANT"?(hd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},Oj(t,s),Oj(t,o)):(Oj(t,r),tle(t,o),tle(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(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),AI(e,"KHR_materials_common")}var MM=dVe;function zc(){}zc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
${n.message}`);let o=new ue(i);return l(n)&&(o.stack=`Original stack:
${n.stack}
Handler stack:
${o.stack}`),o};zc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:d.ZERO,l(e.rotation)?e.rotation:Qe.IDENTITY,l(e.scale)?e.scale:d.ONE)};zc.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}};zc.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}};zc.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}};zc.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};zc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=rt.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),u;return c&&(u=r?"vec4":Ut.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var VVe=new d,HVe=new d;zc.getPositionMinMax=function(e,t,n){let i=zc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=d.add(r,t,HVe),o=d.add(o,n,VVe)),{min:r,max:o}};zc.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===eo.Y?n=M.clone(eo.Y_UP_TO_Z_UP,n):e===eo.X&&(n=M.clone(eo.X_UP_TO_Z_UP,n)),t===eo.Z&&(n=M.multiplyTransformation(n,eo.Z_UP_TO_X_UP,n)),n};var YVe=new X;zc.getCullFace=function(e,t){if(!Pe.isTriangles(t))return Ni.BACK;let n=M.getMatrix3(e,YVe);return X.determinant(n)<0?Ni.FRONT:Ni.BACK};zc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};zc.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};zc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!zc.supportedExtensions[i])throw new ue(`Unsupported glTF Extension: ${i}`)}};var Lt=zc;function lC(e){e=e??V.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=dt.UNLOADED,this._promise=void 0}l(Object.create)&&(lC.prototype=Object.create(Yi.prototype),lC.prototype.constructor=lC);Object.defineProperties(lC.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});lC.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=dt.LOADING,l(this._gltfJson)?(this._promise=sle(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=ale(this,this._typedArray),this._promise):(this._promise=WVe(this),this._promise))};async function WVe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;Gj(e,n)}return ale(e,t)}function Gj(e,t){e.unload(),e._state=dt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function jVe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Or(t,"KHR_techniques_webgl")&&!Or(t,"KHR_materials_common"))return Promise.resolve();let n=[];Me.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),MM(t)}function qVe(e){let t=[];return Me.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Ah(i)&&(delete n.uri,t.push(Be.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function KVe(e,t){let n=[];return Me.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 sle(e,t){try{cC(t),await qVe(t),await jVe(e,t),bM(t),await KVe(e,t),TM(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new ue(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Lt.checkSupportedExtensions(i),e._gltf=t,e._state=dt.READY,e}catch(n){if(e.isDestroyed())return;Gj(e,n)}}async function ale(e,t){let n;try{Mh(t)==="glTF"?n=dI(t):n=Ir(t)}catch(i){if(e.isDestroyed())return;Gj(e,i)}return sle(e,n)}lC.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};lC.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var Qx=lC;var JVe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},lm=Object.freeze(JVe);var jo={};function XVe(){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 ZVe(){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 $Ve(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function e4e(){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 t4e(){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 n4e(){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 i4e(){this.attributes=[]}function o4e(){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 r4e(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function s4e(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function a4e(){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 c4e(){this.nodes=[]}var l4e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function u4e(){this.input=[],this.interpolation=void 0,this.output=[]}function f4e(){this.node=void 0,this.path=void 0}function d4e(){this.sampler=void 0,this.target=void 0}function h4e(){this.name=void 0,this.samplers=[],this.channels=[]}function A4e(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function m4e(){this.name=void 0,this.stages=[]}function cle(){this.credits=[]}function p4e(){this.asset=new cle,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=M.clone(M.IDENTITY),this.extensions={}}function g4e(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=X.clone(X.IDENTITY),this.scale=1,this.channels=void 0}function uC(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(uC.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=uC.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=uC.DEFAULT_ROUGHNESS_FACTOR}uC.DEFAULT_BASE_COLOR_FACTOR=se.ONE;uC.DEFAULT_METALLIC_FACTOR=1;uC.DEFAULT_ROUGHNESS_FACTOR=1;function mI(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(mI.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=d.clone(mI.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=mI.DEFAULT_GLOSSINESS_FACTOR}mI.DEFAULT_DIFFUSE_FACTOR=se.ONE;mI.DEFAULT_SPECULAR_FACTOR=d.ONE;mI.DEFAULT_GLOSSINESS_FACTOR=1;function NM(){this.specularFactor=NM.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=d.clone(NM.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}NM.DEFAULT_SPECULAR_FACTOR=1;NM.DEFAULT_SPECULAR_COLOR_FACTOR=d.ONE;function LM(){this.anisotropyStrength=LM.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=LM.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}LM.DEFAULT_ANISOTROPY_STRENGTH=0;LM.DEFAULT_ANISOTROPY_ROTATION=0;function OM(){this.clearcoatFactor=OM.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=OM.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}OM.DEFAULT_CLEARCOAT_FACTOR=0;OM.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function zj(){this.metallicRoughness=new uC,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=d.clone(zj.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=lm.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}zj.DEFAULT_EMISSIVE_FACTOR=d.ZERO;jo.Quantization=XVe;jo.Attribute=ZVe;jo.Indices=$Ve;jo.FeatureIdAttribute=e4e;jo.FeatureIdTexture=n4e;jo.FeatureIdImplicitRange=t4e;jo.MorphTarget=i4e;jo.Primitive=o4e;jo.Instances=r4e;jo.Skin=s4e;jo.Node=a4e;jo.Scene=c4e;jo.AnimatedPropertyType=Object.freeze(l4e);jo.AnimationSampler=u4e;jo.AnimationTarget=f4e;jo.AnimationChannel=d4e;jo.Animation=h4e;jo.ArticulationStage=A4e;jo.Articulation=m4e;jo.Asset=cle;jo.Components=p4e;jo.TextureReader=g4e;jo.MetallicRoughness=uC;jo.SpecularGlossiness=mI;jo.Specular=NM;jo.Anisotropy=LM;jo.Clearcoat=OM;jo.Material=zj;var yn=jo;var uV={};uV.getImageIdFromTexture=function(e){e=e??V.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};uV.createSampler=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=En.REPEAT,r=En.REPEAT,s=Kt.LINEAR,a=mi.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let h=t.samplers[f];o=h.wrapS??o,r=h.wrapT??r,s=h.minFilter??s,a=h.magFilter??a}return i&&s!==Kt.LINEAR&&s!==Kt.NEAREST&&(s===Kt.NEAREST_MIPMAP_NEAREST||s===Kt.NEAREST_MIPMAP_LINEAR?s=Kt.NEAREST:s=Kt.LINEAR),new Jt({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var _4e=new F(1,1);uV.createModelTextureReader=function(e){e=e??V.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)?F.unpack(s.offset):F.ZERO,u=s.rotation??0,f=l(s.scale)?F.unpack(s.scale):_4e;u=-u,r=new X(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new yn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var pu=uV;function C4e(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var fC=C4e;function dC(e){e=e??V.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,u=i.index,f=pu.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,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=dt.UNLOADED,this._promise=void 0}l(Object.create)&&(dC.prototype=Object.create(Yi.prototype),dC.prototype.constructor=dC);Object.defineProperties(dC.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var y4e=new Vj;async function E4e(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=dt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=dt.FAILED,e.getError("Failed to load texture",n)}}dC.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=dt.LOADING,this._promise=E4e(this),this._promise)};function Vj(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}Vj.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};Vj.prototype.execute=function(){this.texture=lle(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function lle(e,t,n,i,o,r){let s=i.internalFormat,a=!1;qe.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=pu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,h=c.wrapT,m=u===Kt.NEAREST_MIPMAP_NEAREST||u===Kt.NEAREST_MIPMAP_LINEAR||u===Kt.LINEAR_MIPMAP_NEAREST||u===Kt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&m,A=g||f===En.REPEAT||f===En.MIRRORED_REPEAT||h===En.REPEAT||h===En.MIRRORED_REPEAT,_=!D.isPowerOfTwo(i.width)||!D.isPowerOfTwo(i.height),C=A&&_,y;return l(s)?(!r.webgl2&&qe.isCompressedFormat(s)&&_&&A&&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."),y=Bt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(C&&(i=fC(i)),y=Bt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&y.generateMipmap(),y}dC.prototype.process=function(e){if(this._state===dt.READY)return!0;if(this._state!==dt.LOADED&&this._state!==dt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=dt.PROCESSING;let t;if(this._asynchronous){let n=y4e;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Ec.TEXTURE))return;t=n.texture}else t=lle(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=dt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};dC.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 kx=dC;function hC(e){e=e??V.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,u=e.accessorId,f=e.cacheKey,h=e.spz,m=e.asynchronous??!0,g=e.loadBuffer??!1,A=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=u,this._cacheKey=f,this._asynchronous=m,this._loadBuffer=g,this._loadTypedArray=A,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=dt.UNLOADED,this._promise=void 0}l(Object.create)&&(hC.prototype=Object.create(Yi.prototype),hC.prototype.constructor=hC);Object.defineProperties(hC.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 I4e(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}hC.prototype.load=async function(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=x4e(this),this._promise):I4e(this._draco,this._attributeSemantic)?(this._promise=w4e(this),this._promise):(this._promise=v4e(this),this._promise)};function b4e(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new yn.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 u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(h){return h*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function x4e(e){e._state=dt.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=dt.LOADED,e)}catch{if(e.isDestroyed())return}}function T4e(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function S4e(e){let t=T4e(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 B4e(e){e._state=dt.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]=D.clamp(i[r*3]*255,0,255),e._typedArray[r*4+1]=D.clamp(i[r*3+1]*255,0,255),e._typedArray[r*4+2]=D.clamp(i[r*3+2]*255,0,255),e._typedArray[r*4+3]=D.clamp(o[r]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:o}=S4e(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,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let h=f*s+a[i-1]+o*3;e._typedArray[f*3]=u[h],e._typedArray[f*3+1]=u[h+1],e._typedArray[f*3+2]=u[h+2]}}}async function w4e(e){e._state=dt.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=dt.LOADED,e)}catch{if(e.isDestroyed())return;fV(e)}}function D4e(e){e._state=dt.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,u=o.data.quantization;l(u)&&(e._quantization=b4e(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function v4e(e){e._state=dt.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=dt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;fV(e,n)}}function fV(e,t){throw e.unload(),e._state=dt.FAILED,e.getError("Failed to load vertex buffer",t)}function Hj(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}Hj.prototype.set=function(e,t){this.typedArray=e,this.context=t};Hj.prototype.execute=function(){this.buffer=ule(this.typedArray,this.context)};function ule(e,t){let n=ut.createVertexBuffer({typedArray:e,context:t,usage:Oe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var P4e=new Hj;hC.prototype.process=function(e){if(this._state===dt.READY)return!0;if(this._state!==dt.LOADED&&this._state!==dt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){fV(this,i)}D4e(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(e))return!1}catch(i){fV(this,i)}B4e(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=P4e;if(i.set(n,e.context),!e.jobScheduler.execute(i,Ec.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=ule(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=dt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};hC.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 Ux=hC;var fle={};async function R4e(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:re}=await Promise.resolve().then(()=>F4e);var a=re(fle.url)}var c="./this.program",u=fle.url,f;if(s){var h=a("fs");u.startsWith("file:")&&a("path").dirname(a("url").fileURLToPath(u)),f=re=>(re=C(re)?new URL(re):re,h.readFileSync(re)),1<process.argv.length&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2)}else if(o||r){try{new URL(".",u)}catch{}r&&(f=re=>{var ie=new XMLHttpRequest;return ie.open("GET",re,!1),ie.responseType="arraybuffer",ie.send(null),new Uint8Array(ie.response)})}var m=console.log.bind(console),g=console.error.bind(console),A,_=!1,C=re=>re.startsWith("file://"),y,E,I,x,S,w,v,P,N,L,p,b,T,B=!1;function R(){var re=I.buffer;x=new Int8Array(re),w=new Int16Array(re),i.HEAPU8=S=new Uint8Array(re),v=new Uint16Array(re),P=new Int32Array(re),N=new Uint32Array(re),i.HEAPF32=L=new Float32Array(re),p=new Float64Array(re),b=new BigInt64Array(re),T=new BigUint64Array(re)}var O=0,U=null;function k(re){var ie;throw(ie=i.onAbort)==null||ie.call(i,re),re="Aborted("+re+")",g(re),_=!0,re=new WebAssembly.RuntimeError(re+". Build with -sASSERTIONS for more info."),E?.(re),re}var z;async function Q(re){if(!ArrayBuffer.isView(re))if(re==z&&A)re=new Uint8Array(A);else if(f)re=f(re);else throw"both async and sync fetching of the wasm failed";return re}async function H(re){var ie=z;try{var Ie=await Q(ie);return await WebAssembly.instantiate(Ie,re)}catch(Te){g(`failed to asynchronously prepare wasm: ${Te}`),k(Te)}}async function W(re){return H(re)}var Z=re=>{for(;0<re.length;)re.shift()(i)},Y=[],$=[],K=()=>{var re=i.preRun.shift();$.push(re)},fe=re=>{if(s)return re=Buffer.from(re,"base64"),new Uint8Array(re.buffer,re.byteOffset,re.length);for(var ie,Ie,Te=0,je=0,gt=re.length,ct=new Uint8Array((3*gt>>2)-(re[gt-2]=="=")-(re[gt-1]=="="));Te<gt;Te+=4,je+=3)ie=lp[re.charCodeAt(Te+1)],Ie=lp[re.charCodeAt(Te+2)],ct[je]=lp[re.charCodeAt(Te)]<<2|ie>>4,ct[je+1]=ie<<4|Ie>>2,ct[je+2]=Ie<<6|lp[re.charCodeAt(Te+3)];return ct},ge={},ne=re=>{for(;re.length;){var ie=re.pop();re.pop()(ie)}};function Ce(re){return this.N(N[re>>2])}var ye={},De={},be={},Ne=class extends Error{constructor(re){super(re),this.name="InternalError"}},ke=(re,ie,Ie)=>{function Te(xt){if(xt=Ie(xt),xt.length!==re.length)throw new Ne("Mismatched type converter count");for(var Bn=0;Bn<re.length;++Bn)nt(re[Bn],xt[Bn])}re.forEach(xt=>be[xt]=ie);var je=Array(ie.length),gt=[],ct=0;ie.forEach((xt,Bn)=>{De.hasOwnProperty(xt)?je[Bn]=De[xt]:(gt.push(xt),ye.hasOwnProperty(xt)||(ye[xt]=[]),ye[xt].push(()=>{je[Bn]=De[xt],++ct,ct===gt.length&&Te(je)}))}),gt.length===0&&Te(je)},Ue=re=>{for(var ie="";;){var Ie=S[re++];if(!Ie)return ie;ie+=String.fromCharCode(Ie)}},He=class extends Error{constructor(re){super(re),this.name="BindingError"}},Et=re=>{throw new He(re)};function Ye(re,ie,Ie={}){var Te=ie.name;if(!re)throw new He(`type "${Te}" must have a positive integer typeid pointer`);if(De.hasOwnProperty(re)){if(Ie.wa)return;throw new He(`Cannot register type '${Te}' twice`)}De[re]=ie,delete be[re],ye.hasOwnProperty(re)&&(ie=ye[re],delete ye[re],ie.forEach(je=>je()))}function nt(re,ie,Ie={}){return Ye(re,ie,Ie)}var Ct=(re,ie,Ie)=>{switch(ie){case 1:return Ie?Te=>x[Te]:Te=>S[Te];case 2:return Ie?Te=>w[Te>>1]:Te=>v[Te>>1];case 4:return Ie?Te=>P[Te>>2]:Te=>N[Te>>2];case 8:return Ie?Te=>b[Te>>3]:Te=>T[Te>>3];default:throw new TypeError(`invalid integer width (${ie}): ${re}`)}},Wt=re=>{throw new He(re.L.P.M.name+" instance already deleted")},Qn=!1,on=()=>{},lt=re=>typeof FinalizationRegistry>"u"?(lt=ie=>ie,re):(Qn=new FinalizationRegistry(ie=>{ie=ie.L,--ie.count.value,ie.count.value===0&&(ie.S?ie.W.Y(ie.S):ie.P.M.Y(ie.O))}),lt=ie=>{var Ie=ie.L;return Ie.S&&Qn.register(ie,{L:Ie},ie),ie},on=ie=>{Qn.unregister(ie)},lt(re));function Nt(){}var Mn=(re,ie)=>Object.defineProperty(ie,"name",{value:re}),at={},fi=(re,ie,Ie)=>{if(re[ie].R===void 0){var Te=re[ie];re[ie]=function(...je){if(!re[ie].R.hasOwnProperty(je.length))throw new He(`Function '${Ie}' called with an invalid number of arguments (${je.length}) - expects one of (${re[ie].R})!`);return re[ie].R[je.length].apply(this,je)},re[ie].R=[],re[ie].R[Te.aa]=Te}},ro=(re,ie,Ie)=>{if(i.hasOwnProperty(re)){if(Ie===void 0||i[re].R!==void 0&&i[re].R[Ie]!==void 0)throw new He(`Cannot register public name '${re}' twice`);if(fi(i,re,re),i[re].R.hasOwnProperty(Ie))throw new He(`Cannot register multiple overloads of a function with the same number of arguments (${Ie})!`);i[re].R[Ie]=ie}else i[re]=ie,i[re].aa=Ie},Ao=re=>{re=re.replace(/[^a-zA-Z0-9_]/g,"$");var ie=re.charCodeAt(0);return 48<=ie&&57>=ie?`_${re}`:re};function ii(re,ie,Ie,Te,je,gt,ct,xt){this.name=re,this.constructor=ie,this.$=Ie,this.Y=Te,this.U=je,this.ra=gt,this.ea=ct,this.pa=xt,this.ya=[]}var so=(re,ie,Ie)=>{for(;ie!==Ie;){if(!ie.ea)throw new He(`Expected null or instance of ${Ie.name}, got an instance of ${ie.name}`);re=ie.ea(re),ie=ie.U}return re},ao=re=>{if(re===null)return"null";var ie=typeof re;return ie==="object"||ie==="array"||ie==="function"?re.toString():""+re};function Ui(re,ie){if(ie===null){if(this.ha)throw new He(`null is not a valid ${this.name}`);return 0}if(!ie.L)throw new He(`Cannot pass "${ao(ie)}" as a ${this.name}`);if(!ie.L.O)throw new He(`Cannot pass deleted object as a pointer of type ${this.name}`);return so(ie.L.O,ie.L.P.M,this.M)}function Pi(re,ie){if(ie===null){if(this.ha)throw new He(`null is not a valid ${this.name}`);if(this.ga){var Ie=this.ia();return re!==null&&re.push(this.Y,Ie),Ie}return 0}if(!ie||!ie.L)throw new He(`Cannot pass "${ao(ie)}" as a ${this.name}`);if(!ie.L.O)throw new He(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.fa&&ie.L.P.fa)throw new He(`Cannot convert argument of type ${ie.L.W?ie.L.W.name:ie.L.P.name} to parameter type ${this.name}`);if(Ie=so(ie.L.O,ie.L.P.M,this.M),this.ga){if(ie.L.S===void 0)throw new He("Passing raw pointer to smart pointer is illegal");switch(this.Da){case 0:if(ie.L.W===this)Ie=ie.L.S;else throw new He(`Cannot convert argument of type ${ie.L.W?ie.L.W.name:ie.L.P.name} to parameter type ${this.name}`);break;case 1:Ie=ie.L.S;break;case 2:if(ie.L.W===this)Ie=ie.L.S;else{var Te=ie.clone();Ie=this.za(Ie,Fs(()=>Te.delete())),re!==null&&re.push(this.Y,Ie)}break;default:throw new He("Unsupporting sharing policy")}}return Ie}function Vn(re,ie){if(ie===null){if(this.ha)throw new He(`null is not a valid ${this.name}`);return 0}if(!ie.L)throw new He(`Cannot pass "${ao(ie)}" as a ${this.name}`);if(!ie.L.O)throw new He(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ie.L.P.fa)throw new He(`Cannot convert argument of type ${ie.L.P.name} to parameter type ${this.name}`);return so(ie.L.O,ie.L.P.M,this.M)}var co=(re,ie,Ie)=>ie===Ie?re:Ie.U===void 0?null:(re=co(re,ie,Ie.U),re===null?null:Ie.pa(re)),Vo={},hr=(re,ie)=>{if(ie===void 0)throw new He("ptr should not be undefined");for(;re.U;)ie=re.ea(ie),re=re.U;return Vo[ie]},Rr=(re,ie)=>{if(!ie.P||!ie.O)throw new Ne("makeClassHandle requires ptr and ptrType");if(!!ie.W!=!!ie.S)throw new Ne("Both smartPtrType and smartPtr must be specified");return ie.count={value:1},lt(Object.create(re,{L:{value:ie,writable:!0}}))};function Js(re,ie,Ie,Te,je,gt,ct,xt,Bn,Hn,ln){this.name=re,this.M=ie,this.ha=Ie,this.fa=Te,this.ga=je,this.xa=gt,this.Da=ct,this.na=xt,this.ia=Bn,this.za=Hn,this.Y=ln,je||ie.U!==void 0?this.T=Pi:(this.T=Te?Ui:Vn,this.V=null)}var Is=(re,ie,Ie)=>{if(!i.hasOwnProperty(re))throw new Ne("Replacing nonexistent public symbol");i[re].R!==void 0&&Ie!==void 0?i[re].R[Ie]=ie:(i[re]=ie,i[re].aa=Ie)},ka,mo=(re,ie)=>{re=Ue(re);var Ie=ka.get(ie);if(typeof Ie!="function")throw new He(`unknown function pointer with signature ${re}: ${ie}`);return Ie};class vn extends Error{}var Ho=re=>{re=sne(re);var ie=Ue(re);return v_(re),ie},Yo=(re,ie)=>{function Ie(gt){je[gt]||De[gt]||(be[gt]?be[gt].forEach(Ie):(Te.push(gt),je[gt]=!0))}var Te=[],je={};throw ie.forEach(Ie),new vn(`${re}: `+Te.map(Ho).join([", "]))},Xs=(re,ie)=>{for(var Ie=[],Te=0;Te<re;Te++)Ie.push(N[ie+4*Te>>2]);return Ie};function Ri(re){for(var ie=1;ie<re.length;++ie)if(re[ie]!==null&&re[ie].V===void 0)return!0;return!1}function Po(re,ie,Ie,Te,je,gt){var ct=ie.length;if(2>ct)throw new He("argTypes array size mismatch! Must at least get return value and 'this' types!");var xt=ie[1]!==null&&Ie!==null,Bn=Ri(ie);Ie=!ie[0].ma;var Hn=ie[0],ln=ie[1];for(Te=[re,Et,Te,je,ne,Hn.N.bind(Hn),ln?.T.bind(ln)],je=2;je<ct;++je)Hn=ie[je],Te.push(Hn.T.bind(Hn));if(!Bn)for(je=xt?1:2;je<ie.length;++je)ie[je].V!==null&&Te.push(ie[je].V);for(Bn=Ri(ie),je=ie.length-2,ln=[],Hn=["fn"],xt&&Hn.push("thisWired"),ct=0;ct<je;++ct)ln.push(`arg${ct}`),Hn.push(`arg${ct}Wired`);ln=ln.join(","),Hn=Hn.join(","),ln=`return function (${ln}) {
`,Bn&&(ln+=`var destructors = [];
`);var xs=Bn?"destructors":"null",Vu="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(xt&&(ln+=`var thisWired = toClassParamWire(${xs}, this);
`),ct=0;ct<je;++ct){var ul=`toArg${ct}Wire`;ln+=`var arg${ct}Wired = ${ul}(${xs}, arg${ct});
`,Vu.push(ul)}if(ln+=(Ie||gt?"var rv = ":"")+`invoker(${Hn});
`,Bn)ln+=`runDestructors(destructors);
`;else for(ct=xt?1:2;ct<ie.length;++ct)gt=ct===1?"thisWired":"arg"+(ct-2)+"Wired",ie[ct].V!==null&&(ln+=`${gt}_dtor(${gt});
`,Vu.push(`${gt}_dtor`));return Ie&&(ln+=`var ret = fromRetWire(rv);
return ret;
`),ie=new Function(Vu,ln+`}
`)(...Te),Mn(re,ie)}for(var dc=re=>{re=re.trim();let ie=re.indexOf("(");return ie===-1?re:re.slice(0,ie)},Zs=[],Mr=[0,1,,1,null,1,!0,1,!1,1],Nr=re=>{9<re&&--Mr[re+1]===0&&(Mr[re]=void 0,Zs.push(re))},uh=re=>{if(!re)throw new He(`Cannot use deleted val. handle = ${re}`);return Mr[re]},Fs=re=>{switch(re){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ie=Zs.pop()||Mr.length;return Mr[ie]=re,Mr[ie+1]=1,ie}},Ua={name:"emscripten::val",N:re=>{var ie=uh(re);return Nr(re),ie},T:(re,ie)=>Fs(ie),X:Ce,V:null},zA=(re,ie,Ie)=>{switch(ie){case 1:return Ie?function(Te){return this.N(x[Te])}:function(Te){return this.N(S[Te])};case 2:return Ie?function(Te){return this.N(w[Te>>1])}:function(Te){return this.N(v[Te>>1])};case 4:return Ie?function(Te){return this.N(P[Te>>2])}:function(Te){return this.N(N[Te>>2])};default:throw new TypeError(`invalid integer width (${ie}): ${re}`)}},Ro=(re,ie)=>{var Ie=De[re];if(Ie===void 0)throw re=`${ie} has unknown type ${Ho(re)}`,new He(re);return Ie},eu=(re,ie)=>{switch(ie){case 4:return function(Ie){return this.N(L[Ie>>2])};case 8:return function(Ie){return this.N(p[Ie>>3])};default:throw new TypeError(`invalid float width (${ie}): ${re}`)}},tu=Object.assign({optional:!0},Ua),Aa=(re,ie,Ie)=>{var Te=S;if(!(0<Ie))return 0;var je=ie;Ie=ie+Ie-1;for(var gt=0;gt<re.length;++gt){var ct=re.codePointAt(gt);if(127>=ct){if(ie>=Ie)break;Te[ie++]=ct}else if(2047>=ct){if(ie+1>=Ie)break;Te[ie++]=192|ct>>6,Te[ie++]=128|ct&63}else if(65535>=ct){if(ie+2>=Ie)break;Te[ie++]=224|ct>>12,Te[ie++]=128|ct>>6&63,Te[ie++]=128|ct&63}else{if(ie+3>=Ie)break;Te[ie++]=240|ct>>18,Te[ie++]=128|ct>>12&63,Te[ie++]=128|ct>>6&63,Te[ie++]=128|ct&63,gt++}}return Te[ie]=0,ie-je},Mo=re=>{for(var ie=0,Ie=0;Ie<re.length;++Ie){var Te=re.charCodeAt(Ie);127>=Te?ie++:2047>=Te?ie+=2:55296<=Te&&57343>=Te?(ie+=4,++Ie):ie+=3}return ie},nu=new TextDecoder,An=(re,ie,Ie,Te)=>{if(Ie=ie+Ie,Te)return Ie;for(;re[ie]&&!(ie>=Ie);)++ie;return ie},Se=new TextDecoder("utf-16le"),wt=(re,ie,Ie)=>(re>>=1,Se.decode(v.subarray(re,An(v,re,ie/2,Ie)))),mn=(re,ie,Ie)=>{if(Ie??(Ie=2147483647),2>Ie)return 0;Ie-=2;var Te=ie;Ie=Ie<2*re.length?Ie/2:re.length;for(var je=0;je<Ie;++je)w[ie>>1]=re.charCodeAt(je),ie+=2;return w[ie>>1]=0,ie-Te},Ar=re=>2*re.length,Ga=(re,ie,Ie)=>{var Te="";re>>=2;for(var je=0;!(je>=ie/4);je++){var gt=N[re+je];if(!gt&&!Ie)break;Te+=String.fromCodePoint(gt)}return Te},bs=(re,ie,Ie)=>{if(Ie??(Ie=2147483647),4>Ie)return 0;var Te=ie;Ie=Te+Ie-4;for(var je=0;je<re.length;++je){var gt=re.codePointAt(je);if(65535<gt&&je++,P[ie>>2]=gt,ie+=4,ie+4>Ie)break}return P[ie>>2]=0,ie-Te},Dc=re=>{for(var ie=0,Ie=0;Ie<re.length;++Ie)65535<re.codePointAt(Ie)&&Ie++,ie+=4;return ie},zu=[],w_=re=>{var ie=zu.length;return zu.push(re),ie},gw=(re,ie)=>{for(var Ie=Array(re),Te=0;Te<re;++Te)Ie[Te]=Ro(N[ie+4*Te>>2],`parameter ${Te}`);return Ie},ma=(re,ie,Ie)=>{var Te=[];return re=re(Te,Ie),Te.length&&(N[ie>>2]=Fs(Te)),re},bG={},xG=re=>{var ie=bG[re];return ie===void 0?Ue(re):ie},v9={},rne=()=>{if(!P9){var re={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"},ie;for(ie in v9)v9[ie]===void 0?delete re[ie]:re[ie]=v9[ie];var Ie=[];for(ie in re)Ie.push(`${ie}=${re[ie]}`);P9=Ie}return P9},P9,mDe=[null,[],[]],lp=new Uint8Array(123),D_=25;0<=D_;--D_)lp[48+D_]=52+D_,lp[65+D_]=D_,lp[97+D_]=26+D_;lp[43]=62,lp[47]=63,(()=>{let re=Nt.prototype;Object.assign(re,{isAliasOf:function(Ie){if(!(this instanceof Nt&&Ie instanceof Nt))return!1;var Te=this.L.P.M,je=this.L.O;Ie.L=Ie.L;var gt=Ie.L.P.M;for(Ie=Ie.L.O;Te.U;)je=Te.ea(je),Te=Te.U;for(;gt.U;)Ie=gt.ea(Ie),gt=gt.U;return Te===gt&&je===Ie},clone:function(){if(this.L.O||Wt(this),this.L.da)return this.L.count.value+=1,this;var Ie=lt,Te=Object,je=Te.create,gt=Object.getPrototypeOf(this),ct=this.L;return Ie=Ie(je.call(Te,gt,{L:{value:{count:ct.count,ba:ct.ba,da:ct.da,O:ct.O,P:ct.P,S:ct.S,W:ct.W}}})),Ie.L.count.value+=1,Ie.L.ba=!1,Ie},delete(){if(this.L.O||Wt(this),this.L.ba&&!this.L.da)throw new He("Object already scheduled for deletion");on(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||Wt(this),this.L.ba&&!this.L.da)throw new He("Object already scheduled for deletion");return this.L.ba=!0,this}});let ie=Symbol.dispose;ie&&(re[ie]=re.delete)})(),Object.assign(Js.prototype,{sa(re){return this.na&&(re=this.na(re)),re},ka(re){var ie;(ie=this.Y)==null||ie.call(this,re)},X:Ce,N:function(re){function ie(){return this.ga?Rr(this.M.$,{P:this.xa,O:Ie,W:this,S:re}):Rr(this.M.$,{P:this,O:re})}var Ie=this.sa(re);if(!Ie)return this.ka(re),null;var Te=hr(this.M,Ie);if(Te!==void 0)return Te.L.count.value===0?(Te.L.O=Ie,Te.L.S=re,Te.clone()):(Te=Te.clone(),this.ka(re),Te);if(Te=this.M.ra(Ie),Te=at[Te],!Te)return ie.call(this);Te=this.fa?Te.oa:Te.pointerType;var je=co(Ie,this.M,Te.M);return je===null?ie.call(this):this.ga?Rr(Te.M.$,{P:Te,O:je,W:this,S:re}):Rr(Te.M.$,{P:Te,O:je})}}),i.print&&(m=i.print),i.printErr&&(g=i.printErr),i.wasmBinary&&(A=i.wasmBinary),i.thisProgram&&(c=i.thisProgram);var sne,R9,v_,pDe={x:()=>k(""),q:re=>{var ie=ge[re];delete ge[re];var Ie=ie.ia,Te=ie.Y,je=ie.la,gt=je.map(ct=>ct.va).concat(je.map(ct=>ct.Ba));ke([re],gt,ct=>{var xt={};return je.forEach((Bn,Hn)=>{var ln=ct[Hn],xs=Bn.ta,Vu=Bn.ua,ul=ct[Hn+je.length],fl=Bn.Aa,qf=Bn.Ca;xt[Bn.qa]={read:up=>ln.N(xs(Vu,up)),write:(up,_w)=>{var Hu=[];fl(qf,up,ul.T(Hu,_w)),ne(Hu)},optional:ct[Hn].optional}}),[{name:ie.name,N:Bn=>{var Hn={},ln;for(ln in xt)Hn[ln]=xt[ln].read(Bn);return Te(Bn),Hn},T:(Bn,Hn)=>{for(var ln in xt)if(!(ln in Hn||xt[ln].optional))throw new TypeError(`Missing field: "${ln}"`);var xs=Ie();for(ln in xt)xt[ln].write(xs,Hn[ln]);return Bn!==null&&Bn.push(Te,xs),xs},X:Ce,V:Te}]})},n:(re,ie,Ie,Te,je)=>{ie=Ue(ie),Te=Te===0n;let gt=ct=>ct;if(Te){let ct=8*Ie;gt=xt=>BigInt.asUintN(ct,xt),je=gt(je)}nt(re,{name:ie,N:gt,T:(ct,xt)=>(typeof xt=="number"&&(xt=BigInt(xt)),xt),X:Ct(ie,Ie,!Te),V:null})},B:(re,ie,Ie,Te)=>{ie=Ue(ie),nt(re,{name:ie,N:function(je){return!!je},T:function(je,gt){return gt?Ie:Te},X:function(je){return this.N(S[je])},V:null})},j:(re,ie,Ie,Te,je,gt,ct,xt,Bn,Hn,ln,xs,Vu)=>{ln=Ue(ln),gt=mo(je,gt),xt&&(xt=mo(ct,xt)),Hn&&(Hn=mo(Bn,Hn)),Vu=mo(xs,Vu);var ul=Ao(ln);ro(ul,function(){Yo(`Cannot construct ${ln} due to unbound types`,[Te])}),ke([re,ie,Ie],Te?[Te]:[],fl=>{if(fl=fl[0],Te)var qf=fl.M,up=qf.$;else up=Nt.prototype;fl=Mn(ln,function(...N9){if(Object.getPrototypeOf(this)!==_w)throw new He(`Use 'new' to construct ${ln}`);if(Hu.Z===void 0)throw new He(`${ln} has no accessible constructor`);var ane=Hu.Z[N9.length];if(ane===void 0)throw new He(`Tried to invoke ctor of ${ln} with invalid number of parameters (${N9.length}) - expected (${Object.keys(Hu.Z).toString()}) parameters instead!`);return ane.apply(this,N9)});var _w=Object.create(up,{constructor:{value:fl}});fl.prototype=_w;var Hu=new ii(ln,fl,_w,Vu,qf,gt,xt,Hn);if(Hu.U){var Cw;(Cw=Hu.U).ja??(Cw.ja=[]),Hu.U.ja.push(Hu)}return qf=new Js(ln,Hu,!0,!1,!1),Cw=new Js(ln+"*",Hu,!1,!1,!1),up=new Js(ln+" const*",Hu,!1,!0,!1),at[re]={pointerType:Cw,oa:up},Is(ul,fl),[qf,Cw,up]})},g:(re,ie,Ie,Te,je,gt)=>{var ct=Xs(ie,Ie);je=mo(Te,je),ke([],[re],xt=>{xt=xt[0];var Bn=`constructor ${xt.name}`;if(xt.M.Z===void 0&&(xt.M.Z=[]),xt.M.Z[ie-1]!==void 0)throw new He(`Cannot register multiple constructors with identical number of parameters (${ie-1}) for class '${xt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return xt.M.Z[ie-1]=()=>{Yo(`Cannot construct ${xt.name} due to unbound types`,ct)},ke([],ct,Hn=>(Hn.splice(1,0,null),xt.M.Z[ie-1]=Po(Bn,Hn,null,je,gt),[])),[]})},b:(re,ie,Ie,Te,je,gt,ct,xt,Bn)=>{var Hn=Xs(Ie,Te);ie=Ue(ie),ie=dc(ie),gt=mo(je,gt),ke([],[re],ln=>{function xs(){Yo(`Cannot call ${Vu} due to unbound types`,Hn)}ln=ln[0];var Vu=`${ln.name}.${ie}`;ie.startsWith("@@")&&(ie=Symbol[ie.substring(2)]),xt&&ln.M.ya.push(ie);var ul=ln.M.$,fl=ul[ie];return fl===void 0||fl.R===void 0&&fl.className!==ln.name&&fl.aa===Ie-2?(xs.aa=Ie-2,xs.className=ln.name,ul[ie]=xs):(fi(ul,ie,Vu),ul[ie].R[Ie-2]=xs),ke([],Hn,qf=>(qf=Po(Vu,qf,ln,gt,ct,Bn),ul[ie].R===void 0?(qf.aa=Ie-2,ul[ie]=qf):ul[ie].R[Ie-2]=qf,[])),[]})},z:re=>nt(re,Ua),r:(re,ie,Ie,Te)=>{function je(){}ie=Ue(ie),je.values={},nt(re,{name:ie,constructor:je,N:function(gt){return this.constructor.values[gt]},T:(gt,ct)=>ct.value,X:zA(ie,Ie,Te),V:null}),ro(ie,je)},d:(re,ie,Ie)=>{var Te=Ro(re,"enum");ie=Ue(ie),re=Te.constructor,Te=Object.create(Te.constructor.prototype,{value:{value:Ie},constructor:{value:Mn(`${Te.name}_${ie}`,function(){})}}),re.values[Ie]=Te,re[ie]=Te},m:(re,ie,Ie)=>{ie=Ue(ie),nt(re,{name:ie,N:Te=>Te,T:(Te,je)=>je,X:eu(ie,Ie),V:null})},l:(re,ie,Ie,Te,je,gt,ct)=>{var xt=Xs(ie,Ie);re=Ue(re),re=dc(re),je=mo(Te,je),ro(re,function(){Yo(`Cannot call ${re} due to unbound types`,xt)},ie-1),ke([],xt,Bn=>(Bn=[Bn[0],null].concat(Bn.slice(1)),Is(re,Po(re,Bn,null,je,gt,ct),ie-1),[]))},c:(re,ie,Ie,Te,je)=>{ie=Ue(ie);let gt=xt=>xt;if(Te===0){var ct=32-8*Ie;gt=xt=>xt<<ct>>>ct,je=gt(je)}nt(re,{name:ie,N:gt,T:(xt,Bn)=>Bn,X:Ct(ie,Ie,Te!==0),V:null})},a:(re,ie,Ie)=>{function Te(gt){return new je(x.buffer,N[gt+4>>2],N[gt>>2])}var je=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ie];Ie=Ue(Ie),nt(re,{name:Ie,N:Te,X:Te},{wa:!0})},h:re=>{nt(re,tu)},A:(re,ie)=>{ie=Ue(ie),nt(re,{name:ie,N(Ie){var Te=(Te=Ie+4)?nu.decode(S.subarray(Te,An(S,Te,N[Ie>>2],!0))):"";return v_(Ie),Te},T(Ie,Te){Te instanceof ArrayBuffer&&(Te=new Uint8Array(Te));var je=typeof Te=="string";if(!(je||ArrayBuffer.isView(Te)&&Te.BYTES_PER_ELEMENT==1))throw new He("Cannot pass non-string to std::string");var gt=je?Mo(Te):Te.length,ct=R9(4+gt+1),xt=ct+4;return N[ct>>2]=gt,je?Aa(Te,xt,gt+1):S.set(Te,xt),Ie!==null&&Ie.push(v_,ct),ct},X:Ce,V(Ie){v_(Ie)}})},f:(re,ie,Ie)=>{if(Ie=Ue(Ie),ie===2)var Te=wt,je=mn,gt=Ar;else Te=Ga,je=bs,gt=Dc;nt(re,{name:Ie,N:ct=>{var xt=Te(ct+4,N[ct>>2]*ie,!0);return v_(ct),xt},T:(ct,xt)=>{if(typeof xt!="string")throw new He(`Cannot pass non-string to C++ string type ${Ie}`);var Bn=gt(xt),Hn=R9(4+Bn+ie);return N[Hn>>2]=Bn/ie,je(xt,Hn+4,Bn+ie),ct!==null&&ct.push(v_,Hn),Hn},X:Ce,V(ct){v_(ct)}})},i:(re,ie,Ie,Te,je,gt)=>{ge[re]={name:Ue(ie),ia:mo(Ie,Te),Y:mo(je,gt),la:[]}},e:(re,ie,Ie,Te,je,gt,ct,xt,Bn,Hn)=>{ge[re].la.push({qa:Ue(ie),va:Ie,ta:mo(Te,je),ua:gt,Ba:ct,Aa:mo(xt,Bn),Ca:Hn})},C:(re,ie)=>{ie=Ue(ie),nt(re,{ma:!0,name:ie,N:()=>{},T:()=>{}})},p:(re,ie,Ie)=>{var[Te,...je]=gw(re,ie);ie=Te.T.bind(Te);var gt=je.map(Bn=>Bn.X.bind(Bn));re--;var ct={toValue:uh};switch(re=gt.map((Bn,Hn)=>{var ln=`argFromPtr${Hn}`;return ct[ln]=Bn,`${ln}(args${Hn?"+"+8*Hn:""})`}),Ie){case 0:var xt="toValue(handle)";break;case 2:xt="new (toValue(handle))";break;case 3:xt="";break;case 1:ct.getStringOrSymbol=xG,xt="toValue(handle)[getStringOrSymbol(methodName)]"}return xt+=`(${re})`,Te.ma||(ct.toReturnWire=ie,ct.emval_returnValue=ma,xt=`return emval_returnValue(toReturnWire, destructorsRef, ${xt})`),xt=`return function (handle, methodName, destructorsRef, args) {
${xt}
}`,Ie=new Function(Object.keys(ct),xt)(...Object.values(ct)),xt=`methodCaller<(${je.map(Bn=>Bn.name)}) => ${Te.name}>`,w_(Mn(xt,Ie))},E:Nr,o:(re,ie,Ie,Te,je)=>zu[re](ie,Ie,Te,je),D:re=>{var ie=uh(re);ne(ie),Nr(re)},s:(re,ie,Ie,Te)=>{var je=new Date().getFullYear(),gt=new Date(je,0,1).getTimezoneOffset();je=new Date(je,6,1).getTimezoneOffset(),N[re>>2]=60*Math.max(gt,je),P[ie>>2]=+(gt!=je),ie=ct=>{var xt=Math.abs(ct);return`UTC${0<=ct?"-":"+"}${String(Math.floor(xt/60)).padStart(2,"0")}${String(xt%60).padStart(2,"0")}`},re=ie(gt),ie=ie(je),je<gt?(Aa(re,Ie,17),Aa(ie,Te,17)):(Aa(re,Te,17),Aa(ie,Ie,17))},y:re=>{var ie=S.length;if(re>>>=0,2147483648<re)return!1;for(var Ie=1;4>=Ie;Ie*=2){var Te=ie*(1+.2/Ie);Te=Math.min(Te,re+100663296);e:{Te=(Math.min(2147483648,65536*Math.ceil(Math.max(re,Te)/65536))-I.buffer.byteLength+65535)/65536|0;try{I.grow(Te),R();var je=1;break e}catch{}je=void 0}if(je)return!0}return!1},t:(re,ie)=>{var Ie=0,Te=0,je;for(je of rne()){var gt=ie+Ie;N[re+Te>>2]=gt,Ie+=Aa(je,gt,1/0)+1,Te+=4}return 0},u:(re,ie)=>{var Ie=rne();N[re>>2]=Ie.length,re=0;for(var Te of Ie)re+=Mo(Te)+1;return N[ie>>2]=re,0},v:()=>52,w:function(){return 70},k:(re,ie,Ie,Te)=>{for(var je=0,gt=0;gt<Ie;gt++){var ct=N[ie>>2],xt=N[ie+4>>2];ie+=8;for(var Bn=0;Bn<xt;Bn++){var Hn=re,ln=S[ct+Bn],xs=mDe[Hn];ln===0||ln===10?(Hn=Hn===1?m:g,ln=An(xs,0),ln=nu.decode(xs.buffer?xs.subarray(0,ln):new Uint8Array(xs.slice(0,ln))),Hn(ln),xs.length=0):xs.push(ln)}je+=xt}return N[Te>>2]=je,0}},Vb=await(async function(){var re;function ie(Te){var je;return Vb=Te.exports,I=Vb.F,R(),ka=Vb.H,Te=Vb,sne=Te.I,i._malloc=R9=Te.J,i._free=v_=Te.K,O--,(je=i.monitorRunDependencies)==null||je.call(i,O),O==0&&U&&(Te=U,U=null,Te()),Vb}O++,(re=i.monitorRunDependencies)==null||re.call(i,O);var Ie={a:pDe};return i.instantiateWasm?new Promise(Te=>{i.instantiateWasm(Ie,(je,gt)=>{Te(ie(je))})}):(z??(z=fe("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C0EAEKEDRQRAQZiDASEBIARBmIMBQRgQiwFFDQJBsIMBIQEgBEGwgwFBGBCLAUUNAkEAIQBBvO4BLQAARQRAA0AgAEECdCAAQcYfEKIDNgKM7gEgAEEBaiIAQQZHDQALQbzuAUEBOgAAQaTuAUGM7gEoAgA2AgALQYzuASEBIAJBCGoiAEGM7gFBGBCLAUUNAkGk7gEhASAAQaTuAUEYEIsBRQ0CQRgQNCIBRQ0BCyABIAIpAgg3AgAgASACKQIYNwIQIAEgAikCEDcCCAwBC0EAIQELIAJBIGokAEGc8QFBAToAAEGY8QEgATYCACABC80KAgV/CX4jAEHgAGsiBSQAIARC////////P4MhCiACIASFQoCAgICAgICAgH+DIQsgAkL///////8/gyIMQiCIIQ8gBEIwiKdB//8BcSEHAkACQCACQjCIp0H//wFxIglB//8Ba0GCgH5PBEAgB0H//wFrQYGAfksNAQsgAVAgAkL///////////8AgyINQoCAgICAgMD//wBUIA1CgICAgICAwP//AFEbRQRAIAJCgICAgICAIIQhCwwCCyADUCAEQv///////////wCDIgJCgICAgICAwP//AFQgAkKAgICAgIDA//8AURtFBEAgBEKAgICAgIAghCELIAMhAQwCCyABIA1CgICAgICAwP//AIWEUARAIAIgA4RQBEBCgICAgICA4P//ACELQgAhAQwDCyALQoCAgICAgMD//wCEIQtCACEBDAILIAMgAkKAgICAgIDA//8AhYRQBEAgASANhEIAIQFQBEBCgICAgICA4P//ACELDAMLIAtCgICAgICAwP//AIQhCwwCCyABIA2EUARAQgAhAQwCCyACIAOEUARAQgAhAQwCCyANQv///////z9YBEAgBUHQAGogASAMIAEgDCAMUCIGG3lCwABCACAGG3ynIgZBD2sQREEQIAZrIQYgBSkDWCIMQiCIIQ8gBSkDUCEBCyACQv///////z9WDQAgBUFAayADIAogAyAKIApQIggbeULAAEIAIAgbfKciCEEPaxBEIAYgCGtBEGohBiAFKQNIIQogBSkDQCEDCyAHIAlqIAZqQf//AGshBgJAIApCD4YiDkIgiEKAgICACIQiAiABQiCIIgR+IhAgA0IPhiIRQiCIIgogD0KAgASEIg1+fCIPIBBUrSAPIANCMYggDoRC/////w+DIgMgDEL/////D4MiDH58Ig4gD1StfCACIA1+fCAOIA4gEUKAgP7/D4MiDyAMfiIRIAQgCn58IhAgEVStIBAgECADIAFC/////w+DIgF+fCIQVq18fCIOVq18IAMgDX4iEiACIAx+fCIRIBJUrUIghiARQiCIhHwgDiAOIBFCIIZ8Ig5WrXwgDiANIA9+Ig0gCiAMfnwiDCABIAJ+fCICIAMgBH58IgNCIIggAiADVq0gDCANVK0gAiAMVK18fEIghoR8IgIgDlStfCACIBAgBCAPfiIMIAEgCn58IgRCIIggBCAMVK1CIIaEfCIKIBBUrSAKIANCIIZ8IgMgClStfHwiCiACVK18IAogAyAEQiCGIgIgASAPfnwiASACVK18IgIgA1StfCIEIApUrXwiA0KAgICAgIDAAINQRQRAIAZBAWohBgwBCyABQj+IIANCAYYgBEI/iIQhAyAEQgGGIAJCP4iEIQQgAUIBhiEBIAJCAYaEIQILIAZB//8BTgRAIAtCgICAgICAwP//AIQhC0IAIQEMAQsCfiAGQQBMBEBBASAGayIHQf8ATQRAIAVBMGogASACIAZB/wBqIgYQRCAFQSBqIAQgAyAGEEQgBUEQaiABIAIgBxCKASAFIAQgAyAHEIoBIAUpAzAgBSkDOIRCAFKtIAUpAyAgBSkDEISEIQEgBSkDKCAFKQMYhCECIAUpAwAhBCAFKQMIDAILQgAhAQwCCyADQv///////z+DIAatQjCGhAsgC4QhCyABUCACQgBZIAJCgICAgICAgICAf1EbRQRAIAsgBEIBfCIBUK18IQsMAQsgASACQoCAgICAgICAgH+FhFBFBEAgBCEBDAELIAsgBCAEQgGDfCIBIARUrXwhCwsgACABNwMAIAAgCzcDCCAFQeAAaiQACwYAIAAQLQt8AQN/IwBBEGsiASQAIAEgADYCDCMAQRBrIgIkACAAKAIAQX9HBEAgAkEIaiACQQxqIAFBDGoQVRBVIQMDQCAAKAIAQQFGDQALIAAoAgBFBEAgAEEBNgIAIAMQ0gIgAEF/NgIACwsgAkEQaiQAIAAoAgQgAUEQaiQAQQFrCyAAIAAgAUEBazYCBCAAQeDVATYCACAAQZCtATYCACAAC/cFAQl/IwBBEGsiCSQAIAEQ1wIgCUEMaiABEFUhCCAAQQhqIgMQayACTQRAAkAgAkEBaiIAIAMQayIBSwRAIwBBIGsiCiQAAkAgACABayIHIAMoAgggAygCBGtBAnVNBEAgAyAHENkCDAELIApBDGohAQJ/IAMQayAHaiEFIwBBEGsiACQAIAAgBTYCDCAFELwCIgRNBEAgAxC5AiIFIARBAXZJBEAgACAFQQF0NgIIIABBCGogAEEMahCgASgCACEECyAAQRBqJAAgBAwBCxCMAQALIQQgAxBrIQUjAEEQayIAJAAgASADQQxqIgs2AhAgAUEANgIMIAQEfyAAQQhqIAsgBBC7AiAAKAIIIQYgACgCDAVBAAshBCABIAY2AgAgASAGIAVBAnRqIgU2AgggASAGIARBAnRqNgIMIAEgBTYCBCAAQRBqJAAjAEEQayIGJAAgASgCCCEEIAZBBGoiACABQQhqNgIIIAAgBDYCACAAIAQgB0ECdGo2AgQgACgCACEEA0AgACgCBCAERwRAIAEoAhAaIAQQugIgACAAKAIAQQRqIgQ2AgAMAQsLIAAoAgggACgCADYCACAGQRBqJAAgASgCBCADKAIAIgAgAygCBGtqIQQgAygCBCAAayIHBEAgBCAAIAf8CgAACyABIAQ2AgQgAyADKAIANgIEIAMgAUEEahDXASADQQRqIAFBCGoQ1wEgA0EIaiABQQxqENcBIAEgASgCBDYCACADEGsaIAEoAgQhAANAIAEoAggiBCAARwRAIAEgBEEEazYCCCABKAIQGgwBCwsgASgCACIABEAgASgCECAAIAEoAgwgASgCAGtBAnUQuAILCyAKQSBqJAAMAQsgACABSQRAIAMoAgAgAEECdGohACADEGsaIAMgABDYAgsLCyADIAIQggEoAgAEQCADIAIQggEoAgAQvwELIAgQrAEhACADIAIQggEgADYCACAIKAIAIQAgCEEANgIAIAAEQCAAEL8BCyAJQRBqJAALySgBC38jAEEQayIKJAACQAJAAkACQAJAAkACQAJAAkACQCAAQfQBTQRAQYzqASgCACIEQRAgAEELakH4A3EgAEELSRsiBkEDdiIAdiIBQQNxBEACQCABQX9zQQFxIABqIgJBA3QiAUG06gFqIgAgASgCvOoBIgEoAggiBUYEQEGM6gEgBEF+IAJ3cTYCAAwBCyAFIAA2AgwgACAFNgIICyABQQhqIQAgASACQQN0IgJBA3I2AgQgASACaiIBIAEoAgRBAXI2AgQMCwsgBkGU6gEoAgAiCE0NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgFBA3QiAEG06gFqIgIgACgCvOoBIgAoAggiBUYEQEGM6gEgBEF+IAF3cSIENgIADAELIAUgAjYCDCACIAU2AggLIAAgBkEDcjYCBCAAIAZqIgcgAUEDdCIBIAZrIgVBAXI2AgQgACABaiAFNgIAIAgEQCAIQXhxQbTqAWohAUGg6gEoAgAhAgJ/IARBASAIQQN2dCIDcUUEQEGM6gEgAyAEcjYCACABDAELIAEoAggLIQMgASACNgIIIAMgAjYCDCACIAE2AgwgAiADNgIICyAAQQhqIQBBoOoBIAc2AgBBlOoBIAU2AgAMCwtBkOoBKAIAIgtFDQEgC2hBAnQoArzsASICKAIEQXhxIAZrIQMgAiEBA0ACQCABKAIQIgBFBEAgASgCFCIARQ0BCyAAKAIEQXhxIAZrIgEgAyABIANJIgEbIQMgACACIAEbIQIgACEBDAELCyACKAIYIQkgAiACKAIMIgBHBEAgAigCCCIBIAA2AgwgACABNgIIDAoLIAIoAhQiAQR/IAJBFGoFIAIoAhAiAUUNAyACQRBqCyEFA0AgBSEHIAEiAEEUaiEFIAAoAhQiAQ0AIABBEGohBSAAKAIQIgENAAsgB0EANgIADAkLQX8hBiAAQb9/Sw0AIABBC2oiAUF4cSEGQZDqASgCACIHRQ0AQR8hCEEAIAZrIQMgAEH0//8HTQRAIAZBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohCAsCQAJAAkAgCEECdCgCvOwBIgFFBEBBACEADAELQQAhACAGQRkgCEEBdmtBACAIQR9HG3QhAgNAAkAgASgCBEF4cSAGayIEIANPDQAgASEFIAQiAw0AQQAhAyABIQAMAwsgACABKAIUIgQgBCABIAJBHXZBBHFqKAIQIgFGGyAAIAQbIQAgAkEBdCECIAENAAsLIAAgBXJFBEBBACEFQQIgCHQiAEEAIABrciAHcSIARQ0DIABoQQJ0KAK87AEhAAsgAEUNAQsDQCAAKAIEQXhxIAZrIgIgA0khASACIAMgARshAyAAIAUgARshBSAAKAIQIgEEfyABBSAAKAIUCyIADQALCyAFRQ0AIANBlOoBKAIAIAZrTw0AIAUoAhghCCAFIAUoAgwiAEcEQCAFKAIIIgEgADYCDCAAIAE2AggMCAsgBSgCFCIBBH8gBUEUagUgBSgCECIBRQ0DIAVBEGoLIQIDQCACIQQgASIAQRRqIQIgACgCFCIBDQAgAEEQaiECIAAoAhAiAQ0ACyAEQQA2AgAMBwsgBkGU6gEoAgAiBU0EQEGg6gEoAgAhAAJAIAUgBmsiAUEQTwRAIAAgBmoiAiABQQFyNgIEIAAgBWogATYCACAAIAZBA3I2AgQMAQsgACAFQQNyNgIEIAAgBWoiASABKAIEQQFyNgIEQQAhAkEAIQELQZTqASABNgIAQaDqASACNgIAIABBCGohAAwJCyAGQZjqASgCACICSQRAQZjqASACIAZrIgE2AgBBpOoBQaTqASgCACIAIAZqIgI2AgAgAiABQQFyNgIEIAAgBkEDcjYCBCAAQQhqIQAMCQtBACEAIAZBL2oiAwJ/QeTtASgCAARAQeztASgCAAwBC0Hw7QFCfzcCAEHo7QFCgKCAgICABDcCAEHk7QEgCkEMakFwcUHYqtWqBXM2AgBB+O0BQQA2AgBByO0BQQA2AgBBgCALIgFqIgRBACABayIHcSIBIAZNDQhBxO0BKAIAIgUEQEG87QEoAgAiCCABaiIJIAhNIAUgCUlyDQkLAkBByO0BLQAAQQRxRQRAAkACQAJAAkBBpOoBKAIAIgUEQEHM7QEhAANAIAAoAgAiCCAFTQRAIAUgCCAAKAIEakkNAwsgACgCCCIADQALC0EAEKUBIgJBf0YNAyABIQRB6O0BKAIAIgBBAWsiBSACcQRAIAEgAmsgAiAFakEAIABrcWohBAsgBCAGTQ0DQcTtASgCACIABEBBvO0BKAIAIgUgBGoiByAFTSAAIAdJcg0ECyAEEKUBIgAgAkcNAQwFCyAEIAJrIAdxIgQQpQEiAiAAKAIAIAAoAgRqRg0BIAIhAAsgAEF/Rg0BIAZBMGogBE0EQCAAIQIMBAtB7O0BKAIAIgIgAyAEa2pBACACa3EiAhClAUF/Rg0BIAIgBGohBCAAIQIMAwsgAkF/Rw0CC0HI7QFByO0BKAIAQQRyNgIACyABEKUBIgJBf0ZBABClASIAQX9GciAAIAJNcg0FIAAgAmsiBCAGQShqTQ0FC0G87QFBvO0BKAIAIARqIgA2AgBBwO0BKAIAIABJBEBBwO0BIAA2AgALAkBBpOoBKAIAIgMEQEHM7QEhAANAIAIgACgCACIBIAAoAgQiBWpGDQIgACgCCCIADQALDAQLQZzqASgCACIAQQAgACACTRtFBEBBnOoBIAI2AgALQQAhAEHQ7QEgBDYCAEHM7QEgAjYCAEGs6gFBfzYCAEGw6gFB5O0BKAIANgIAQdjtAUEANgIAA0AgAEEDdCIBIAFBtOoBaiIFNgK86gEgASAFNgLA6gEgAEEBaiIAQSBHDQALQZjqASAEQShrIgBBeCACa0EHcSIBayIFNgIAQaTqASABIAJqIgE2AgAgASAFQQFyNgIEIAAgAmpBKDYCBEGo6gFB9O0BKAIANgIADAQLIAIgA00gASADS3INAiAAKAIMQQhxDQIgACAEIAVqNgIEQaTqASADQXggA2tBB3EiAGoiATYCAEGY6gFBmOoBKAIAIARqIgIgAGsiADYCACABIABBAXI2AgQgAiADakEoNgIEQajqAUH07QEoAgA2AgAMAwtBACEADAYLQQAhAAwEC0Gc6gEoAgAgAksEQEGc6gEgAjYCAAsgAiAEaiEFQcztASEAAkADQCAFIAAoAgAiAUcEQCAAKAIIIgANAQwCCwsgAC0ADEEIcUUNAwtBzO0BIQADQAJAIAAoAgAiASADTQRAIAMgASAAKAIEaiIFSQ0BCyAAKAIIIQAMAQsLQZjqASAEQShrIgBBeCACa0EHcSIBayIHNgIAQaTqASABIAJqIgE2AgAgASAHQQFyNgIEIAAgAmpBKDYCBEGo6gFB9O0BKAIANgIAIAMgBUEnIAVrQQdxakEvayIAIAAgA0EQakkbIgFBGzYCBCABQdTtASkCADcCECABQcztASkCADcCCEHU7QEgAUEIajYCAEHQ7QEgBDYCAEHM7QEgAjYCAEHY7QFBADYCACABQRhqIQADQCAAQQc2AgQgAEEIaiAAQQRqIQAgBUkNAAsgASADRg0AIAEgASgCBEF+cTYCBCADIAEgA2siAkEBcjYCBCABIAI2AgACfyACQf8BTQRAIAJBeHFBtOoBaiEAAn9BjOoBKAIAIgFBASACQQN2dCICcUUEQEGM6gEgASACcjYCACAADAELIAAoAggLIQEgACADNgIIIAEgAzYCDEEMIQJBCAwBC0EfIQAgAkH///8HTQRAIAJBJiACQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAAsgAyAANgIcIANCADcCECAAQQJ0QbzsAWohAQJAAkBBkOoBKAIAIgVBASAAdCIEcUUEQEGQ6gEgBCAFcjYCACABIAM2AgAMAQsgAkEZIABBAXZrQQAgAEEfRxt0IQAgASgCACEFA0AgBSIBKAIEQXhxIAJGDQIgAEEddiEFIABBAXQhACABIAVBBHFqIgQoAhAiBQ0ACyAEIAM2AhALIAMgATYCGEEIIQIgAyIBIQBBDAwBCyABKAIIIgAgAzYCDCABIAM2AgggAyAANgIIQQAhAEEYIQJBDAsgA2ogATYCACACIANqIAA2AgALQZjqASgCACIAIAZNDQBBmOoBIAAgBmsiATYCAEGk6gFBpOoBKAIAIgAgBmoiAjYCACACIAFBAXI2AgQgACAGQQNyNgIEIABBCGohAAwEC0GI6gFBMDYCAEEAIQAMAwsgACACNgIAIAAgACgCBCAEajYCBCACQXggAmtBB3FqIgggBkEDcjYCBCABQXggAWtBB3FqIgQgBiAIaiIDayEHAkBBpOoBKAIAIARGBEBBpOoBIAM2AgBBmOoBQZjqASgCACAHaiIANgIAIAMgAEEBcjYCBAwBC0Gg6gEoAgAgBEYEQEGg6gEgAzYCAEGU6gFBlOoBKAIAIAdqIgA2AgAgAyAAQQFyNgIEIAAgA2ogADYCAAwBCyAEKAIEIgBBA3FBAUYEQCAAQXhxIQkgBCgCDCECAkAgAEH/AU0EQCAEKAIIIgEgAkYEQEGM6gFBjOoBKAIAQX4gAEEDdndxNgIADAILIAEgAjYCDCACIAE2AggMAQsgBCgCGCEGAkAgAiAERwRAIAQoAggiACACNgIMIAIgADYCCAwBCwJAIAQoAhQiAAR/IARBFGoFIAQoAhAiAEUNASAEQRBqCyEBA0AgASEFIAAiAkEUaiEBIAAoAhQiAA0AIAJBEGohASACKAIQIgANAAsgBUEANgIADAELQQAhAgsgBkUNAAJAIAQoAhwiAEECdCIBKAK87AEgBEYEQCABQbzsAWogAjYCACACDQFBkOoBQZDqASgCAEF+IAB3cTYCAAwCCwJAIAQgBigCEEYEQCAGIAI2AhAMAQsgBiACNgIUCyACRQ0BCyACIAY2AhggBCgCECIABEAgAiAANgIQIAAgAjYCGAsgBCgCFCIARQ0AIAIgADYCFCAAIAI2AhgLIAcgCWohByAEIAlqIgQoAgQhAAsgBCAAQX5xNgIEIAMgB0EBcjYCBCADIAdqIAc2AgAgB0H/AU0EQCAHQXhxQbTqAWohAAJ/QYzqASgCACIBQQEgB0EDdnQiAnFFBEBBjOoBIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgAzYCCCABIAM2AgwgAyAANgIMIAMgATYCCAwBC0EfIQIgB0H///8HTQRAIAdBJiAHQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgAyACNgIcIANCADcCECACQQJ0QbzsAWohAAJAAkBBkOoBKAIAIgFBASACdCIFcUUEQEGQ6gEgASAFcjYCACAAIAM2AgAMAQsgB0EZIAJBAXZrQQAgAkEfRxt0IQIgACgCACEBA0AgASIAKAIEQXhxIAdGDQIgAkEddiEBIAJBAXQhAiAAIAFBBHFqIgUoAhAiAQ0ACyAFIAM2AhALIAMgADYCGCADIAM2AgwgAyADNgIIDAELIAAoAggiASADNgIMIAAgAzYCCCADQQA2AhggAyAANgIMIAMgATYCCAsgCEEIaiEADAILAkAgCEUNAAJAIAUoAhwiAUECdCICKAK87AEgBUYEQCACQbzsAWogADYCACAADQFBkOoBIAdBfiABd3EiBzYCAAwCCwJAIAUgCCgCEEYEQCAIIAA2AhAMAQsgCCAANgIUCyAARQ0BCyAAIAg2AhggBSgCECIBBEAgACABNgIQIAEgADYCGAsgBSgCFCIBRQ0AIAAgATYCFCABIAA2AhgLAkAgA0EPTQRAIAUgAyAGaiIAQQNyNgIEIAAgBWoiACAAKAIEQQFyNgIEDAELIAUgBkEDcjYCBCAFIAZqIgQgA0EBcjYCBCADIARqIAM2AgAgA0H/AU0EQCADQXhxQbTqAWohAAJ/QYzqASgCACIBQQEgA0EDdnQiAnFFBEBBjOoBIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgBDYCCCABIAQ2AgwgBCAANgIMIAQgATYCCAwBC0EfIQAgA0H///8HTQRAIANBJiADQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAAsgBCAANgIcIARCADcCECAAQQJ0QbzsAWohAQJAAkAgB0EBIAB0IgJxRQRAQZDqASACIAdyNgIAIAEgBDYCACAEIAE2AhgMAQsgA0EZIABBAXZrQQAgAEEfRxt0IQAgASgCACEBA0AgASICKAIEQXhxIANGDQIgAEEddiEBIABBAXQhACACIAFBBHFqIgcoAhAiAQ0ACyAHIAQ2AhAgBCACNgIYCyAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgBUEIaiEADAELAkAgCUUNAAJAIAIoAhwiAUECdCIFKAK87AEgAkYEQCAFQbzsAWogADYCACAADQFBkOoBIAtBfiABd3E2AgAMAgsCQCACIAkoAhBGBEAgCSAANgIQDAELIAkgADYCFAsgAEUNAQsgACAJNgIYIAIoAhAiAQRAIAAgATYCECABIAA2AhgLIAIoAhQiAUUNACAAIAE2AhQgASAANgIYCwJAIANBD00EQCACIAMgBmoiAEEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwBCyACIAZBA3I2AgQgAiAGaiIFIANBAXI2AgQgAyAFaiADNgIAIAgEQCAIQXhxQbTqAWohAEGg6gEoAgAhAQJ/QQEgCEEDdnQiByAEcUUEQEGM6gEgBCAHcjYCACAADAELIAAoAggLIQQgACABNgIIIAQgATYCDCABIAA2AgwgASAENgIIC0Gg6gEgBTYCAEGU6gEgAzYCAAsgAkEIaiEACyAKQRBqJAAgAAsIACAAQQAQPAsVACAAIAE2AgAgACACKAIANgIEIAALCgAgACgCABC9AwsLACAAKAIAEMMDwAsXACAAEEcEQCAAKAIAIAAQfhCpAQsgAAs7AQJ/IwBBEGsiASQAIAEgADYCDCABKAIMIgAoAgAiAgRAIAAgAjYCBCAAKAIIGiACEC0LIAFBEGokAAstACACRQRAIAAoAgQgASgCBEYPCyAAIAFGBEBBAQ8LIAAoAgQgASgCBBDQAUULIQEBfyAAKAIAIQIgACABNgIAIAIEQCACIAAoAgQRAgALCwYAEMoDAAsNACAAKAIAELwDGiAACw0AIAAoAgAQnQIaIAALdQEBfiAAIAEgBH4gAiADfnwgA0IgiCICIAFCIIgiBH58IANC/////w+DIgMgAUL/////D4MiAX4iBUIgiCADIAR+fCIDQiCIfCABIAJ+IANC/////w+DfCIBQiCIfDcDCCAAIAVC/////w+DIAFCIIaENwMACxEAIAAgASAAKAIAKAIcEQQAC8EBAQN/IAAtAABBIHFFBEACQCAAKAIQIgMEfyADBSAAEN8BDQEgACgCEAsgACgCFCIEayACSQRAIAAgASACIAAoAiQRAwAaDAELAkACQCACRSAAKAJQQQBIcg0AIAIhAwNAIAEgA2oiBUEBay0AAEEKRwRAIANBAWsiAw0BDAILCyAAIAEgAyAAKAIkEQMAIANJDQIgAiADayECIAAoAhQhBAwBCyABIQULIAQgBSACEHEaIAAgACgCFCACajYCFAsLC6EBAQJ/AkAgABAfRSACIAFrQQVIcg0AIAEgAhDHASACQQRrIQQgABAjIgIgABAfaiEFAkADQAJAIAIsAAAhACABIARPDQAgAEEATCAAQf8ATnJFBEAgASgCACACLAAARw0DCyABQQRqIQEgAiAFIAJrQQFKaiECDAELCyAAQQBMIABB/wBOcg0BIAIsAAAgBCgCAEEBa0sNAQsgA0EENgIACwtQAQF+AkAgA0HAAHEEQCABIANBQGqthiECQgAhAQwBCyADRQ0AIAIgA60iBIYgAUHAACADa62IhCECIAEgBIYhAQsgACABNwMAIAAgAjcDCAtpAQF/IwBBgAJrIgUkACAEQYDABHEgAiADTHJFBEAgBSABIAIgA2siA0GAAiADQYACSSIBGxCYAiABRQRAA0AgACAFQYACEEIgA0GAAmsiA0H/AUsNAAsLIAAgBSADEEILIAVBgAJqJAALBABBAAsKACAALQALQQd2CwoAIABB0PIBEHoLCgAgAEHY8gEQegvPCQIEfwR+IwBB8ABrIgYkACAEQv///////////wCDIQkCQAJAIAFQIgUgAkL///////////8AgyIKQoCAgICAgMD//wB9QoCAgICAgMCAgH9UIApQG0UEQCADQgBSIAlCgICAgICAwP//AH0iC0KAgICAgIDAgIB/ViALQoCAgICAgMCAgH9RGw0BCyAFIApCgICAgICAwP//AFQgCkKAgICAgIDA//8AURtFBEAgAkKAgICAgIAghCEEIAEhAwwCCyADUCAJQoCAgICAgMD//wBUIAlCgICAgICAwP//AFEbRQRAIARCgICAgICAIIQhBAwCCyABIApCgICAgICAwP//AIWEUARAQoCAgICAgOD//wAgAiABIAOFIAIgBIVCgICAgICAgICAf4WEUCIFGyEEQgAgASAFGyEDDAILIAMgCUKAgICAgIDA//8AhYRQDQEgASAKhFAEQCADIAmEQgBSDQIgASADgyEDIAIgBIMhBAwCCyADIAmEUEUNACABIQMgAiEEDAELIAMgASABIANUIAkgClYgCSAKURsiCBshCiAEIAIgCBsiDEL///////8/gyEJIAIgBCAIGyILQjCIp0H//wFxIQcgDEIwiKdB//8BcSIFRQRAIAZB4ABqIAogCSAKIAkgCVAiBRt5QsAAQgAgBRt8pyIFQQ9rEEQgBikDaCEJIAYpA2AhCkEQIAVrIQULIAEgAyAIGyEDIAtC////////P4MhASAHBH4gAQUgBkHQAGogAyABIAMgASABUCIHG3lCwABCACAHG3ynIgdBD2sQREEQIAdrIQcgBikDUCEDIAYpA1gLQgOGIANCPYiEQoCAgICAgIAEhCEBIAlCA4YgCkI9iIQgAiAEhSEEAn4gA0IDhiICIAUgB0YNABogBSAHayIHQf8ASwRAQgAhAUIBDAELIAZBQGsgAiABQYABIAdrEEQgBkEwaiACIAEgBxCKASAGKQM4IQEgBikDMCAGKQNAIAYpA0iEQgBSrYQLIQlCgICAgICAgASEIQsgCkIDhiEKAkAgBEIAUwRAQgAhA0IAIQQgCSAKhSABIAuFhFANAiAKIAl9IQIgCyABfSAJIApWrX0iBEL/////////A1YNASAGQSBqIAIgBCACIAQgBFAiBxt5QsAAQgAgBxt8p0EMayIHEEQgBSAHayEFIAYpAyghBCAGKQMgIQIMAQsgCSAKfCICIAlUrSABIAt8fCIEQoCAgICAgIAIg1ANACAJQgGDIARCP4YgAkIBiISEIQIgBUEBaiEFIARCAYghBAsgDEKAgICAgICAgIB/gyEDIAVB//8BTgRAIANCgICAgICAwP//AIQhBEIAIQMMAQtBACEHAkAgBUEASgRAIAUhBwwBCyAGQRBqIAIgBCAFQf8AahBEIAYgAiAEQQEgBWsQigEgBikDACAGKQMQIAYpAxiEQgBSrYQhAiAGKQMIIQQLIARCPYYgAkIDiIQhASAEQgOIQv///////z+DIAetQjCGhCADhCEEAkACQCACp0EHcSIFQQRHBEAgBCABIAEgBUEES618IgNWrXwhBAwBCyAEIAEgASABQgGDfCIDVq18IQQMAQsgBUUN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C14BA38gAEEANgIIIABCADcCACABKAIAIQMgASgCBCIBIANrIgRBAnUiAgRAIAAgAhCuAyAAKAIEIQIgBEUgASADRnJFBEAgAiADIAT8CgAACyAAIAIgBGo2AgQLIAALDQAgACgCACABQQJ0agsXACAAEEcEQCAAIAE2AgQPCyAAIAEQUAthAQF/IwBBEGsiAiQAIAIgADYCDAJAIAAgAUYNAANAIAIgAUEBayIBNgIIIAAgAU8NASACKAIMIAIoAggQ8wIgAiACKAIMQQFqIgA2AgwgAigCCCEBDAALAAsgAkEQaiQAC6wBAQR/IwBBEGsiByQAAkAgAEUNACAEKAIMIQYgAiABa0ECdSIIQQBKBEAgACABIAgQjQIgCEcNAQsgAyABa0ECdSIBIAZIBEAgACAHQQRqIAYgAWsiASAFEP0CIgUQIyABEI0CIQYgBRA5GiABIAZHDQELIAMgAmtBAnUiAUEASgRAIAAgAiABEI0CIAFHDQELIAQoAgwaIARBADYCDCAAIQkLIAdBEGokACAJCycBAX8jAEEQayIDJAAgAyACNgIMIABB5AAgASACENEBIANBEGokAAvbAQIBfwJ+QQEhBAJAIABCAFIgAUL///////////8AgyIFQoCAgICAgMD//wBWIAVCgICAgICAwP//AFEbDQAgAkIAUiADQv///////////wCDIgZCgICAgICAwP//AFYgBkKAgICAgIDA//8AURsNACAAIAKEIAUgBoSEUARAQQAPCyABIAODQgBZBEAgACACVCABIANTIAEgA1EbBEBBfw8LIAAgAoUgASADhYRCAFIPCyAAIAJWIAEgA1UgASADURsEQEF/DwsgACAChSABIAOFhEIAUiEECyAEC+wBAQR/IwBBEGsiBCQAIABBADYCBCMAQRBrIgUkACAEQQA6AA8gACAAKAIAQQxrKAIAahDZASEGIAAgACgCAEEMaygCAGohAwJAIAYEQCADKAJIBEAgACAAKAIAQQxrKAIAaigCSBDFAwsgBCAAIAAoAgBBDGsoAgBqENkBOgAPDAELIANBBBDVAQsgBUEQaiQAQQQhAyAELQAPBEAgACAAIAAoAgBBDGsoAgBqKAIYIgMgASACIAMoAgAoAiARAwAiATYCBEEGQQAgASACRxshAwsgACAAKAIAQQxrKAIAaiADENUBIARB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AxsLPAAgAEEANgIIIABCADcCACAAIAEoAgA2AgAgACABKAIENgIEIAAgASgCCDYCCCABQQA2AgggAUIANwIACywBAX8gAEEANgIIIABCADcCACAAIAEoAgAiAiABKAIEIgEgASACaxDAAyAACwgAIABB/wFxC/wBAQN/IAAoAgQgACgCACIDa0ECdSICIAFJBEAjAEEgayIDJAACQCABIAJrIgIgACgCCCAAKAIEIgFrQQJ1TQRAIAAoAgQiASACQQJ0aiECA0AgASACRgRAIAAgAjYCBAUgAUEANgIAIAFBBGohAQwBCwsMAQsgA0EMaiAAIAEgACgCAGtBAnUgAmoQtgEgACgCBCAAKAIAa0ECdSAAEIcCIgQoAggiASACQQJ0aiECA0AgASACRwRAIAFBADYCACABQQRqIQEMAQsLIAQgAjYCCCAAIAQQhQIgBBCBAgsgA0EgaiQADwsgASACSQRAIAAgAyABQQJ0ajYCBAsLUgECf0HU3gEoAgAiASAAQQdqQXhxIgJqIQACQCACQQAgACABTRtFBEAgAD8AQRB0TQ0BIAAQGA0BC0GI6gFBMDYCAEF/DwtB1N4BIAA2AgAgAQt/AgF+A38CQCAAQoCAgIAQVARAIAAhAgwBCwNAIAFBAWsiASAAIABCCoAiAkIKfn2nQTByOgAAIABC/////58BViACIQANAAsLIAJQRQRAIAKnIQMDQCABQQFrIgEgAyADQQpuIgRBCmxrQTByOgAAIANBCUsgBCEDDQALCyABC78BAQN/IAAoAgQgACgCACIDayICIAFJBEAjAEEgayIDJAACQCABIAJrIgIgACgCCCAAKAIEIgFrTQRAIAAgAhCYAwwBCyACIANBDGogACABIAJqIAAoAgBrELQBIAAoAgQgACgCAGsgABDGASIEKAIIIgFqIQIDQCABIAJHBEAgAUEAOgAAIAFBAWohAQwBCwsgBCACNgIIIAAgBBDvASAEELoBCyADQSBqJAAPCyABIAJJBEAgACABIANqNgIECwt9AQN/AkACQCAAIgFBA3FFDQAgAS0AAEUEQEEADwsDQCABQQFqIgFBA3FFDQEgAS0AAA0ACwwBCwNAIAEiAkEEaiEBQYCChAggAigCACIDayADckGAgYKEeHFBgIGChHhGDQALA0AgAiIBQQFqIQIgAS0AAA0ACwsgASAA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BEBBCiEBIAAQXgwBCyAAEH5BAWshASAAKAIECyIDIAFGBEAgACABQQEgASABEPQBIAAQIxoMAQsgABAjGiAEDQAgACIBIANBAWoQUAwBCyAAKAIAIQEgACADQQFqNgIECyABIANqIgAgAkEPahBdIAJBADoADiAAQQFqIAJBDmoQXSACQRBqJAALoQIBA38jAEEgayIIJABB9////wciCSABQX9zaiACTwRAIAAQIyEKIAFB8////wNJBEAgCCABQQF0NgIcIAggASACajYCECAIQRBqIAhBHGoQoAEoAgAQnwFBAWohCQsgCEEcaiAIQRhqIAAQVSgCABC8ASAIQRBqIAkQngEgCCgCECECIAgoAhQaIAQEQCACIAogBBBNCyAGBEAgAiAEaiAHIAYQTQsgAyAEIAVqIglrIQcgAyAJRwRAIAIgBGogBmogBCAKaiAFaiAHEE0LIAFBCkcEQCAKEIsCCyAAIAI2AgAgACAIKAIUEFwgACAEIAZqIAdqIgA2AgQgCEEAOgAPIAAgAmogCEEPahBdIAhBHGoQuwEgCEEgaiQADwsQWwALCQAgAEEBEKgCCwoAIAAoAgAQHxoLCQAgACABEFUaCwcAIABBAkkLBABBBAsoAQF/IAAgACgCBEEBayIBNgIEIAFBf0YEQCAAIAAoAgAoAggRAgALC5UBAQN/IwBBEGsiBCQAIAQgATYCDCAEIAM2AgggBEEEaiAEQQxqEGMgBCgCCCEDIwBBEGsiASQAIAEgAzYCDCABIAM2AghBfyEFAkBBAEEAIAIgAxDRASIDQQBIDQAgACADQQFqIgMQNCIANgIAIABFDQAgACADIAIgASgCDBDRASEFCyABQRBqJAAQYiAEQRBqJAAgBQsPACAAIAAoAgAoAiQRAAALEQAgACABIAEoAgAoAiARAQALDgAgACABKAIANgIAIAALCABB/////wcLBQBB/wALOwAgACADNgIQIAAgAQR/IAEQUwVBAAsiAzYCACAAIAIgA2oiAjYCCCAAIAEgA2o2AgwgACACNgIEIAALYQEBfyMAQRBrIgIkACACIAA2AgwCQCAAIAFGDQADQCACIAFBBGsiATYCCCAAIAFPDQEgAigCDCACKAIIENcBIAIgAigCDEEEaiIANgIMIAIoAgghAQwACwALIAJBEGokAAs5AgF/AX4jAEEQayIEJAAgAykDACEFIAQgAykDCDcDCCAEIAU3AwAgACABIAIgBBDAASAEQRBqJAAL0AEBAn8gAkGAEHEEQCAAQSs6AAAgAEEBaiEACyACQYAIcQRAIABBIzoAACAAQQFqIQALIAJBhAJxIgNBhAJHBEAgAEGu1AA7AAAgAEECaiEACyACQYCAAXEhAgNAIAEtAAAiBARAIAAgBDoAACAAQQFqIQAgAUEBaiEBDAELCyAAAn8CQCADQYACRwRAIANBBEcNAUHGAEHmACACGwwCC0HFAEHlACACGwwBC0HBAEHhACACGyADQYQCRg0AGkHHAEHnACACGws6AAAgA0GEAkcLKwEBfyMAQRBrIgUkACAFIAQoAgA2AgAgACABIAIgAyAFEJYBIAVBEGokAAuqAQEBfwJAIANBgBBxRSACRXINACADQcoAcSIEQQhGIARBwABGcg0AIABBKzoAACAAQQFqIQALIANBgARxBEAgAEEjOgAAIABBAWohAAsDQCABLQAAIgQEQCAAIAQ6AAAgAEEBaiEAIAFBAWohAQwBCwsgAAJ/Qe8AIANBygBxIgFBwABGDQAaQdgAQfgAIANBgIABcRsgAUEIRg0AGkHkAEH1ACACGws6AAALDAAgABAjIAFBAnRqC5IEAQt/IwBBgAFrIgokACAKIAE2AnwgAiADELUCIQggCkHjADYCECAKQQhqQQAgCkEQaiIJEDYhDwJAAkACQCAIQeUATwRAIAgQNCIJRQ0BIA8gCRA8CyAJIQcgAiEBA0AgASADRgRAA0AgACAKQfwAaiIBECtBASAIGwRAIAAgARArBEAgBSAFKAIAQQJyNgIACwNAIAIgA0YNBiAJLQAAQQJGDQcgCUEBaiEJIAJBDGohAgwACwALIAAQNyEOIAZFBEAgBCAOEEEhDgsgDUEBaiEMQQAhECAJIQcgAiEBA0AgASADRgRAIAwhDSAQRQ0CIAAQPhogCSEHIAIhASAIIAtqQQJJDQIDQCABIANGBEAMBAUCQCAHLQAAQQJHDQAgARAfIA1GDQAgB0EAOgAAIAtBAWshCwsgB0EBaiEHIAFBDGohAQwBCwALAAUCQCAHLQAAQQFHDQAgASANEMwBKAIAIRECQCAGBH8gEQUgBCAREEELIA5GBEBBASEQIAEQHyAMRw0CIAdBAjoAACALQQFqIQsMAQsgB0EAOgAACyAIQQFrIQgLIAdBAWohByABQQxqIQEMAQsACwALAAUgB0ECQQEgARBaIgwbOgAAIAdBAWohByABQQxqIQEgCyAMaiELIAggDGshCAwBCwALAAsQPQALIAUgBSgCAEEEcjYCAAsgDxA1IApBgAFqJAAgAgsRACAAIAEgACgCACgCDBEEAAuTBAELfyMAQYABayIKJAAgCiABNgJ8IAIgAxC1AiEIIApB4wA2AhAgCkEIakEAIApBEGoiCRA2IQ8CQAJAAkAgCEHlAE8EQCAIEDQiCUUNASAPIAkQPAsgCSEHIAIhAQNAIAEgA0YEQANAIAAgCkH8AGoiARAsQQEgCBsEQCAAIAEQLARAIAUgBSgCAEECcjYCAAsDQCACIANGDQYgCS0AAEECRg0HIAlBAWohCSACQQxqIQIMAAsACyAAEDghDiAGRQRAIAQgDhDOASEOCyANQQFqIQxBACEQIAkhByACIQEDQCABIANGBEAgDCENIBBFDQIgABA/GiAJIQcgAiEBIAggC2pBAkkNAgNAIAEgA0YEQAwEBQJAIActAABBAkcNACABEB8gDUYNACAHQQA6AAAgC0EBayELCyAHQQFqIQcgAUEMaiEBDAELAAsABQJAIActAABBAUcNACABIA0QIiwAACERAkAgBgR/IBEFIAQgERDOAQsgDkYEQEEBIRAgARAfIAxHDQIgB0ECOgAAIAtBAWohCwwBCyAHQQA6AAALIAhBAWshCAsgB0EBaiEHIAFBDGohAQwBCwALAAsABSAHQQJBASABEFoiDBs6AAAgB0EBaiEHIAFBDGohASALIAxqIQsgCCAMayEIDAELAAsACxA9AAsgBSAFKAIAQQRyNgIACyAPEDUgCkGAAWokACACC0oBAn8CQCAALQAAIgJFIAIgAS0AACIDR3INAANAIAEtAAEhAyAALQABIgJFDQEgAUEBaiEBIABBAWohACACIANGDQALCyACIANrC4QBAQJ/IwBBoAFrIgQkACAEIAAgBEGeAWogARsiADYClAEgBCABQQFrIgVBACABIAVPGzYCmAEgBEEAQZAB/AsAIARBfzYCTCAEQeIANgIkIARBfzYCUCAEIARBnwFqNgIsIAQgBEGUAWo2AlQgAEEAOgAAIAQgAiADEM0DIARBoAFqJAALuwIBBH8gA0H87QEgAxsiBSgCACEDAkAC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IBAtIAAoAiQQLSAAKAIwEC0gACgCPBAtCyAACwcAIAEgAGsLDABBARDWARogABAtCwkAIAAQsQEQLQsTACAAIAEgAiAAKAIAKAIwEQMACwkAIAAQ2AEQLQsMACAAQQRqENoBIAALDAAgAEEIahDaASAACygBAn8jAEEQayICJAAgASgCACAAKAIASCEDIAJBEGokACABIAAgAxsLEAAgACABNwMIIABCADcDAAsCAAsUACAAQZj1ADYCACAAQQRqECUgAAvyAwICfgV/IwBBIGsiBSQAIAFC////////P4MhAgJ+IAFCMIhC//8BgyIDpyIEQYH4AGtB/Q9NBEAgAkIEhiAAQjyIhCECIARBgPgAa60hAwJAIABC//////////8PgyIAQoGAgICAgICACFoEQCACQgF8IQIMAQsgAEKAgICAgICAgAhSDQAgAkIBgyACfCECC0IAIAIgAkL/////////B1YiBBshACAErSADfAwBCyAAIAKEUCADQv//AVJyRQRAIAJCBIYgAEI8iIRCgICAgICAgASEIQBC/w8MAQsgBEH+hwFLBEBCACEAQv8PDAELQYD4AEGB+AAgA1AiBxsiCCAEayIGQfAASgRAQgAhAEIADAELIAVBEGogACACIAJCgICAgICAwACEIAcbIgJBgAEgBmsQRCAFIAAgAiAGEIoBIAUpAwhCBIYgBSkDACICQjyIhCEAAkAgBCAIRyAFKQMQIAUpAxiEQgBSca0gAkL//////////w+DhCICQoGAgICAgICACFoEQCAAQgF8IQAMAQsgAkKAgICAgICAgAhSDQAgAEIBgyAAfCEACyAAQoCAgICAgIAIhSAAIABC/////////wdWIgQbIQAgBK0LIQIgBUEgaiQAIAFCgICAgICAgICAf4MgAkI0hoQgAIS/C4kCAAJAIAAEfyABQf8ATQ0BAkBB3OEBKAIAKAIARQRAIAFBgH9xQYC/A0YNAwwBCyABQf8PTQRAIAAgAUE/cUGAAXI6AAEgACABQQZ2QcABcjoAAEECDwsgAUGAQHFBgMADRyABQYCwA09xRQRAIAAgAUE/cUGAAXI6AAIgACABQQx2QeABcjoAACAAIAFBBnZBP3FBgAFyOgABQQMPCyABQYCABGtB//8/TQRAIAAgAUE/cUGAAXI6AAMgACABQRJ2QfABcjoAACAA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AXI2AgQgCSAGIAkoAgBBAXFyQQJyNgIAIAEgBmoiAiACKAIEQQFyNgIEIAEgBhDbAQsCQCAAKAIEIgJBA3FFDQAgAkF4cSIBIAVBEGpNDQAgACAFIAJBAXFyQQJyNgIEIAAgBWoiBCABIAVrIgJBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQgBCACENsBCyAAQQhqCwsiAEUNARogCCAANgIMQQAhAQsgAQshAEEAIAgoAgwgABshAQsgCEEQaiQAIAENAEHk/gEoAgAiAEUNACAAEQwADAELCyABRQRAEOsBCyABCwoAIAEgAGtBDG0LCQAgABAuNgIACyMBAn8gACEBA0AgASICQQRqIQEgAigCAA0ACyACIABrQQJ1Cy8BAX8jAEEQayIDJAACQCAAIAFGBEAgAEEAOgB4DAELIAEgAhCpAQsgA0EQaiQACxAAIAAoAgggACgCAGtBAnULCQAgAEEANgIAC0kBAX8jAEEQayIDJAACQAJAIAJBHksNACABLQB4QQFxDQAgAUEBOgB4DAELIAIQwQIhAQsgA0EQaiQAIAAgAjYCBCAAIAE2AgALOgECfyMAQRBrIgAkACAAQf////8DNgIMIABB/////wc2AgggAEEMaiAAQQhqELUDKAIAIABBEGokAAs0AQF/IwBBEGsiAyQAIAMgARBzNgIMIAMgAhBzNgIIIAAgA0EMaiADQQhqEGYgA0EQaiQAC04BAX8jAEEQayIDJAAgAyABNgIIIAMgADYCDCADIAI2AgRBACEBIANBBGoiACADQQxqENMBRQRAIAAgA0EIahDTASEBCyADQRBqJAAgAQswAQF/IwBBEGsiAyQAIAMgATYCDCADIAI2AgggACADQQxqIANBCGoQZiADQRBqJAALMwEBfyMAQRBrIgMkACAAEB8aIAAgAhCDASADQQA6AA8gASACaiADQQ9qEF0gA0EQaiQACzEAIABB/////wNLBEAQqgIACwJ/IABBAnQhAEEEENYBBEAgAEEEELQCDAELIAAQUwsLCQAgABDtARAtCxUAIABB8KoBNgIAIABBEGoQIBogAAsVACAAQciqATYCACAAQQxqECAaIAALgAMBBH8gAiEAA0ACQCAEIAdNIAAgA09yDQAgACwAACIBQf8BcSEFAn9BASABQQBODQAaIAFBQkkNASABQV9NBEAgAyAAa0ECSA0CIAAtAAFBwAFxQYABRw0CQQIMAQsgAUFvTQRAIAMgAGtBA0gNAiAALQACIAAsAAEhAQJAAkAgBUHtAUcEQCAFQeABRw0BIAFBYHFBoH9GDQIMBQsgAUGgf04NBAwBCyABQb9/Sg0DC0HAAXFBgAFHDQJBAwwBCyADIABrQQRIIAFBdEtyDQEgAC0AAyEGIAAtAAIhCCAALAABIQECQAJAAkACQCAFQfABaw4FAAICAgECCyABQfAAakH/AXFBME8NBAwCCyABQZB/Tg0DDAELIAFBv39KDQILIAhBwAFxQYABRyAGQcABcUGAAUdyIAZBP3EgCEEGdEHAH3EgBUESdEGAgPAAcSABQT9xQQx0cnJyQf//wwBLcg0BQQQLIQEgB0EBaiEHIAAgAWohAAwBCwsgACACawu4BAEEfyMAQRBrIgAkAAJ/IAAgAjYCDCAAIAU2AggCQAJAA0AgAiADTyAFIAZPckUEQCACLAAAIghB/wFxIQECfyAIQQBOBEAgAUH//8MASw0FQQEMAQsgCEFCSQ0EIAhBX00EQEEBIAMgAmtBAkgNBhpBAiEIIAItAAEiCUHAAXFBgAFHDQQgCUE/cSABQQZ0QcAPcXIhAUECDAELIAhBb00EQEEBIQggAyACayIKQQJIDQQgAiwAASEJAkACQCABQe0BRwRAIAFB4AFHDQEgCUFgcUGgf0YNAgwICyAJQaB/SA0BDAcLIAlBv39KDQYLIApBAkYNBCACLQACIghBwAFxQYABRw0FIAhBP3EgAUEMdEGA4ANxIAlBP3FBBnRyciEBQQMMAQsgCEF0Sw0EQQEhCCADIAJrIgpBAkgNAyACLAABIQkCQAJAAkACQCABQfABaw4FAAICAgECCyAJQfAAakH/AXFBME8NBwwCCyAJQZB/Tg0GDAELIAlBv39KDQULIApBAkYNAyACLQACIgtBwAFxQYABRw0EIApBA0YNAyACLQADIgpBwAFxQYABRw0EQQIhCCAKQT9xIAtBBnRBwB9xIAFBEnRBgIDwAHEgCUE/cUEMdHJyciIBQf//wwBLDQNBBAshCCAFIAE2AgAgACACIAhqIgI2AgwgACAFQQRqIgU2AggMAQsLIAIgA0khCAsgCAwBC0ECCyAEIAAoAgw2AgAgByAAKAIINgIAIABBEGokAAv1AwAjAEEQayIAJAACfyAAIAI2AgwgACAFNgIIAkADQAJAIAIgA08EQEEAIQUMAQtBAiEFIAIoAgAiAUH//8MASyABQYBwcUGAsANGcg0AAkAgAUH/AE0EQEEBIQUgBiAAKAIIIgJrQQBMDQIgACACQQFqNgIIIAIgAToAAAwBCyABQf8PTQRAIAYgACgCCCICa0ECSA0EIAAgAkEBajYCCCACIAFBBnZBwAFyOgAAIAAgACgCCCICQQFqNgIIIAIgAUE/cUGAAXI6AAAMAQsgBiAAKAIIIgJrIQUgAUH//wNNBEAgBUEDSA0EIAAgAkEBajYCCCACIAFBDHZB4AFyOgAAIAAgACgCCCICQQFqNgIIIAIgAUEGdkE/cUGAAXI6AAAgACAAKAIIIgJBAWo2AgggAiABQT9xQYABcjoAAAwBCyAFQQRIDQMgACACQQFqNgIIIAIgAUESdkHwAXI6AAAgACAAKAIIIgJBAWo2AgggAiABQQx2QT9xQYABcjoAACAAIAAoAggiAkEBajYCCCACIAFBBnZBP3FBgAFyOgAAIAAgACgCCCICQQFqNgIIIAIgAUE/cUGAAXI6AAALIAAgACgCDEEEaiICNgIMDAELCyAFDAELQQELIAQgACgCDDYCACAHIAAoAgg2AgAgAEEQaiQAC5IDAQR/IAIhAANAAkAgBCAGTSAAIANPcg0AAn8gAEEBaiAALQAAIgHAQQBODQAaIAFBwgFJDQEgAUHfAU0EQCADIABrQQJIDQIgAC0AAUHAAXFBgAFHDQIgAEECagwBCyABQe8BTQRAIAMgAGtBA0gNAiAALQACIAAsAAEhBQJAAkAgAUHtAUcEQCABQeABRw0BIAVBYHFBoH9GDQIMBQsgBUGgf04NBAwBCyAFQb9/Sg0DC0HAAXFBgAFHDQIgAEEDagwBCyADIABrQQRIIAFB9AFLciAEIAZrQQJJcg0BIAAtAAMhByAALQACIQggACwAASEFAkACQAJAAkAgAUHwAWsOBQACAgIBAgsgBUHwAGpB/wFxQTBPDQQMAgsgBUGQf04NAwwBCyAFQb9/Sg0CCyAIQcABcUGAAUcgB0HAAXFBgAFHciAHQT9xIAhBBnRBwB9xIAFBEnRBgIDwAHEgBUE/cUEMdHJyckH//8MAS3INASAGQQFqIQYgAEEEagshACAGQQFqIQYMAQsLIAAgAmsLgQUBBX8jAEEQayIAJAACfyAAIAI2AgwgACAFNgIIAkACQANAIAIgA08gBSAGT3JFBEBBAiEJIAACfyACLQAAIgHAQQBOBEAgBSABOwEAQQEMAQsgAUHCAUkNBCABQd8BTQRAQQEgAyACa0ECSA0GGiACLQABIghBwAFxQYABRw0EIAUgCEE/cSABQQZ0QcAPcXI7AQBBAgwBCyABQe8BTQRAQQEhCSADIAJrIgpBAkgNBCACLAABIQgCQAJAIAFB7QFHBEAgAUHgAUcNASAIQWBxQaB/Rw0IDAILIAhBoH9ODQcMAQsgCEG/f0oNBgsgCkECRg0EIAItAAIiCUHAAXFBgAFHDQUgBSAJQT9xIAhBP3FBBnQgAUEMdHJyOwEAQQMMAQsgAUH0AUsNBEEBIQkgAyACayIKQQJIDQMgAi0AASILwCEIAkACQAJAAkAgAUHwAWsOBQACAgIBAgsgCEHwAGpB/wFxQTBPDQcMAgsgCEGQf04NBgwBCyAIQb9/Sg0FCyAKQQJGDQMgAi0AAiIIQcABcUGAAUcNBCAKQQNGDQMgAi0AAyIKQcABcUGAAUcNBCAGIAVrQQNIDQNBAiEJIApBP3EiCiAIQQZ0IgxBwB9xIAtBDHRBgOAPcSABQQdxIgFBEnRycnJB///DAEsNAyAFIAogDEHAB3FyQYC4A3I7AQIgBSAIQQR2QQNxIAtBAnQiCUHAAXEgAUEIdHIgCUE8cXJyQcD/AGpBgLADcjsBACAFQQJqIQVBBAsgAmoiAjYCDCAAIAVBAmoiBTYCCAwBCwsgAiADSSEJCyAJDAELQQILIAQgACgCDDYCACAHIAAoAgg2AgAgAEEQaiQAC8sFAQJ/IwBBEGsiACQAAn8gACACNgIMIAAgBTYCCAJAAkADQCACIANPBEBBACEFDAILQQIhBQJAAkAgAi8BACIBQf8ATQRAQQEhBSAGIAAoAggiAmtBAEwNBCAAIAJBAWo2AgggAiABOgAADAELIAFB/w9NBEAgBiAAKAIIIgJrQQJIDQUgACACQQFqNgIIIAIgAUEGdkHAAXI6AAAgACAAKAIIIgJBAWo2AgggAiABQT9xQYABcjoAAAwBCyABQf+vA00EQCAGIAAoAggiAmtBA0gNBSAAIAJBAWo2AgggAiABQQx2QeABcjoAACAAIAAoAggiAkEBajYCCCACIAFBBnZBP3FBgAFyOgAAIAAgACgCCCICQQFqNgIIIAIgAUE/cUGAAXI6AAAMAQsgAUH/twNNBEBBASEFIAMgAmtBA0gNBCACLwECIghBgPgDcUGAuANHDQIgBiAAKAIIIglrQQRIDQQgCEH/B3EgAUEKdEGA+ANxIAFBwAdxIgVBCnRyckH//z9LDQIgACACQQJqNgIMIAAgCUEBajYCCCAJIAVBBnZBAWoiAkECdkHwAXI6AAAgACAAKAIIIgVBAWo2AgggBSACQQR0QTBxIAFBAnZBD3FyQYABcjoAACAAIAAoAggiAkEBajYCCCACIAhBBnZBD3EgAUEEdEEwcXJBgAFyOgAAIAAgACgCCCIBQQFqNgIIIAEgCEE/cUGAAXI6AAAMAQsgAUGAwANJDQMgBiAAKAIIIgJrQQNIDQQgACACQQFqNgIIIAIgAUEMdkHgAXI6AAAgACAAKAIIIgJBAWo2AgggAiABQQZ2Qb8BcToAACAAIAAoAggiAkEBajYCCCACIAFBP3FBgAFyOgAACyAAIAAoAgxBAmoiAjYCDAwBCwtBAgwCCyAFDAELQQELIAQgACgCDDYCACAHIAAoAgg2AgAgAEEQaiQACw8AIAEgACgCAGogAjYCAAs8AQJ/IwBBEGsiASQAIAEgADYCDCABQQhqIAFBDGoQY0EEQQFB3OEBKAIAKAIAGyECEGIgAUEQaiQAIAILOAEBfyMAQRBrIgUkACAFIAQ2AgwgBUEIaiAFQQxqEGMgACABIAIgAxDSASEAEGIgBUEQaiQAIAALEgAgBCACNgIAIAcgBTYCAEEDCw0AIAEgACgCAGooAgALKwEBfyAAQdyhATYCAAJAIAAoAggiAUUNACAALQAMQQFxRQ0AIAEQLQsgAAsEACABCycBAX8gACgCACgCACgCAEHM8gFBzPIBKAIAQQFqIgA2AgAgADYCBAu0CgEHf0HI8gEtAABFBEAjAEEQayIFJABBwPIBLQAARQRAIwBBEGsiBiQAIAZBATYCDEGg8QEgBigCDBAyIgFByKEBNgIAIwBBEGsiAyQAIAFBCGoiAkEANgIIIAJCADcCACACQQA6AIQBIANBCGogAhBVKAIAGiADQQA6AA8jAEEQayIEJAAQvAJBHkkEQBCMAQALIARBCGogAkEMakEeELsCIAIgBCgCCCIHNgIEIAIgBzYCACACIAcgBCgCDEECdGo2AgggBEEQaiQAIAJBHhDZAiADQQE6AA8gA0EQaiQAIAFBkAFqQYwWELABIAIQ2gJBrPwBQQEQMkHotQE2AgAgAUGs/AFB+O8BEDEQM0G0/AFBARAyQYi2ATYCACABQbT8AUGA8AEQMRAzQbz8AUEBEDIiAkEAOgAMIAJBADYCCCACQdyhATYCACACQZCiATYCCCABQbz8AUHY8gEQMRAzQcz8AUEBEDJByK0BNgIAIAFBzPwBQdDyARAxEDNB1PwBQQEQMkHgrgE2AgAgAUHU/AFB4PIBEDEQM0Hc/AFBARAyIgJBmKoBNgIAIAIQLjYCCCABQdz8AUHo8gEQMRAzQej8AUEBEDJB9K8BNgIAIAFB6PwBQfDyARAxEDNB8PwBQQEQMkHcsQE2AgAgAUHw/AFBgPMBEDEQM0H4/AFBARAyQeiwATYCACABQfj8AUH48gEQMRAzQYD9AUEBEDJB0LIBNgIAIAFBgP0BQYjzARAxEDNBiP0BQQEQMiICQa7YADsBCCACQciqATYCACACQQxqECQaIAFBiP0BQZDzARAxEDNBoP0BQQEQMiICQq6AgIDABTcCCCACQfCqATYCACACQRBqECQaIAFBoP0BQZjzARAxEDNBvP0BQQEQMkGotgE2AgAgAUG8/QFBiPABEDEQM0HE/QFBARAyQaC4ATYCACABQcT9AUGQ8AEQMRAzQcz9AUEBEDJB9LkBNgIAIAFBzP0BQZjwARAxEDNB1P0BQQEQMkHguwE2AgAgAUHU/QFBoPABEDEQM0Hc/QFBARAyQcTDATYCACABQdz9AUHI8AEQMRAzQeT9AUEBEDJB2MQBNgIAIAFB5P0BQdDwARAxEDNB7P0BQQEQMkHMxQE2AgAgAUHs/QFB2PABEDEQM0H0/QFBARAyQcDGATYCACABQfT9AUHg8AEQMRAzQfz9AUEBEDJBtMcBNgIAIAFB/P0BQejwARAxEDNBhP4BQQEQMkHcyAE2AgAgAUGE/gFB8PABEDEQM0GM/gFBARAyQYTKATYCACABQYz+AUH48AEQMRAzQZT+AUEBEDJBrMsBNgIAIAFBlP4BQYDxARAxEDNBnP4BQQEQMiICQZjVATYCCCACQai9ATYCACACQdi9ATYCCCABQZz+AUGo8AEQMRAzQaj+AUEBEDIiAkG81QE2AgggAkG0vwE2AgAgAkHkvwE2AgggAUGo/gFBsPABEDEQM0G0/gFBARAyIgJBCGoQtgIgAkGkwQE2AgAgAUG0/gFBuPABEDEQM0HA/gFBARAyIgJBCGoQtgIgAkHEwgE2AgAgAUHA/gFBwPABEDEQM0HM/gFBARAyQdTMATYCACABQcz+AUGI8QEQMRAzQdT+AUEBEDJBzM0BNgIAIAFB1P4BQZDxARAxEDMgBkEQaiQAIAVBoPEBNgIIQbzyASAFKAIIEFUaQcDyAUEBOgAACyAFQRBqJABBxPIBQbzyARDVAkHI8gFBAToAAAsgAEHE8gEoAgAiADYCACAAENQCCxEAIABBoPEBRwRAIAAQ1wILCxMAIAAgASgCACIANgIAIAAQ1AILlwEBA38gAEHIoQE2AgAgAEEIaiEBA0AgARBrIAJLBEAgASACEIIBKAIABEAgASACEIIBKAIAEL8BCyACQQFqIQIMAQsLIABBkAFqECAaIwBBEGsiAiQAIAJBDGogARBVIgEoAgAiAygCAARAIAMQ2gIgASgCABogASgCACIBQQxqIAEoAgAgARC5AhC4AgsgAkEQaiQAIAALDwAgACAAKAIEQQFqNgIECyYBAX8gACgCBCECA0AgASACRwRAIAJBBGshAgwBCwsgACABNgIEC3UBAn8jAEEQayIDJAAgA0EEaiICIAA2AgAgAiAAKAIEIgA2AgQgAiAAIAFBAnRqNgIIIAIiASgCBCEAIAIoAgghAgNAIAAgAkYEQCABKAIAIAEoAgQ2AgQgA0EQaiQABSAAELoCIAEgAEEEaiIANgIEDAELCwsRACAAEGsaIAAgACgCABDYAgsgACAAQZiqATYCACAAKAIIEC5HBEAgACgCCBCgAwsgAAsEAEF/C+EBAQR/IwBBEGsiBSQAIwBBIGsiAyQAIANBGGogACABEL0CIAMoAhghBCADKAIcIQYjAEEQayIBJAAgASAGNgIMIAIgBCAGIARrIgRBAnUQZSABIAIgBGo2AgggA0EQaiABQQxqIAFBCGoQZiABQRBqJAAgAygCECEEIwBBEGsiASQAIAEgADYCDCABQQxqIgAgBCAAEOwBa0ECdRDwASEAIAFBEGokACADIAA2AgwgAyACIAMoAhQQjgE2AgggBUEIaiADQQxqIANBCGoQZiADQSBqJAAgBSgCDCAFQRBqJAAL9gUBCn8jAEEQayITJAAgAiAANgIAQQRBACAHGyEVIANBgARxIRYDQCAUQQRGBEAgDRAfQQFLBEAgEyANEE42AgwgAiATQQxqQQEQ8AEgDRB1IAIoAgAQ3QI2AgALIANBsAFxIgNBEEcEQCABIANBIEYEfyACKAIABSAACzYCAAsgE0EQaiQABQJAAkACQAJAAkACQCAIIBRqLQAADgUAAQMCBAULIAEgAigCADYCAAwECyABIAIoAgA2AgAgBkEgEEshByACIAIoAgAiD0EEajYCACAPIAc2AgAMAwsgDRBaDQIgDUEAEMwBKAIAIQcgAiACKAIAIg9BBGo2AgAgDyAHNgIADAILIAwQWiAWRXINASACIAwQTiAMEHUgAigCABDdAjYCAAwBCyACKAIAIAQgFWoiBCEHA0ACQCAFIAdNDQAgBkHAACAHKAIAEF9FDQAgB0EEaiEHDAELCyAOQQBKBEAgAigCACEPIA4hEANAIBBFIAQgB09yRQRAIBBBAWshECAHQQRrIgcoAgAhESACIA9BBGoiEjYCACAPIBE2AgAgEiEPDAELCyAQBH8gBkEwEEsFQQALIREgAigCACEPA0AgEEEASgRAIAIgD0EEaiISNgIAIA8gETYCACAQQQFrIRAgEiEPDAELCyACIAIoAgAiD0EEajYCACAPIAk2AgALAkAgBCAHRgRAIAZBMBBLIQcgAiACKAIAIg9BBGo2AgAgDyAHNgIADAELIAsQWgR/QX8FIAtBABAiLAAACyESQQAhEEEAIREDQCAEIAdGDQECQCAQIBJHBEAgECEPDAELIAIgAigCACIPQQRqNgIAIA8gCjYCAEEAIQ8gCxAfIBFBAWoiEU0EQCAQIRIMAQsgCyARECItAABB/wBGBEBBfyESDAELIAsgERAiLAAAIRILIAdBBGsiBygCACEQIAIgAigCACIYQQRqNgIAIBggEDYCACAPQQFqIRAMAAsACyACKAIAEMcBCyAUQQFqIRQMAQsLC70BAQF/IwBBEGsiCiQAAn8gAARAIAIQ5gIMAQsgAhDlAgshAAJAIAEEQCAKQQRqIgEgABCSASADIAooAgQ2AAAgASAAEMIBDAELIApBBGoiASAAEOECIAMgCigCBDYAACABIAAQewsgCCABEKsBIAEQORogBCAAEHg2AgAgBSAAEFk2AgAgCkEEaiIBIAAQWCAGIAEQcCABECAaIAEgABB8IAcgARCrASABEDkaIAkgABDBATYCACAKQRBqJAAL2wEBBH8jAEEQayIFJAAjAEEgayIDJAAgA0EYaiAAIAEQvQIgAygCGCEEIAMoAhwhBiMAQRBrIgEkACABIAY2AgwgAiAEIAYgBGsiBBBNIAEgAiAEajYCCCADQRBqIAFBDGogAUEIahBmIAFBEGokACADKAIQIQQjAEEQayIBJAAgASAANgIMIAFBDGoiACAEIAAQ7AFrEPMBIQAgAUEQaiQAIAMgADYCDCADIAIgAygCFBCOATYCCCAFQQhqIANBDGogA0EIahBmIANBIGokACAFKAIMIAVBEGokAAsRACAAIAEgASgCACgCKBEBAAvLBQEKfyMAQRBrIhQkACACIAA2AgAgA0GABHEhFgNAIBVBBEYEQCANEB9BAUsEQCAUIA0QTjYCDCACIBRBDGpBARDzASANEHcgAigCABDgAjYCAAsgA0GwAXEiA0EQRwRAIAEgA0EgRgR/IAIoAgAFIAALNgIACyAUQRBqJAAFAkACQAJAAkACQAJAIAggFWotAAAOBQABAwIEBQsgASACKAIANgIADAQLIAEgAigCADYCACAGQSAQQSEPIAIgAigCACIQQQFqNgIAIBAgDzoAAAwDCyANEFoNAiANQQAQIi0AACEPIAIgAigCACIQQQFqNgIAIBAgDzoAAAwCCyAMEFogFkVyDQEgAiAMEE4gDBB3IAIoAgAQ4AI2AgAMAQsgAigCACAEIAdqIgQhEQNAAkAgBSARTQ0AIAZBwAAgESwAABBgRQ0AIBFBAWohEQwBCwsgDiIPQQBKBEADQCAPRSAEIBFPckUEQCAPQQFrIQ8gEUEBayIRLQAAIRAgAiACKAIAIhJBAWo2AgAgEiAQOgAADAELCyAPBH8gBkEwEEEFQQALIRIDQCACIAIoAgAiEEEBajYCACAPQQBKBEAgECASOgAAIA9BAWshDwwBCwsgECAJOgAACwJAIAQgEUYEQCAGQTAQQSEPIAIgAigCACIQQQFqNgIAIBAgDzoAAAwBCyALEFoEf0F/BSALQQAQIiwAAAshEEEAIQ9BACETA0AgBCARRg0BAkAgDyAQRwRAIA8hEgwBCyACIAIoAgAiEEEBajYCACAQIAo6AABBACESIAsQHyATQQFqIhNNBEAgDyEQDAELIAsgExAiLQAAQf8ARgRAQX8hEAwBCyALIBMQIiwAACEQCyARQQFrIhEtAAAhDyACIAIoAgAiGEEBajYCACAYIA86AAAgEkEBaiEPDAALAAsgAigCABCEAQsgFUEBaiEVDAELCwu7AQEBfyMAQRBrIgokAAJ/IAAEQCACEO0CDAELIAIQ7AILIQACQCABBEAgCkEEaiIBIAAQkgEgAyAKKAIENgAAIAEgABDCAQwBCyAKQQRqIgEgABDhAiADIAooAgQ2AAAgASAAEHsLIAggARBwIAEQIBogBCAAEHg6AAAgBSAAEFk6AAAgCkEEaiIBIAAQWCAGIAEQcCABECAaIAEgABB8IAcgARBwIAEQIBogCSAAEMEBNgIAIApBEGokAAsIACAAKAIARQsKACAAQdjwARB6CwoAIABB4PABEHoLFwAgAiAAIAEgAGsiAEECdRBlIAAgAmoLgwIBBX8jAEEQayIGJAAgBkEMaiIJIAZBCGogABBVKAIAELwBIwBBEGsiBSQAAkBB9////wMgAWsgAk8EQCAAECMhByAFQQRqIgggAUHz////AUkEfyAFIAFBAXQ2AgwgBSABIAJqNgIEIAggBUEMahCgASgCABCQAUEBagVB9////wMLEI8BIAUoAgQhAiAFKAIIGiAEBEAgAiAHIAQQZQsgAyAERwRAIARBAnQiCCACaiAHIAhqIAMgBGsQZQsgAUEBaiIBQQJHBEAgByABEKkBCyAAIAI2AgAgACAFKAIIEFwgBUEQaiQADAELEFsACyAAIAM2AgQgCRC7ASAGQRBqJAALHwEBfyABKAIAELwDIQIgACABKAIANgIEIAAgAjYCAAuyDgEKfyMAQZAEayILJAAgCyAKNgKIBCALIAE2AowEAkAgACALQYwEahArBEAgBSAFKAIAQQRyNgIAQQAhAAwBCyALQeQANgJIIAsgC0HoAGogC0HwAGogC0HIAGoiARA2Ig8oAgAiCjYCZCALIApBkANqNgJgIAEQJCERIAtBPGoQJCEMIAtBMGoQJCEOIAtBJGoQJCENIAtBGGoQJCEQIwBBEGsiASQAAkAgAgRAIAFBBGoiCiADEOYCIgIQkgEMAQsgAUEEaiIKIAMQ5QIiAhCSAQsgCyABKAIENgBcIAogAhDCASANIAoQqwEgChA5GiAKIAIQeyAOIAoQqwEgChA5GiALIAIQeDYCWCALIAIQWTYCVCAKIAIQWCARIAoQcCAKECAaIAogAhB8IAwgChCrASAKEDkaIAsgAhDBATYCFCABQRBqJAAgCSAIKAIANgIAIARBgARxIRJBACEDQQAhAQNAIAEhAgJAAkACQAJAIANBBEYNACAAIAtBjARqECsNAEEAIQoCQAJAAkACQAJAAkAgC0HcAGogA2otAAAOBQEABAMFCQsgA0EDRg0HIAdBASAAEDcQXwRAIAtBDGogABDpAiAQIAsoAgwQ6gEMAgsgBSAFKAIAQQRyNgIAQQAhAAwGCyADQQNGDQYLA0AgACALQYwEahArDQYgB0EBIAAQNxBfRQ0GIAtBDGogABDpAiAQIAsoAgwQ6gEMAAsACwJAIA4QH0UNACAAEDcgDhAjKAIARw0AIAAQPhogBkEAOgAAIA4gAiAOEB9BAUsbIQEMBgsCQCANEB9FDQAgABA3IA0QIygCAEcNACAAED4aIAZBAToAACANIAIgDRAfQQFLGyEBDAYLAkAgDhAfRQ0AIA0QH0UNACAFIAUoAgBBBHI2AgBBACEADAQLIA4QH0UEQCANEB9FDQULIAYgDRAfRToAAAwECyASIAIgA0ECSXJyRQRAQQAhASADQQJGIAstAF9BAEdxRQ0FCyALIAwQTjYCCCALQQxqIAtBCGoQwwEhAQJAIANFDQAgAyALai0AW0EBSw0AA0ACQCALIAwQdTYCCCABIAtBCGoQdg0AIAdBASABKAIAKAIAEF9FDQAgARD2AQwBCwsgCyAMEE42AgggASgCACALQQhqIgQoAgBrQQJ1IgogEBAfTQRAIAsgEBB1NgIIIARBACAKaxDwASAQEHUhCiAMEE4hEyMAQRBrIhQkABBzIQQgChBzIQogBCATEHMgCiAEa0F8cRCLAUUgFEEQaiQADQELIAsgDBBONgIEIAEgC0EIaiALQQRqEMMBKAIANgIACyALIAEoAgA2AggDQAJAIAsgDBB1NgIEIAtBCGoiASALQQRqEHYNACAAIAtBjARqECsNACAAEDcgASgCACgCAEcNACAAED4aIAEQ9gEMAQsLIBJFDQMgCyAMEHU2AgQgC0EIaiALQQRqEHYNAyAFIAUoAgBBBHI2AgBBACEADAILA0ACQCAAIAtBjARqECsNAAJ/IAdBwAAgABA3IgEQXwRAIAkoAgAiBCALKAKIBEYEQCAIIAkgC0GIBGoQkwEgCSgCACEECyAJIARBBGo2AgAgBCABNgIAIApBAWoMAQsgERAfRSAKRXINASABIAsoAlRHDQEgCygCZCIBIAsoAmBGBEAgDyALQeQAaiALQeAAahCTASALKAJkIQELIAsgAUEEajYCZCABIAo2AgBBAAshCiAAED4aDAELCyAKRSALKAJkIgEgDygCAEZyRQRAIAsoAmAgAUYEQCAPIAtB5ABqIAtB4ABqEJMBIAsoAmQhAQsgCyABQQRqNgJkIAEgCjYCAAsCQCALKAIUQQBMDQACQCAAIAtBjARqECtFBEAgABA3IAsoAlhGDQELIAUgBSgCAEEEcjYCAEEAIQAMAwsDQCAAED4aIAsoAhRBAEwNAQJAIAAgC0GMBGoQK0UEQCAHQcAAIAAQNxBfDQELIAUgBSgCAEEEcjYCAEEAIQAMBAsgCSgCACALKAKIBEYEQCAIIAkgC0GIBGoQkwELIAAQNyEBIAkgCSgCACIEQQRqNgIAIAQgATYCACALIAsoAhRBAWs2AhQMAAsACyACIQEgCCgCACAJKAIARw0DIAUgBSgCAEEEcjYCAEEAIQAMAQsCQCACRQ0AQQEhCgNAIAIQHyAKTQ0BAkAgACALQYwEahArRQRAIAAQNyACIAoQzAEoAgBGDQELIAUgBSgCAEEEcjYCAEEAIQAMAwsgABA+GiAKQQFqIQoMAAsAC0EBIQAgDygCACALKAJkRg0AQQAhACALQQA2AgwgESAPKAIAIAsoAmQgC0EMahBDIAsoAgwEQCAFIAUoAgBBBHI2AgAMAQtBASEACyAQEDkaIA0QORogDhA5GiAMEDkaIBEQIBogDxA1DAMLIAIhAQsgA0EBaiEDDAALAAsgC0GQBGokACAACxgAIAAgARCsARA8IAAgARDyASgCADYCBAsKACAAQcjwARB6CwoAIABB0PABEHoLxwEBBn8jAEEQayIEJAAgABDyASgCACEFQQECfyACKAIAIAAoAgBrIgNB/////wdJBEAgA0EBdAwBC0F/CyIDIANBAU0bIQMgASgCACEGIAAoAgAhByAFQeQARgR/QQAFIAAoAgALIAMQ3AEiCARAIAVB5ABHBEAgABCsARoLIARB4wA2AgQgACAEQQhqIAggBEEEahA2IgUQ6wIgBRA1IAEgACgCACAGIAdrajYCACACIAMgACgCAGo2AgAgBEEQaiQADwsQPQALIAEBfyABKAIAEJ0CwCECIAAgASgCADYCBCAAIAI6AAALxA4BCn8jAEGQBGsiCyQAIAsgCjYCiAQgCyABNgKMBAJAIAAgC0GMBGoQLARAIAUgBSgCAEEEcjYCAEEAIQAMAQsgC0HkADYCTCALIAtB6ABqIAtB8ABqIAtBzABqIgEQNiIPKAIAIgo2AmQgCyAKQZADajYCYCABECQhESALQUBrECQhDCALQTRqECQhDiALQShqECQhDSALQRxqECQhECMAQRBrIgEkAAJAIAIEQCABQQRqIgogAxDtAiICEJIBDAELIAFBBGoiCiADEOwCIgIQkgELIAsgASgCBDYAXCAKIAIQwgEgDSAKEHAgChAgGiAKIAIQeyAOIAoQcCAKECAaIAsgAhB4OgBbIAsgAhBZOgBaIAogAhBYIBEgChBwIAoQIBogCiACEHwgDCAKEHAgChAgGiALIAIQwQE2AhggAUEQaiQAIAkgCCgCADYCACAEQYAEcSESQQAhA0EAIQEDQCABIQICQAJAAkACQCADQQRGDQAgACALQYwEahAsDQBBACEKAkACQAJAAkACQAJAIAtB3ABqIANqLQAADgUBAAQDBQkLIANBA0YNByAHQQEgABA4EGAEQCALQRBqIAAQ7wIgECALLAAQELgBDAILIAUgBSgCAEEEcjYCAEEAIQAMBgsgA0EDRg0GCwNAIAAgC0GMBGoQLA0GIAdBASAAEDgQYEUNBiALQRBqIAAQ7wIgECALLAAQELgBDAALAAsCQCAOEB9FDQAgABA4Qf8BcSAOQQAQIi0AAEcNACAAED8aIAZBADoAACAOIAIgDhAfQQFLGyEBDAYLAkAgDRAfRQ0AIAAQOEH/AXEgDUEAECItAABHDQAgABA/GiAGQQE6AAAgDSACIA0QH0EBSxshAQwGCwJAIA4QH0UNACANEB9FDQAgBSAFKAIAQQRyNgIAQQAhAAwECyAOEB9FBEAgDRAfRQ0FCyAGIA0QH0U6AAAMBAsgEiACIANBAklyckUEQEEAIQEgA0ECRiALLQBfQQBHcUUNBQsgCyAMEE42AgwgC0EQaiALQQxqEMMBIQECQCADRQ0AIAMgC2otAFtBAUsNAANAAkAgCyAMEHc2AgwgASALQQxqEHYNACAHQQEgASgCACwAABBgRQ0AIAEQ+AEMAQsLIAsgDBBONgIMIAEoAgAgC0EMaiIEKAIAayIKIBAQH00EQCALIBAQdzYCDCAEQQAgCmsQ8wEgEBB3IQogDBBOIRMjAEEQayIUJAAQcyEEIAoQcyEKIAQgExBzIAogBGsQiwFFIBRBEGokAA0BCyALIAwQTjYCCCABIAtBDGogC0EIahDDASgCADYCAAsgCyABKAIANgIMA0ACQCALIAwQdzYCCCALQQxqIgEgC0EIahB2DQAgACALQYwEahAsDQAgABA4Qf8BcSABKAIALQAARw0AIAAQPxogARD4AQwBCwsgEkUNAyALIAwQdzYCCCALQQxqIAtBCGoQdg0DIAUgBSgCAEEEcjYCAEEAIQAMAgsDQAJAIAAgC0GMBGoQLA0AAn8gB0HAACAAEDgiARBgBEAgCSgCACIEIAsoAogERgRAIAggCSALQYgEahDuAiAJKAIAIQQLIAkgBEEBajYCACAEIAE6AAAgCkEBagwBCyAREB9FIApFcg0BIAstAFogAUH/AXFHDQEgCygCZCIBIAsoAmBGBEAgDyALQeQAaiALQeAAahCTASALKAJkIQELIAsgAUEEajYCZCABIAo2AgBBAAshCiAAED8aDAELCyAKRSALKAJkIgEgDygCAEZyRQRAIAsoAmAgAUYEQCAPIAtB5ABqIAtB4ABqEJMBIAsoAmQhAQsgCyABQQRqNgJkIAEgCjYCAAsCQCALKAIYQQBMDQACQCAAIAtBjARqECxFBEAgABA4Qf8BcSALLQBbRg0BCyAFIAUoAgBBBHI2AgBBACEADAMLA0AgABA/GiALKAIYQQBMDQECQCAAIAtBjARqECxFBEAgB0HAACAAEDgQYA0BCyAFIAUoAgBBBHI2AgBBACEADAQLIAkoAgAgCygCiARGBEAgCCAJIAtBiARqEO4CCyAAEDghASAJIAkoAgAiBEEBajYCACAEIAE6AAAgCyALKAIYQQFrNgIYDAALAAsgAiEBIAgoAgAgCSgCAEcNAyAFIAUoAgBBBHI2AgBBACEADAELAkAgAkUNAEEBIQoDQCACEB8gCk0NAQJAIAAgC0GMBGoQLEUEQCAAEDhB/wFxIAIgChAiLQAARg0BCyAFIAUoAgBBBHI2AgBBACEADAMLIAAQPxogCkEBaiEKDAALAAtBASEAIA8oAgAgCygCZEYNAEEAIQAgC0EANgIQIBEgDygCACALKAJkIAtBEGoQQyALKAIQBEAgBSAFKAIAQQRyNgIADAELQQEhAAsgEBAgGiANECAaIA4QIBogDBAgGiARECAaIA8QNQwDCyACIQELIANBAWohAwwACwALIAtBkARqJAAgAAsMACAAQQFBLRD9AhoLCwAgAEEBQS0QsAILHAEBfyAALQAAIQIgACABLQAAOgAAIAEgAjoAAAtlAQF/IwBBEGsiBiQAIAZBADoADyAGIAU6AA4gBiAEOgANIAZBJToADCAFBEAgBkENaiAGQQ5qEPMCCyACIAEgASACKAIAEIoCIAZBDGogAyAAKAIAEJ4DIAFqNgIAIAZBEGokAAtBACABIAIgAyAEQQQQZyEBIAMtAABBBHFFBEAgACABQdAPaiABQewOaiABIAFB5ABJGyABQcUASBtB7A5rNgIACwtAACACIAMgAEEIaiAAKAIIKAIEEQAAIgAgAEGgAmogBSAEQQAQzQEgAGsiAEGfAkwEQCABIABBDG1BDG82AgALC0AAIAIgAyAAQQhqIAAoAggoAgARAAAiACAAQagBaiAFIARBABDNASAAayIAQacBTARAIAEgAEEMbUEHbzYCAAsLQQAgASACIAMgBEEEEGghASADLQAAQQRxRQRAIAAgAUHQD2ogAUHsDmogASABQeQASRsgAUHFAEgbQewOazYCAAsLQAAgAiADIABBCGogACgCCCgCBBEAACIAIABBoAJqIAUgBEEAEM8BIABrIgBBnwJMBEAgASAAQQxtQQxvNgIACwtAACACIAMgAEEIaiAAKAIIKAIAEQAAIgAgAEGoAWogBSAEQQAQzwEgAGsiAEGnAUwEQCABIABBDG1BB282AgALCxgBAX9BDBBTIgBBADYCCCAAQgA3AgAgAAsEAEECC8oBAQR/IwBBEGsiAyQAAkAgAUH3////A00EQAJAIAEQvQEEQCAAIAEQUCAAIQQMAQsgA0EIaiABEJABQQFqEI8BIAMoAgwaIAAgAygCCCIENgIAIAAgAygCDBBcIAAgATYCBAsjAEEQayIFJAAgBSACNgIMIAQhBiABIQIDQCACBEAgBiAFKAIMNgIAIAJBAWshAiAGQQRqIQYMAQsLIAVBEGokACADQQA2AgQgBCABQQJ0aiADQQRqEFYgA0EQaiQADAELEFsA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hoRCAEKAgICAgIDAwz8QLyAFKQNIIQIgBSkDQCEEDAELIAlC////////P4MgBiAHcq1CMIaEIQILIAAgBDcDACAAIAI3AwggBUGAAWokAAuIEAIFfw9+IwBB0AJrIgUkACAEQv///////z+DIQsgAkL///////8/gyEKIAIgBIVCgICAgICAgICAf4MhDCAEQjCIp0H//wFxIQcCQAJAIAJCMIinQf//AXEiCEH//wFrQYKAfk8EQCAHQf//AWtBgYB+Sw0BCyABUCACQv///////////wCDIg5CgICAgICAwP//AFQgDkKAgICAgIDA//8AURtFBEAgAkKAgICAgIAghCEMDAILIANQIARC////////////AIMiAkKAgICAgIDA//8AVCACQoCAgICAgMD//wBRG0UEQCAEQoCAgICAgCCEIQwgAyEBDAILIAEgDkKAgICAgIDA//8AhYRQBEAgAyACQoCAgICAgMD//wCFhFAEQEIAIQFCgICAgICA4P//ACEMDAMLIAxCgICAgICAwP//AIQhDEIAIQEMAgsgAyACQoCAgICAgMD//wCFhFAEQEIAIQEMAgsgASAOhFAEQEKAgICAgIDg//8AIAwgAiADhFAbIQxCACEBDAILIAIgA4RQBEAgDEKAgICAgIDA//8AhCEMQgAhAQwCCyAOQv///////z9YBEAgBUHAAmogASAKIAEgCiAKUCIGG3lCwABCACAGG3ynIgZBD2sQREEQIAZrIQYgBSkDyAIhCiAFKQPAAiEBCyACQv///////z9WDQAgBUGwAmogAyALIAMgCyALUCIJG3lCwABCACAJG3ynIglBD2sQRCAGIAlqQRBrIQYgBSkDuAIhCyAFKQOwAiEDCyAFQaACaiALQoCAgICAgMAAhCISQg+GIANCMYiEIgJCAEKAgICAsOa8gvUAIAJ9IgRCABBAIAVBkAJqQgAgBSkDqAJ9QgAgBEIAEEAgBUGAAmogBSkDmAJCAYYgBSkDkAJCP4iEIgRCACACQgAQQCAFQfABaiAEQgBCACAFKQOIAn1CABBAIAVB4AFqIAUpA/gBQgGGIAUpA/ABQj+IhCIEQgAgAkIAEEAgBUHQAWogBEIAQgAgBSkD6AF9QgAQQCAFQcABaiAFKQPYAUIBhiAFKQPQAUI/iIQiBEIAIAJCABBAIAVBsAFqIARCAEIAIAUpA8gBfUIAEEAgBUGgAWogAkIAIAUpA7gBQgGGIAUpA7ABQj+IhEIBfSICQgAQQCAFQZABaiADQg+GQgAgAkIAEEAgBUHwAGogAkIAQgAgBSkDqAEgBSkDoAEiDiAFKQOYAXwiBCAOVK18IARCAVatfH1CABBAIAVBgAFqQgEgBH1CACACQgAQQCAGIAggB2tqIghB//8AaiEGAn4gBSkDcCITQgGGIg0gBSkDiAEiD0IBhiAFKQOAAUI/iIR8IhBC5+wAfSIUQiCIIgIgCkKAgICAgIDAAIQiFUIBhiIWQiCIIgR+IhEgAUIBhiIOQiCIIgsgECAUVq0gDSAQVq0gBSkDeEIBhiATQj+IhCAPQj+IfHx8QgF9IhNCIIgiEH58Ig0gEVStIA0gDSATQv////8PgyITIAFCP4giFyAKQgGGhEL/////D4MiCn58Ig1WrXwgBCAQfnwgBCATfiIRIAogEH58Ig8gEVStQiCGIA9CIIiEfCANIA9CIIZ8Ig8gDVStfCAPIA8gFEL/////D4MiFCAKfiINIAIgC358IhEgDVStIBEgESATIA5C/v///w+DIg1+fCIRVq18fCIPVq18IA8gBCAUfiIYIA0gEH58IgQgAiAKfnwiCiALIBN+fCIQQiCIIAogEFatIAQgGFStIAQgClatfHxCIIaEfCIEIA9UrXwgBCAEIBEgAiANfiIKIAsgFH58IgJCIIggAiAKVK1CIIaEfCIKIBFUrSAKIAogEEIghnwiClatfHwiBFatfCAEIAQgCiACQiCGIgIgDSAUfnwgAlStQn+FIgJWIAIgClJxrXwiBFatfCICQv////////8AWARAIBYgF4QhFSAFQdAAaiAEIAJCgICAgICAwABUIgetIguGIgogAiALhiAEQgGIIAdBP3OtiIQiBCADIBIQQCAIQf7/AGogBiAHG0EBayEGIAFCMYYgBSkDWH0gBSkDUCIBQgBSrX0hC0IAIAF9DAELIAVB4ABqIAJCP4YgBEIBiIQiCiACQgGIIgQgAyASEEAgAUIwhiAFKQNofSAFKQNgIgJCAFKtfSELIAEhDkIAIAJ9CyECIAZB//8BTgRAIAxCgICAgICAwP//AIQhDEIAIQEMAQsCfiAGQQBKBEAgC0IBhiACQj+IhCEBIARC////////P4MgBq1CMIaEIQsgAkIBhgwBCyAGQY9/TARAQgAhAQwCCyAFQUBrIAogBEEBIAZrEIoBIAVBMGogDiAVIAZB8ABqEEQgBUEgaiADIBIgBSkDQCIKIAUpA0giCxBAIAUpAzggBSkDKEIBhiAFKQMgIgFCP4iEfSAFKQMwIgIgAUIBhiIEVK19IQEgAiAEfQshAiAFQRBqIAMgEkIDQgAQQCAFIAMgEkIFQgAQQCALIAogAyAKQgGDIgMgAnwiAlQgASACIANUrXwiASASViABIBJRG618IgMgClStfCIEIAMgAyAEQoCAgICAgMD//wBUIAIgBSkDEFYgASAFKQMYIgRWIAEgBFEbca18IgNWrXwiBCADIARCgICAgICAwP//AFQgAiAFKQMAViABIAUpAwgiAlYgASACURtxrXwiASADVK18IAyEIQwLIAAgATcDACAAIAw3AwggBUHQAmokAAu/AgEBfyMAQdAAayIEJAACQCADQYCAAU4EQCAEQSBqIAEgAkIAQoCAgICAgID//wAQLyAEKQMoIQIgBCkDICEBIANB//8BSQRAIANB//8AayEDDAILIARBEGogASACQgBCgICAgICAgP//ABAvQf3/AiADIANB/f8CTxtB/v8BayEDIAQpAxghAiAEKQMQIQEMAQsgA0GBgH9KDQAgBEFAayABIAJCAEKAgICAgICAORAvIAQpA0ghAiAEKQNAIQEgA0H0gH5LBEAgA0GN/wBqIQMMAQsgBEEwaiABIAJCAEKAgICAgICAORAvQeiBfSADIANB6IF9TRtBmv4BaiEDIAQpAzghAiAEKQMwIQELIAQgASACQgAgA0H//wBqrUIwhhAvIAAgBCkDCDcDCCAAIAQpAwA3AwAgBEHQAGokAAs8ACAAIAE3AwAgACACQv///////z+DIAJCgICAgICAwP//AINCMIinIANCMIinQYCAAnFyrUIwhoQ3AwgLwAECAX8CfkF/IQMCQCAAQgBSIAFC////////////AIMiBEKAgICAgIDA//8AViAEQoCAgICAgMD//wBRGw0AIAJC////////////AIMiBUKAgICAgIDA//8AViAFQoCAgICAgMD//wBScQ0AIAAgBCAFhIRQBEBBAA8LIAEgAoNCAFkEQCABIAJSIAEgAlNxDQEgACABIAKFhEIAUg8LIABCAFIgASACVSABIAJRGw0AIAAg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EKYCCyEAIAEQTAR/QZiEASgCACABQf8BcUECdGooAgAFIAELwAsJACAAENACEC0LOwADQCABIAJGRQRAIAMhACAEIAEoAgAQTAR/IAEoAgAFIAALOgAAIARBAWohBCABQQRqIQEMAQsLIAELDAAgASACIAEQTBvACyoAA0AgASACRkUEQCADIAEsAAA2AgAgA0EEaiEDIAFBAWohAQwBCwsgAQsPACAAIAEgAkGgkAEQpwILHAAgARBMBH9BoJABKAIAIAFBAnRqKAIABSABCwsPACAAIAEgAkGYhAEQpwILHAAgARBMBH9BmIQBKAIAIAFBAnRqKAIABSABCwsQACAABEAgABDHAwsgABAtCzoAA0ACQCACIANGDQAgAigCABBMRQ0AIAIoAgBBAnRBkKIBaigCACABcUUNACACQQRqIQIMAQsLIAILOQADQAJAIAIgA0YNACACKAIAEEwEQCACKAIAQQJ0QZCiAWooAgAgAXENAQsgAkEEaiECDAELCyACC0YAA0AgASACRkUEQEEAIQAgAyABKAIAEEwEfyABKAIAQQJ0QZCiAWooAgAFQQALNgIAIANBBGohAyABQQRqIQEMAQsLIAELIwBBACEAIAIQTAR/IAJBAnRBkKIBaigCACABcUEARwVBAAsLDwAgACAAKAIAKAIEEQIACwkAIAAQ1gIQLQsVAQF/QdQAEFMiAEEAQdQA/AsAIAALFAAgACgCACABaiACLQAAOgAAQQELrgEAAkAgBRBHRQRAIAAgBSkCADcCACAAIAUoAgg2AgggABBeGgwBCyAFKAIAIQQgBSgCBCECIwBBEGsiAyQAAkACQAJAIAIQvQEEQCAAIgEgAhBQDAELIAJB9////wNLDQEgA0EIaiACEJABQQFqEI8BIAMoAgwaIAAgAygCCCIBNgIAIAAgAygCDBBcIAAgAjYCBAsgASAEIAJBAWoQZSADQRBqJAAMAQsQWwALCwsJACAAIAUQ5AELhAMBCH8jAEHgA2siACQAIABB3ANqIgYgAxAnIAYQSCEKIAUQHwRAIAVBABDMASgCACAKQS0QS0YhCwsgAiALIABB3ANqIABB2ANqIABB1ANqIABB0ANqIABBxANqECQiDCAAQbgDahAkIgYgAEGsA2oQJCIHIABBqANqEN8CIABB4wA2AhAgAEEIakEAIABBEGoiAhA2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KAK8ASAEEI8DOQMAIABBzAFqIABBEGogACgCDCAEEEMgAEHcAmogAEHYAmoQKwRAIAQgBCgCAEECcjYCAAsgACgC3AIgARAgGiAAQcwBahAgGiAAQeACaiQADAMLQQEhAwsgAEHcAmoQPhoMAAsACwvKBAEDfwJ/IwBB4AJrIgAkACAAIAI2AtgCIAAgATYC3AIgAEHMAWogAyAAQeABaiAAQdwBaiAAQdgBahD7ASAAQcABahAkIgEgARAoECEgACABQQAQIiICNgK8ASAAIABBEGo2AgwgAEEANgIIIABBAToAByAAQcUAOgAGQQAhAwNAAkACQAJAIABB3AJqIABB2AJqECsNACAAKAK8ASABEB8gAmpGBEAgARAfIQYgASABEB9BAXQQISABIAEQKBAhIAAgBiABQQAQIiICajYCvAELIABB3AJqEDcgAEEHaiAAQQZqIAIgAEG8AWogACgC3AEgACgC2AEgAEHMAWogAEEQaiAAQQxqIABBCGogAEHgAWoQ+gENACADDQFBACEDIAAoArwBIAJrIgdBAEwNAgJAAkAgAi0AACIGQStrIggOAwEAAQALIAZBLkYNAkEBIQMgBkEwa0H/AXFBCkkNAwwBCyAHQQFGDQICQCAIDgMAAwADCyACLQABIgZBLkYNAUEBIQMgBkEwa0H/AXFBCU0NAgsCQCAAQcwBahAfRQ0AIAAtAAdBAXFFDQAgACgCDCIDIABBEGprQZ8BSg0AIAAgA0EEajYCDCADIAAoAgg2AgALIAUgAiAAKAK8ASAEEJEDOAIAIABBzAFqIABBEGogACgCDCAEEEMgAEHcAmogAEHYAmoQKwRAIAQgBCgCAEECcjYCAAsgACgC3AIgARAgGiAAQcwBahAgGiAAQeACaiQADAMLQQEhAwsgAEHcAmoQPhoMAAsACwuWAwECfyMAQdACayIAJAAgACACNgLIAiAAIAE2AswCIAMQaiEGIAMgAEHQAWoQrgEhByAAQcQBaiADIABBxAJqEK0BIABBuAFqECQiASABECgQISAAIAFBABAiIgI2ArQBIAAgAEEQajYCDCAAQQA2AggDQAJAIABBzAJqIABByAJqECsNACAAKAK0ASABEB8gAmpGBEAgARAfIQMgASABEB9BAXQQISABIAEQKBAhIAAgAyABQQAQIiICajYCtAELIABBzAJqIgMQNyAGIAIgAEG0AWogAEEIaiAAKALEAiAAQcQBaiAAQRBqIABBDGogBxCYAQ0AIAMQPhoMAQsLAkAgAEHEAWoQH0UNACAAKAIMIgMgAEEQamtBnwFKDQAgACADQQRqNgIMIAMgACgCCDYCAAsgBSACIAAoArQBIAQgBhCSAzcDACAAQcQBaiAAQRBqIAAoAgwgBBBDIABBzAJqIABByAJqECsEQCAEIAQoAgBBAnI2AgALIAAoAswCIAEQIBogAEHEAWoQIBogAEHQAmokAAuWAwECfyMAQdACayIAJAAgACACNgLIAiAAIAE2AswCIAMQaiEGIAMgAEHQAWoQrgEhByAAQcQBaiADIABBxAJqEK0BIABBuAFqECQiASABECgQISAAIAFBABAiIgI2ArQBIAAgAEEQajYCDCAAQQA2AggDQAJAIABBzAJqIABByAJqECsNACAAKAK0ASABEB8gAmpGBEAgARAfIQMgASABEB9BAXQQISABIAEQKBAhIAAgAyABQQAQIiICajYCtAELIABBzAJqIgMQNyAGIAIgAEG0AWogAEEIaiAAKALEAiAAQcQBaiAAQRBqIABBDGogBxCYAQ0AIAMQPhoMAQsLAkAgAEHEAWoQH0UNACAAKAIMIgMgAEEQamtBnwFKDQAgACADQQRqNgIMIAMgACgCCDYCAAsgBSACIAAoArQBIAQgBhCVAzsBACAAQcQBaiAAQRBqIAAoAgwgBBBDIABBzAJqIABByAJqECsEQCAEIAQoAgBBAnI2AgALIAAoAswCIAEQIBogAEHEAWoQIBogAEHQAmokAAuWAwECfyMAQdACayIAJAAgACACNgLIAiAAIAE2AswCIAMQaiEGIAMgAEHQAWoQrgEhByAAQcQBaiADIABBxAJqEK0BIABBuAFqECQiASABECgQISAAIAFBABAiIgI2ArQBIAAgAEEQajYCDCAAQQA2AggDQAJAIABBzAJqIABByAJqECsNACAAKAK0ASABEB8gAmpGBEAgARAfIQMgASABEB9BAXQQISABIAEQKBAhIAAgAyABQQAQIiICajYCtAELIABBzAJqIgMQNyAGIAIgAEG0AWogAEEIaiAAKALEAiAAQcQBaiAAQRBqIABBDGogBxCYAQ0AIAMQPhoMAQsLAkAgAEHEAWoQH0UNACAAKAIMIgMgAEEQamtB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DCECDAYLIANBIHIhAyABQQRqIQIgBEEEayEEIAEtAAMgCHQgB2ohBwsCQCAFQQRxRQ0AIAcgBigCIEYNACAKQd4ONgIYIAZB0f4ANgIEIAIhASAGKAIEIQUMAQsLIAIhAUEAIQdBACEDCyAGQdD+ADYCBAtBASECDAELQQAhBCAMIQILIAogDzYCECAKIBA2AgwgCiAENgIEIAogATYCACAGIAM2AkAgBiAHNgI8AkACQCAGKAIsRQRAIA8gFUYNASAGKAIEQdD+AEsNAQsCfyAVIA9rIQMCQAJAIAooAhwiASgCOCIMRQRAQQEhBSABIAooAihBASABKAIodEEBIAooAiARAwAiDDYCOCAMRQ0BCyABKAIsIgRFBEAgAUIANwIwIAFBASABKAIodCIENgIsCyADIARPBEAgBARAIAwgECAEayAE/AoAAAsgAUEANgI0DAILIAQgASgCNCIIayIFIAMgAyAFSxsiBARAIAggDGogECADayAE/AoAAAsgAyAFSwRAIAMgBGsiAwRAIAEoAjggECADayAD/AoAAAsgASADNgI0DAILQQAhBSABIAEoAjQgBGoiA0EAIAMgASgCLCIMRxs2AjQgDCABKAIwIgNNDQAgASADIARqNgIwCyAFDAELIAEgASgCLDYCMEEACw0BIAooAhAhDyAKKAIEIQQLIAogCigCCCAkIARrajYCCCAKIBUgD2siASAKKAIUajYCFCAGIAYoAiAgAWo2AiAgBi0ADEEEcUUgDyAVRnJFBEAgCigCDCABayEDIAYoAhwhBSAGAn8gBigCFARAIAUgAyABEFEMAQsgBSADIAEQswELIgE2AhwgCiABNgIwCyAKIAYoAkBBwABBACAGKAIIG2pBgAFBACAGKAIEIgFBv/4ARhtqQYACQYACQQAgAUHC/gBGGyABQcf+AEYbajYCLCACQXsgAhsgAiAPIBVGGyACIAQgJEYbIRwMAgsgBkHS/gA2AgQLQXwhHAsgF0EQaiQAIBxBAUsNASATQagBaiEBIBMoAqwBIQMgGigCACEJIBooAgQgEygCFGshDCMAQSBrIggkAAJAIAwgCWsiBUEATA0AIAEoAgggASgCBCICayAFTgRAIAIgA2siBCAFSARAIAwgBCAJaiIHayILRSAHIAxGckUEQCACIAcgC/wKAAALIAEgAiALajYCBCAE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eQAtKyAgIDBYMHgALTBYKzBYIDBYLTB4KzB4IDB4AE5vdgBUaHUAQXVndXN0AHVuc2lnbmVkIHNob3J0AHVuc2lnbmVkIGludABpbnZhbGlkIGxpdGVyYWwvbGVuZ3RocyBzZXQAaW52YWxpZCBjb2RlIGxlbmd0aHMgc2V0AHVua25vd24gaGVhZGVyIGZsYWdzIHNldABpbnZhbGlkIGRpc3RhbmNlcyBzZXQAZ2V0AE9jdABmbG9hdABpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0AFNhdABudW1Qb2ludHMAY29sb3JzAFVucGFja09wdGlvbnMAcG9zaXRpb25zAHJvdGF0aW9ucwB0b28gbWFueSBsZW5ndGggb3IgZGlzdGFuY2Ugc3ltYm9scwBpbnZhbGlkIHN0b3JlZCBibG9jayBsZW5ndGhzAHNjYWxlcwBhbHBoYXMAW1NQWjogRVJST1JdIENoZWNrIGZhaWxlZDogJXM6JWQ6ICVzAHZmMzJfcHRyAEFwcgB2ZWN0b3IAbW9uZXlfZ2V0IGVycm9yAFtTUFogRVJST1JdIGRlc2VyaWFsaXplUGFja2VkR2F1c3NpYW5zOiByZWFkIGVycm9yAE9jdG9iZXIATm92ZW1iZXIAU2VwdGVtYmVyAERlY2VtYmVyAHVuc2lnbmVkIGNoYXIAaW9zX2Jhc2U6OmNsZWFyAE1hcgAvZW1zZGsvZW1zY3JpcHRlbi9zeXN0ZW0vbGliL2xpYmN4eGFiaS9zcmMvcHJpdmF0ZV90eXBlaW5mby5jcHAAU2VwACVJOiVNOiVTICVwAFN1bgBKdW4ATW9uAG5hbgBKYW4AY29vcmRpbmF0ZVN5c3RlbQBDb29yZGluYXRlU3lzdGVtAEp1bABib29sAGxsAEFwcmlsAGludmFsaWQgY29kZSAtLSBtaXNzaW5nIGVuZC1vZi1ibG9jawBpbmNvcnJlY3QgaGVhZGVyIGNoZWNrAGluY29ycmVjdCBsZW5ndGggY2hlY2sAaW5jb3JyZWN0IGRhdGEgY2hlY2sAcHVzaF9iYWNrAGludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrAEZyaQBzaABoZWFkZXIgY3JjIG1pc21hdGNoAE1hcmNoAEF1ZwB1bnNpZ25lZCBsb25nIGxvbmcAdW5zaWduZWQgbG9uZwBzdGQ6OndzdHJpbmcAYmFzaWNfc3RyaW5nAHN0ZDo6c3RyaW5nAHN0ZDo6dTE2c3RyaW5nAHN0ZDo6dTMyc3RyaW5nAGluZgAlLjBMZgAlTGYAcmVzaXplAGludmFsaWQgd2luZG93IHNpemUAdHJ1ZQBUdWUAZmFsc2UAaW52YWxpZCBibG9jayB0eXBlAEp1bmUAZG91YmxlAHNoRGVncmVlAGJhZF9hcnJheV9uZXdfbGVuZ3RoIHdhcyB0aHJvd24gaW4gLWZuby1leGNlcHRpb25zIG1vZGUAaW52YWxpZCBsaXRlcmFsL2xlbmd0aCBjb2RlAGludmFsaWQgZGlzdGFuY2UgY29kZQBSYXdHYXVzc2lhbkNsb3VkAHVua25vd24gY29tcHJlc3Npb24gbWV0aG9kAFtTUFogRVJST1JdIGRlc2VyaWFsaXplUGFja2VkR2F1c3NpYW5zOiBoZWFkZXIgbm90IGZvdW5kACUwKmxsZAAlKmxsZAArJWxsZAAlKy40bGQAdm9pZABsb2NhbGUgbm90IHN1cHBvcnRlZABhbnRpYWxpYXNlZABXZWQAJVktJW0tJWQAW1NQWiBFUlJPUl0gZGVzZXJpYWxpemVQYWNrZWRHYXVzc2lhbnM6IFRvbyBtYW55IHBvaW50czogJWQAW1NQWiBFUlJPUl0gZGVzZXJpYWxpemVQYWNrZWRHYXVzc2lhbnM6IFVuc3VwcG9ydGVkIFNIIGRlZ3JlZTogJWQAW1NQWiBFUlJPUl0gZGVzZXJpYWxpemVQYWNrZWRHYXVzc2lhbnM6IHZlcnNpb24gbm90IHN1cHBvcnRlZDogJWQARGVjAC4vc3B6L3NyYy9jYy9sb2FkLXNwei5jYwBGZWIAJWEgJWIgJWQgJUg6JU06JVMgJVkAUE9TSVgAVmVjdG9yVUludDhUACVIOiVNOiVTAE5BTgBQTQBBTQAlSDolTQBMQ19BTEwAQVNDSUkATEFORwBSVUYATFVGAElORgBSREYATERGAFVOU1BFQ0lGSUVEAEMAUlVCAExVQgBSREIATERCAGNhdGNoaW5nIGEgY2xhc3Mgd2l0aG91dCBhbiBvYmplY3Q/AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBzaG9ydD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNpZ25lZCBjaGFyPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxkb3VibGU+ADAxMjM0NTY3ODkAQy5VVEYtOABWZWN0b3JGbG9hdDMyADEuMy4xAC4ALQAocGFja2VkLmFscGhhcy5zaXplKCkpID09IChudW1Qb2ludHMpAChudWxsKQAocGFja2VkLmNvbG9ycy5zaXplKCkpID09IChudW1Qb2ludHMgKiAzKQAocGFja2VkLnNjYWxlcy5zaXplKCkpID09IChudW1Qb2ludHMgKiAzKQAocGFja2VkLnNoLnNpemUoKSkgPT0gKG51bVBvaW50cyAqIHNoRGltICogMykAKHBhY2tlZC5yb3RhdGlvbnMuc2l6ZSgpKSA9PSAobnVtUG9pbnRzICogKHBhY2tlZC51c2VzUXVhdGVybmlvblNtYWxsZXN0VGhyZWUgPyA0IDogMykpAChwYWNrZWQucG9zaXRpb25zLnNpemUoKSkgPT0gKG51bVBvaW50cyAqIDMgKiAodXNlc0Zsb2F0MTYgPyAyIDogMykpACUAbGVuZ3RoX2Vycm9yIHdhcyB0aHJvd24gaW4gLWZuby1leGNlcHRpb25zIG1vZGUgd2l0aCBtZXNzYWdlICIlcyIAUHVyZSB2aXJ0dWFsIGZ1bmN0aW9uIGNhbGxlZCEAW1NQWjogRVJST1JdIFVuc3VwcG9ydGVkIFNIIGRlZ3JlZTogJWQKAAkAAAAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwBBkCALthMgEAAA9GwAAPRsAABAEAAAqG0AACgQAABOM3NwejEzR2F1c3NpYW5DbG91ZEUAAACobQAASBAAAE4zc3B6MTNVbnBhY2tPcHRpb25zRQBwcGlpcAD0bAAAbBAAAKhtAAB0EAAATlN0M19fMjZ2ZWN0b3JJZk5TXzlhbGxvY2F0b3JJZkVFRUUAaXBwACxuAADEEAAAAAAAAAMAAADcEAAAAAAAACgSAAAAAAAAWBIAAAAAAABOU3QzX18yOG9wdGlvbmFsSWZFRQAAAADQbQAA6BAAABgRAABOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJZkxiMUVFRQAAAADQbQAAJBEAAFQRAABOU3QzX18yMjdfX29wdGlvbmFsX2NvcHlfYXNzaWduX2Jhc2VJZkxiMUVFRQAAAADQbQAAYBEAAIgRAABOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlmTGIxRUVFAAAA0G0AAJQRAAC8EQAATlN0M19fMjIwX19vcHRpb25hbF9jb3B5X2Jhc2VJZkxiMUVFRQAAANBtAADIEQAA9BEAAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSWZMYjBFRUUAAAAAqG0AAPwRAABOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJZkxiMUVFRQAAAKhtAAAwEgAATlN0M19fMjE4X19zZmluYWVfY3Rvcl9iYXNlSUxiMUVMYjFFRUUAAKhtAABgEgAATlN0M19fMjIwX19zZmluYWVfYXNzaWduX2Jhc2VJTGIxRUxiMUVFRQAAAACIbgAAnBIAAAAAAABsEAAAUE5TdDNfXzI2dmVjdG9ySWZOU185YWxsb2NhdG9ySWZFRUVFAAAAAIhuAADUEgAAAQAAAGwQAABQS05TdDNfXzI2dmVjdG9ySWZOU185YWxsb2NhdG9ySWZFRUVFAHBwAHYAdnAAAACMEgAAcHAAAJRsAACMEgAAPG0AAHZwcGQAAAAAlGwAAIwSAAAYbQAAPG0AAHZwcHBkAAAAGG0AAMQSAABwcHAATBMAADxtAACobQAAVBMAAE4xMGVtc2NyaXB0ZW4zdmFsRQAAnBAAAGwQAAAYbQAAcHBwcAAAAAAAAAAArGwAAGwQAAAYbQAAPG0AAGlwcHBkAAAALG4AAMATAAAAAAAAAwAAANgTAAAAAAAAKBIAAAAAAABYEgAAAAAAAE5TdDNfXzI4b3B0aW9uYWxJaEVFAAAAANBtAADkEwAAFBQAAE5TdDNfXzIyN19fb3B0aW9uYWxfbW92ZV9hc3NpZ25fYmFzZUloTGIxRUVFAAAAANBtAAAgFAAAUBQAAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUloTGIxRUVFAAAAANBtAABcFAAAhBQAAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSWhMYjFFRUUAAADQbQAAkBQAALgUAABOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUloTGIxRUVFAAAA0G0AAMQUAADwFAAATlN0M19fMjIzX19vcHRpb25hbF9zdG9yYWdlX2Jhc2VJaExiMEVFRQAAAACobQAA+BQAAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUloTGIxRUVFAAAAqG0AACwVAABOU3QzX18yNnZlY3RvckloTlNfOWFsbG9jYXRvckloRUVFRQCIbgAAYBUAAAAAAAAkFQAAUE5TdDNfXzI2dmVjdG9ySWhOU185YWxsb2NhdG9ySWhFRUVFAAAAAIhuAACYFQAAAQAAACQVAABQS05TdDNfXzI2dmVjdG9ySWhOU185YWxsb2NhdG9ySWhFRUVFAHBwAHZwAFAVAABwcAAAlGwAAFAVAADEbAAAdnBwaQAAAACUbAAAUBUAABhtAADEbAAAdnBwcGkAAAAYbQAAiBUAAHBwcABMEwAAxGwAAJgTAAAkFQAAGG0AAHBwcHAAAAAArGwAACQVAAAYbQAAxGwAAGlwcHBpAHAAdnAAaXBwAHZwcGkAaXBwAHZwcGkAcHBwAHZwcHAAAABcbQAAYBYAAE4zc3B6MTZDb29yZGluYXRlU3lzdGVtRQBwAHZwAGlwcAB2cHBpAAAAAAAAAwAAAAgAAAAPAAAAqG0AAKAWAABOU3QzX18yMTJiYXNpY19zdHJpbmdJY05TXzExY2hhcl90cmFpdHNJY0VFTlNfOWFsbG9jYXRvckljRUVFRQAAqG0AAOgWAABOU3QzX18yMTJiYXNpY19zdHJpbmdJd05TXzExY2hhcl90cmFpdHNJd0VFTlNfOWFsbG9jYXRvckl3RUVFRQAAqG0AADAXAABOU3QzX18yMTJiYXNpY19zdHJpbmdJRHNOU18xMWNoYXJfdHJhaXRzSURzRUVOU185YWxsb2NhdG9ySURzRUVFRQAAAKhtAAB8FwAATlN0M19fMjEyYmFzaWNfc3RyaW5nSURpTlNfMTFjaGFyX3RyYWl0c0lEaUVFTlNfOWFsbG9jYXRvcklEaUVFRUUAAACobQAAyBcAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWNFRQAAqG0AAPAXAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lhRUUAAKhtAAAYGAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJaEVFAACobQAAQBgAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXNFRQAAqG0AAGgYAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0l0RUUAAKhtAACQGAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJaUVFAACobQAAuBgAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWpFRQAAqG0AAOAYAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lsRUUAAKhtAAAIGQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJbUVFAACobQAAMBkAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXhFRQAAqG0AAFgZAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0l5RUUAAKhtAACAGQAATjEwZW1zY3Jp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AAAJqAAACAQAAAiEAAAIRAAACegAEAcIAAAIXAAACBwAAAmYABQHUwAACHwAAAg8AAAJ2AASBxcAAAhsAAAILAAACbgAAAgMAAAIjAAACEwAAAn4ABAHAwAACFIAAAgSABUIowATByMAAAhyAAAIMgAACcQAEQcLAAAIYgAACCIAAAmkAAAIAgAACIIAAAhCAAAJ5AAQBwcAAAhaAAAIGgAACZQAFAdDAAAIegAACDoAAAnUABIHEwAACGoAAAgqAAAJtAAACAoAAAiKAAAISgAACfQAEAcFAAAIVgAACBYAQAgAABMHMwAACHYAAAg2AAAJzAARBw8AAAhmAAAIJgAACawAAAgGAAAIhgAACEYAAAnsABAHCQAACF4AAAgeAAAJnAAUB2MAAAh+AAAIPgAACdwAEgcbAAAIbgAACC4AAAm8AAAIDgAACI4AAAhOAAAJ/ABgBwAAAAhRAAAIEQAVCIMAEgcfAAAIcQAACDEAAAnCABAHCgAACGEAAAghAAAJogAACAEAAAiBAAAIQQAACeIAEAcGAAAIWQAACBkAAAmSABMHOwAACHkAAAg5AAAJ0gARBxEAAAhpAAAIKQAACbIAAAgJAAAIiQAACEkAAAnyABAHBAAACFUAAAgVABAIAgETBysAAAh1AAAINQAACcoAEQcNAAAIZQAACCUAAAmqAAAIBQAACIUAAAhFAAAJ6gAQBwgAAAhdAAAIHQAACZoAFAdTAAAIfQAACD0AAAnaABIHFwAACG0AAAgtAAAJugAACA0AAAiNAAAITQAACfoAEAcDAAAIUwAACBMAFQjDABMHIwAACHMAAAgzAAAJxgARBwsAAAhjAAAIIwAACaYAAAgDAAAIgwAACEMAAAnmABAHBwAACFsAAAgbAAAJlgAUB0MAAAh7AAAIOwAACdYAEgcTAAAIawAACCsAAAm2AAAICwAACIsAAAhLAAAJ9gAQBwUAAAhXAAAIFwBACAAAEwczAAAIdwAACDcAAAnOABEHDwAACGcAAAgnAAAJrgAACAcAAAiHAAAIRwAACe4AEAcJAAAIXwAACB8AAAmeABQHYwAACH8AAAg/AAAJ3gASBxsAAAhvAAAILwAACb4AAAgPAAAIjwAACE8AAAn+AGAHAAAACFAAAAgQABQIcwASBx8AAAhwAAAIMAAACcEAEAcKAAAIYAAACCAAAAmhAAAIAAAACIAAAAhAAAAJ4QAQBwYAAAhYAAAIGAAACZEAEwc7AAAIeAAACDgAAAnRABEHEQAACGgAAAgoAAAJsQAACAgAAAiIAAAISAAACfEAEAcEAAAIVAAACBQAFQjjABMHKwAACHQAAAg0AAAJyQARBw0AAAhkAAAIJAAACakAAAgEAAAIhAAACEQAAAnpABAHCAAACFwAAAgcAAAJmQAUB1MAAAh8AAAIPAAACdkAEgcXAAAIbAAACCwAAAm5AAAIDAAACIwAAAhMAAAJ+QAQBwMAAAhSAAAIEgAVCKMAEwcjAAAIcgAACDIAAAnFABEHCwAACGIAAAgiAAAJpQAACAIAAAiCAAAIQgAACeUAEAcHAAAIWgAACBoAAAmVABQHQwAACHoAAAg6AAAJ1QASBxMAAAhqAAAIKgAACbUAAAgKAAAIigAACEoAAAn1ABAHBQAACFYAAAgWAEAIAAATBzMAAAh2AAAINgAACc0AEQcPAAAIZgAACCYAAAmtAAAIBgAACIYAAAhGAAAJ7QAQBwkAAAheAAAIHgAACZ0AFAdjAAAIfgAACD4AAAndABIHGwAACG4AAAguAAAJvQAACA4AAAiOAAAITgAACf0AYAcAAAAIUQAACBEAFQiDABIHHwAACHEAAAgxAAAJwwAQBwoAAAhhAAAIIQAACaMAAAgBAAAIgQAACEEAAAnjABAHBgAACFkAAAgZAAAJkwATBzsAAAh5AAAIOQAACdMAEQcRAAAIaQAACCkAAAmzAAAICQAACIkAAAhJAAAJ8wAQBwQAAAhVAAAIFQAQCAIBEwcrAAAIdQAACDUAAAnLABEHDQAACGUAAAglAAAJqwAACAUAAAiFAAAIRQAACesAEAcIAAAIXQAACB0AAAmbABQHUwAACH0AAAg9AAAJ2wASBxcAAAhtAAAILQAACbsAAAgNAAAIjQAACE0AAAn7ABAHAwAACFMAAAgTABUIwwATByMAAAhzAAAIMwAACccAEQcLAAAIYwAACCMAAAmnAAAIAwAACIMAAAhDAAAJ5wAQBwcAAAhbAAAIGwAACZcAFAdDAAAIewAACDsAAAnXABIHEwAACGsAAAgrAAAJtwAACAsAAAiLAAAISwAACfcAEAcFAAAIVwAACBcAQAgAABMHMwAACHcAAAg3AAAJzwARBw8AAAhnAAAIJwAACa8AAAgH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Y05TXzExY2hhcl90cmFpdHNJY0VFRUUA0G0AAHg9AAAAPAAATlN0M19fMjE1YmFzaWNfc3RyaW5nYnVmSWNOU18xMWNoYXJfdHJhaXRzSWNFRU5TXzlhbGxvY2F0b3JJY0VFRUUAAABAAAAAAAAAAKw+AABZAAAAWgAAADgAAAD4////rD4AAFsAAABcAAAAwP///8D///+sPgAAXQAAAF4AAADIPQAALD4AAGg+AAB8PgAAkD4AAKQ+AABUPgAAQD4AAPA9AADcPQAAQAAAAAAAAAAcPQAATAAAAE0AAAA4AAAA+P///xw9AABOAAAATwAAAMD////A////HD0AAFAAAABRAAAAQAAAAAAAAAA8PAAARAAAAEUAAADA////wP///zw8AABGAAAARwAAADgAAAAAAAAAhDwAAEgAAABJAAAAyP///8j///+EPAAASgAAAEsAAADQbQAAuD4AABw9AABOU3QzX18yMThiYXNpY19zdHJpbmdzdHJlYW1JY05TXzExY2hhcl90cmFpdHNJY0VFTlNfOWFsbG9jYXRvckljRUVFRQAAAAAAAAAAED8AAF8AAABgAAAAqG0AABg/AABOU3QzX18yOGlvc19iYXNlRQAAAAAAAADRdJ4AV529KoBwUg///z4nCgAAAGQAAADoAwAAECcAAKCGAQBAQg8AgJaYAADh9QUYAAAANQAAAHEAAABr////zvv//5K///8AAAAAAAAAAP////////////////////////////////////////////////////////////////8AAQIDBAUGBwgJ/////////woLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIj////////CgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiP/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAECBAcDBgUAAAAAAAAAAgAAwAMAAMAEAADABQAAwAYAAMAHAADACAAAwAkAAMAKAADACwAAwAwAAMANAADADgAAwA8AAMAQAADAEQAAwBIAAMATAADA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")),ie((await W(Ie)).instance))})();function M9(){function re(){var ie;if(i.calledRun=!0,!_){if(B=!0,Vb.G(),y?.(i),(ie=i.onRuntimeInitialized)==null||ie.call(i),i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;){var Ie=i.postRun.shift();Y.push(Ie)}Z(Y)}}if(0<O)U=M9;else{if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)K();Z($),0<O?U=M9:i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),re()},1)):re()}}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);0<i.preInit.length;)i.preInit.shift()();return M9(),B?n=i:n=new Promise((re,ie)=>{y=re,E=ie}),n}var Gx=(e,t,n=i=>i)=>{let i=e.vf32_ptr(t),o=t.size();return new Float32Array(e.HEAPF32.buffer,i,o).map(n)},M4e=e=>1/(1+Math.exp(-e)),N4e=e=>t=>t*e+.5,L4e=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:Gx(e,t.positions),scales:Gx(e,t.scales,Math.exp),rotations:Gx(e,t.rotations),alphas:Gx(e,t.alphas,M4e),colors:Gx(e,t.colors,N4e(i)),sh:Gx(e,t.sh)}},O4e=(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))},dle=async(e,t)=>{var n;let i=await R4e(),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=L4e(i,a,t);return O4e(i,a),c}catch(s){throw s}finally{r!==null&&i._free(r)}};var F4e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function AC(e){e=e??V.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=dt.UNLOADED,this._promise=void 0,this._spzError=void 0}l(Object.create)&&(AC.prototype=Object.create(Yi.prototype),AC.prototype.constructor=AC);Object.defineProperties(AC.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function Q4e(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=dt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;hle(e,n)}}AC.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=dt.LOADING,this._promise=Q4e(this),this._promise)};function hle(e,t){throw e.unload(),e._state=dt.FAILED,e.getError("Failed to load SPZ",t)}async function k4e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=dt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}AC.prototype.process=function(e){if(this._state===dt.READY)return!0;if(this._state!==dt.PROCESSING||(l(this._spzError)&&hle(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=dle(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(t))return!1;this._decodePromise=k4e(this,t)};AC.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 FM=AC;function QM(e){e=e??V.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=Ve(e.extras,!0),this._extensions=Ve(e.extensions,!0)}QM.fromJson=function(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=sm.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new QM({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(QM.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}}});QM.BATCH_TABLE_CLASS_NAME="_batchTable";var Fh=QM;function dV(e){e=e??V.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ve(e.extras,!0),this._extensions=Ve(e.extensions,!0)}dV.fromJson=function(e){return new dV({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(dV.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 kM=dV;function hV(e){e=e??V.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??kt.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=Ve(e.extras,!0),this._extensions=Ve(e.extensions,!0)}hV.fromJson=function(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(o){return kM.fromJson(o)});return new hV({id:t,values:i,valueType:kt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(hV.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 UM=hV;function AV(e){e=e??V.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=Ve(e.extras,!0),this._extensions=Ve(e.extensions,!0)}AV.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=UM.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]=Fh.fromJson({id:i,class:e.classes[i],enums:t}));return new AV({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(AV.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 Pl=AV;function pI(e){e=e??V.EMPTY_OBJECT;let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?Pl.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=dt.UNLOADED,this._promise=void 0}l(Object.create)&&(pI.prototype=Object.create(Yi.prototype),pI.prototype.constructor=pI);Object.defineProperties(pI.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});pI.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=U4e(this),this._promise)};async function U4e(e){let t=e._resource;e._state=dt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Pl.fromJson(n),e._state=dt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=dt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}pI.prototype.unload=function(){this._schema=void 0};var mC=pI;var Ad={};function zx(e){return VA(e.url)}function GM(e){let{byteOffset:t,byteLength:n}=e;if(Ii(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function G4e(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function Ale(e,t){return`${zx(e)}-buffer-id-${t}`}function Vx(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return zx(o)}return Ale(n,t)}function Yj(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=Vx(a,s,n,i),u=GM(r);return`${c}-range-${u}`}function mle(e,t,n,i){let r=e.bufferViews[0],s=r.buffer,a=e.buffers[s],c=Vx(a,s,n,i),u=GM(r);return`${c}-range-${u}`}function ple(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let m=i.getDerivedResource({url:s});return zx(m)}let a=e.bufferViews[r],c=a.buffer,u=e.buffers[c],f=Vx(u,c,n,i),h=GM(a);return`${f}-range-${h}`}function z4e(e,t){let n=pu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Ad.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${zx(n)}`};Ad.getExternalBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${zx(t)}`};Ad.getEmbeddedBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Ale(t,n)}`};Ad.getGltfCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${zx(t)}`};Ad.getBufferViewCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];Ii(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=Vx(a,s,i,o),u=GM(r);return`buffer-view:${c}-range-${u}`};Ad.getDracoCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${Yj(t,n,i,o)}`};Ad.getSpzCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,primitive:n,gltfResource:i,baseResource:o}=e;return`spz:${mle(t,n,i,o)}`};Ad.getVertexBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,spz:a,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:h=!1}=e,m="";if(u&&(m+="-dequantize"),f&&(m+="-buffer",m+=`-context-${o.context.id}`),h&&(m+="-typed-array"),l(s))return`vertex-buffer:${Yj(t,s,n,i)}-draco-${c}${m}`;if(a)return`vertex-buffer:${mle(t,a,n,i)}-spz-${c}${m}`;let g=t.bufferViews[r],A=g.buffer,_=t.buffers[A],C=Vx(_,A,n,i),y=GM(g);return`vertex-buffer:${C}-range-${y}${m}`};Ad.getIndexBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${Yj(t,s,i,o)}-draco${u}`;let f=t.accessors[n],h=f.bufferView,m=t.bufferViews[h],g=m.buffer,A=t.buffers[g],_=Vx(A,g,i,o),C=G4e(f,m);return`index-buffer:${_}-accessor-${C}${u}`};Ad.getImageCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${ple(t,n,i,o)}`};Ad.getTextureCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=pu.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=ple(t,c,i,o),f=z4e(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Rl=Ad;function zM(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}zM.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};zM.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};zM.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};zM.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 VM=zM;function Rn(){}Rn.cacheEntries={};Rn.statistics=new VM;function V4e(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Rn.get=function(e){let t=Rn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Rn.add=function(e){let t=e.cacheKey;return Rn.cacheEntries[t]=new V4e(e),e};Rn.unload=function(e){let t=e.cacheKey,n=Rn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Rn.statistics.removeLoader(e),e.destroy(),delete Rn.cacheEntries[t])};Rn.getSchemaLoader=function(e){e=e??V.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=Rl.getSchemaCacheKey({schema:t,resource:n}),o=Rn.get(i);return l(o)?o:(o=new mC({schema:t,resource:n,cacheKey:i}),Rn.add(o))};Rn.getEmbeddedBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,o=Rl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Rn.get(o);return l(r)?r:(r=new aI({typedArray:i,cacheKey:o}),Rn.add(r))};Rn.getExternalBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{resource:t}=e,n=Rl.getExternalBufferCacheKey({resource:t}),i=Rn.get(n);return l(i)?i:(i=new aI({resource:t,cacheKey:n}),Rn.add(i))};Rn.getGltfJsonLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Rl.getGltfCacheKey({gltfResource:t}),s=Rn.get(r);return l(s)?s:(s=new Qx({resourceCache:Rn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Rn.add(s))};Rn.getBufferViewLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Rl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Rn.get(r);return l(s)?s:(s=new Mx({resourceCache:Rn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Rn.add(s))};Rn.getDracoLoader=function(e){e=e??V.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=Rn.get(s);return l(a)?a:(a=new Nx({resourceCache:Rn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),Rn.add(a))};Rn.getSpzLoader=function(e){e=e??V.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=Rn.get(s);return l(a)?a:(a=new FM({resourceCache:Rn,gltf:t,primitive:n,spz:i,gltfResource:o,baseResource:r,cacheKey:s}),Rn.add(a))};Rn.getVertexBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,asynchronous:h=!0,dequantize:m=!1,loadBuffer:g=!1,loadTypedArray:A=!1}=e,_=Rl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,spz:c,attributeSemantic:u,dequantize:m,loadBuffer:g,loadTypedArray:A}),C=Rn.get(_);return l(C)?C:(C=new Ux({resourceCache:Rn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,cacheKey:_,asynchronous:h,dequantize:m,loadBuffer:g,loadTypedArray:A}),Rn.add(C))};Rn.getIndexBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,h=Rl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:u,loadTypedArray:f}),m=Rn.get(h);return l(m)?m:(m=new Ox({resourceCache:Rn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:h,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Rn.add(m))};Rn.getImageLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Rl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Rn.get(r);return l(s)?s:(s=new Lx({resourceCache:Rn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Rn.add(s))};Rn.getTextureLoader=function(e){e=e??V.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}),u=Rn.get(c);return l(u)?u:(u=new kx({resourceCache:Rn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Rn.add(u))};Rn.clearForSpecs=function(){let e=[Ux,Ox,Nx,kx,Lx,Mx,aI,mC,Qx],t,n=Rn.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])}Rn.statistics.clear()};var Di=Rn;function Ka(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(Ka.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}}});Ka.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Ka.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Ka.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};Ka.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Ka.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Ka.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Ka.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Ka.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Ds.OCTREE&&(t=3),e>>t};Ka.fromSubtreeJson=async function(e,t,n,i,o){let r=new Ka(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=H4e(n);let a=s.json;r._subtreeJson=a;let c;if(Ii(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let E=a.tileMetadata;c=a.propertyTables[E]}let u=[];if(l(a.contentMetadata)){let E=a.contentMetadata.length;for(let I=0;I<E;I++){let x=a.contentMetadata[I];u.push(a.propertyTables[x])}}let f,h=i.metadataSchema,m=a.subtreeMetadata;if(l(m)){let E=m.class,I=h.classes[E];f=new pM({subtreeMetadata:m,class:I})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],Ii(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 A=Y4e(a.buffers),_=W4e(a.bufferViews,A);j4e(a,_),l(c)&&gle(c,_);for(let E=0;E<u.length;E++){let I=u[E];gle(I,_)}let C=await q4e(r,A,s.binary),y=J4e(_,C);return X4e(r,a,i,y),l(c)&&(Z4e(r,i,y),eHe(r)),$4e(r,i,y),tHe(r),r._ready=!0,r};function H4e(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=Ir(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function Y4e(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 W4e(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 j4e(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 gle(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 q4e(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=K4e(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 K4e(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Di.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function J4e(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 X4e(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=Ii(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=Wj(t.tileAvailability,i,s,f);let h=e._contentPropertyTableJsons.length>0;f=f||h;for(let m=0;m<t.contentAvailabilityHeaders.length;m++){let g=Wj(t.contentAvailabilityHeaders[m],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=Wj(t.childSubtreeAvailability,i,a)}function Wj(e,t,n,i){if(l(e.constant))return new Px({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 Px({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function Z4e(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new dd({class:a,count:o,properties:i.properties,bufferViews:n})}function $4e(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],f=o[a].availableCount,h=c.class,m=r.classes[h],g=new dd({class:m,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function _le(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 eHe(e){let t=_le(e._tileAvailability);e._tileJumpBuffer=t}function tHe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=_le(o);t.push(r)}}Ka.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new ue("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Ka.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new ue("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function nHe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function iHe(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]}Ka.prototype.getTileMetadataView=function(e){let t=nHe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new Rx({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Ka.prototype.getContentMetadataView=function(e,t){let n=iHe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new Rx({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};Ka.prototype.isDestroyed=function(){return!1};Ka.prototype.destroy=function(){return l(this._bufferLoader)&&Di.unload(this._bufferLoader),de(this)};var Zp=Ka;var oHe={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"},md=Object.freeze(oHe);var pC={};pC.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:pC.parseBoundingVolumeSemantic(e,t),minimumHeight:pC._parseMinimumHeight(e,t),maximumHeight:pC._parseMaximumHeight(e,t)}};pC.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}};pC._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};pC._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var gC=pC;function Ml(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(Ml.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}}});Ml.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,u=await Zp.fromSubtreeJson(n,i,s,a,c),f=new Ml(e,t,n);return f._implicitSubtree=u,rHe(f,u),f._ready=!0,f};function rHe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=aHe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=sHe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=pHe(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function sHe(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 aHe(e,t,n,i){let s=Cle(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let h=1;h<f.subtreeLevels;h++){let m=t.getLevelOffset(h),g=f.branchingFactor*c.length;for(let A=0;A<g;A++){let _=m+A;if(!t.tileIsAvailableAtIndex(_)){u.push(void 0);continue}let C=t.getParentMortonIndex(A),y=c[C],E=A%f.branchingFactor,I=Cle(e,t,y,E,_);y.children.push(I),a.numberOfTilesTotal++,u.push(I)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function yle(e,t,n){let i=md.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Cle(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(a),u=gC.parseAllBoundingVolumeSemantics("TILE",c));let h=t.contentPropertyTableJsons.length,m=!1;for(let S=0;S<h;S++)if(t.contentIsAvailableAtCoordinates(a,S)){m=!0;break}let g=uHe(s,a,i,r,n,u),A=[];for(let S=0;S<s.contentCount;S++){if(!t.contentIsAvailableAtIndex(o,S))continue;let P={uri:s.contentUriTemplates[S].getDerivedResource({templateValues:a.getTemplateValues()}).url},N;if(t.contentPropertyTableJsons.length>0){let p=t.getContentMetadataView(a,S);N=gC.parseAllBoundingVolumeSemantics("CONTENT",p)}let L=fHe(g,N);l(L)&&(P.boundingVolume=L),A.push(St(P,s.contentHeaders[S]))}let _=yle(c,s,a),C={boundingVolume:g,geometricError:_,refine:s.refine,contents:A},y=!0,E=Ve(s.tileHeader,y);delete E.boundingVolume,delete E.transform,delete E.metadata;let I=St(C,E,y),x=Tle(e,s.baseResource,I,n);return x.implicitCoordinates=a,x.implicitSubtree=t,x.metadata=c,x.hasImplicitContentMetadata=m,x}function mV(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(Ii(e,"3DTILES_bounding_volume_S2")||l(e.region))}function qj(e,t){l(t)&&(Ii(e,"3DTILES_bounding_volume_S2")?lHe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&cHe(e.region,t.minimumHeight,t.maximumHeight))}function cHe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function lHe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function uHe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!mV(r.boundingVolume,r)&&mV(e.boundingVolume,r)?s=Ele(e,t,n,i??!1,o):s=r.boundingVolume,qj(s,r),s}function fHe(e,t){let n;return l(t)&&(n=t.boundingVolume),mV(n,t)?qj(n,t):mV(e,t)&&(n=Ve(e,!0),qj(n,t)),n}function Ele(e,t,n,i,o){let r=e.boundingVolume;return Ii(r,"3DTILES_bounding_volume_S2")?Ile(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:xle(r.region,t.level,t.x,t.y,t.z)}:{box:ble(r.box,t.level,t.x,t.y,t.z)}}function Ile(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Hp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?Dx.encode2D(i,o,r):Dx.encode2D(i,r,o),f=Hp.fromFacePositionLevel(c,BigInt(u),i),h,m;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:g,m=n<4?g:a.maximumHeight}else h=a.minimumHeight,m=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Hp.getTokenFromId(f._cellId),minimumHeight:h,maximumHeight:m}}}}var dHe=new d,hHe=new d,jj=new d,AHe=new X;function ble(e,t,n,i,o){if(t===0)return e;let r=d.unpack(e,0,hHe),s=X.unpack(e,3,AHe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,h=d.fromElements(a,a,1,dHe);l(o)&&(f=-1+(2*o+1)*a,h.z=a);let m=d.fromElements(c,u,f,jj);m=X.multiplyByVector(s,m,jj),m=d.add(m,r,jj);let g=X.clone(s);g=X.multiplyByScale(g,h,g);let A=new Array(12);return d.pack(m,A),X.pack(g,A,3),A}var mHe=new ce;function xle(e,t,n,i,o){if(t===0)return e.slice();let r=ce.unpack(e,0,mHe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,f=D.negativePiToPi(r.west+n*u),h=D.negativePiToPi(f+u),m=c*r.height,g=D.negativePiToPi(r.south+i*m),A=D.negativePiToPi(g+m),_=s,C=a;if(l(o)){let y=c*(a-s);_+=o*y,C=_+y}return[f,g,h,A,_,C]}function pHe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Ele(i,o,n,!1,t),s=yle(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Tle(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function Tle(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Ml.prototype.hasProperty=function(e,t){return!1};Ml.prototype.getFeature=function(e){};Ml.prototype.applyDebugSettings=function(e,t){};Ml.prototype.applyStyle=function(e){};Ml.prototype.update=function(e,t){};Ml.prototype.pick=function(e,t,n){};Ml.prototype.isDestroyed=function(){return!1};Ml.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),de(this)};Ml._deriveBoundingBox=ble;Ml._deriveBoundingRegion=xle;Ml._deriveBoundingVolumeS2=Ile;var Hx=Ml;var gHe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},gu=Object.freeze(gHe);function Yx(e,t){this._distance=t,this._normal=new Sle(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(Yx.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)&&!d.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),d.clone(e,this._normal._cartesian3)}}});Yx.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new Yx(e.normal,e.distance),t};Yx.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new Yx(e.normal,e.distance)};function Sle(e,t){this._clippingPlane=t,this._cartesian3=d.clone(e)}Object.defineProperties(Sle.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 zs=Yx;function Vc(e){e=e??V.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.edgeColor=G.clone(e.edgeColor??G.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new _e,this.planeRemoved=new _e,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Ple:Rle,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 Ple(e){return e===qt.OUTSIDE}function Rle(e){return e===qt.INSIDE}Object.defineProperties(Vc.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?Ple:Rle)}},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 Ble(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Vc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Ble(n,i)},e.index=t,Ble(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Vc.prototype.get=function(e){return this._planes[e]};function Mle(e,t){let n=e.length;for(let i=0;i<n;++i)if(rn.equals(e[i],t))return i;return-1}Vc.prototype.contains=function(e){return Mle(this._planes,e)!==-1};Vc.prototype.remove=function(e){let t=this._planes,n=Mle(t,e);if(n===-1)return!1;e instanceof zs&&(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 zs&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Vc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof zs&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var _He=new se,CHe=new se;function wle(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=bn.octEncodeToCartesian4(a.normal,CHe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=se.packFloat(a.distance,_He);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function Dle(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 Nle(e,t){let n=Ft.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var yHe=new F;Vc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Vc.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=Nle(o,yHe);s.y*=2,i?(t=new Bt({context:n,width:s.x,height:s.y,pixelFormat:qe.RGBA,pixelDatatype:Ge.FLOAT,sampler:Jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Bt({context:n,width:s.x,height:s.y,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,sampler:Jt.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?(Dle(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(wle(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),Dle(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),wle(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 EHe=new M,vle=new rn(d.UNIT_X,0);Vc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=M.multiply(t,o,EHe));let r=qt.INSIDE;!this.unionClippingRegions&&i>0&&(r=qt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];rn.transform(a,o,vle);let c=e.intersectPlane(vle);if(c===qt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Vc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Vc.useFloatTexture=function(e){return e.floatingPointTexture};Vc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Vc.useFloatTexture(t)?e.length:e.length*2,r=Nle(o,n);return r.y*=2,r};Vc.prototype.isDestroyed=function(){return!1};Vc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),de(this)};var cs=Vc;function Xj(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Ole(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,u;if(i&&(r=SHe(e,t,r,n)),e.length>80*n){a=e[0],c=e[1];let f=a,h=c;for(let m=n;m<o;m+=n){let g=e[m],A=e[m+1];g<a&&(a=g),A<c&&(c=A),g>f&&(f=g),A>h&&(h=A)}u=Math.max(f-a,h-c),u=u!==0?32767/u:0}return YM(r,s,n,a,c,u,0),s}function Ole(e,t,n,i,o){let r;if(o===FHe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=Lle(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=Lle(s/i|0,e[s],e[s+1],r);return r&&Wx(r,r.next)&&(jM(r),r=r.next),r}function gI(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(Wx(n,n.next)||ls(n.prev,n,n.next)===0)){if(jM(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function YM(e,t,n,i,o,r,s){if(!e)return;!s&&r&&PHe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?bHe(e,i,o,r):IHe(e)){t.push(c.i,e.i,u.i),jM(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=xHe(gI(e),t),YM(e,t,n,i,o,r,2)):s===2&&THe(e,t,n,i,o,r):YM(gI(e),t,n,i,o,r,1);break}}}function IHe(e){let t=e.prev,n=e,i=e.next;if(ls(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(o,r,s),h=Math.min(a,c,u),m=Math.max(o,r,s),g=Math.max(a,c,u),A=i.next;for(;A!==t;){if(A.x>=f&&A.x<=m&&A.y>=h&&A.y<=g&&HM(o,a,r,c,s,u,A.x,A.y)&&ls(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function bHe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(ls(o,r,s)>=0)return!1;let a=o.x,c=r.x,u=s.x,f=o.y,h=r.y,m=s.y,g=Math.min(a,c,u),A=Math.min(f,h,m),_=Math.max(a,c,u),C=Math.max(f,h,m),y=Kj(g,A,t,n,i),E=Kj(_,C,t,n,i),I=e.prevZ,x=e.nextZ;for(;I&&I.z>=y&&x&&x.z<=E;){if(I.x>=g&&I.x<=_&&I.y>=A&&I.y<=C&&I!==o&&I!==s&&HM(a,f,c,h,u,m,I.x,I.y)&&ls(I.prev,I,I.next)>=0||(I=I.prevZ,x.x>=g&&x.x<=_&&x.y>=A&&x.y<=C&&x!==o&&x!==s&&HM(a,f,c,h,u,m,x.x,x.y)&&ls(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;I&&I.z>=y;){if(I.x>=g&&I.x<=_&&I.y>=A&&I.y<=C&&I!==o&&I!==s&&HM(a,f,c,h,u,m,I.x,I.y)&&ls(I.prev,I,I.next)>=0)return!1;I=I.prevZ}for(;x&&x.z<=E;){if(x.x>=g&&x.x<=_&&x.y>=A&&x.y<=C&&x!==o&&x!==s&&HM(a,f,c,h,u,m,x.x,x.y)&&ls(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function xHe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!Wx(i,o)&&Qle(i,n,n.next,o)&&WM(i,o)&&WM(o,i)&&(t.push(i.i,n.i,o.i),jM(n),jM(n.next),n=e=o),n=n.next}while(n!==e);return gI(n)}function THe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&NHe(s,a)){let c=kle(s,a);s=gI(s,s.next),c=gI(c,c.next),YM(s,t,n,i,o,r,0),YM(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function SHe(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,u=Ole(e,a,c,i,!1);u===u.next&&(u.steiner=!0),o.push(MHe(u))}o.sort(BHe);for(let r=0;r<o.length;r++)n=wHe(o[r],n);return n}function BHe(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 wHe(e,t){let n=DHe(e,t);if(!n)return t;let i=kle(n,e);return gI(i,i.next),gI(n,n.next)}function DHe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(Wx(e,n))return n;do{if(Wx(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,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&Fle(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);WM(n,e)&&(h<f||h===f&&(n.x>s.x||n.x===s.x&&vHe(s,n)))&&(s=n,f=h)}n=n.next}while(n!==a);return s}function vHe(e,t){return ls(e.prev,e,t.prev)<0&&ls(t.next,e,e.next)<0}function PHe(e,t,n,i){let o=e;do o.z===0&&(o.z=Kj(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,RHe(o)}function RHe(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 u=0;u<n&&(a++,s=s.nextZ,!!s);u++);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 Kj(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 MHe(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 Fle(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 HM(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Fle(e,t,n,i,o,r,s,a)}function NHe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!LHe(e,t)&&(WM(e,t)&&WM(t,e)&&OHe(e,t)&&(ls(e.prev,e,t.prev)||ls(e,t.prev,t))||Wx(e,t)&&ls(e.prev,e,e.next)>0&&ls(t.prev,t,t.next)>0)}function ls(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Wx(e,t){return e.x===t.x&&e.y===t.y}function Qle(e,t,n,i){let o=gV(ls(e,t,n)),r=gV(ls(e,t,i)),s=gV(ls(n,i,e)),a=gV(ls(n,i,t));return!!(o!==r&&s!==a||o===0&&pV(e,n,t)||r===0&&pV(e,i,t)||s===0&&pV(n,e,i)||a===0&&pV(n,t,i))}function pV(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 gV(e){return e>0?1:e<0?-1:0}function LHe(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&&Qle(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function WM(e,t){return ls(e.prev,e,e.next)<0?ls(e,t,e.next)>=0&&ls(e,e.prev,t)>=0:ls(e,t,e.prev)<0||ls(e,e.next,t)<0}function OHe(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 kle(e,t){let n=Jj(e.i,e.x,e.y),i=Jj(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 Lle(e,t,n,i){let o=Jj(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 jM(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 Jj(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function FHe(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 QHe=new d,kHe=new d,_C={};_C.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};_C.computeWindingOrder2D=function(e){return _C.computeArea2D(e)>0?ks.COUNTER_CLOCKWISE:ks.CLOCKWISE};_C.triangulate=function(e,t){let n=F.packArray(e);return Xj(n,t,2)};var Vle=new d,Hle=new d,Yle=new d,Ule=new d,Gle=new d,zle=new d,$p=new d,Wle=new F,jle=new F,qle=new F,jx=new F;_C.computeSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,m=0;for(a=0;a<c;a++){let I=t[a];if(u[h++]=I.x,u[h++]=I.y,u[h++]=I.z,r){let x=i[a];f[m++]=x.x,f[m++]=x.y}}let g=[],A={},_=e.maximumRadius,C=D.chordLength(o,_),y=C*C;for(;s.length>0;){let I=s.pop(),x=s.pop(),S=s.pop(),w=d.fromArray(u,S*3,Vle),v=d.fromArray(u,x*3,Hle),P=d.fromArray(u,I*3,Yle),N,L,p;r&&(N=F.fromArray(f,S*2,Wle),L=F.fromArray(f,x*2,jle),p=F.fromArray(f,I*2,qle));let b=d.multiplyByScalar(d.normalize(w,Ule),_,Ule),T=d.multiplyByScalar(d.normalize(v,Gle),_,Gle),B=d.multiplyByScalar(d.normalize(P,zle),_,zle),R=d.magnitudeSquared(d.subtract(b,T,$p)),O=d.magnitudeSquared(d.subtract(T,B,$p)),U=d.magnitudeSquared(d.subtract(B,b,$p)),k=Math.max(R,O,U),z,Q,H;k>y?R===k?(z=`${Math.min(S,x)} ${Math.max(S,x)}`,a=A[z],l(a)||(Q=d.add(w,v,$p),d.multiplyByScalar(Q,.5,Q),u.push(Q.x,Q.y,Q.z),a=u.length/3-1,A[z]=a,r&&(H=F.add(N,L,jx),F.multiplyByScalar(H,.5,H),f.push(H.x,H.y))),s.push(S,a,I),s.push(a,x,I)):O===k?(z=`${Math.min(x,I)} ${Math.max(x,I)}`,a=A[z],l(a)||(Q=d.add(v,P,$p),d.multiplyByScalar(Q,.5,Q),u.push(Q.x,Q.y,Q.z),a=u.length/3-1,A[z]=a,r&&(H=F.add(L,p,jx),F.multiplyByScalar(H,.5,H),f.push(H.x,H.y))),s.push(x,a,S),s.push(a,I,S)):U===k&&(z=`${Math.min(I,S)} ${Math.max(I,S)}`,a=A[z],l(a)||(Q=d.add(P,w,$p),d.multiplyByScalar(Q,.5,Q),u.push(Q.x,Q.y,Q.z),a=u.length/3-1,A[z]=a,r&&(H=F.add(p,N,jx),F.multiplyByScalar(H,.5,H),f.push(H.x,H.y))),s.push(I,a,x),s.push(a,S,x)):(g.push(S),g.push(x),g.push(I))}let E={attributes:{position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Pe.TRIANGLES};return r&&(E.attributes.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:f})),new ht(E)};var UHe=new he,GHe=new he,zHe=new he,Zj=new he;_C.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,m=0;for(a=0;a<c;a++){let S=t[a];if(u[h++]=S.x,u[h++]=S.y,u[h++]=S.z,r){let w=i[a];f[m++]=w.x,f[m++]=w.y}}let g=[],A={},_=e.maximumRadius,C=D.chordLength(o,_),y=new _c(void 0,void 0,e),E=new _c(void 0,void 0,e),I=new _c(void 0,void 0,e);for(;s.length>0;){let S=s.pop(),w=s.pop(),v=s.pop(),P=d.fromArray(u,v*3,Vle),N=d.fromArray(u,w*3,Hle),L=d.fromArray(u,S*3,Yle),p,b,T;r&&(p=F.fromArray(f,v*2,Wle),b=F.fromArray(f,w*2,jle),T=F.fromArray(f,S*2,qle));let B=e.cartesianToCartographic(P,UHe),R=e.cartesianToCartographic(N,GHe),O=e.cartesianToCartographic(L,zHe);y.setEndPoints(B,R);let U=y.surfaceDistance;E.setEndPoints(R,O);let k=E.surfaceDistance;I.setEndPoints(O,B);let z=I.surfaceDistance,Q=Math.max(U,k,z),H,W,Z,Y,$;Q>C?U===Q?(H=`${Math.min(v,w)} ${Math.max(v,w)}`,a=A[H],l(a)||(W=y.interpolateUsingFraction(.5,Zj),Z=(B.height+R.height)*.5,Y=d.fromRadians(W.longitude,W.latitude,Z,e,$p),u.push(Y.x,Y.y,Y.z),a=u.length/3-1,A[H]=a,r&&($=F.add(p,b,jx),F.multiplyByScalar($,.5,$),f.push($.x,$.y))),s.push(v,a,S),s.push(a,w,S)):k===Q?(H=`${Math.min(w,S)} ${Math.max(w,S)}`,a=A[H],l(a)||(W=E.interpolateUsingFraction(.5,Zj),Z=(R.height+O.height)*.5,Y=d.fromRadians(W.longitude,W.latitude,Z,e,$p),u.push(Y.x,Y.y,Y.z),a=u.length/3-1,A[H]=a,r&&($=F.add(b,T,jx),F.multiplyByScalar($,.5,$),f.push($.x,$.y))),s.push(w,a,v),s.push(a,S,v)):z===Q&&(H=`${Math.min(S,v)} ${Math.max(S,v)}`,a=A[H],l(a)||(W=I.interpolateUsingFraction(.5,Zj),Z=(O.height+B.height)*.5,Y=d.fromRadians(W.longitude,W.latitude,Z,e,$p),u.push(Y.x,Y.y,Y.z),a=u.length/3-1,A[H]=a,r&&($=F.add(T,p,jx),F.multiplyByScalar($,.5,$),f.push($.x,$.y))),s.push(S,a,w),s.push(a,v,w)):(g.push(v),g.push(w),g.push(S))}let x={attributes:{position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Pe.TRIANGLES};return r&&(x.attributes.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:f})),new ht(x)};_C.scaleToGeodeticHeight=function(e,t,n,i){n=n??te.default;let o=QHe,r=kHe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)d.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),d.multiplyByScalar(o,t,o),d.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var bi=_C;function CC(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(CC.prototype,{length:{get:function(){return this._length}}});CC.prototype.enqueue=function(e){this._array.push(e),this._length++};CC.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};CC.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};CC.prototype.contains=function(e){return this._array.indexOf(e)!==-1};CC.prototype.clear=function(){this._array.length=this._offset=this._length=0};CC.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var yC=CC;var br={};br.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};br.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 u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)o.push(a[u])}}return n};br.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]=br.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var _I=new F;function Xle(e,t,n,i){return F.subtract(t,e,_I),F.multiplyByScalar(_I,n/i,_I),F.add(e,_I,_I),[_I.x,_I.y]}var EC=new d;function VHe(e,t,n,i){return d.subtract(t,e,EC),d.multiplyByScalar(EC,n/i,EC),d.add(e,EC,EC),[EC.x,EC.y,EC.z]}br.subdivideLineCount=function(e,t,n){let o=d.distance(e,t)/n,r=Math.max(0,Math.ceil(D.log2(o)));return Math.pow(2,r)};var CV=new he,yV=new he,HHe=new he,YHe=new d,_V=new _c;br.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,CV),r=e.cartesianToCartographic(n,yV),a=new _c(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(a)));return Math.pow(2,c)};br.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=br.subdivideLineCount(n,i,o),a=F.distance(e,t),c=a/s,u=r;u.length=s*2;let f=0;for(let h=0;h<s;h++){let m=Xle(e,t,h*c,a);u[f++]=m[0],u[f++]=m[1]}return u};br.subdivideLine=function(e,t,n,i){let o=br.subdivideLineCount(e,t,n),r=d.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let u=0;u<o;u++){let f=VHe(e,t,u*s,r);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};br.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,CV),c=n.cartesianToCartographic(o,yV);_V.setEndPoints(a,c);let u=_V.surfaceDistance/r,f=Math.max(0,Math.ceil(D.log2(u))),h=Math.pow(2,f),m=F.distance(e,t),g=m/h,A=s;A.length=h*2;let _=0;for(let C=0;C<h;C++){let y=Xle(e,t,C*g,m);A[_++]=y[0],A[_++]=y[1]}return A};br.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,CV),s=e.cartesianToCartographic(n,yV),a=new _c(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,u=Math.max(0,Math.ceil(D.log2(c))),f=Math.pow(2,u),h=a.surfaceDistance/f,m=o;m.length=f*3;let g=0;for(let A=0;A<f;A++){let _=a.interpolateUsingSurfaceDistance(A*h,HHe),C=e.cartographicToCartesian(_,YHe);m[g++]=C.x,m[g++]=C.y,m[g++]=C.z}return m};var WHe=new d,jHe=new d,qHe=new d,KHe=new d;br.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??te.default;let r=WHe,s=jHe,a=qHe,c=KHe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let h=0;h<f;h+=3)d.fromArray(u,h,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=d.multiplyByScalar(r,n,s),s=d.add(c,s,s),u[h+f]=s.x,u[h+1+f]=s.y,u[h+2+f]=s.z,o&&(c=d.clone(a,c)),s=d.multiplyByScalar(r,t,s),s=d.add(c,s,s),u[h]=s.x,u[h+1]=s.y,u[h+2]=s.z}return e};br.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new yC;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=Uo(u,d.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let h=c.holes[r],m=h.positions;if(t)for(a=m.length,s=0;s<a;++s)n.scaleToGeodeticSurface(m[s],m[s]);if(m=Uo(m,d.equalsEpsilon,!0),m.length<3)continue;i.push(m);let g=0;for(l(h.holes)&&(g=h.holes.length),s=0;s<g;s++)o.enqueue(h.holes[s])}i.push(u)}return i};var JHe=new he;function XHe(e,t,n){let i=n.cartesianToCartographic(e,CV),o=n.cartesianToCartographic(t,yV);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;_V.setEndPoints(i,o);let r=_V.findIntersectionWithLatitude(0,JHe);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>D.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function ZHe(e,t,n,i){if(i===an.RHUMB)return XHe(e,t,n);let o=ci.lineSegmentPlane(e,t,rn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var $He=new he;function e8e(e,t,n){let i=[],o,r,s,a,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=D.sign(o.z),a=D.sign(r.z);let f=h=>t.cartesianToCartographic(h,$He).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(c=ZHe(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function Zle(e,t,n,i,o,r,s){let a=[],c=r,u=h=>m=>m.position===h,f=[];do{let h=n[c];a.push(h);let m=i.findIndex(u(c)),g=i[m];if(!l(g)){++c;continue}let{visited:A,type:_,next:C}=g;if(g.visited=!0,_===0){if(C===0){let x=i[m-(s?1:-1)];if(x?.position===c+1)x.visited=!0;else{++c;continue}}if(!A&&s&&C>0||r===c&&!s&&C<0){++c;continue}}if(!(s?_>=0:_<=0)){++c;continue}A||f.push(c);let E=m+(s?1:-1),I=i[E];if(!l(I)){++c;continue}c=I.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let h of f)t=Zle(e,++t,n,i,0,h,!s);return t}br.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=e8e(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;o=Zle(i,o,s,a,1,0,c)}return i};br.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new yC;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),h=f.positions,m=f.holes,g,A;if(i)for(A=h.length,g=0;g<A;g++)o.scaleToGeodeticSurface(h[g],h[g]);if(t||(h=Uo(h,d.equalsEpsilon,!0)),h.length<3)continue;let _=n(h);if(!l(_))continue;let C=[],y=bi.computeWindingOrder2D(_);if(y===ks.CLOCKWISE&&(_.reverse(),h=h.slice().reverse()),u){u=!1;let w=[h];if(w=r(w,w),w.length>1){for(let v of w)c.enqueue(new Cc(v,m));continue}}let E=h.slice(),I=l(m)?m.length:0,x=[],S;for(g=0;g<I;g++){let w=m[g],v=w.positions;if(i)for(A=v.length,S=0;S<A;++S)o.scaleToGeodeticSurface(v[S],v[S]);if(t||(v=Uo(v,d.equalsEpsilon,!0)),v.length<3)continue;let P=n(v);if(!l(P))continue;y=bi.computeWindingOrder2D(P),y===ks.CLOCKWISE&&(P.reverse(),v=v.slice().reverse()),x.push(v),C.push(E.length),E=E.concat(v),_=_.concat(P);let N=0;for(l(w.holes)&&(N=w.holes.length),S=0;S<N;S++)c.enqueue(w.holes[S])}s.push({outerRing:h,holes:x}),a.push({positions:E,positions2D:_,holes:C})}return{hierarchy:s,polygons:a}};var t8e=new F,n8e=new d,i8e=new Qe,o8e=new X;br.computeBoundingRectangle=function(e,t,n,i,o){let r=Qe.fromAxisAngle(e,i,i8e),s=X.fromQuaternion(r,o8e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=n.length;for(let m=0;m<h;++m){let g=d.clone(n[m],n8e);X.multiplyByVector(s,g,g);let A=t(g,t8e);l(A)&&(a=Math.min(a,A.x),c=Math.max(c,A.x),u=Math.min(u,A.y),f=Math.max(f,A.y))}return o.x=a,o.y=u,o.width=c-a,o.height=f-u,o};br.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=bi.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let h=c.length,m=new Array(h*3),g=0;for(let C=0;C<h;C++){let y=c[C];m[g++]=y.x,m[g++]=y.y,m[g++]=y.z}let A={attributes:{position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:m})},indices:a,primitiveType:Pe.TRIANGLES};u&&(A.attributes.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:F.packArray(f)}));let _=new ht(A);return r.normal?Un.computeNormal(_):_}if(s===an.GEODESIC)return bi.computeSubdivision(e,c,a,f,i);if(s===an.RHUMB)return bi.computeRhumbLineSubdivision(e,c,a,f,i)};var Kle=[],Jle=[],r8e=new d,s8e=new d;br.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,u,f,h,m,g,A,_=e.length,C=0,y=0,E=l(t),I=E?t.positions:void 0;if(o)for(a=_*3*2,s=new Array(a*2),E&&(A=_*2*2,g=new Array(A*2)),c=0;c<_;c++)u=e[c],f=e[(c+1)%_],s[C]=s[C+a]=u.x,++C,s[C]=s[C+a]=u.y,++C,s[C]=s[C+a]=u.z,++C,s[C]=s[C+a]=f.x,++C,s[C]=s[C+a]=f.y,++C,s[C]=s[C+a]=f.z,++C,E&&(h=I[c],m=I[(c+1)%_],g[y]=g[y+A]=h.x,++y,g[y]=g[y+A]=h.y,++y,g[y]=g[y+A]=m.x,++y,g[y]=g[y+A]=m.y,++y);else{let P=D.chordLength(i,n.maximumRadius),N=0;if(r===an.GEODESIC)for(c=0;c<_;c++)N+=br.subdivideLineCount(e[c],e[(c+1)%_],P);else if(r===an.RHUMB)for(c=0;c<_;c++)N+=br.subdivideRhumbLineCount(n,e[c],e[(c+1)%_],P);for(a=(N+_)*3,s=new Array(a*2),E&&(A=(N+_)*2,g=new Array(A*2)),c=0;c<_;c++){u=e[c],f=e[(c+1)%_];let L,p;E&&(h=I[c],m=I[(c+1)%_]),r===an.GEODESIC?(L=br.subdivideLine(u,f,P,Jle),E&&(p=br.subdivideTexcoordLine(h,m,u,f,P,Kle))):r===an.RHUMB&&(L=br.subdivideRhumbLine(n,u,f,P,Jle),E&&(p=br.subdivideTexcoordRhumbLine(h,m,n,u,f,P,Kle)));let b=L.length;for(let T=0;T<b;++T,++C)s[C]=L[T],s[C+a]=L[T];if(s[C]=f.x,s[C+a]=f.x,++C,s[C]=f.y,s[C+a]=f.y,++C,s[C]=f.z,s[C+a]=f.z,++C,E){let T=p.length;for(let B=0;B<T;++B,++y)g[y]=p[B],g[y+A]=p[B];g[y]=m.x,g[y+A]=m.x,++y,g[y]=m.y,g[y+A]=m.y,++y}}}_=s.length;let x=Fe.createTypedArray(_/3,_-e.length*6),S=0;for(_/=6,c=0;c<_;c++){let P=c,N=P+1,L=P+_,p=L+1;u=d.fromArray(s,P*3,r8e),f=d.fromArray(s,N*3,s8e),!d.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(x[S++]=P,x[S++]=L,x[S++]=N,x[S++]=N,x[S++]=L,x[S++]=p)}let w={attributes:new pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s})}),indices:x,primitiveType:Pe.TRIANGLES};return E&&(w.attributes.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:g})),new ht(w)};var Zn=br;function us(e,t){this.position=e,l(this.position)||(this.position=new F),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=us.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(us.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=F.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(D.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=D.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=D.TWO_PI),e}}});var qx=new he,a8e=new d;us.prototype.getLatitude=function(e){l(e)||(e=te.default),qx.latitude=this.conformalLatitude,qx.longitude=this.longitude,qx.height=0;let t=this.ellipsoid.cartographicToCartesian(qx,a8e);return e.cartesianToCartographic(t,qx),qx.latitude};var c8e=new gn,l8e=new d,u8e=new d;us.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=us.NORTH_POLE_TANGENT_PLANE,o=us.SOUTH_POLE;n<0&&(i=us.SOUTH_POLE_TANGENT_PLANE,o=us.NORTH_POLE);let r=c8e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=d.subtract(r.origin,o,l8e),d.normalize(r.direction,r.direction);let s=ci.rayPlane(r,i.plane,u8e),a=d.subtract(s,o,s),c=d.dot(i.xAxis,a),u=n*d.dot(i.yAxis,a);return l(t)?(t.position=new F(c,u),t.tangentPlane=i,t):new us(new F(c,u),i)};us.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]=us.fromCartesian(e[i],t[i]);return t};us.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new us(e.position,e.tangentPlane)};us.HALF_UNIT_SPHERE=Object.freeze(new te(.5,.5,.5));us.NORTH_POLE=Object.freeze(new d(0,0,.5));us.SOUTH_POLE=Object.freeze(new d(0,0,-.5));us.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Ss(us.NORTH_POLE,us.HALF_UNIT_SPHERE));us.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Ss(us.SOUTH_POLE,us.HALF_UNIT_SPHERE));var Hc=us;var f8e=new he,$le=new he;function d8e(e,t,n,i){let r=i.cartesianToCartographic(e,f8e).height,s=i.cartesianToCartographic(t,$le);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,$le);a.height=r-100,i.cartographicToCartesian(a,n)}var eue=new Xe,h8e=new d,A8e=new d,m8e=new d,p8e=new d,g8e=new d,_8e=new d,EV=new d,um=new d,Kx=new d,C8e=new F,y8e=new F,E8e=new d,tue=new Qe,I8e=new X,b8e=new X;function $j(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,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,h=e.rotationAxis,m=e.projectTo2d,g=e.ellipsoid,A=e.stRotation,_=e.perPositionHeight,C=C8e;C.x=f.x,C.y=f.y;let y=t.st?new Float32Array(2*(s/3)):void 0,E;t.normal&&(_&&c&&!a?E=n.attributes.normal.values:E=new Float32Array(s));let I=t.tangent?new Float32Array(s):void 0,x=t.bitangent?new Float32Array(s):void 0,S=i?new Float32Array(s):void 0,w=0,v=0,P=A8e,N=m8e,L=p8e,p=!0,b=I8e,T=b8e;if(A!==0){let O=Qe.fromAxisAngle(h,A,tue);b=X.fromQuaternion(O,b),O=Qe.fromAxisAngle(h,-A,tue),T=X.fromQuaternion(O,T)}else b=X.clone(X.IDENTITY,b),T=X.clone(X.IDENTITY,T);let B=0,R=0;c&&u&&(B=s/2,R=s/3,s/=2);for(let O=0;O<s;O+=3){let U=d.fromArray(o,O,E8e);if(t.st&&!l(r)){let k=X.multiplyByVector(b,U,h8e);k=g.scaleToGeodeticSurface(k,k);let z=m([k],y8e)[0];F.subtract(z,C,z);let Q=D.clamp(z.x/f.width,0,1),H=D.clamp(z.y/f.height,0,1);u&&(y[w+R]=Q,y[w+1+R]=H),c&&(y[w]=Q,y[w+1]=H),w+=2}if(t.normal||t.tangent||t.bitangent||i){let k=v+1,z=v+2;if(a){if(O+3<s){let Q=d.fromArray(o,O+3,g8e);if(p){let H=d.fromArray(o,O+s,_8e);_&&d8e(U,Q,H,g),d.subtract(Q,U,Q),d.subtract(H,U,H),P=d.normalize(d.cross(H,Q,P),P),p=!1}d.equalsEpsilon(Q,U,D.EPSILON10)&&(p=!0)}(t.tangent||t.bitangent)&&(L=g.geodeticSurfaceNormal(U,L),t.tangent&&(N=d.normalize(d.cross(L,P,N),N)))}else P=g.geodeticSurfaceNormal(U,P),(t.tangent||t.bitangent)&&(_&&(EV=d.fromArray(E,v,EV),um=d.cross(d.UNIT_Z,EV,um),um=d.normalize(X.multiplyByVector(T,um,um),um),t.bitangent&&(Kx=d.normalize(d.cross(EV,um,Kx),Kx))),N=d.cross(d.UNIT_Z,P,N),N=d.normalize(X.multiplyByVector(T,N,N),N),t.bitangent&&(L=d.normalize(d.cross(P,N,L),L)));t.normal&&(e.wall?(E[v+B]=P.x,E[k+B]=P.y,E[z+B]=P.z):u&&(E[v+B]=-P.x,E[k+B]=-P.y,E[z+B]=-P.z),(c&&!_||a)&&(E[v]=P.x,E[k]=P.y,E[z]=P.z)),i&&(a&&(P=g.geodeticSurfaceNormal(U,P)),S[v+B]=-P.x,S[k+B]=-P.y,S[z+B]=-P.z),t.tangent&&(e.wall?(I[v+B]=N.x,I[k+B]=N.y,I[z+B]=N.z):u&&(I[v+B]=-N.x,I[k+B]=-N.y,I[z+B]=-N.z),c&&(_?(I[v]=um.x,I[k]=um.y,I[z]=um.z):(I[v]=N.x,I[k]=N.y,I[z]=N.z))),t.bitangent&&(u&&(x[v+B]=L.x,x[k+B]=L.y,x[z+B]=L.z),c&&(_?(x[v]=Kx.x,x[k]=Kx.y,x[z]=Kx.z):(x[v]=L.x,x[k]=L.y,x[z]=L.z))),v+=3}}t.st&&!l(r)&&(n.attributes.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:y})),t.normal&&(n.attributes.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:E})),t.tangent&&(n.attributes.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:I})),t.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:x})),i&&(n.attributes.extrudeDirection=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,h=new Uint8Array(f);if(e.offsetAttribute===un.TOP)c&&u||a?h=h.fill(1,0,f/2):c&&(h=h.fill(1));else{let m=e.offsetAttribute===un.NONE?0:1;h=h.fill(m)}n.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var nue=[];function x8e(e,t,n,i,o,r,s,a,c,u){let f={walls:[]},h;if(s||a){let E=Zn.createGeometryFromPositions(e,t,n,i,r,c,u),I=E.attributes.position.values,x=E.indices,S,w;if(s&&a){let v=I.concat(I);S=v.length/3,w=Fe.createTypedArray(S,x.length*2),w.set(x);let P=x.length,N=S/2;for(h=0;h<P;h+=3){let L=w[h]+N,p=w[h+1]+N,b=w[h+2]+N;w[h+P]=b,w[h+1+P]=p,w[h+2+P]=L}if(E.attributes.position.values=v,r&&c.normal){let L=E.attributes.normal.values;E.attributes.normal.values=new Float32Array(v.length),E.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=E.attributes.st.values;E.attributes.st.values=new Float32Array(S*2),E.attributes.st.values=L.concat(L)}E.indices=w}else if(a){for(S=I.length/3,w=Fe.createTypedArray(S,x.length),h=0;h<x.length;h+=3)w[h]=x[h+2],w[h+1]=x[h+1],w[h+2]=x[h];E.indices=w}f.topAndBottom=new Rt({geometry:E})}let m=o.outerRing,g=Ss.fromPoints(m,e),A=g.projectPointsOntoPlane(m,nue),_=bi.computeWindingOrder2D(A);_===ks.CLOCKWISE&&(m=m.slice().reverse());let C=Zn.computeWallGeometry(m,n,e,i,r,u);f.walls.push(new Rt({geometry:C}));let y=o.holes;for(h=0;h<y.length;h++){let E=y[h];A=g.projectPointsOntoPlane(E,nue),_=bi.computeWindingOrder2D(A),_===ks.COUNTER_CLOCKWISE&&(E=E.slice().reverse()),C=Zn.computeWallGeometry(E,n,e,i,r,u),f.walls.push(new Rt({geometry:C}))}return f}function gd(e){let t=e.polygonHierarchy,n=e.vertexFormat??Re.DEFAULT,i=e.ellipsoid??te.default,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let h=Math.max(u,f);f=Math.min(u,f),u=h}this._vertexFormat=Re.clone(n),this._ellipsoid=te.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,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??an.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Zn.computeHierarchyPackedLength(t,d)+te.packedLength+Re.packedLength+(s?Zn.computeHierarchyPackedLength(s,F):1)+12}gd.fromPositions=function(e){e=e??V.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 gd(t)};gd.pack=function(e,t,n){return n=n??0,n=Zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),te.pack(e._ellipsoid,t,n),n+=te.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.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=Zn.packPolygonHierarchy(e._textureCoordinates,t,n,F):t[n++]=-1,t[n++]=e.packedLength,t};var T8e=te.clone(te.UNIT_SPHERE),S8e=new Re,B8e={polygonHierarchy:{}};gd.unpack=function(e,t,n){t=t??0;let i=Zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,T8e);t+=te.packedLength;let r=Re.unpack(e,t,S8e);t+=Re.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,h=e[t++]===1,m=e[t++]===1,g=e[t++]===1,A=e[t++]===1,_=e[t++],C=e[t++],y=e[t]===-1?void 0:Zn.unpackPolygonHierarchy(e,t,F);l(y)?(t=y.startingIndex,delete y.startingIndex):t++;let E=e[t++];return l(n)||(n=new gd(B8e)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=Re.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=h,n._closeTop=m,n._closeBottom=g,n._shadowVolume=A,n._offsetAttribute=_===-1?void 0:_,n._arcType=C,n._textureCoordinates=y,n.packedLength=E,n};var w8e=new F,D8e=new F,v8e=new Hc;function iue(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+D.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),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==an.RHUMB){let m=F.subtract(t.position,e.position,w8e),g=F.dot(t.position,m)/F.dot(m,m);if(g>0&&g<1){let A=F.add(t.position,F.multiplyByScalar(m,-g,m),D8e),_=Hc.clone(t,v8e);_.position=A;let C=_.getLatitude(n);r.south=Math.min(r.south,C),r.north=Math.max(r.north,C),Math.abs(c)>Math.abs(C)&&(u=C)}}let f=t.x*e.y-e.x*t.y,h=Math.sign(f);h!==0&&(h*=F.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=h),u<=0&&(o.southAngle+=h)}var oue=new Hc,P8e=new Hc,pd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};gd.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ce),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,pd.northAngle=0,pd.southAngle=0,pd.westOverIdl=Number.POSITIVE_INFINITY,pd.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Hc.fromCartesian(e[0],P8e);for(let s=1;s<o;s++){let a=Hc.fromCartesian(e[s],oue);iue(a,r,t,n,pd,i),r=Hc.clone(a,r)}return iue(Hc.fromCartesian(e[0],oue),r,t,n,pd,i),i.east-i.west>pd.eastOverIdl-pd.westOverIdl&&(i.west=pd.westOverIdl,i.east=pd.eastOverIdl,i.east>D.PI&&(i.east=i.east-D.TWO_PI),i.west>D.PI&&(i.west=i.west-D.TWO_PI)),D.equalsEpsilon(Math.abs(pd.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(pd.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var R8e=new Hc;function M8e(e,t,n){return e.height>=D.PI||e.width>=D.PI?Hc.fromCartesian(t[0],R8e).tangentPlane:Ss.fromPoints(t,n)}var rue=new he;function N8e(e,t,n){return(i,o)=>{if(e.height>=D.PI||e.width>=D.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],rue);o[s]=new F(a.longitude/D.PI,a.latitude/D.PI_OVER_TWO)}return o.length=i.length,o}return Hc.fromCartesianArray(i,o)}return Ss.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function L8e(e,t,n){if(e.height>=D.PI||e.width>=D.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,rue);return l(r)||(r=new F),r.x=s.longitude/D.PI,r.y=s.latitude/D.PI_OVER_TWO,r}return Hc.fromCartesian(o,r)};let i=Ss.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function O8e(e,t,n,i){return(o,r)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?Zn.splitPolygonsOnEquator(o,t,n,r):o}function F8e(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return Xe.fromRectangle(t,void 0,eue);let o=e,r=Ss.fromPoints(o,n);return Zn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,eue)}gd.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,u=e._arcType,f=e._textureCoordinates,h=l(f),m=r.positions;if(m.length<3)return;let g=e.rectangle,A=Zn.polygonsFromHierarchy(r,h,N8e(g,m,n),!s,n,O8e(g,n,u,s)),_=A.hierarchy,C=A.polygons,y=function(B){return B},E=h?Zn.polygonsFromHierarchy(f,!0,y,!1,n).polygons:void 0;if(_.length===0)return;let I=_[0].outerRing,x=F8e(I,g,n,o),S=[],w=e._height,v=e._extrudedHeight,P=e._perPositionHeightExtrude||!D.equalsEpsilon(w,v,0,D.EPSILON2),N={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:M8e(g,I,n).plane.normal,projectTo2d:L8e(g,I,n),boundingRectangle:x,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(P)for(N.extrude=!0,N.top=a,N.bottom=c,N.shadowVolume=e._shadowVolume,N.offsetAttribute=e._offsetAttribute,L=0;L<C.length;L++){let B=x8e(n,C[L],h?E[L]:void 0,i,_[L],s,a,c,t,u),R;a&&c?(R=B.topAndBottom,N.geometry=Zn.scaleToGeodeticHeightExtruded(R.geometry,w,v,n,s)):a?(R=B.topAndBottom,R.geometry.attributes.position.values=bi.scaleToGeodeticHeight(R.geometry.attributes.position.values,w,n,!s),N.geometry=R.geometry):c&&(R=B.topAndBottom,R.geometry.attributes.position.values=bi.scaleToGeodeticHeight(R.geometry.attributes.position.values,v,n,!0),N.geometry=R.geometry),(a||c)&&(N.wall=!1,R.geometry=$j(N),S.push(R));let O=B.walls;N.wall=!0;for(let U=0;U<O.length;U++){let k=O[U];N.geometry=Zn.scaleToGeodeticHeightExtruded(k.geometry,w,v,n,s),k.geometry=$j(N),S.push(k)}}else for(L=0;L<C.length;L++){let B=new Rt({geometry:Zn.createGeometryFromPositions(n,C[L],h?E[L]:void 0,i,s,t,u)});if(B.geometry.attributes.position.values=bi.scaleToGeodeticHeight(B.geometry.attributes.position.values,w,n,!s),N.geometry=B.geometry,B.geometry=$j(N),l(e._offsetAttribute)){let R=B.geometry.attributes.position.values.length,O=e._offsetAttribute===un.NONE?0:1,U=new Uint8Array(R/3).fill(O);B.geometry.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}S.push(B)}let p=Un.combineInstances(S)[0];p.attributes.position.values=new Float64Array(p.attributes.position.values),p.indices=Fe.createTypedArray(p.attributes.position.values.length/3,p.indices);let b=p.attributes,T=le.fromVertices(b.position.values);return t.position||delete b.position,new ht({attributes:b,indices:p.indices,primitiveType:p.primitiveType,boundingSphere:T,offsetAttribute:e._offsetAttribute})};gd.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new gd({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Re.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function Q8e(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 ht._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(gd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=gd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Q8e(this)),this._textureCoordinateRotationPoints}}});var eg=gd;function CI(e){this._ellipsoid=e.ellipsoid??te.default,this._positions=aue(e.positions),this._cachedPositions=void 0,this._cachedRectangle=void 0}function aue(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=d.clone(e[i]);return n}function k8e(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(!d.equals(o,r))return!1}return!0}Object.defineProperties(CI.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});CI.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new CI({positions:e.positions,ellipsoid:e.ellipsoid})};CI.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};CI.prototype.computeRectangle=function(e){if(k8e(this._positions,this._cachedPositions))return ce.clone(this._cachedRectangle,e);let t=eg.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e);return this._cachedPositions=aue(this._positions),this._cachedRectangle=ce.clone(t),t};var U8e=new ce,sue=new d;CI.prototype.computeSphericalExtents=function(e){l(e)||(e=new ce);let t=this.computeRectangle(U8e),n=he.toCartesian(ce.southwest(t),this.ellipsoid,sue),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=he.toCartesian(ce.northeast(t),this.ellipsoid,sue),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var Jx=CI;var qM=`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 vs(e){e=e??V.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new _e,this.polygonRemoved=new _e,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(vs.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}}});vs.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};vs.prototype.get=function(e){return this._polygons[e]};vs.prototype.contains=function(e){return this._polygons.some(t=>Jx.equals(t,e))};vs.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>Jx.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var G8e=new ce;function z8e(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),u=Math.max(a.width*2.5,.001),f=ce.clone(a);f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let h=[r];for(let m=0;m<t.length;++m){let g=t[m];if(l(g)&&l(ce.simpleIntersection(g,f))&&!ce.equals(g,f)){let A=n[m];h.push(...A),A.reduce((_,C)=>ce.union(e[C].computeSphericalExtents(G8e),_,_),a),t[m]=void 0,n[m]=void 0,c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ce.clone(a,f),f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),m=-1}}t.push(f),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}}vs.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 V8e(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=z8e(i),s=0;for(let[c,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(c);for(let h=0;h<f;++h){let m=u.positions[h],g=Math.hypot(m.x,m.y),A=D.fastApproximateAtan2(g,m.z),_=D.fastApproximateAtan2(m.x,m.y);t[s++]=A,t[s++]=_}}let a=0;for(let c of o){let u=1/(c.east-c.west),f=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var e6=new F;vs.prototype.update=function(e){let t=e.context;if(!vs.isSupported(e))throw new ue("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=vs.getTextureResolution(i,this.pixelsNeededForPolygonPositions,e6);i=new Bt({context:t,width:s.x,height:s.y,pixelFormat:qe.RG,pixelDatatype:Ge.FLOAT,sampler:Jt.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=vs.getTextureResolution(o,this.pixelsNeededForExtents,e6);o=new Bt({context:t,width:s.x,height:s.y,pixelFormat:qe.RGBA,pixelDatatype:Ge.FLOAT,sampler:Jt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(V8e(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=vs.getClippingDistanceTextureResolution(this,e6);r=new Bt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?qe.RED:qe.LUMINANCE,pixelDatatype:Ge.FLOAT,sampler:new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:mi.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=H8e(this)};vs.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function H8e(e){let t=e._polygonsTexture,n=e._extentsTexture;return new hl({fragmentShaderSource:qM,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 cue=new ce,Y8e=new ce;vs.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=qt.OUTSIDE;this.inverse&&(o=qt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();c=ce.fromCartesianArray(f,t,cue)}l(c)||(c=ce.fromBoundingSphere(e.boundingSphere,t,cue));let u=ce.simpleIntersection(c,a,Y8e);l(u)&&(o=qt.INTERSECTING)}return o};vs.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};vs.isSupported=function(e){return e?.context.webgl2};vs.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Ft.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};vs.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Ft.maximumTextureSize,4096),t.y=Math.min(Ft.maximumTextureSize,4096),t)};vs.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):vs.getTextureResolution(n,e.pixelsNeededForExtents,t)};vs.prototype.isDestroyed=function(){return!1};vs.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(),de(this)};var Qh=vs;var KM={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};KM.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?KM.SUNLIGHT:KM.SCENE_LIGHT:KM.NONE};var tg=Object.freeze(KM);function lue(){this.lightIntensity=10,this.rayleighCoefficient=new d(55e-7,13e-6,284e-7),this.mieCoefficient=new d(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=tg.NONE}lue.requiresColorCorrect=function(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))};var yI=lue;var kh=`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 JM=`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 XM=`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 ZM=`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 $M=`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 pi(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??V.EMPTY_OBJECT;let t=Math.min(e.mipmapLevels??7,Math.log2(Ft.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),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((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=pi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new J;let n=Math.pow(2,t-1);this._textureDimensions=new F(n,n),this._radiiAndDynamicAtmosphereColor=new d,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??pi.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(pi.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){d.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=d.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}}});pi._maximumComputeCommandCount=8;pi._activeComputeCommandCount=0;pi._nextFrameCommandQueue=[];pi._queueCommand=(e,t)=>{if(pi._activeComputeCommandCount>=pi._maximumComputeCommandCount){pi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),pi._activeComputeCommandCount++};pi._updateCommandQueue=e=>{if(pi._maximumComputeCommandCount=Math.log2(Ft.maximumCubeMapSize),pi._nextFrameCommandQueue.length>0&&pi._activeComputeCommandCount<pi._maximumComputeCommandCount){let t=pi._nextFrameCommandQueue.shift();for(;l(t)&&pi._activeComputeCommandCount<pi._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=pi._nextFrameCommandQueue.shift();continue}e.commandList.push(t),pi._activeComputeCommandCount++,t=pi._nextFrameCommandQueue.shift()}l(t)&&pi._nextFrameCommandQueue.push(t)}};pi.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};pi.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 W8e=new d,j8e=new d;function q8e(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,j8e),s=1.025,a=W8e,c=l(r)?d.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!d.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(d.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var uue=new d,K8e=new M,J8e=new se,X8e=new G;function Z8e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new Kr({context:n,width:i.x,height:i.y,pixelDatatype:Ge.UNSIGNED_BYTE,pixelFormat:qe.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new We({sources:[kh,XM]}),e._radianceMapFS=o),yI.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=It.eastNorthUpToFixedFrame(r,a,K8e),u=J8e;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let h of Kr.faceNames()){let m=e._radianceMapTextures[f];l(m)&&!m.isDestroyed()&&m.destroy(),m=new Bt({context:n,width:i.x,height:i.y,pixelDatatype:Ge.UNSIGNED_BYTE,pixelFormat:qe.RGBA}),e._radianceMapTextures[f]=m;let g=f,A=new hl({fragmentShaderSource:o,outputTexture:m,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>Kr.getDirection(h,uue),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,X8e)},owner:e});A.postExecute=()=>{if(e.isDestroyed()||A.canceled){pi._activeComputeCommandCount--;return}let _=e._radianceMapComputeCommands;_[g]=void 0;let C=new os({context:n,colorTextures:[e._radianceMapTextures[g]]});C._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),C._unBind(),C.destroy(),pi._activeComputeCommandCount--,_.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=A,pi._queueCommand(A,t),f++}e._radianceCommandsDirty=!1}}function $8e(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,u=(h,m,g,A,_)=>()=>{if(e.isDestroyed()||h.canceled){pi._activeComputeCommandCount--;return}let C=e._convolutionComputeCommands;C[m]=void 0,n.copyFace(t,g,A,_),c++,pi._activeComputeCommandCount--,g.destroy(),e._specularMapTextures[m]=void 0;let y=e._specularMapTextures.length;c>=y&&(e._irradianceCommandDirty=!0,n.sampler=new Jt({minificationFilter:Kt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},f=0;for(let h=1;h<i;++h){for(let m of Kr.faceNames()){l(e._specularMapTextures[f])&&e._specularMapTextures[f].destroy();let g=e._specularMapTextures[f]=new Bt({context:a,width:r,height:s,pixelDatatype:Ge.UNSIGNED_BYTE,pixelFormat:qe.RGBA}),A=e._va;l(A)||(A=Kr.createVertexArray(a,m),e._va=A);let _=e._convolveSP;l(_)||(_=sn.fromCache({context:a,vertexShaderSource:$M,fragmentShaderSource:ZM,attributeLocations:{positions:0}}),e._convolveSP=_);let C=new hl({shaderProgram:_,vertexArray:A,outputTexture:g,persists:!0,owner:e,uniformMap:{u_roughness:()=>h/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Kr.getDirection(m,uue)}});C.postExecute=u(C,f,g,m,h),e._convolutionComputeCommands[f]=C,pi._queueCommand(C,t),++f}r/=2,s/=2}}var fue=new F(3,3);function e5e(e,t){let n=t.context,i=fue,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new Bt({context:n,width:i.x,height:i.y,pixelDatatype:Ge.FLOAT,pixelFormat:qe.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new We({sources:[JM]}),e._irradianceMapFS=r);let s=new hl({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){pi._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,pi._activeComputeCommandCount--},e._irradianceComputeCommand=s,pi._queueCommand(s,t),e._irradianceTextureDirty=!0}function t5e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new os({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=fue,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]=d.unpack(r,s*4),d.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}pi.prototype.update=function(e){let t=e.mode;if(!pi.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}pi._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=q8e(this,e)||i===tg.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&&(Z8e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&($8e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(e5e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){t5e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};pi.prototype.isDestroyed=function(){return!1};pi.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(),de(this)};pi.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};pi.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(G.fromCssColorString("#717145"));pi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new d(.35449,.35449,.35449)),d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO]);var ng=pi;var eN={HIGHLIGHT:0,REPLACE:1,MIX:2};eN.getColorBlend=function(e,t){if(e===eN.HIGHLIGHT)return 0;if(e===eN.REPLACE)return 1;if(e===eN.MIX)return D.clamp(t,D.EPSILON4,1)};var Yc=Object.freeze(eN);var n5e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},Wc=Object.freeze(n5e);var i5e={STEP:0,LINEAR:1,CUBICSPLINE:2},Uh=Object.freeze(i5e);var due={};function tN(e){this._count=e.count,this._properties=Ve(e.properties,!0)}tN.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,due)};tN.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,due,e)};tN.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ve(n[e],!0)};tN.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ve(n,!0)};var ig=tN;function jc(e){e=e??V.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(jc.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}}});jc.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))};jc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};jc.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))};jc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var t6=[];jc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(t6);ei(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,t6);ei(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(t6);ei(t,n)}return t};jc.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};jc.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 ig({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};jc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};jc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};jc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};jc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};jc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};jc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};jc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var Nl=jc;function nN(e){e=e??V.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=pu.createModelTextureReader({textureInfo:r,channels:s5e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=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=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(nN.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}}});nN.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!==_t.SCALAR?(At(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==kt.UINT8?(At(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:_t.isVectorType(t)||t===_t.SCALAR?n!==kt.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 o5e=[void 0,"float","vec2","vec3","vec4"],r5e=[void 0,"int","ivec2","ivec3","ivec4"];nN.prototype.getGlslType=function(){let e=this._classProperty,t=_t.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?o5e[t]:r5e[t]};nN.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function s5e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var iN=nN;function n6(e){e=e??V.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 iN({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(n6.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}}});n6.prototype.getProperty=function(e){return this._properties[e]};var og=n6;function hue(e){e=e??V.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(hue.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 oN=hue;function i6(e){e=e??V.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 oN({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(i6.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}}});i6.prototype.getProperty=function(e){return this._properties[e]};var EI=i6;function rN(e){e=e??V.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(rN.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}}});rN.prototype.getPropertyTable=function(e){return this._propertyTables[e]};rN.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};rN.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var xa=rN;function a5e(e){e=e??V.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],u=new dd({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Nl({id:s,name:a.name,count:a.count,metadataTable:u,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 og({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 EI({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new xa({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var sN=a5e;function c5e(e){e=e??V.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],u=n.classes[c.class],f=new dd({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new Nl({id:a,count:c.count,metadataTable:f,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 og({id:a,propertyTexture:l5e(c),class:n.classes[c.class],textures:e.textures}))}return new xa({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function l5e(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:u5e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=St(o.texture,r,!0)}return t}function u5e(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 aN=c5e;function IC(e){e=e??V.EMPTY_OBJECT;let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:u=!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=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=dt.UNLOADED,this._promise=void 0}l(Object.create)&&(IC.prototype=Object.create(Yi.prototype),IC.prototype.constructor=IC);Object.defineProperties(IC.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function f5e(e){try{let t=p5e(e),n=E5e(e),i=I5e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=dt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=dt.FAILED,e.getError("Failed to load structural metadata",t)}}IC.prototype.load=function(){return l(this._promise)?this._promise:(this._state=dt.LOADING,this._promise=f5e(this),this._promise)};function d5e(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 h5e(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 A5e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];d5e(o.properties,n)}return n}function m5e(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)&&h5e(r,n)}}return n}async function p5e(e){let t;l(e._extension)?t=A5e(e._extension):t=m5e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Di.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 g5e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&_5e(r,t)}return t}function _5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function C5e(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)&&y5e(r,t)}}return t}function y5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function E5e(e){let t;l(e._extension)?t=g5e(e._extension):t=C5e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Di.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function I5e(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Di.getSchemaLoader({resource:i})}else n=Di.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}IC.prototype.process=function(e){if(this._state===dt.READY)return!0;if(this._state!==dt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=sN({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=aN({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Aue(this),this._state=dt.READY,!0};function Aue(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Di.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function b5e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Di.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}IC.prototype.unload=function(){Aue(this),b5e(this),l(this._schemaLoader)&&Di.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var cN=IC;var Xx={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};Xx.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return Xx.TRANSLATION;case"ROTATION":return Xx.ROTATION;case"SCALE":return Xx.SCALE;case"_FEATURE_ID":return Xx.FEATURE_ID}};var Ps=Object.freeze(Xx);var x5e=65534,T5e=255;function IV(e){e=e??V.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new gue(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],S5e(this)}Object.defineProperties(IV.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function S5e(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],u=t[a+1],f=t[a+2],h=!1,m=h||n.hasEdge(c,u),g=h||n.hasEdge(u,f),A=h||n.hasEdge(f,c),_=mue(i,c,u,f,m,g,A);for(;l(_);){let C=s[_];if(!l(C)){C=r+o.length;let y=_;for(;y>=r;)y=o[y-r];o.push(y),s[_]=C}C>x5e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):C>T5e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),_===c?(c=C,t[a]=C):_===u?(u=C,t[a+1]=C):(f=C,t[a+2]=C),_=mue(i,c,u,f,m,g,A)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function mue(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=o6(e,t,a,c,u);if(f===0)return t;let h=0,m=o?1:0,g=r?1:0,A=o6(e,n,h,m,g);if(A===0)return n;let _=s?1:0,C=0,y=r?1:0,E=o6(e,i,_,C,y);if(E===0)return i;let I=f&A&E,x,S,w;if(I&1)x=0,S=1,w=2;else if(I&2)x=0,w=1,S=2;else if(I&4)S=0,x=1,w=2;else if(I&8)S=0,w=1,x=2;else if(I&16)w=0,x=1,S=2;else if(I&32)w=0,S=1,x=2;else{let L=r6(f),p=r6(A),b=r6(E);return L<p&&L<b?t:p<b?n:i}let v=t*3;e[v+x]=a,e[v+S]=c,e[v+w]=u;let P=n*3;e[P+x]=h,e[P+S]=m,e[P+w]=g;let N=i*3;e[N+x]=_,e[N+S]=C,e[N+w]=y}function o6(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 r6(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}IV.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,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};IV.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,Ft.maximumTextureSize),i=n,o=pue(i),r=[];for(;i>1;)i>>=1,r.push(pue(i));let s=new Bt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:qe.LUMINANCE,sampler:new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR_MIPMAP_LINEAR,magnificationFilter:mi.LINEAR})});return t.outlineTexture=s,s};function pue(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 gue(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)}}gue.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 II=IV;function _ue(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function B5e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function bV(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}bV.prototype.postProcess=function(e){this.needsOutlines&&(w5e(this),P5e(this,e)),this.needsGaussianSplats&&v5e(this,e)};function w5e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new II({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Fe.fromTypedArray(n.typedArray);let r=D5e(o.outlineCoordinates),s=new _ue(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 u=0;u<c;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function D5e(e){let t=new yn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=q.FLOAT,t.type=Ut.VEC3,t.normalized=!1,t.count=e.length/3,t}function v5e(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 P5e(e,t){R5e(e.attributePlans,t),l(e.indicesPlan)&&M5e(e.indicesPlan,t)}function R5e(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=ut.createVertexBuffer({typedArray:s,context:t,usage:Oe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function M5e(e,t){let n=e.indices;if(e.loadBuffer){let i=ut.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Oe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}bV.AttributeLoadPlan=_ue;bV.IndicesLoadPlan=B5e;var bI=bV;function N5e(e){e=e??V.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var lN=N5e;function Cue(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Cue.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var uN=Cue;function yue(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(yue.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var fN=yue;function Eue(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Eue.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var dN=Eue;var L5e={Direct:"Direct",Indirect:"Indirect"},bC=Object.freeze(L5e);function Iue(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(Iue.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 Zx=Iue;function bue(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(bue.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 hN=bue;function $x(){}function xue(e){return new X(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function O5e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d);return new uN({position:t,adjustmentParams:n})}function F5e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d),i=xue(e.covarianceMatrix);return new fN({position:t,adjustmentParams:n,covarianceMatrix:i})}function Q5e(e){let t=e.groupFlags,n=d.fromArray(e.rotationThetas,0,new d),i=[];for(let r of e.params){let s=new hN({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new dN({groupFlags:t,rotationThetas:n,params:i})}$x.load=function(e){let t=e.storageType;if(t===bC.Direct)return $x.loadDirect(e);if(t===bC.Indirect)return $x.loadIndirect(e);throw new ue(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};$x.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=O5e(r);t.push(s)}let i=xue(e.covarianceDirectUpperTriangle);return new Zx({storageType:bC.Direct,anchorPointsDirect:t,covarianceDirect:i})};$x.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=F5e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=Q5e(s);o.push(a)}return new Zx({storageType:bC.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var AN=$x;function Tue(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(Tue.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 mN=Tue;function Sue(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(Sue.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var pN=Sue;function Bue(e){this._ppeTextures=e}Object.defineProperties(Bue.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var gN=Bue;function $r(e){e=e??V.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=dt.UNLOADED,this._promise=void 0}l(Object.create)&&($r.prototype=Object.create(Yi.prototype),$r.prototype.constructor=$r);Object.defineProperties($r.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});$r.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=dt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=dt.FAILED,this.getError("Failed to load GPM data",e)}};$r.prototype.load=function(){return l(this._promise)?this._promise:(this._state=dt.LOADING,this._promise=this._loadResources(this),this._promise)};function k5e(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}$r.prototype._loadTextures=function(){let e;l(this._extension)&&(e=k5e(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 u=Di.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};$r.ppeTexturesMetadataSchemaCache=new Map;$r._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}}}};$r._obtainPpeTexturesMetadataSchema=function(e){let n=$r._collectPpeTexturePropertyIdentifiers(e).toString(),i=$r.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${$r.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=$r._createPpeTextureClassJson(c,a);r.classes[u]=f}return i=Pl.fromJson(r),$r.ppeTexturesMetadataSchemaCache.set(n,i),i};$r._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=$r._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};$r._convertToStructuralMetadata=function(e,t){let n=[],i=$r._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,f=a.traits.source,h=i.classes[c],m={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new og({id:s,name:a.name,propertyTexture:m,class:h,textures:t}))}return new xa({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};$r.prototype.process=function(e){if(this._state===dt.READY)return!0;if(this._state!==dt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let h=t[u].process(e);i=i&&h}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],h=t[u];h.isDestroyed()||(o[f]=h.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let h=f.traits,m=new pN({min:h.min,max:h.max,source:h.source}),g=new mN({traits:m,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(g)}}let a=new gN(r);this._meshPrimitiveGpmLocal=a;let c=$r._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=dt.READY,!0};$r.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Di.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};$r.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var _N=$r;function U5e(e){let n=(e.extensions??V.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let o=[];ei(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 ee.TRIANGLE_FAN:case ee.TRIANGLE_STRIP:case ee.LINE_STRIP:case ee.LINE_LOOP:break;default:return i}for(let c of r.primitives){let u=o[c];if(!l(u?.indices)||u.mode!==a.mode)return i;o[c]=void 0}o[s]=a}return o.filter(l)}var CN=U5e;var{Attribute:G5e,Indices:z5e,FeatureIdAttribute:wue,FeatureIdTexture:Due,FeatureIdImplicitRange:vue,MorphTarget:V5e,Primitive:H5e,Instances:Y5e,Skin:W5e,Node:j5e,AnimatedPropertyType:q5e,AnimationSampler:K5e,AnimationTarget:J5e,AnimationChannel:X5e,Animation:Z5e,ArticulationStage:$5e,Articulation:e9e,Asset:t9e,Scene:n9e,Components:i9e,MetallicRoughness:o9e,SpecularGlossiness:r9e,Specular:s9e,Anisotropy:s6,Clearcoat:a6,Material:a9e}=yn,tr={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Gh(e){e=e??V.EMPTY_OBJECT;let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=eo.Y,forwardAxis:a=eo.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:u=!1,enablePick:f=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:m=!0,loadForClassification:g=!1,renameBatchIdSemantic:A=!1}=e,{baseResource:_=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=_,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=u,this._enablePick=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=m,this._loadForClassification=g,this._renameBatchIdSemantic=A,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)&&(Gh.prototype=Object.create(Yi.prototype),Gh.prototype.constructor=Gh);Object.defineProperties(Gh.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 c9e(e){e._state=tr.LOADING,e._textureState=tr.LOADING;try{let t=Di.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,xV(e,t)}}async function l9e(e,t){zt.supportsWebP.initialized||await zt.supportsWebP.initialize(),e._supportedImageFormats=new lN({webp:zt.supportsWebP(),basis:t.context.supportsBasis});let n=AYe(e,t);return e._state=tr.PROCESSING,e._textureState=tr.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Di.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}Gh.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=c9e(this),this._promise)};function xV(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function u9e(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 f9e(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)&&d9e(e,o)}}function d9e(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)}Gh.prototype._process=function(e){return this._state===tr.READY?!0:(this._state===tr.PROCESSING&&u9e(this,e),this._resourcesLoaded&&this._state===tr.POST_PROCESSING&&(f9e(this,e.context),this._state=tr.PROCESSED),this._resourcesLoaded&&this._state===tr.PROCESSED?(kue(this),this._typedArray=void 0,this._state=tr.READY,!0):!1)};Gh.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};Gh.prototype.process=function(e){if(this._state===tr.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=l9e(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,xV(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,xV(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=tr.FAILED,xV(this,o)}return this._incrementallyLoadTextures?n:n&&i};function h9e(e,t,n,i,o,r,s,a,c){let u=e.gltfJson,h=u.accessors[t].bufferView;return Di.getVertexBufferLoader({gltf:u,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 A9e(e,t,n,i,o,r,s){return Di.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 m9e(e,t){let n=Di.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Pue(e,t,n){let i=t.byteOffset,o=mu(e,t),r=t.count,s=of(t.type),a=t.componentType,c=q.getSizeInBytes(a),u=c*s,f=r*s;if(o===u)return n=new Uint8Array(n),q.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let h=q.createTypedArray(a,f),m=new DataView(n.buffer),g=new Array(s),A=Xp(t.componentType);i=n.byteOffset+i;for(let _=0;_<r;++_){A(m,i,s,c,g);for(let C=0;C<s;++C)h[_*s+C]=g[C];i+=o}return h}function p9e(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 g9e(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]=Qe.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 _9e(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=Pue(r,n,t.typedArray);i=i??!1,g9e(n,s,o,i)}function eT(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=m9e(e,o),s=_9e(e,r,t,n,i);return e._loaderPromises.push(s),i}return p9e(t,i)}function rf(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function C9e(e){return e===Number?0:new e}function y9e(e){switch(e){case q.BYTE:return 127;case q.UNSIGNED_BYTE:return 255;case q.SHORT:return 32767;case q.UNSIGNED_SHORT:return 65535;default:return 1}}var E9e={VEC2:new F(-1,-1),VEC3:new d(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function I9e(e,t){let n=y9e(e.componentDatatype),i=E9e[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 b9e(e,t,n){let i=e.decodeMatrix,o=rf(n,e.decodedMin),r=rf(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new yn.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 F(i[6],i[7]),s.quantizedVolumeStepSize=new F(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new d(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new d(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function x9e(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=C9e(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=rf(s,r.min),c.max=rf(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=mu(e,r),Ii(r,"WEB3D_quantized_attributes")&&b9e(r.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===rt.POSITION||c.semantic===rt.NORMAL||c.semantic===rt.TANGENT||c.semantic===rt.TEXCOORD||c.semantic===rt.FEATURE_ID||c.semantic===rt.SCALE||c.semantic===rt.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&I9e(c,s),c}function Rue(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var T9e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function c6(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=T9e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function S9e(e){let t=e===rt.POSITION,n=e===rt.FEATURE_ID,i=e===rt.TEXCOORD;return t||n||i}function B9e(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=q.createArrayBufferView(o,t.typedArray.buffer)}}function w9e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=q.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===rt.POSITION){let o=s=>{let a=1/0,c=-1/0,u=1/0,f=-1/0,h=1/0,m=-1/0;for(let g=0;g<s.length;g+=3){let A=s[g],_=s[g+1],C=s[g+2];a=Math.min(a,A),c=Math.max(c,A),u=Math.min(u,_),f=Math.max(f,_),h=Math.min(h,C),m=Math.max(m,C)}return[new d(a,u,h),new d(c,f,m)]},r=e.typedArray;[e.min,e.max]=o(r)}}function D9e(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Pue(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Mue(e,t,n,i,o,r,s,a,c){let u=e.gltfJson,f=u.accessors[t],h=f.bufferView,m=n.gltfSemantic,g=n.renamedSemantic,A=n.modelSemantic,_=l(A)?Rue(g):void 0,y=x9e(u,t,m,A,_);if(!l(o)&&!l(h)&&!l(r))return y;let E=h9e(e,t,m,i,o,r,s,a,c),I=e._geometryLoaders.length;e._geometryLoaders.push(E);let x=E.load();return e._loaderPromises.push(x),e._geometryCallbacks[I]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[m])?B9e(y,E,s,a):l(r)?w9e(y,E,s,a):D9e(u,f,y,E,s,a)},y}function Nue(e,t,n,i,o,r,s,a,c){let u=n.modelSemantic,f=u===rt.POSITION,h=u===rt.FEATURE_ID,m=f&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,g=f&&e._enablePick&&!c.context.webgl2,A=e._loadForClassification&&h,_=e._loadAttributesAsTypedArray,C=!_,y=_||m||g||A,x=Mue(e,t,n,i,o,r,a?!1:C,a?!0:y,c),S=new bI.AttributeLoadPlan(x);return S.loadBuffer=C,S.loadTypedArray=y,S}function v9e(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=c6(e,Ps,i),u=c.modelSemantic,f=u===Ps.TRANSLATION||u===Ps.ROTATION||u===Ps.SCALE,h=u===Ps.TRANSLATION,m=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,A=!m,_=e._loadAttributesFor2D&&!o.scene3DOnly;return Mue(e,t,c,void 0,void 0,void 0,A,m||h&&(!a||_||g),o)}function P9e(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??V.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(a))return;let h=new z5e;h.count=s.count;let m=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,A=e._loadForClassification&&i,C=!m,y=m||g||A||f,x=A9e(e,t,n,u,o?!1:C,o?!0:y,r),S=e._geometryLoaders.length;e._geometryLoaders.push(x);let w=x.load();e._loaderPromises.push(w),e._geometryCallbacks[S]=()=>{h.indexDatatype=x.indexDatatype,h.buffer=x.buffer,h.typedArray=x.typedArray};let v=new bI.IndicesLoadPlan(h);return v.loadBuffer=C,v.loadTypedArray=y,v}function Ll(e,t,n,i){let o=e.gltfJson,r=pu.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Di.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=pu.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=tr.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function R9e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new r9e;return l(i)&&(c.diffuseTexture=Ll(e,i,n)),l(o)&&(c.specularGlossinessTexture=Ll(e,o,n)),c.diffuseFactor=rf(se,r),c.specularFactor=rf(d,s),c.glossinessFactor=a,c}function M9e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new o9e;return l(i)&&(c.baseColorTexture=Ll(e,i,n)),l(o)&&(c.metallicRoughnessTexture=Ll(e,o,n)),c.baseColorFactor=rf(se,r),c.metallicFactor=s,c.roughnessFactor=a,c}function N9e(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new s9e;return l(o)&&(a.specularTexture=Ll(e,o,n)),l(s)&&(a.specularColorTexture=Ll(e,s,n)),a.specularFactor=i,a.specularColorFactor=rf(d,r),a}function L9e(e,t,n){let{anisotropyStrength:i=s6.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=s6.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new s6;return l(r)&&(s.anisotropyTexture=Ll(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function O9e(e,t,n){let{clearcoatFactor:i=a6.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=a6.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new a6;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 F9e(e,t,n){let i=new a9e,o=t.extensions??V.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=R9e(e,r,n):(l(u)&&(i.metallicRoughness=M9e(e,u,n)),l(s)&&!i.unlit&&(i.specular=N9e(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=L9e(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=O9e(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=rf(d,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Lue(e,t){let n=new wue;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 Oue(e,t,n,i){let o=new wue,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Rue(r.attribute),o.positionalLabel=i,o}function Fue(e,t){let n=new vue;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 Que(e,t,n,i){let o=new vue,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 Q9e(e,t,n,i){let o=new Due;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,Jt.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function k9e(e,t,n,i,o,r){let s=new Due,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=Ll(e,c,i,Jt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function U9e(e,t,n,i,o){let r=new V5e,s=void 0,a=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let h=t[f],m=c6(e,rt,f),g=Nue(e,h,m,s,a,c,u,n,o);r.attributes.push(g.attribute),i.attributePlans.push(g)}return r}function G9e(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function z9e(e,t,n,i){let o=new H5e,r=new bI(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=F9e(e,e.gltfJson.materials[s],i));let a=t.extensions??V.EMPTY_OBJECT,c=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(u)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=V9e(e,u,r));let f=a.EXT_mesh_primitive_edge_visibility;if(l(f)){let P=e.gltfJson.accessors[f.visibility];if(!l(P))throw new ue("Edge visibility accessor not found!");let N=eT(e,P);if(o.edgeVisibility={visibility:N,material:f.material},l(f.silhouetteNormals)){let L=e.gltfJson.accessors[f.silhouetteNormals];if(l(L)){let p=eT(e,L);o.edgeVisibility.silhouetteNormals=p}}l(f.lineStrings)&&(r.edgeVisibility.lineStrings=f.lineStrings)}let m=G9e(a);l(m)&&(c=!0,r.needsGaussianSplats=!0);let g=e._loadForClassification,A=a.KHR_draco_mesh_compression,_=!1,C=t.attributes;if(l(C))for(let P in C){if(!C.hasOwnProperty(P))continue;let N=C[P],L=c6(e,rt,P),p=L.modelSemantic;if(g&&!S9e(p))continue;p===rt.FEATURE_ID&&(_=!0);let b=Nue(e,N,L,t,A,m,n,c,i);r.attributePlans.push(b),o.attributes.push(b.attribute)}let y=t.targets;if(l(y)&&!g)for(let P=0;P<y.length;++P)o.morphTargets.push(U9e(e,y[P],c,r,i));let E=t.indices;if(l(E)){let P=P9e(e,E,t,_,c,i);l(P)&&(r.indicesPlan=P,o.indices=P.indices)}let I=a.EXT_structural_metadata,x=a.EXT_mesh_features,S=a.EXT_feature_metadata,w=l(S);l(x)?H9e(e,o,x,i):w&&Y9e(e,o,S,i),l(I)?W9e(o,I):w&&j9e(e,o,S);let v=t.mode;if(g&&v!==Pe.TRIANGLES)throw new ue("Only triangle meshes can be used for classification.");return o.primitiveType=v,o}function V9e(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return eT(e,i,!1)}function H9e(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=Q9e(e,s,i,a):l(s.attribute)?c=Lue(s,a):c=Fue(s,a),t.featureIds.push(c)}}function Y9e(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 u=s[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),m=o[f].count,g=`featureId_${r}`;r++;let A;l(u.featureIds.attribute)?A=Oue(u,h,m,g):A=Que(u,h,m,g),t.featureIds.push(A)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),m=o[f].count,g=`featureId_${r}`;r++;let A=k9e(e,u,h,i,m,g);t.featureIds.push(A)}}function W9e(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function j9e(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function q9e(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new Y5e,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(v9e(e,f,r,u,n))}let s=i.extensions??V.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?K9e(o,a):l(c)&&J9e(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function K9e(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=Lue(o,r):s=Fue(o,r),e.featureIds.push(s)}}function J9e(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,u=i.indexOf(c),f=o[c].count,h=`instanceFeatureId_${s}`,m;l(a.featureIds.attribute)?m=Oue(a,u,f,h):m=Que(a,u,f,h),t.featureIds.push(m)}}function X9e(e,t,n){let i=new j5e;i.name=t.name,i.matrix=rf(M,t.matrix),i.translation=rf(d,t.translation),i.rotation=rf(Qe,t.rotation),i.scale=rf(d,t.scale);let o=t.extensions??V.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new ue("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=q9e(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],u=CN(c);for(let m=0;m<u.length;++m)i.primitives.push(z9e(e,u[m],l(i.instances),n));let f=t.weights??c.weights,h=i.primitives[0].morphTargets;i.morphWeights=l(f)?f.slice():new Array(h.length).fill(0)}return i}function Z9e(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=X9e(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 $9e(e,t,n){let i=new W5e,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=eT(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(M.IDENTITY);return i}function eYe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=$9e(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 tYe(e,t,n,i){let o=new cN({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 nYe(e,t,n,i){let o=new _N({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 iYe(e,t){let n=new K5e,i=e.gltfJson.accessors,o=i[t.input];n.input=eT(e,o);let r=t.interpolation;n.interpolation=Uh[r]??Uh.LINEAR;let s=i[t.output];return n.output=eT(e,s,!0),n}function oYe(e,t){let n=new J5e,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=q5e[o],n}function rYe(e,t,n){let i=new X5e,o=e.sampler;return i.sampler=t[o],i.target=oYe(e.target,n),i}function sYe(e,t,n){let i=new Z5e;i.name=t.name;let o=t.samplers.map(function(s,a){let c=iYe(e,s);return c.index=a,c}),r=t.channels.map(function(s){return rYe(s,o,n)});return i.samplers=o,i.channels=r,i}function aYe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=sYe(e,o,t);return s.index=r,s})}function cYe(e){let t=new $5e;t.name=e.name;let n=e.type.toUpperCase();return t.type=Wc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function lYe(e){let t=new e9e;return t.name=e.name,t.stages=e.stages.map(cYe),t}function uYe(e){let n=(e.extensions??V.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(lYe):[]}function fYe(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 dYe(e,t){let n=new n9e,i=fYe(e);return n.nodes=i.map(function(o){return t[o]}),n}var hYe=new d;function AYe(e,t){let n=e.gltfJson,i=n.extensions??V.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let E=r.featureTables,I=r.featureTextures,x=l(E)?E:[],S=l(I)?I:[];e._sortedPropertyTableIds=Object.keys(x).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let a=Z9e(e,t),c=eYe(e,a),u=aYe(e,a),f=uYe(n),h=dYe(n,a),m=new i9e,g=new t9e,A=n.asset.copyright;if(l(A)){let E=A.split(";").map(function(I){return new pt(I.trim())});g.credits=E}if(m.asset=g,m.scene=h,m.nodes=a,m.skins=c,m.animations=u,m.articulations=f,m.upAxis=e._upAxis,m.forwardAxis=e._forwardAxis,l(s)){let E=d.fromArray(s.center,0,hYe);m.transform=M.fromTranslation(E,m.transform)}if(e._components=m,l(o)||l(r)){let E=tYe(e,o,r,t);e._loaderPromises.push(E)}let _=i.NGA_gpm_local;if(l(_)){let E=AN.load(_);e._components.extensions.NGA_gpm_local=E}let C=n.meshes;if(l(C))for(let E of C){let I=E.primitives;if(l(I))for(let x of I){let S=x.extensions;if(l(S)){let w=S.NGA_gpm_local;if(l(w)){let v=nYe(e,n,w,t);e._loaderPromises.push(v)}}}}let y=[];return ei(y,e._loaderPromises),e._incrementallyLoadTextures||ei(y,e._texturesPromises),Promise.all(y)}function mYe(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._textureLoaders.length=0}function kue(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._bufferViewLoaders.length=0}function pYe(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._geometryLoaders.length=0}function gYe(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 _Ye(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function CYe(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}Gh.prototype.isUnloaded=function(){return this._state===tr.UNLOADED};Gh.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Di.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,mYe(this),kue(this),pYe(this),gYe(this),_Ye(this),CYe(this),this._components=void 0,this._typedArray=void 0,this._state=tr.UNLOADED};var sf=Gh;var yN=`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 tT(){this._framebuffer=new Ci({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(tT.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 yYe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var l6=new F;function EYe(e,t){let n=new We({defines:["LOG_DEPTH_WRITE"],sources:[yN]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return l6.x=e._radius,l6.y=e._strength,l6}},o=ze.fromCache({blending:dn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:we.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ai({framebuffer:e.framebuffer,color:new G(0,0,0,0),depth:1,renderState:ze.fromCache(),pass:we.CESIUM_3D_TILE,owner:e})}function IYe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),EYe(e,t)}function Uue(e){return e.drawBuffers&&e.fragmentDepth}tT.isSupported=Uue;function bYe(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=We.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}tT.prototype.update=function(e,t,n,i){if(!Uue(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,IYe(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Pe.POINTS||u.pass===we.TRANSLUCENT)continue;let f,h,m=u.derivedCommands.pointCloudProcessor;l(m)&&(f=m.command,h=m.originalShaderProgram),(!l(f)||u.dirty||h!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=et.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=bYe(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(m)||(m={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=m),m.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};tT.prototype.isDestroyed=function(){return!1};tT.prototype.destroy=function(){return yYe(this),de(this)};var rg=tT;function Gue(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}Gue.isSupported=function(e){return rg.isSupported(e.context)};var fm=Gue;var Ic={},xYe=new se(0,0,0,1),qc=new se,TYe=new Xe,u6=new F,f6=new F;Ic.worldToWindowCoordinates=function(e,t,n){return Ic.worldWithEyeOffsetToWindowCoordinates(e,t,d.ZERO,n)};var zue=new se,Vue=new d;function EN(e,t,n,i){let o=n.viewMatrix,r=M.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,zue),zue),s=d.multiplyComponents(t,d.normalize(r,Vue),Vue);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,M.multiplyByVector(n.frustum.projectionMatrix,r,i)}var SYe=new he(Math.PI,D.PI_OVER_TWO),BYe=new d,wYe=new d;Ic.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Ic.computeActualEllipsoidPosition(o,t,xYe);if(!l(r))return;let s=e.canvas,a=TYe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(o.mode===oe.SCENE2D){let f=e.mapProjection,h=SYe,m=f.project(h,BYe),g=d.clone(c.position,wYe),A=c.frustum.clone(),_=M.computeViewportTransformation(a,0,1,new M),C=c.frustum.projectionMatrix,y=c.positionWC.y,E=d.fromElements(D.sign(y)*m.x-y,0,-c.positionWC.x),I=It.pointToGLWindowCoordinates(C,_,E);if(y===0||I.x<=0||I.x>=s.clientWidth)u=!0;else{if(I.x>s.clientWidth*.5){a.width=I.x,c.frustum.right=m.x-y,qc=EN(r,n,c,qc),Ic.clipToGLWindowCoordinates(a,qc,u6),a.x+=I.x,c.position.x=-c.position.x;let x=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-x,qc=EN(r,n,c,qc),Ic.clipToGLWindowCoordinates(a,qc,f6)}else{a.x+=I.x,a.width-=I.x,c.frustum.left=-m.x-y,qc=EN(r,n,c,qc),Ic.clipToGLWindowCoordinates(a,qc,u6),a.x=a.x-a.width,c.position.x=-c.position.x;let x=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-x,qc=EN(r,n,c,qc),Ic.clipToGLWindowCoordinates(a,qc,f6)}d.clone(g,c.position),c.frustum=A.clone(),i=F.clone(u6,i),(i.x<0||i.x>s.clientWidth)&&(i.x=f6.x)}}if(o.mode!==oe.SCENE2D||u){if(qc=EN(r,n,c,qc),qc.z<0&&!(c.frustum instanceof fn)&&!(c.frustum instanceof rs))return;i=Ic.clipToGLWindowCoordinates(a,qc,i)}return i.y=s.clientHeight-i.y,i};Ic.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Ic.worldToWindowCoordinates(e,t,n),!!l(n))return Ic.transformWindowToDrawingBuffer(e,n,n)};var sg=new d,DYe=new he;Ic.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return d.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,DYe);if(!l(r))return;if(o.project(r,sg),i===oe.COLUMBUS_VIEW)return d.fromElements(sg.z,sg.x,sg.y,n);if(i===oe.SCENE2D)return d.fromElements(0,sg.x,sg.y,n);let s=e.morphTime;return d.fromElements(D.lerp(sg.z,t.x,s),D.lerp(sg.x,t.y,s),D.lerp(sg.y,t.z,s),n)};var Hue=new d,Yue=new d,Wue=new M;Ic.clipToGLWindowCoordinates=function(e,t,n){return d.divideByScalar(t,t.w,Hue),M.computeViewportTransformation(e,0,1,Wue),M.multiplyByPoint(Wue,Hue,Yue),F.fromCartesian3(Yue,n)};Ic.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return F.fromElements(t.x*o,t.y*r,n)};var vYe=new se,jue=new se;Ic.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,A=Math.pow(2,g)-1;n=c*(1-a/(A+a))/(c-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,vYe);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let h,m=e.camera.frustum;if(l(m.fovy)){h=M.multiplyByVector(r.inverseViewProjection,f,jue);let g=1/h.w;d.multiplyByScalar(h,g,h)}else{let g=m.offCenterFrustum;l(g)&&(m=g),h=jue,h.x=(f.x*(m.right-m.left)+m.left+m.right)*.5,h.y=(f.y*(m.top-m.bottom)+m.bottom+m.top)*.5,h.z=(f.z*(a-c)-a-c)*.5,h.w=1,h=M.multiplyByVector(r.inverseView,h,h)}return d.fromCartesian4(h,i)};var to=Ic;var nT={};nT._deprecationWarning=Ea;var ag=Uint32Array.BYTES_PER_ELEMENT;nT.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=ag;let r=o.getUint32(t,!0);if(r!==1)throw new ue(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=ag;let s=o.getUint32(t,!0);t+=ag;let a=o.getUint32(t,!0);t+=ag;let c=o.getUint32(t,!0);t+=ag;let u=o.getUint32(t,!0);t+=ag;let f=o.getUint32(t,!0);t+=ag;let h;u>=570425344?(t-=ag*2,h=a,u=c,f=0,a=0,c=0,nT._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.")):f>=570425344&&(t-=ag,h=u,u=a,f=c,a=0,c=0,nT._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 m;a===0?m={BATCH_LENGTH:h??0}:(m=Ir(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let A,_;u>0&&(A=Ir(i,t,u),t+=u,f>0&&(_=new Uint8Array(e,t,f),_=new Uint8Array(_),t+=f));let C=n+s-t;if(C===0)throw new ue("glTF byte length must be greater than 0.");let y;return t%4===0?y=new Uint8Array(e,t,C):(nT._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),y=new Uint8Array(i.subarray(t,t+C))),{batchLength:h,featureTableJson:m,featureTableBinary:g,batchTableJson:A,batchTableBinary:_,gltf:y}};var IN=nT;function bN(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function que(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function PYe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=q.createTypedArray(n,i),o[t]=r),r}bN.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??q.UNSIGNED_INT,n=n??1,que(this,e,t,n,1,i.byteOffset)):i};bN.prototype.hasProperty=function(e){return l(this.json[e])};bN.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=q.fromName(i.componentType)),que(this,e,t,n,this.featuresLength,i.byteOffset)):PYe(this,e,t,i)};bN.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 zh=bN;function xN(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput,s=RYe(n),a;l(s.jsonProperties)&&(a=new ig({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new tI({extension:s.hierarchy,binaryBody:i}));let u=Fh.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,h,m,g;if(o){let C=NYe(t,u,f,i,r);g=C.transcodedSchema,m=[new EI({propertyAttribute:C.propertyAttributeJson,class:C.transcodedClass})]}else{let C=MYe(t,u,f,i);g=C.transcodedSchema;let y=C.featureTableJson;h=new dd({count:y.count,properties:y.properties,class:C.transcodedClass,bufferViews:C.bufferViewsTypedArrays}),m=[]}let A=[];if(l(h)||l(a)||l(c)){let C=new Nl({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:a,batchTableHierarchy:c});A.push(C)}let _={schema:g,propertyTables:A,propertyAttributes:m,extensions:s.extensions,extras:s.extras};return new xa(_)}function RYe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(xN._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 MYe(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 ue(`Property ${h} requires a batch table binary.`);let m=n[h],g=ld(m);r[h]={bufferView:a},o[h]=Kue(m),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+m.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let u=Pl.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function NYe(e,t,n,i,o){let r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;let m=n[h];if(!l(i)&&!l(m.typedArray))throw new ue(`Property ${h} requires a batch table binary.`);let g=Lt.sanitizeGlslIdentifier(h);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let A=Kue(m);A.name=h,r[g]=A;let _=g.toUpperCase();_.startsWith("_")||(_=`_${_}`);let C=m.typedArray;l(C)||(C=ld(m).createArrayBufferView(i.buffer,i.byteOffset+m.byteOffset,e));let y=new yn.Attribute;y.name=_,y.count=e,y.type=m.type;let E=q.fromTypedArray(C);(E===q.INT||E===q.UNSIGNED_INT||E===q.DOUBLE)&&(xN._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${_}" 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)),y.componentDatatype=q.fromTypedArray(C),y.typedArray=C,o.push(y),s[g]={attribute:_}}let c={classes:{}};c.classes[t]={properties:r};let u=Pl.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function Kue(e){let t=LYe(e.componentType);return{type:e.type,componentType:t}}function LYe(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"}}xN._deprecationWarning=Ea;xN._oneTimeWarning=At;var cg=xN;var xI={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},OYe=yn.FeatureIdAttribute;function xC(e){e=e??V.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??eo.Y,u=e.forwardAxis??eo.X,f=e.loadAttributesAsTypedArray??!1,h=e.loadAttributesFor2D??!1,m=e.enablePick??!1,g=e.loadIndicesForWireframe??!1,A=e.loadPrimitiveOutline??!0,_=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=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=h,this._enablePick=m,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=A,this._loadForClassification=_,this._state=xI.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=M.IDENTITY}l(Object.create)&&(xC.prototype=Object.create(Yi.prototype),xC.prototype.constructor=xC);Object.defineProperties(xC.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});xC.prototype.load=function(){if(l(this._promise))return this._promise;let e=IN.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new zh(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",q.FLOAT,3);l(a)&&(this._transform=M.fromTranslation(d.fromArray(a))),this._batchTable={json:o,binary:r};let c=new sf({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=xI.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=xI.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return FYe(u,f)}),this._promise};function FYe(e,t){return e.unload(),e._state=xI.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}xC.prototype.process=function(e){if(this._state===xI.READY)return!0;if(this._state!==xI.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=M.multiplyTransformation(this._transform,n.transform,n.transform),QYe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=xI.READY,!0};function QYe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=cg({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Nl({name:Fh.BATCH_TABLE_CLASS_NAME,count:i});o=new xa({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)Jue(r[a]);t.structuralMetadata=o}function Jue(e){let t=e.children.length;for(let i=0;i<t;i++)Jue(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Lt.getAttributeBySemantic(o,rt.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new OYe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}xC.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var TN=xC;function TC(e){e=e??V.EMPTY_OBJECT,this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(TC.prototype=Object.create(Yi.prototype),TC.prototype.constructor=TC);Object.defineProperties(TC.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});TC.prototype.load=function(){return Promise.resolve(this)};TC.prototype.process=function(e){return l(this._components)||(this._components=XYe(this._geoJson,e),this._geoJson=void 0),!0};function kYe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function UYe(){this.features=[]}function d6(e){let t=e[0],n=e[1],i=e[2]??0;return new d(t,n,i)}function h6(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=d6(e[o]);return[n]}function GYe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=h6(e[i])[0];return n}function Xue(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=h6(e[i])[0];return n}function zYe(e){let t=e.length,n=[];for(let i=0;i<t;i++){let o=Xue(e[i]);ei(n,o)}return n}function VYe(e){return[d6(e)]}function HYe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=d6(e[i]);return n}var YYe={LineString:h6,MultiLineString:GYe,MultiPolygon:zYe,Polygon:Xue,MultiPoint:HYe,Point:VYe},WYe={LineString:Pe.LINES,MultiLineString:Pe.LINES,MultiPolygon:Pe.LINES,Polygon:Pe.LINES,MultiPoint:Pe.POINTS,Point:Pe.POINTS};function Zue(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=YYe[n],o=WYe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new kYe;o===Pe.LINES?s.lines=i(r):o===Pe.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function jYe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Zue(n[o],t)}var qYe={FeatureCollection:jYe,Feature:Zue},TV=new d;function KYe(e,t,n){let i=0,o=0,r=e.length;for(let N=0;N<r;N++){let L=e[N];if(l(L.lines)){let p=L.lines.length;for(let b=0;b<p;b++){let T=L.lines[b];i+=T.length,o+=(T.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Fe.createTypedArray(i,o),u=Fe.fromTypedArray(c),f=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=0,g=0;for(let N=0;N<r;N++){let L=e[N];if(!l(L.lines))continue;let p=L.lines.length;for(let b=0;b<p;b++){let T=L.lines[b],B=T.length;for(let R=0;R<B;R++){let O=T[R],U=d.fromDegrees(O.x,O.y,O.z,te.WGS84,TV),k=M.multiplyByPoint(t,U,TV);d.minimumByComponent(f,k,f),d.maximumByComponent(h,k,h),d.pack(k,s,m*3),a[m]=N,R<B-1&&(c[g*2]=m,c[g*2+1]=m+1,g++),m++}}}let A=ut.createVertexBuffer({typedArray:s,context:n.context,usage:Oe.STATIC_DRAW});A.vertexArrayDestroyable=!1;let _=ut.createVertexBuffer({typedArray:a,context:n.context,usage:Oe.STATIC_DRAW});_.vertexArrayDestroyable=!1;let C=ut.createIndexBuffer({typedArray:c,context:n.context,usage:Oe.STATIC_DRAW,indexDatatype:u});C.vertexArrayDestroyable=!1;let y=new yn.Attribute;y.semantic=rt.POSITION,y.componentDatatype=q.FLOAT,y.type=Ut.VEC3,y.count=i,y.min=f,y.max=h,y.buffer=A;let E=new yn.Attribute;E.semantic=rt.FEATURE_ID,E.setIndex=0,E.componentDatatype=q.FLOAT,E.type=Ut.SCALAR,E.count=i,E.buffer=_;let I=[y,E],x=new yn.Material;x.unlit=!0;let S=new yn.Indices;S.indexDatatype=u,S.count=c.length,S.buffer=C;let w=new yn.FeatureIdAttribute;w.featureCount=r,w.propertyTableId=0,w.setIndex=0,w.positionalLabel="featureId_0";let v=[w],P=new yn.Primitive;return P.attributes=I,P.indices=S,P.featureIds=v,P.primitiveType=Pe.LINES,P.material=x,P}function JYe(e,t,n){let i=0,o=e.length;for(let I=0;I<o;I++){let x=e[I];l(x.points)&&(i+=x.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let I=0;I<o;I++){let x=e[I];if(!l(x.points))continue;let S=x.points.length;for(let w=0;w<S;w++){let v=x.points[w],P=d.fromDegrees(v.x,v.y,v.z,te.WGS84,TV),N=M.multiplyByPoint(t,P,TV);d.minimumByComponent(a,N,a),d.maximumByComponent(c,N,c),d.pack(N,r,u*3),s[u]=I,u++}}let f=ut.createVertexBuffer({typedArray:r,context:n.context,usage:Oe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let h=ut.createVertexBuffer({typedArray:s,context:n.context,usage:Oe.STATIC_DRAW});h.vertexArrayDestroyable=!1;let m=new yn.Attribute;m.semantic=rt.POSITION,m.componentDatatype=q.FLOAT,m.type=Ut.VEC3,m.count=i,m.min=a,m.max=c,m.buffer=f;let g=new yn.Attribute;g.semantic=rt.FEATURE_ID,g.setIndex=0,g.componentDatatype=q.FLOAT,g.type=Ut.SCALAR,g.count=i,g.buffer=h;let A=[m,g],_=new yn.Material;_.unlit=!0;let C=new yn.FeatureIdAttribute;C.featureCount=o,C.propertyTableId=0,C.setIndex=0,C.positionalLabel="featureId_0";let y=[C],E=new yn.Primitive;return E.attributes=A,E.featureIds=y,E.primitiveType=Pe.POINTS,E.material=_,E}function XYe(e,t){let n=new UYe,i=qYe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new ue("GeoJSON must have at least one feature");let s={};for(let N=0;N<r;N++){let p=o[N].properties??V.EMPTY_OBJECT;for(let b in p)p.hasOwnProperty(b)&&(l(s[b])||(s[b]=new Array(r)))}for(let N=0;N<r;N++){let L=o[N];for(let p in s)if(s.hasOwnProperty(p)){let b=L.properties[p]??"";s[p][N]=b}}let a=new ig({count:r,properties:s}),u=[new Nl({id:0,count:r,jsonMetadataTable:a})],f=Pl.fromJson({}),h=new xa({schema:f,propertyTables:u}),m=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),A=!1,_=!1;for(let N=0;N<r;N++){let L=o[N];if(l(L.lines)){A=!0;let p=L.lines.length;for(let b=0;b<p;b++){let T=L.lines[b],B=T.length;for(let R=0;R<B;R++)d.minimumByComponent(m,T[R],m),d.maximumByComponent(g,T[R],g)}}if(l(L.points)){_=!0;let p=L.points.length;for(let b=0;b<p;b++){let T=L.points[b];d.minimumByComponent(m,T,m),d.maximumByComponent(g,T,g)}}}let C=d.midpoint(m,g,new d),y=d.fromDegrees(C.x,C.y,C.z,te.WGS84,new d),E=It.eastNorthUpToFixedFrame(y,te.WGS84,new M),I=M.inverseTransformation(E,new M),x=[];A&&x.push(KYe(o,I,t)),_&&x.push(JYe(o,I,t));let S=new yn.Node;S.index=0,S.primitives=x;let w=[S],v=new yn.Scene;v.nodes=w;let P=new yn.Components;return P.scene=v,P.nodes=w,P.transform=E,P.structuralMetadata=h,P}TC.prototype.unload=function(){this._components=void 0};var SN=TC;var SV={};SV._deprecationWarning=Ea;var SC=Uint32Array.BYTES_PER_ELEMENT;SV.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=SC;let r=o.getUint32(t,!0);if(r!==1)throw new ue(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=SC;let s=o.getUint32(t,!0);t+=SC;let a=o.getUint32(t,!0);if(a===0)throw new ue("featureTableJsonByteLength is zero, the feature table must be defined.");t+=SC;let c=o.getUint32(t,!0);t+=SC;let u=o.getUint32(t,!0);t+=SC;let f=o.getUint32(t,!0);t+=SC;let h=o.getUint32(t,!0);if(h!==1&&h!==0)throw new ue(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${h} is not.`);t+=SC;let m=Ir(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let A,_;u>0&&(A=Ir(i,t,u),t+=u,f>0&&(_=new Uint8Array(e,t,f),_=new Uint8Array(_),t+=f));let C=n+s-t;if(C===0)throw new ue("glTF byte length must be greater than 0.");let y;return t%4===0?y=new Uint8Array(e,t,C):(SV._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),y=new Uint8Array(i.subarray(t,t+C))),{gltfFormat:h,featureTableJson:m,featureTableBinary:g,batchTableJson:A,batchTableBinary:_,gltf:y}};var BN=SV;var lg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},BV=yn.Attribute,ZYe=yn.FeatureIdAttribute,efe=yn.Instances;function ug(e){e=e??V.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??eo.Y,u=e.forwardAxis??eo.X,f=e.loadAttributesAsTypedArray??!1,h=e.loadIndicesForWireframe??!1,m=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=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=m,this._enablePick=g,this._state=lg.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(ug.prototype=Object.create(Yi.prototype),ug.prototype.constructor=ug);Object.defineProperties(ug.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});ug.prototype.load=function(){if(l(this._promise))return this._promise;let e=BN.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new zh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new ue("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",q.FLOAT,3);l(c)&&(this._transform=M.fromTranslation(d.fromArray(c))),this._batchTable={json:i,binary:o};let u={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=du(e.gltf);h=h.replace(/[\s\0]+$/,"");let m=this._baseResource.getDerivedResource({url:h});u.gltfResource=m,u.baseResource=m}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new sf(u);return this._gltfLoader=f,this._state=lg.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=lg.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw $Ye(this,h)}),this._promise};function $Ye(e,t){return e.unload(),e._state=lg.FAILED,e.getError("Failed to load i3dm",t)}ug.prototype.process=function(e){if(this._state===lg.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===lg.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),nWe(this,i,e),eWe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=lg.READY,!0};function eWe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=cg({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Nl({name:Fh.BATCH_TABLE_CLASS_NAME,count:i});o=new xa({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var wV=new d,A6=new Array(4),tWe=new M;function nWe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",q.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=oWe(o,r),h;c&&(h=new Float32Array(4*r));let m;u&&(m=new Float32Array(3*r));let g=new Float32Array(r),A=d.unpackArray(f),_=new d,C=new d,y=new d,E=new d,I=new X,x=new Qe,S=new Array(4),w=new d,v=new Array(3),P=new M;if(!l(s)||d.equals(d.unpack(s),d.ZERO)){let k=le.fromPoints(A);for(i=0;i<A.length;i++)d.subtract(A[i],k.center,wV),f[3*i+0]=wV.x,f[3*i+1]=wV.y,f[3*i+2]=wV.z;let z=M.fromTranslation(k.center,tWe);t.transform=M.multiplyTransformation(z,t.transform,t.transform)}for(i=0;i<r;i++){_=d.clone(A[i]),l(s)&&d.add(_,d.unpack(s),_),c&&(rWe(o,a,i,x,_,y,C,E,I,P),Qe.pack(x,S,0),h[4*i+0]=S[0],h[4*i+1]=S[1],h[4*i+2]=S[2],h[4*i+3]=S[3]),u&&(sWe(o,i,w),d.pack(w,v,0),m[3*i+0]=v[0],m[3*i+1]=v[1],m[3*i+2]=v[2]);let k=o.getProperty("BATCH_ID",q.UNSIGNED_SHORT,1,i);l(k)||(k=i),g[i]=k}let N=new efe;N.transformInWorldSpace=!0;let L=e._buffers,p=new BV;if(p.name="Instance Translation",p.semantic=Ps.TRANSLATION,p.componentDatatype=q.FLOAT,p.type=Ut.VEC3,p.count=r,p.typedArray=f,!c){let k=ut.createVertexBuffer({context:n.context,typedArray:f,usage:Oe.STATIC_DRAW});k.vertexArrayDestroyable=!1,L.push(k),p.buffer=k}if(N.attributes.push(p),c){let k=new BV;k.name="Instance Rotation",k.semantic=Ps.ROTATION,k.componentDatatype=q.FLOAT,k.type=Ut.VEC4,k.count=r,k.typedArray=h,N.attributes.push(k)}if(u){let k=new BV;if(k.name="Instance Scale",k.semantic=Ps.SCALE,k.componentDatatype=q.FLOAT,k.type=Ut.VEC3,k.count=r,c)k.typedArray=m;else{let z=ut.createVertexBuffer({context:n.context,typedArray:m,usage:Oe.STATIC_DRAW});z.vertexArrayDestroyable=!1,L.push(z),k.buffer=z}N.attributes.push(k)}let b=new BV;b.name="Instance Feature ID",b.setIndex=0,b.semantic=Ps.FEATURE_ID,b.componentDatatype=q.FLOAT,b.type=Ut.SCALAR,b.count=r;let T=ut.createVertexBuffer({context:n.context,typedArray:g,usage:Oe.STATIC_DRAW});T.vertexArrayDestroyable=!1,L.push(T),b.buffer=T,N.attributes.push(b);let B=new ZYe;B.propertyTableId=0,B.setIndex=0,B.positionalLabel="instanceFeatureId_0",N.featureIds.push(B);let R=t.nodes,O=R.length,U=!1;for(i=0;i<O;i++){let k=R[i];k.primitives.length>0&&(k.instances=U?iWe(N):N,U=!0)}}function iWe(e){let t=new efe;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ve(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function oWe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",q.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",q.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",q.FLOAT,3);if(!l(i))throw new ue("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",q.FLOAT,3);if(!l(o))throw new ue("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 ue("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var $ue=new Array(4);function rWe(e,t,n,i,o,r,s,a,c,u){let f=e.getProperty("NORMAL_UP",q.FLOAT,3,n,A6),h=e.getProperty("NORMAL_RIGHT",q.FLOAT,3,n,$ue),m=!1;if(l(f)){if(!l(h))throw new ue("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");d.unpack(f,0,r),d.unpack(h,0,s),m=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",q.UNSIGNED_SHORT,2,n,A6),A=e.getProperty("NORMAL_RIGHT_OCT32P",q.UNSIGNED_SHORT,2,n,$ue);if(l(g)){if(!l(A))throw new ue("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");bn.octDecodeInRange(g[0],g[1],65535,r),bn.octDecodeInRange(A[0],A[1],65535,s),m=!0}else t?(It.eastNorthUpToFixedFrame(o,te.WGS84,u),M.getMatrix3(u,c)):X.clone(X.IDENTITY,c)}m&&(d.cross(s,r,a),d.normalize(a,a),X.setColumn(c,0,s,c),X.setColumn(c,1,r,c),X.setColumn(c,2,a,c)),Qe.fromRotationMatrix(c,i)}function sWe(e,t,n){n=d.fromElements(1,1,1,n);let i=e.getProperty("SCALE",q.FLOAT,1,t);l(i)&&d.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",q.FLOAT,3,t,A6);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function aWe(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}ug.prototype.isUnloaded=function(){return this._state===lg.UNLOADED};ug.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),aWe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=lg.UNLOADED};var wN=ug;var cWe={STOPPED:0,ANIMATING:1},Vh=Object.freeze(cWe);function iT(){this.times=void 0,this.points=void 0,Ae.throwInstantiationError()}iT.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof d)return d;if(e instanceof Qe)return Qe};iT.prototype.evaluate=Ae.throwInstantiationError;iT.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};iT.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};iT.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var Io=iT;function oT(e){this._value=e,this._valueType=Io.getPointType(e)}Object.defineProperties(oT.prototype,{value:{get:function(){return this._value}}});oT.prototype.findTimeInterval=function(e){};oT.prototype.wrapTime=function(e){return 0};oT.prototype.clampTime=function(e){return 0};oT.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var DN=oT;function rT(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Io.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(rT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});rT.prototype.findTimeInterval=Io.prototype.findTimeInterval;rT.prototype.wrapTime=Io.prototype.wrapTime;rT.prototype.clampTime=Io.prototype.clampTime;rT.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 d),d.lerp(n[o],n[o+1],r,t))};var BC=rT;var tfe={};tfe.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 d,s[a]=new d;o[0]=n[0]/t[0],r[0]=d.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]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=d.subtract(r[a],d.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var sT=tfe;var nfe=[],ife=[],ofe=[],rfe=[];function lWe(e,t,n){let i=nfe,o=ofe,r=ife,s=rfe;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 d),d.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 d),d.subtract(e[a+1],e[a-1],c),d.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new d),d.subtract(e[a+1],e[a-1],c),d.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new d),d.clone(n,c),sT.solve(i,r,o,s)}function uWe(e){let t=nfe,n=ofe,i=ife,o=rfe;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 d),d.subtract(e[1],e[0],s),d.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 d),d.subtract(e[r+1],e[r-1],s),d.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new d),d.subtract(e[r],e[r-1],s),d.multiplyByScalar(s,3,s),sT.solve(t,i,n,o)}function _u(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=Io.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(_u.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}}});_u.createC1=function(e){e=e??V.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 _u({times:t,points:n,inTangents:r,outTangents:o})};_u.createNaturalCubic=function(e){e=e??V.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new BC({points:n,times:t});let i=uWe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new _u({times:t,points:n,inTangents:r,outTangents:o})};_u.createClampedCubic=function(e){e=e??V.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=Io.getPointType(n[0]);if(n.length<3)return new BC({points:n,times:t});let s=lWe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new _u({times:t,points:n,inTangents:c,outTangents:a})};_u.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);_u.prototype.findTimeInterval=Io.prototype.findTimeInterval;var fWe=new se,aT=new d;_u.prototype.wrapTime=Io.prototype.wrapTime;_u.prototype.clampTime=Io.prototype.clampTime;_u.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,u=fWe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=M.multiplyByVector(_u.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let h=this._pointType;return h===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(l(t)||(t=new h),t=h.multiplyByScalar(n[s],f.x,t),h.multiplyByScalar(n[s+1],f.y,aT),h.add(t,aT,t),h.multiplyByScalar(r[s],f.z,aT),h.add(t,aT,t),h.multiplyByScalar(o[s],f.w,aT),h.add(t,aT,t))};var wC=_u;function cT(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Io.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(cT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});cT.prototype.findTimeInterval=Io.prototype.findTimeInterval;cT.prototype.wrapTime=Io.prototype.wrapTime;cT.prototype.clampTime=Io.prototype.clampTime;cT.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 vN=cT;function dWe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Qe);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 Qe.fastSlerp(a,c,s,o)}}function lT(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=dWe(this),this._lastTimeIndex=0}Object.defineProperties(lT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});lT.prototype.findTimeInterval=Io.prototype.findTimeInterval;lT.prototype.wrapTime=Io.prototype.wrapTime;lT.prototype.clampTime=Io.prototype.clampTime;lT.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var PN=lT;var uT=yn.AnimatedPropertyType;function m6(e){e=e??V.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,gWe(this)}Object.defineProperties(m6.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 hWe(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 wC({times:e,points:n,inTangents:i,outTangents:o})}function sfe(e,t,n,i){if(e.length===1&&t.length===1)return new DN(t[0]);switch(n){case Uh.STEP:return new vN({times:e,points:t});case Uh.CUBICSPLINE:return hWe(e,t);case Uh.LINEAR:return i===uT.ROTATION?new PN({times:e,points:t}):new BC({times:e,points:t})}}function AWe(e,t,n,i,o){let r=[];if(i===uT.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),h=c;if(n===Uh.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[h],f[u+1]=t[h+o],f[u+2]=t[h+2*o],h+=o*3;else for(u=0;u<a;u++)f[u]=t[h],h+=o;r.push(sfe(e,f,n,i))}}else r.push(sfe(e,t,n,i));return r}var mWe=new d,pWe=new Qe;function gWe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=AWe(i,o,r,a,u);e._splines=f,e._path=a}m6.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===uT.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===uT.TRANSLATION||n===uT.SCALE?o[n]=r.evaluate(s,mWe):n===uT.ROTATION&&(o[n]=r.evaluate(s,pWe))}}};var RN=m6;function p6(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??gu.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new _e,this.update=new _e,this.stop=new _e,this._state=Vh.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,_We(this)}Object.defineProperties(p6.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 _We(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 u=r[c],f=u.target;if(!l(f))continue;let h=f.node.index,m=i._runtimeNodes[h],g=new RN({channel:u,runtimeAnimation:e,runtimeNode:m}),A=u.sampler.input;t=Math.min(t,A[0]),n=Math.max(n,A[A.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}p6.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var MN=p6;function fg(e){this.animationAdded=new _e,this.animationRemoved=new _e,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(fg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function g6(e,t,n){let i=e._model,o=new MN(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}fg.prototype.add=function(e){e=e??V.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return g6(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 g6(this,n[i],e)};fg.prototype.addAll=function(e){e=e??V.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=g6(this,n[r],e);i.push(s)}return i};fg.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};fg.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])};fg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};fg.prototype.get=function(e){return this._runtimeAnimations[e]};var DV=[];function CWe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}fg.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,u=a._duration,f=a.stopTime,h=J.lessThanOrEquals(c,o),m=l(f)&&J.greaterThan(o,f),g=0;if(u!==0){let C=J.secondsDifference(m?f:o,c);g=l(a._animationTime)?a._animationTime(u,C):C/u}let A=a.loop===gu.REPEAT||a.loop===gu.MIRRORED_REPEAT,_=(h||A&&!l(a.startTime))&&(g<=1||A)&&!m;if(g===a._prevAnimationDelta){let C=a._state===Vh.STOPPED;if(_!==C)continue}if(a._prevAnimationDelta=g,_||a._state===Vh.ANIMATING){if(_&&a._state===Vh.STOPPED&&(a._state=Vh.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===gu.REPEAT)g=g-Math.floor(g);else if(a.loop===gu.MIRRORED_REPEAT){let y=Math.floor(g),E=g-y;g=y%2===1?1-E:E}a.reverse&&(g=1-g);let C=g*u*a.multiplier;C=D.clamp(C,a.localStartTime,a.localStopTime),a.animate(C),a.update.numberOfListeners>0&&(a._updateEventTime=C,e.afterRender.push(a._raiseUpdateEvent)),i=!0,_||(a._state=Vh.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&DV.push(a))}}n=DV.length;for(let s=0;s<n;++s){let a=DV[s];t.splice(t.indexOf(a),1),e.afterRender.push(CWe(this,r,a))}return DV.length=0,i};var NN=fg;function TI(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(TI.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 G),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}}});TI.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};TI.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};TI.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};TI.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};TI.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var LN=TI;var ON={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};ON.getStyleCommandsNeeded=function(e,t){return t===0?ON.ALL_OPAQUE:t===e?ON.ALL_TRANSLUCENT:ON.OPAQUE_AND_TRANSLUCENT};var Hh=Object.freeze(ON);var DC={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};DC.is3DTiles=function(e){switch(e){case DC.TILE_GLTF:case DC.TILE_B3DM:case DC.TILE_I3DM:case DC.TILE_PNTS:case DC.TILE_GEOJSON:return!0;case DC.GLTF:return!1}};var Fr=Object.freeze(DC);function fs(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=Hh.ALL_OPAQUE,yWe(this)}Object.defineProperties(fs.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 yWe(e){let t=e._model,n=Fr.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 Ia(s,o)}else for(o=0;o<i;o++)r[o]=new LN({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new vl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}fs.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Hh.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};fs.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};fs.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};fs.prototype.getShow=function(e){return this._batchTexture.getShow(e)};fs.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};fs.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};fs.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};fs.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};fs.prototype.getFeature=function(e){return this._features[e]};fs.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};fs.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};fs.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};fs.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};fs.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};fs.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};fs.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};fs.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};fs.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var EWe=new G;fs.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(vl.DEFAULT_COLOR_VALUE),this.setAllShow(vl.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,EWe)??vl.DEFAULT_COLOR_VALUE:vl.DEFAULT_COLOR_VALUE,o=l(e.show)?e.show.evaluate(n)??vl.DEFAULT_SHOW_VALUE:vl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};fs.prototype.isDestroyed=function(){return!1};fs.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),de(this)};var FN=fs;var afe={name:"TilesetPipelineStage"};afe.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,pe.FRAGMENT);let r={u_polygonOffset:function(){return F.ZERO}};e.uniformMap=St(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK};var QN=afe;var kN=`// 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 UN=`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 cfe={name:"AtmospherePipelineStage"};cfe.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,pe.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([UN]),i.addFragmentLines([kN]),i.addUniform("bool","u_isInFog",pe.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=d.distance(n.camera.positionWC,t.boundingSphere.center);return D.fog(o,n.fog.density)>D.EPSILON3}};var GN=cfe;var zN=`#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 lfe={name:"ImageBasedLightingPipelineStage"},IWe=new F;lfe.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,pe.FRAGMENT),r.addUniform("vec2","model_iblFactor",pe.FRAGMENT),Ph.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",pe.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,pe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",pe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,pe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",pe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",pe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT)),r.addFragmentLines(zN);let c={model_iblFactor:function(){return F.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,IWe)},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=St(c,e.uniformMap)};var VN=lfe;var bWe=D.EPSILON16;function C6(e){e=e??V.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(C6.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=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,bWe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var xWe=new d,_6=new X;C6.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=xWe,o;switch(t){case Wc.XROTATE:o=X.fromRotationX(D.toRadians(n),_6),e=M.multiplyByMatrix3(e,o,e);break;case Wc.YROTATE:o=X.fromRotationY(D.toRadians(n),_6),e=M.multiplyByMatrix3(e,o,e);break;case Wc.ZROTATE:o=X.fromRotationZ(D.toRadians(n),_6),e=M.multiplyByMatrix3(e,o,e);break;case Wc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Wc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Wc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case Wc.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case Wc.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case Wc.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case Wc.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var HN=C6;function vV(e){e=e??V.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,TWe(this)}Object.defineProperties(vV.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 TWe(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 HN({stage:a,runtimeArticulation:e});o.push(c);let u=a.name;r[u]=c}}vV.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var SWe=new M,BWe=new M;vV.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,SWe),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=M.multiplyTransformation(s.originalTransform,e,BWe);s.transform=a}};var YN=vV;var WN=`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 fT={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};fT.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,pe.FRAGMENT),i.addFragmentLines(WN);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=we.TRANSLUCENT),i.addUniform("vec4",fT.COLOR_UNIFORM_NAME,pe.FRAGMENT),o[fT.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",fT.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),o[fT.COLOR_BLEND_UNIFORM_NAME]=function(){return Yc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=St(o,e.uniformMap)};var vC=fT;var jN=`#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 ufe={name:"ModelClippingPlanesPipelineStage"},wWe=new F;ufe.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,pe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,pe.FRAGMENT),cs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,pe.FRAGMENT);let s=cs.getTextureResolution(i,o,wWe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,pe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",pe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",pe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",pe.FRAGMENT),r.addFragmentLines(jN);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=G.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=St(a,e.uniformMap)};var qN=ufe;var KN=`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 JN=`void modelClippingPolygonsStage()
{
vec2 clippingPosition = v_clippingPosition;
int regionIndex = v_regionIndex;
czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
}
`;var ffe={name:"ModelClippingPolygonsPipelineStage"};ffe.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,pe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,pe.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,pe.BOTH),o.addUniform("sampler2D","model_clippingDistance",pe.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",pe.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(KN),o.addFragmentLines(JN);let r={model_clippingDistance:function(){return i.clippingTexture??n.context.defaultTexture},model_clippingExtents:function(){return i.extentsTexture??n.context.defaultTexture}};e.uniformMap=St(r,e.uniformMap)};var XN=ffe;function dfe(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(dfe.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 ZN=dfe;var $N=`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 eL=`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 tL=`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 PV=new M,DWe=new M,vWe=new M,Afe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Cfe,_transformsToTypedArray:E6};Afe.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines($N);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,h=[];YWe(e,n,i,h,u,f),qWe(e,n,i,h);let m={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",pe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",pe.VERTEX),m.u_instance_modifiedModelView=function(){let g=M.multiplyTransformation(s.modelMatrix,a.components.transform,PV);return u?M.multiplyTransformation(n.context.uniformState.view3D,g,PV):(n.mode!==oe.SCENE3D&&(g=It.basisTo2D(n.mapProjection,g,PV)),M.multiplyTransformation(n.context.uniformState.view,g,PV))},m.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,DWe)},r.addVertexLines(tL)):r.addVertexLines(eL),u){r.addDefine("USE_2D_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_modelView2D",pe.VERTEX);let g=n.context,A=M.fromTranslation(c.instancingReferencePoint2D,new M);m.u_modelView2D=function(){return M.multiplyTransformation(g.uniformState.view,A,vWe)}}e.uniformMap=St(m,e.uniformMap),e.instanceCount=o,ei(e.attributes,h)};var nL=new M,PWe=new d;function RWe(e,t,n,i,o){let r=M.multiplyTransformation(t,e,nL);return r=M.multiplyTransformation(r,n,nL),o=It.basisTo2D(i.mapProjection,r,o),o}function MWe(e,t,n,i,o){let r=M.fromTranslation(e,nL),s=M.multiplyTransformation(t,r,nL);s=M.multiplyTransformation(s,n,nL);let a=M.getTranslation(s,PWe);return o=to.computeActualEllipsoidPosition(i,a,o),o}function mfe(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=M.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=M.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(o.computedModelMatrix,t),t=M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=M.clone(M.IDENTITY,n))}var pfe=new M,gfe=new M,NWe=new M,LWe=new d;function OWe(e,t,n,i){let o=pfe,r=gfe;mfe(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=RWe(f,o,r,n,NWe),m=M.getTranslation(h,LWe),g=d.subtract(m,a,m);i[u]=M.setTranslation(h,g,i[u])}return i}function FWe(e,t,n,i){let o=pfe,r=gfe;mfe(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=MWe(f,o,r,n,f);i[u]=d.subtract(h,a,i[u])}return i}var QWe=new d,kWe=new d;function _fe(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=M.multiplyByPoint(i,n.instancingTranslationMin,QWe),r=to.computeActualEllipsoidPosition(t,o,o),s=M.multiplyByPoint(i,n.instancingTranslationMax,kWe),a=to.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=d.lerp(r,a,.5,new d)}function E6(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 UWe(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 GWe=new d,zWe=new Qe,VWe=new d;function Cfe(e,t,n){let i=new Array(t),o=Lt.getAttributeBySemantic(e,Ps.TRANSLATION),r=Lt.getAttributeBySemantic(e,Ps.ROTATION),s=Lt.getAttributeBySemantic(e,Ps.SCALE),a=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),h=l(s),m=u?o.typedArray:new Float32Array(t*3),g=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(g=bn.dequantize(g,r.componentDatatype,r.type,t));let A;h?A=s.typedArray:(A=new Float32Array(t*3),A.fill(1));for(let C=0;C<t;C++){let y=new d(m[C*3],m[C*3+1],m[C*3+2],GWe);d.maximumByComponent(a,y,a),d.minimumByComponent(c,y,c);let E=new Qe(g[C*4],g[C*4+1],g[C*4+2],f?g[C*4+3]:1,zWe),I=new d(A[C*3],A[C*3+1],A[C*3+2],VWe),x=M.fromTranslationQuaternionRotationScale(y,E,I,new M);i[C]=x}let _=n.runtimeNode;return _.instancingTranslationMin=c,_.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),h&&(s.typedArray=void 0),i}function HWe(e,t,n){let i=new Array(t),o=e.typedArray,r=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new d(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,d.minimumByComponent(r,u,r),d.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function I6(e,t){let n=ut.createVertexBuffer({context:t.context,typedArray:e,usage:Oe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function YWe(e,t,n,i,o,r){let s=Lt.getAttributeBySemantic(n,Ps.ROTATION);l(s)?WWe(e,n,i,t,o,r):jWe(e,n,i,t,o)}function WWe(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",h,m=u.instancingTransformsBuffer;if(!l(m)){h=Cfe(t,a,e);let C=E6(h);m=I6(C,i),c._modelResources.push(m),r&&(u.transformsTypedArray=C),u.instancingTransformsBuffer=m}if(hfe(e,m,n,f),!o)return;let g=Ve(i);g.mode=oe.COLUMBUS_VIEW,_fe(e,g);let A=u.instancingTransformsBuffer2D;if(!l(A)){let C=OWe(h,e,g,h),y=E6(C);A=I6(y,i),c._modelResources.push(A),u.instancingTransformsBuffer2D=A}hfe(e,A,n,"Transform2D")}function jWe(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Lt.getAttributeBySemantic(t,Ps.TRANSLATION),u=Lt.getAttributeBySemantic(t,Ps.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),y6(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,h=c.typedArray;if(l(h)?f=HWe(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),y6(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let g=Ve(i);g.mode=oe.COLUMBUS_VIEW,_fe(e,g);let A=a.instancingTranslationBuffer2D;if(!l(A)){let E=FWe(f,e,g,f),I=UWe(E);r&&(a.transformsTypedArray=I),A=I6(I,i),e.model._modelResources.push(A),a.instancingTranslationBuffer2D=A}if(!o)return;y6(e,A,0,void 0,n,"Translation2D")}function hfe(e,t,n,i){let r=q.getSizeInBytes(q.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:q.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:q.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:q.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`),ei(n,a)}function y6(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:q.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function qWe(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===Ps.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 iL=Afe;var b6={};b6.name="ModelMatrixUpdateStage";b6.update=function(e,t,n){let i=n.mode!==oe.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;yfe(e,t,o,e.transformToRoot),e._transformDirty=!1}};function KWe(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Lt.getCullFace(e.modelMatrix,e.primitiveType)}function yfe(e,t,n,i){let o;i=M.multiplyTransformation(i,e.transform,new M),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];KWe(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=M.clone(i,a._transformToRoot),yfe(a,t,n,i),a._transformDirty=!1}}var oL=b6;var Efe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Ife,_countGeneratedBuffers:bfe};Efe.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Ife(i,o),bfe(i,r)};function Ife(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 bfe(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 rL=Efe;function dT(e){e=e??V.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=M.clone(n,this._originalTransform),this._transform=M.clone(n,this._transform),this._transformToRoot=M.clone(i,this._transformToRoot),this._computedTransform=new M,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,JWe(this)}Object.defineProperties(dT.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=M.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;d.equals(n,e)||(t.translation=d.clone(e,t.translation),x6(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Qe.equals(n,e)||(t.rotation=Qe.clone(e,t.rotation),x6(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;d.equals(n,e)||(t.scale=d.clone(e,t.scale),x6(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 JWe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=M.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new X_(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 x6(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}dT.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};dT.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(iL),t.push(rL),n.push(oL)};dT.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};dT.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 M);let r=M.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=M.inverseTransformation(r,t[o]);t[o]=M.multiplyTransformation(s,n[o],t[o])}};var sL=dT;var xfe={name:"AlphaPipelineStage"};xfe.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===we.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=dn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,pe.FRAGMENT),s.addUniform("float","u_alphaCutoff",pe.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var aL=xfe;var Tfe={name:"BatchTexturePipelineStage"};Tfe.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=St(o,e.uniformMap)};var cL=Tfe;var Sfe={name:"ClassificationPipelineStage"};Sfe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,pe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||XWe(t,o)};function XWe(e,t){let n=Lt.getAttributeBySemantic(e,rt.POSITION);if(!l(n))throw new ue("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=Lt.getAttributeBySemantic(e,rt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],h=r?i[0]:0,m=c[h],g=0;for(let _=1;_<s;_++){let C=r?i[_]:_,y=c[C];if(y!==m){let E=_-g,I=_;u.push(E),f.push(I),g=I,m=y}}let A=s-g;u.push(A),t.batchLengths=u,t.batchOffsets=f}var lL=Sfe;var uL=`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 fL=`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 Bfe={name:"CPUStylingPipelineStage"};Bfe.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(uL),o.addFragmentLines(fL),o.addDefine("USE_CPU_STYLING",void 0,pe.BOTH),l(i.color)||(o.addUniform("float",vC.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),e.uniformMap[vC.COLOR_BLEND_UNIFORM_NAME]=function(){return Yc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",pe.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===we.TRANSLUCENT}};var dL=Bfe;var wfe={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};wfe.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var dg=Object.freeze(wfe);var hL=`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 AL=`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 mL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
}
`;var pL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
{
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
setFeatureIdVaryings();
}
`;var no={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()"};no.process=function(e,t,n){let i=e.shaderBuilder;ZWe(i);let o=e.runtimeNode.node.instances;l(o)&&$We(e,o,n),eje(e,t,n),i.addVertexLines(pL),i.addFragmentLines(mL)};function ZWe(e){e.addStruct(no.STRUCT_ID_FEATURE_IDS_VS,no.STRUCT_NAME_FEATURE_IDS,pe.VERTEX),e.addStruct(no.STRUCT_ID_FEATURE_IDS_FS,no.STRUCT_NAME_FEATURE_IDS,pe.FRAGMENT),e.addFunction(no.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,no.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.VERTEX),e.addFunction(no.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,no.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.FRAGMENT),e.addFunction(no.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,no.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.VERTEX),e.addFunction(no.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,no.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.FRAGMENT),e.addFunction(no.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,no.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,pe.VERTEX)}function $We(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 yn.FeatureIdAttribute?tje(e,s,a):Dfe(e,s,a,o,1,n);let c=s.label;l(c)&&vfe(e,a,c,pe.BOTH)}}function eje(e,t,n){let i=t.featureIds,r=Lt.getAttributeBySemantic(t,rt.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=pe.BOTH;a instanceof yn.FeatureIdAttribute?nje(e,a,c):a instanceof yn.FeatureIdImplicitRange?Dfe(e,a,c,r,void 0,n):(ije(e,a,c,s,n),u=pe.FRAGMENT);let f=a.label;l(f)&&vfe(e,c,f,u)}}function tje(e,t,n){let i=e.shaderBuilder;i.addStructField(no.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(no.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}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(no.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(no.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(no.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function nje(e,t,n){let i=e.shaderBuilder;i.addStructField(no.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(no.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(no.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(no.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Dfe(e,t,n,i,o,r){oje(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(no.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(no.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(no.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(no.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(no.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function ije(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,u=e.shaderBuilder;u.addStructField(no.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,pe.FRAGMENT);let h=`v_texCoord_${a.texCoord}`,m=h,g=a.transform;if(l(g)&&!X.equals(g,X.IDENTITY)){let C=`${r}Transform`;u.addUniform("mat3",C,pe.FRAGMENT),s[C]=function(){return g},m=`vec2(${C} * vec3(${h}, 1.0))`}let A=`texture(${r}, ${m}).${c}`,_=`featureIds.${n} = czm_unpackUint(${A});`;u.addFunctionLines(no.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[_])}function vfe(e,t,n,i){let o=e.shaderBuilder,r=pe.includesVertexShader(i);r&&o.addStructField(no.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(no.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(no.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(no.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function oje(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let u=rje(t,n);s=ut.createVertexBuffer({context:o.context,typedArray:u,usage:Oe.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:q.FLOAT,strideInBytes:q.getSizeInBytes(q.FLOAT),offsetInBytes:0};e.attributes.push(c)}function rje(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 PC=no;var gL=`void metadataStage(
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
}
`;var _L=`void metadataStage(
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
setMetadataVaryings();
}
`;var Qi={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"}]};Qi.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=sje(r.propertyAttributes,t,a),u=cje(r.propertyTextures,a),f=c.concat(u);uje(i,f),hje(i),i.addVertexLines(_L),i.addFragmentLines(gL);for(let h=0;h<c.length;h++){let m=c[h];Aje(e,m)}for(let h=0;h<u.length;h++){let m=u[h];pje(e,m)}};function sje(e,t,n){return l(e)?e.flatMap(i=>aje(i,t,n)):[]}function aje(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Lt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[h,m]=c[f],g=i(t,m.attribute),{glslType:A,variableName:_}=o(g);u[f]={metadataVariable:r(h),property:m,type:m.classProperty.type,glslType:A,variableName:_,propertyStatistics:a?.properties[h],shaderDestination:pe.BOTH}}return u}function cje(e,t){return l(e)?e.flatMap(n=>lje(n,t)):[]}function lje(e,t){let{sanitizeGlslIdentifier:n}=Lt,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,u]=r[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:pe.FRAGMENT}}return s}function uje(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==_t.ENUM&&i.add(u)}let o=Qi.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Qi.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,u){e.addStruct(a,a,pe.BOTH);for(let f=0;f<u.length;f++){let{shaderName:h}=u[f],m=u[f].type==="float"?dje(c):c;e.addStructField(a,m,h)}}}var fje={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function dje(e){let t=fje[e];return l(t)?t:e}function hje(e){e.addStruct(Qi.STRUCT_ID_METADATA_VS,Qi.STRUCT_NAME_METADATA,pe.VERTEX),e.addStruct(Qi.STRUCT_ID_METADATA_FS,Qi.STRUCT_NAME_METADATA,pe.FRAGMENT),e.addStruct(Qi.STRUCT_ID_METADATA_CLASS_VS,Qi.STRUCT_NAME_METADATA_CLASS,pe.VERTEX),e.addStruct(Qi.STRUCT_ID_METADATA_CLASS_FS,Qi.STRUCT_NAME_METADATA_CLASS,pe.FRAGMENT),e.addStruct(Qi.STRUCT_ID_METADATA_STATISTICS_VS,Qi.STRUCT_NAME_METADATA_STATISTICS,pe.VERTEX),e.addStruct(Qi.STRUCT_ID_METADATA_STATISTICS_FS,Qi.STRUCT_NAME_METADATA_STATISTICS,pe.FRAGMENT),e.addFunction(Qi.FUNCTION_ID_INITIALIZE_METADATA_VS,Qi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.VERTEX),e.addFunction(Qi.FUNCTION_ID_INITIALIZE_METADATA_FS,Qi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.FRAGMENT),e.addFunction(Qi.FUNCTION_ID_SET_METADATA_VARYINGS,Qi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,pe.VERTEX)}function Aje(e,t){mje(e,t),Pfe(e.shaderBuilder,t),Rfe(e.shaderBuilder,t)}function mje(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=Nfe({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:pe.BOTH,property:o});n.addStructField(Qi.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Qi.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function pje(e,t){gje(e,t),Pfe(e.shaderBuilder,t),Rfe(e.shaderBuilder,t)}function gje(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:u,texture:f,transform:h}=s.textureReader,m=`u_propertyTexture_${u}`;i.hasOwnProperty(m)||(n.addUniform("sampler2D",m,pe.FRAGMENT),i[m]=()=>f),n.addStructField(Qi.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,A=g;if(l(h)&&!X.equals(h,X.IDENTITY)){let I=`${m}Transform`;n.addUniform("mat3",I,pe.FRAGMENT),i[I]=function(){return h},A=`vec2(${I} * vec3(${g}, 1.0))`}let _=`texture(${m}, ${A}).${c}`,C=s.unpackInShader(_),y=Nfe({valueExpression:C,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:pe.FRAGMENT,property:s}),E=`metadata.${o} = ${y};`;n.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_METADATA_FS,[E])}function Pfe(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Mfe(Qi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Qi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),pe.includesVertexShader(r)&&(e.addStructField(Qi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Rfe(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===_t.ENUM)return;let s=Qi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Mfe(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Qi.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),pe.includesVertexShader(t.shaderDestination)&&(e.addStructField(Qi.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Mfe(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 Nfe(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:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:f,scale:h}=n;return a[o]=()=>f,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var _d=Qi;var _je={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},RC=Object.freeze(_je);var Ja={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};Ja.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===RC.TRANSLUCENT?r.pass=we.TRANSLUCENT:c===RC.OPAQUE&&(r.pass=void 0);let u=Sje(s,t);if(!u.customShaderEnabled)return;if(vje(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,pe.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,pe.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,pe.FRAGMENT);let m=dg.getDefineName(s.mode);i.addDefine(m,void 0,pe.FRAGMENT)}let f=s.uniforms;for(let m in f)if(f.hasOwnProperty(m)){let g=f[m];i.addUniform(g.type,m)}let h=s.varyings;for(let m in h)if(h.hasOwnProperty(m)){let g=h[m];i.addVarying(g,m)}e.uniformMap=St(e.uniformMap,s.uniformMap)};function Cje(e){let t={};for(let n=0;n<e.length;n++){let i=Lt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var yje={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},Eje={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 Lfe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=yje[t],i=Eje[t];if(l(n))return{attributeField:[n,e],value:i}}function Ije(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=Ofe(t,n,!1),o=Ffe(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let f=[i[c].glslType,c];s.push(f),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let u=o[c],f=Lfe(u);if(!l(f))return Ja._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function bje(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 xje(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=Ofe(t,n,!0),o=Ffe(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let h=[i[u].glslType,u];s.push(h),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],h=Lfe(f);if(!l(h))return Ja._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(h.attributeField),r=`fsInput.attributes.${f} = ${h.value};`,a.push(r)}let c=bje(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var Tje={positionWC:!0,positionEC:!0};function Ofe(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 Ffe(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||Tje.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 Sje(e,t){let n=Cje(t.attributes),i=Ije(e,n),o=xje(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function Bje(e,t){let n=Ja.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Ja.STRUCT_NAME_ATTRIBUTES,pe.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=Ja.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Ja.STRUCT_NAME_VERTEX_INPUT,pe.VERTEX),e.addStructField(n,Ja.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,PC.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,_d.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,_d.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,_d.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Ja.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,Ja.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,pe.VERTEX),e.addFunctionLines(r,o)}function wje(e,t){let n=Ja.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Ja.STRUCT_NAME_ATTRIBUTES,pe.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=Ja.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Ja.STRUCT_NAME_FRAGMENT_INPUT,pe.FRAGMENT),e.addStructField(n,Ja.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,PC.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,_d.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,_d.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,_d.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Ja.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,Ja.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,pe.FRAGMENT),e.addFunctionLines(r,o)}var Dje=[];function vje(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=Dje;i.enabled&&(Bje(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,hL),e.addVertexLines(r)),o.enabled&&(wje(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,AL),e.addFragmentLines(r))}var CL=Ja;var yL={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};yL.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,pe.VERTEX),i.addFunction(yL.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,yL.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,pe.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===rt.POSITION,h=c.semantic===rt.TEXCOORD;if(r&&!f&&!h)continue;let m=Lt.getAttributeInfo(c);Rje(i,m),Pje(e,m)}};function Pje(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,pe.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,pe.VERTEX),n.addUniform(c,a,pe.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=Qfe(u,0),f=Qfe(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Qfe(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function Rje(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=Mje(n,i):o=Nje(n),e.addFunctionLines(yL.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function Mje(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 Nje(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var EL=yL;var IL=`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 kfe={name:"EdgeDetectionPipelineStage"};kfe.process=function(e){e.shaderBuilder.addFragmentLines([IL])};var bL=kfe;var xL=`// 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 T6=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=bn.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,u=t.byteOffset,f=t.byteStride,h=q.getSizeInBytes(s),m=o*h;if(!l(f)||f===m){let I=q.createTypedArray(s,r);return c.getBufferData(I,u),I}let g=new Uint8Array(c.sizeInBytes);c.getBufferData(g);let A=q.createTypedArray(s,r),_=f??m,C=new DataView(g.buffer,g.byteOffset,g.byteLength),y=new Array(o),E=e.createComponentsReader(s);for(let I=0;I<i;++I){let x=u+I*_;E(C,x,o,y);for(let S=0;S<o;++S)A[I*o+S]=y[S]}return A}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 d;for(let s=0;s<n;s++)d.unpack(t,s*3,r),bn.octDecodeInRange(r,i,r),d.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 F;for(let a=0;a<n;a++)F.unpack(t,a*2,s),F.multiplyComponents(s,i,s),F.add(s,o,s),F.pack(s,r,a*2);return r}static dequantize3D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let s=new d;for(let a=0;a<n;a++)d.unpack(t,a*3,s),d.multiplyComponents(s,i,s),d.add(s,o,s),d.pack(s,r,a*3);return r}static dequantize4D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let s=new se;for(let a=0;a<n;a++)se.unpack(t,a*4,s),se.multiplyComponents(s,i,s),se.add(s,o,s),se.pack(s,r,a*4);return r}static createComponentsReader(t){let n=e.createComponentReader(t),i=q.getSizeInBytes(t);return function(o,r,s,a){let c=r;for(let u=0;u<s;++u)a[u]=n(o,c),c+=i}}static createComponentReader(t){switch(t){case q.BYTE:return function(n,i){return n.getInt8(i)};case q.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case q.SHORT:return function(n,i){return n.getInt16(i,!0)};case q.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case q.INT:return function(n,i){return n.getInt32(i,!0)};case q.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case q.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case q.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 d,r=t.length/3;for(let s=0;s<r;s++)d.unpack(t,s*3,o),M.multiplyByPoint(n,o,o),d.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===Pe.TRIANGLES)return i;if(n===Pe.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Pe.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new Ae(`The primitiveType must be TRIANGLES (${Pe.TRIANGLES}, TRIANGLE_STRIP (${Pe.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Pe.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 Fe.UNSIGNED_BYTE:return new Uint8Array(n);case Fe.UNSIGNED_SHORT:return new Uint16Array(n);case Fe.UNSIGNED_INT:return new Uint32Array(n)}throw new Ae(`The indexDatatype must be UNSIGNED_BYTE (${Fe.UNSIGNED_BYTE}, UNSIGNED_SHORT (${Fe.UNSIGNED_SHORT}, or UNSIGNED_INT (${Fe.UNSIGNED_INT}, but is ${t}`)}},hg=T6;var Ufe={name:"EdgeVisibilityPipelineStage"};Ufe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,pe.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,pe.FRAGMENT),i.addFragmentLines(xL),i.addUniform("bool","u_isEdgePass",pe.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 u=Lje(t),f=Fje(t);if(!l(f)||!l(f.edgeIndices)||f.edgeIndices.length===0)return;let h=Oje(u,f.edgeIndices),m=Qje(f.edgeIndices,f.edgeData,e,n.context,o,s,a,c,r,t.edgeVisibility,h);l(m)&&(m.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,pe.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},e.edgeGeometry={vertexArray:m.vertexArray,indexCount:m.indexCount,primitiveType:Pe.LINES,pass:we.CESIUM_3D_TILE_EDGES})};function Lje(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=Lt.getAttributeBySemantic(e,rt.POSITION),r=l(o.typedArray)?o.typedArray:hg.readAttributeAsTypedArray(o),s=o.quantization;if(l(s)&&!s.octEncoded){let C=r.length,y=new Float32Array(C),E=s.quantizedVolumeOffset,I=s.quantizedVolumeStepSize;for(let x=0;x<C;x+=3)y[x]=E.x+r[x]*I.x,y[x+1]=E.y+r[x+1]*I.y,y[x+2]=E.z+r[x+2]*I.z;r=y}let a=new Map,c=new Float32Array(i*3),u=new d,f=new d,h=new d,m=new d,g=new d,A=new d;function _(C,y,E){let I=`${C<y?C:y},${C<y?y:C}`,x=a.get(I);l(x)||(x=[],a.set(I,x)),x.length<2&&x.push(E)}for(let C=0;C<i;C++){let y=C*3,E=n[y],I=n[y+1],x=n[y+2],S=E*3,w=I*3,v=x*3;u.x=r[S],u.y=r[S+1],u.z=r[S+2],f.x=r[w],f.y=r[w+1],f.z=r[w+2],h.x=r[v],h.y=r[v+1],h.z=r[v+2],d.subtract(f,u,m),d.subtract(h,u,g),d.cross(m,g,A),d.normalize(A,A),c[y]=A.x,c[y+1]=A.y,c[y+2]=A.z,_(E,I,C),_(I,x,C),_(x,E,C)}return{edgeMap:a,faceNormals:c,triangleCount:i}}function Oje(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],u=`${a<c?a:c},${a<c?c:a}`,f=n.get(u);if(!l(f)||f.length===0)continue;let m=f[0]*3,g=i[m],A=i[m+1],_=i[m+2],C,y,E;if(f.length>1){let S=f[1]*3;C=i[S],y=i[S+1],E=i[S+2]}else C=-g,y=-A,E=-_;let I=s*6;r[I]=g,r[I+1]=A,r[I+2]=_,r[I+3]=C,r[I+4]=y,r[I+5]=E}return r}function Fje(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,u=0,f=0,h=o.length;for(let m=0;m+2<h;m+=3){let g=o[m],A=o[m+1],_=o[m+2];for(let C=0;C<3;C++){let y,E;C===0?(y=g,E=A):C===1?(y=A,E=_):C===2&&(y=_,E=g);let I=Math.floor(f/4),x=f%4*2;if(f++,I>=n.length)break;let w=n[I]>>x&3,v=!1;switch(w){case 0:v=!1;break;case 1:v=!0;break;case 2:v=!0;break;case 3:v=!0;break}if(v){let P=Math.min(y,E),N=Math.max(y,E),L=P*r+N;if(!c.has(L)){c.add(L),s.push(y,E);let p=-1;w===1&&(p=u,u++),a.push({edgeType:w,triangleIndex:Math.floor(m/3),edgeIndex:C,mateVertexIndex:p,currentTriangleVertices:[g,A,_]})}}}}return{edgeIndices:s,edgeData:a,silhouetteEdgeCount:u}}function Qje(e,t,n,i,o,r,s,a,c,u,f){if(!l(e)||e.length===0)return;let h=t.length,g=h*2,A=0,_=Lt.getAttributeBySemantic(n.runtimePrimitive.primitive,rt.POSITION),C=l(_.typedArray)?_.typedArray:hg.readAttributeAsTypedArray(_),y=new Float32Array(g*3),E=new Float32Array(g),I=new Float32Array(g*3),x=new Float32Array(g*3),S=new Float32Array(g*3),w=0,v=C.length/3-1;for(let W=0;W<h;W++){let Z=e[W*2],Y=e[W*2+1];if(Z<0||Y<0||Z>v||Y>v){y[w++]=0,y[w++]=0,y[w++]=0,y[w++]=0,y[w++]=0,y[w++]=0,E[W*2]=0,E[W*2+1]=0;let on=W*2;I[on*3]=0,I[on*3+1]=0,I[on*3+2]=1,I[(on+1)*3]=0,I[(on+1)*3+1]=0,I[(on+1)*3+2]=1,x[on*3]=0,x[on*3+1]=0,x[on*3+2]=1,x[(on+1)*3]=0,x[(on+1)*3+1]=0,x[(on+1)*3+2]=1,S[on*3]=0,S[on*3+1]=0,S[on*3+2]=1,S[(on+1)*3]=0,S[(on+1)*3+1]=0,S[(on+1)*3+2]=1;continue}let $=C[Z*3],K=C[Z*3+1],fe=C[Z*3+2],ge=C[Y*3],ne=C[Y*3+1],Ce=C[Y*3+2];y[w++]=$,y[w++]=K,y[w++]=fe,y[w++]=ge,y[w++]=ne,y[w++]=Ce;let ye=t[W].edgeType,De=ye/255;E[W*2]=De,E[W*2+1]=De;let be=0,Ne=0,ke=1;if(ye===1&&l(u.silhouetteNormals)){let on=t[W].mateVertexIndex;if(on>=0&&on<u.silhouetteNormals.length){let Nt=u.silhouetteNormals[on];l(Nt)&&(be=Nt.x,Ne=Nt.y,ke=Nt.z)}}let Ue=W*2;I[Ue*3]=be,I[Ue*3+1]=Ne,I[Ue*3+2]=ke,I[(Ue+1)*3]=be,I[(Ue+1)*3+1]=Ne,I[(Ue+1)*3+2]=ke;let He=W*6,Et=f[He],Ye=f[He+1],nt=f[He+2],Ct=f[He+3],Wt=f[He+4],Qn=f[He+5];x[Ue*3]=Et,x[Ue*3+1]=Ye,x[Ue*3+2]=nt,x[(Ue+1)*3]=Et,x[(Ue+1)*3+1]=Ye,x[(Ue+1)*3+2]=nt,S[Ue*3]=Ct,S[Ue*3+1]=Wt,S[Ue*3+2]=Qn,S[(Ue+1)*3]=Ct,S[(Ue+1)*3+1]=Wt,S[(Ue+1)*3+2]=Qn}let P=ut.createVertexBuffer({context:i,typedArray:y,usage:Oe.STATIC_DRAW}),N=ut.createVertexBuffer({context:i,typedArray:E,usage:Oe.STATIC_DRAW}),L=ut.createVertexBuffer({context:i,typedArray:I,usage:Oe.STATIC_DRAW}),p=ut.createVertexBuffer({context:i,typedArray:x,usage:Oe.STATIC_DRAW}),b=ut.createVertexBuffer({context:i,typedArray:S,usage:Oe.STATIC_DRAW}),T=g>65534,B=new Array(g);for(let W=0;W<g;W++)B[W]=W;let R=ut.createIndexBuffer({context:i,typedArray:T?new Uint32Array(B):new Uint16Array(B),usage:Oe.STATIC_DRAW,indexDatatype:T?Fe.UNSIGNED_INT:Fe.UNSIGNED_SHORT}),O=[{index:A,vertexBuffer:P,componentsPerAttribute:3,componentDatatype:q.FLOAT,normalize:!1},{index:o,vertexBuffer:N,componentsPerAttribute:1,componentDatatype:q.FLOAT,normalize:!1},{index:r,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:q.FLOAT,normalize:!1},{index:s,vertexBuffer:p,componentsPerAttribute:3,componentDatatype:q.FLOAT,normalize:!1},{index:a,vertexBuffer:b,componentsPerAttribute:3,componentDatatype:q.FLOAT,normalize:!1}],U=n.runtimePrimitive.primitive,z=function(){if(l(U.featureIds)&&U.featureIds.length>0){let W=U.featureIds[0];if(l(W.setIndex)){let Z=U.attributes.find(Y=>Y.semantic===rt.FEATURE_ID&&Y.setIndex===W.setIndex);if(l(Z)){let Y=l(Z.typedArray)?Z.typedArray:hg.readAttributeAsTypedArray(Z),$=new Float32Array(g);for(let K=0;K<h;K++){let fe=e[K*2],ge=fe<Y.length?Y[fe]:0;$[K*2]=ge,$[K*2+1]=ge}return $}}}}(),Q=l(z);if(Q){let W=ut.createVertexBuffer({context:i,typedArray:z,usage:Oe.STATIC_DRAW});O.push({index:c,vertexBuffer:W,componentsPerAttribute:1,componentDatatype:q.FLOAT,normalize:!1})}let H=new oi({context:i,indexBuffer:R,attributes:O});if(!(!H||g===0||g%2!==0))return{vertexArray:H,indexBuffer:R,indexCount:g,hasEdgeFeatureIds:Q}}var TL=Ufe;var SL=`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 BL=`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 hT=`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 wL={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};wL.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=kje(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),Uje(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===pe.BOTH&&i.addVertexLines(hT),i.addFragmentLines(hT)};function Gfe(e){return e instanceof yn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function zfe(e){return e instanceof yn.FeatureIdTexture?pe.FRAGMENT:pe.BOTH}function kje(e,t,n){let i,o;return l(t.instances)&&(o=Lt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:zfe(o),featureIdDefine:Gfe(o)}):(o=Lt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:zfe(o),featureIdDefine:Gfe(o)})}function Uje(e){e.addStructField(wL.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(wL.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(wL.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var MC=wL;var Ta={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)"};Ta.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Ta.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",pe.VERTEX),i.addStruct(Ta.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",pe.FRAGMENT),i.addStruct(MC.STRUCT_ID_SELECTED_FEATURE,MC.STRUCT_NAME_SELECTED_FEATURE,pe.BOTH),i.addFunction(Ta.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ta.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,pe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ta.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ta.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ta.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ta.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.VERTEX),i.addFunction(Ta.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ta.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.FRAGMENT),o.type===Fr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,pe.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],h=Ut.getAttributeLocationCount(f.type),m=f.semantic===rt.POSITION,g;h>1?(g=e.attributeIndex,e.attributeIndex+=h):m&&!a?g=0:g=e.attributeIndex++,Gje(e,f,g,h,r,s)}Jje(i,t.attributes),t.primitiveType===Pe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(BL),i.addFragmentLines(SL)};function Gje(e,t,n,i,o,r){let s=e.shaderBuilder,a=Lt.getAttributeInfo(t),c=o&&!r;i>1?Hje(e,t,n,i):Vje(e,t,n,c),Wje(s,a,c),Yje(s,a),l(t.semantic)&&zje(s,t),jje(s,a,o),qje(s,a,c),Kje(s,a)}function zje(e,t){let{semantic:n,setIndex:i}=t;switch(n){case rt.NORMAL:e.addDefine("HAS_NORMALS");break;case rt.TANGENT:e.addDefine("HAS_TANGENTS");break;case rt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case rt.TEXCOORD:case rt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Vje(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===rt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===rt.POSITION,f=u?0:n,h=Ut.getNumberOfComponents(a),m={index:f,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(m),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,A={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(A)}function Hje(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,u=Ut.getNumberOfComponents(s)/i,f=q.getSizeInBytes(a),h=u*f,m=t.byteStride;for(let g=0;g<i;g++){let A=t.byteOffset+g*h,_={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:A,strideInBytes:m,normalize:r};e.attributes.push(_)}}function Yje(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 Wje(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===rt.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function jje(e,t,n){let i=Ta.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Ta.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 qje(e,t,n){let i=Ta.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 Kje(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Ta.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Ta.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function Jje(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===rt.NORMAL?n=!0:r.semantic===rt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ta.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ta.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var DL=Ta;function NC(e){if(e=e??V.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new ui(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 F(-i,-i),this._rectangleNortheastInMeters=new F(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(NC.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});NC.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};NC.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};NC.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),o=n.project(ce.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ce(i.x,i.y,o.x,o.y)};NC.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,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,h=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=h,i.east=c,i.north=f,i):new ce(a,h,c,f)};NC.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new F(o.west,o.south)),a=r.unproject(new F(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};NC.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),m=h.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-h.y,A=m/a|0;A>=o&&(A=o-1);let _=g/u|0;return _>=r&&(_=r-1),l(n)?(n.x=A,n.y=_,n):new F(A,_)};var Rs=NC;var S6,Vfe="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRA_-es9rk59JndtXxJExAf4pmezE6N8auY2oiYF7U6dXh7yRaT1sNQtBY9wlqlw0devC6v78rHPdmwJcUuC_MbH3liCP4RLfDGesom_8vT8bbbaPe8MoNz66fpwDaRk4lfCE9paNVC2Mx1K0Dgg7eJJ4TF14HaUnSgkHUcR7gLbj_277ZHX9P-QkLR9Tqcf_Y.AT1_7xNXmYif",AT={};AT.defaultAccessToken=Vfe;AT.defaultWorldImageryServer=new Be({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});AT.defaultWorldHillshadeServer=new Be({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});AT.defaultWorldOceanServer=new Be({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});AT.getDefaultTokenCredit=function(e){if(e===Vfe){if(!l(S6)){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>';S6=new pt(t,!0)}return S6}};var af=AT;function B6(e){e=e??V.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Be.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=hh(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,h=u.length;a&&f<h;++f){let m=u[f],g=m.x*4+m.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)}B6.prototype.isReady=function(){return this._isReady};B6.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=hh(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 u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var vL=B6;function w6(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}w6.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])};w6.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 Yh=w6;function mT(){Ae.throwInstantiationError()}Object.defineProperties(mT.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}});mT.prototype.getTileCredits=function(e,t,n){Ae.throwInstantiationError()};mT.prototype.requestImage=function(e,t,n,i){Ae.throwInstantiationError()};mT.prototype.pickFeatures=function(e,t,n,i,o){Ae.throwInstantiationError()};var Xje=/\.ktx2$/i;mT.loadImage=function(e,t){let n=Be.createIfNeeded(t);return Xje.test(n.url)?su(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Ol=mT;var Zje={SATELLITE:1,OCEANS:2,HILLSHADE:3},Wh=Object.freeze(Zje);function Hfe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Vi({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new pt(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}Hfe.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 vL({missingImageUrl:Yfe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new F(0,0),new F(200,20),new F(20,200),new F(80,110),new F(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function $je(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 Rs({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Vi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ue(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 ui,o=e.fullExtent,r=i.unproject(new d(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 d(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.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 ue(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new pt(e.copyrightText)]:t.credit=new pt(e.copyrightText))}function e6e(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ue(n)}async function t6e(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();$je(i,t)}catch(i){e6e(e,i)}}function dm(e){e=e??V.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 Vi({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 pt(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new _e}dm.fromBasemapType=async function(e,t){t=t??V.EMPTY_OBJECT;let n,i,o;switch(e){case Wh.SATELLITE:{n=t.token??af.defaultAccessToken,i=Be.createIfNeeded(af.defaultWorldImageryServer),i.appendForwardSlash();let r=af.getDefaultTokenCredit(n);l(r)&&(o=pt.clone(r))}break;case Wh.OCEANS:{n=t.token??af.defaultAccessToken,i=Be.createIfNeeded(af.defaultWorldOceanServer),i.appendForwardSlash();let r=af.getDefaultTokenCredit(n);l(r)&&(o=pt.clone(r))}break;case Wh.HILLSHADE:{n=t.token??af.defaultAccessToken,i=Be.createIfNeeded(af.defaultWorldHillshadeServer),i.appendForwardSlash();let r=af.getDefaultTokenCredit(n);l(r)&&(o=pt.clone(r))}break;default:}return dm.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Yfe(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 Gi?(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(dm.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}}});dm.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=Be.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new dm(t);i._resource=n;let o=new Hfe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await t6e(n,o),o.build(i),i};dm.prototype.getTileCredits=function(e,t,n){return this._tileCredits};dm.prototype.requestImage=function(e,t,n,i){return Ol.loadImage(this,Yfe(this,e,t,n,i))};dm.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 Gi)s=D.toDegrees(i),a=D.toDegrees(o),c="4326";else{let m=this._tilingScheme.projection.project(new he(i,o,0));s=m.x,a=m.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={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:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(m){let g=[],A=m.results;if(!l(A))return g;for(let _=0;_<A.length;++_){let C=A[_],y=new Yh;if(y.data=C,y.name=C.value,y.properties=C.attributes,y.configureDescriptionFromProperties(C.attributes),C.geometryType==="esriGeometryPoint"&&C.geometry){let E=C.geometry.spatialReference&&C.geometry.spatialReference.wkid?C.geometry.spatialReference.wkid:4326;if(E===4326||E===4283)y.position=he.fromDegrees(C.geometry.x,C.geometry.y,C.geometry.z);else if(E===102100||E===900913||E===3857){let I=new ui;y.position=I.unproject(new d(C.geometry.x,C.geometry.y,C.geometry.z))}}g.push(y)}return g})};dm._metadataCache={};var Ag=dm;function n6e(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 hm=n6e;function RV(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}RV.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 RV(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}": ${hm(i)}`),c};RV.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var qo=RV;var i6e={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"},pT=Object.freeze(i6e);function PL(e){}PL.prototype.isReady=function(){return!0};PL.prototype.shouldDiscardImage=function(e){return PL.EMPTY_IMAGE===e};var MV;Object.defineProperties(PL,{EMPTY_IMAGE:{get:function(){return l(MV)||(MV=new Image,MV.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),MV}}});var gT=PL;function Wfe(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}Wfe.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 pt)break;o.credit=new pt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],u=c.bbox;c.bbox=new ce(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}};function o6e(e,t){if(e.resourceSets.length!==1)throw new ue("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 r6e(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),qo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ue(i)}async function s6e(e,t,n){let i=e.url,o=na._metadataCache[i];l(o)||(o=e.fetchJson(),na._metadataCache[i]=o);try{let r=await o;return o6e(r,t)}catch(r){r6e(e,r,n)}}function na(e){e=e??V.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??pT.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new gT),this._proxy=e.proxy,this._credit=new pt(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${na.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Rs({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 _e}Object.defineProperties(na.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)}}});na.fromUrl=async function(e,t){t=t??V.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??pT.AERIAL,o=Be.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 na(t);a._resource=o;let c=new Wfe(t);return await s6e(s,c),c.build(a),a};var a6e=new ce;na.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,a6e);return u6e(this._attributionList,n,i)};na.prototype.requestImage=function(e,t,n,i){let o=Ol.loadImage(this,c6e(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?gT.EMPTY_IMAGE:Promise.reject(r)})};na.prototype.pickFeatures=function(e,t,n,i,o){};na.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};na.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}};na._logoUrl=void 0;Object.defineProperties(na,{logoUrl:{get:function(){return l(na._logoUrl)||(na._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),na._logoUrl},set:function(e){na._logoUrl=e}}});function c6e(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:na.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var l6e=new ce;function u6e(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 u=0,f=s.coverageAreas.length;!c&&u<f;++u){let h=a[u];if(t>=h.zoomMin&&t<=h.zoomMax){let m=ce.intersection(n,h.bbox,l6e);l(m)&&(c=!0)}}c&&i.push(s.credit)}return i}na._metadataCache={};var RL=na;var jfe=/{[^}]+}/g,qfe={x:A6e,y:p6e,z:C6e,s:y6e,reverseX:m6e,reverseY:g6e,reverseZ:_6e,westDegrees:E6e,southDegrees:I6e,eastDegrees:b6e,northDegrees:x6e,westProjected:T6e,southProjected:S6e,eastProjected:B6e,northProjected:w6e,width:D6e,height:v6e},f6e=St(qfe,{i:P6e,j:R6e,reverseI:M6e,reverseJ:N6e,longitudeDegrees:O6e,latitudeDegrees:F6e,longitudeProjected:Q6e,latitudeProjected:k6e,format:G6e});function ML(e){e=e??V.EMPTY_OBJECT,this._errorEvent=new _e;let t=Be.createIfNeeded(e.url),n=Be.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 Rs({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new pt(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=St(qfe,r),a=St(f6e,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(ML.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}}});ML.prototype.getTileCredits=function(e,t,n){};ML.prototype.requestImage=function(e,t,n,i){return Ol.loadImage(this,d6e(this,e,t,n,i))};ML.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(u,f){return u.callback(f)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=h6e(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var NV=!1,cf=new ce,LV=!1,NL=new ce;function d6e(e,t,n,i,o){NV=!1,LV=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(jfe);return l(u)&&u.forEach(function(f){let h=f.substring(1,f.length-1);l(a[h])&&(c[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var D6=!1,CT=new F,v6=!1;function h6e(e,t,n,i,o,r,s){NV=!1,LV=!1,D6=!1,v6=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},h=c.match(jfe);return l(h)&&h.forEach(function(m){let g=m.substring(1,m.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function yT(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 A6e(e,t,n,i){return yT(e,"{x}",t)}function m6e(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return yT(e,"{reverseX}",o)}function p6e(e,t,n,i){return yT(e,"{y}",n)}function g6e(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return yT(e,"{reverseY}",o)}function _6e(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return yT(e,"{reverseZ}",r)}function C6e(e,t,n,i){return yT(e,"{z}",i)}function y6e(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function OV(e,t,n,i){NV||(e.tilingScheme.tileXYToRectangle(t,n,i,cf),cf.west=D.toDegrees(cf.west),cf.south=D.toDegrees(cf.south),cf.east=D.toDegrees(cf.east),cf.north=D.toDegrees(cf.north),NV=!0)}function E6e(e,t,n,i){return OV(e,t,n,i),cf.west}function I6e(e,t,n,i){return OV(e,t,n,i),cf.south}function b6e(e,t,n,i){return OV(e,t,n,i),cf.east}function x6e(e,t,n,i){return OV(e,t,n,i),cf.north}function FV(e,t,n,i){LV||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,NL),LV=!0)}function T6e(e,t,n,i){return FV(e,t,n,i),NL.west}function S6e(e,t,n,i){return FV(e,t,n,i),NL.south}function B6e(e,t,n,i){return FV(e,t,n,i),NL.east}function w6e(e,t,n,i){return FV(e,t,n,i),NL.north}function D6e(e,t,n,i){return e.tileWidth}function v6e(e,t,n,i){return e.tileHeight}function P6e(e,t,n,i,o,r,s){return QV(e,t,n,i,o,r),CT.x}function R6e(e,t,n,i,o,r,s){return QV(e,t,n,i,o,r),CT.y}function M6e(e,t,n,i,o,r,s){return QV(e,t,n,i,o,r),e.tileWidth-CT.x-1}function N6e(e,t,n,i,o,r,s){return QV(e,t,n,i,o,r),e.tileHeight-CT.y-1}var L6e=new ce,_T=new d;function QV(e,t,n,i,o,r,s){if(D6)return;P6(e,t,n,i,o,r);let a=_T,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,L6e);CT.x=e.tileWidth*(a.x-c.west)/c.width|0,CT.y=e.tileHeight*(c.north-a.y)/c.height|0,D6=!0}function O6e(e,t,n,i,o,r,s){return D.toDegrees(o)}function F6e(e,t,n,i,o,r,s){return D.toDegrees(r)}function Q6e(e,t,n,i,o,r,s){return P6(e,t,n,i,o,r),_T.x}function k6e(e,t,n,i,o,r,s){return P6(e,t,n,i,o,r),_T.y}var U6e=new he;function P6(e,t,n,i,o,r,s){if(!v6){if(e.tilingScheme.projection instanceof Gi)_T.x=D.toDegrees(o),_T.y=D.toDegrees(r);else{let a=U6e;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,_T)}v6=!0}}function G6e(e,t,n,i,o,r,s){return s}var Vs=ML;function Cd(e){Vs.call(this,e)}Cd._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return Cd._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof YA)return Cd._metadataFailure(e,t);throw o}};Cd.fromUrl=async function(e,t){let n=Be.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??V.EMPTY_OBJECT;let r=await Cd._requestMetadata(t,i,o);return new Cd(r)};l(Object.create)&&(Cd.prototype=Object.create(Vs.prototype),Cd.prototype.constructor=Cd);function Kfe(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 Jfe(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),o=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}Cd._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,h,m=[],g=e.childNodes[0].childNodes;for(let P=0;P<g.length;P++)if(r.test(g.item(P).nodeName))u=g.item(P);else if(a.test(g.item(P).nodeName)){h=g.item(P);let N=g.item(P).childNodes;for(let L=0;L<N.length;L++)s.test(N.item(L).nodeName)&&m.push(N.item(L))}else c.test(g.item(P).nodeName)&&(f=g.item(P));let A;if(!l(h)||!l(f))throw A=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&qo.reportError(void 0,o,o.errorEvent,A),new ue(A);let _=t.fileExtension??u.getAttribute("extension"),C=t.tileWidth??parseInt(u.getAttribute("width"),10),y=t.tileHeight??parseInt(u.getAttribute("height"),10),E=t.minimumLevel??parseInt(m[0].getAttribute("order"),10),I=t.maximumLevel??parseInt(m[m.length-1].getAttribute("order"),10),x=h.getAttribute("profile"),S=t.tilingScheme;if(!l(S))if(x==="geodetic"||x==="global-geodetic")S=new Vi({ellipsoid:t.ellipsoid});else if(x==="mercator"||x==="global-mercator")S=new Rs({ellipsoid:t.ellipsoid});else throw A=`${i.url} specifies an unsupported profile attribute, ${x}.`,l(o)&&qo.reportError(void 0,o,o.errorEvent,A),new ue(A);let w=ce.clone(t.rectangle);if(!l(w)){let P,N,L,p;t.flipXY??!1?(L=new F(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),p=new F(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new F(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),p=new F(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let T=x==="geodetic"||x==="mercator";if(S.projection instanceof Gi||T)P=he.fromDegrees(L.x,L.y),N=he.fromDegrees(p.x,p.y);else{let B=S.projection;P=B.unproject(L),N=B.unproject(p)}w=new ce(P.longitude,P.latitude,N.longitude,N.latitude)}return w=Kfe(w,S),E=Jfe(S,w,E),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${_}`}),tilingScheme:S,rectangle:w,tileWidth:C,tileHeight:y,minimumLevel:E,maximumLevel:I,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Cd._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 Rs({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=Kfe(a,s);let c=Jfe(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 LC=Cd;function Xfe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Xfe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function z6e(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 ue(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ue(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Vi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Rs({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ue(o)}return!0}function V6e(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),qo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ue(i)}async function H6e(e,t,n){try{let i=await e.fetchText();z6e(i,t)}catch(i){V6e(i,e,n)}}function Cu(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 pt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Cu.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 _e}Object.defineProperties(Cu.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}}});Cu.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=Be.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 Xfe(n);s.channel=t,await H6e(r,s);let a=new Cu(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Cu.prototype.getTileCredits=function(e,t,n){};Cu.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 Ol.loadImage(this,o)};Cu.prototype.pickFeatures=function(e,t,n,i,o){};Cu._logoUrl=void 0;Object.defineProperties(Cu,{logoUrl:{get:function(){return l(Cu._logoUrl)||(Cu._logoUrl=Zt("Assets/Images/google_earth_credit.png")),Cu._logoUrl},set:function(e){Cu._logoUrl=e}}});var LL=Cu;var Y6e=/\/$/,Zfe=new pt('&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 ET(e){e=e??V.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=Be.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();Y6e.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 pt(s))):s=Zfe,this._resource=i,this._imageryProvider=new Vs({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(ET.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}}});ET.prototype.getTileCredits=function(e,t,n){};ET.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ET.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};ET._defaultCredit=Zfe;var OL=ET;function SI(e){e=e??V.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??ce.MAX_VALUE,n=new Vi({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 _e;let i=e.credit;typeof i=="string"&&(i=new pt(i)),this._credit=i;let o=Be.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(SI.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 W6e(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=qo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return R6(e,n,r);throw l(n)&&(n._hasError=!0),new ue(o)}async function R6(e,t,n){try{return await Ol.loadImage(null,e)}catch(i){return W6e(e,i,t,n)}}SI.fromUrl=async function(e,t){let n=Be.createIfNeeded(e),i=await R6(n);t=t??V.EMPTY_OBJECT;let o=new SI({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};SI.prototype.getTileCredits=function(e,t,n){};SI.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await R6(this._resource,this);return this._image=o,qo.reportSuccess(this._errorEvent),o}return this._image};SI.prototype.pickFeatures=function(e,t,n,i,o){};var FL=SI;function j6e(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=q6e:e==="xml"?n=Z6e:(e==="html"||e==="text")&&(n=$fe)),this.callback=n}function q6e(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Yh;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=he.fromDegrees(s,a)}t.push(r)}return t}var M6="http://www.mapinfo.com/mxp",K6e="http://www.esri.com/wms",J6e="http://www.opengis.net/wfs",X6e="http://www.opengis.net/gml";function Z6e(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===M6)return $6e(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===K6e)return eqe(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===J6e)return tqe(e);if(t.localName==="ServiceExceptionReport")throw new ue(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?nqe(e):iqe(e)}function $6e(e){let t=[],i=e.documentElement.getElementsByTagNameNS(M6,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(M6,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let h=f.getAttribute("ref"),m=f.textContent.trim();s[h]=m}}let c=new Yh;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function eqe(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 u=a[c];i[u.name]=u.value}n.push(kV(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 u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(kV(a,i))}}return n}function tqe(e){let t=[],i=e.documentElement.getElementsByTagNameNS(X6e,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};N6(r,s),t.push(kV(r,s))}return t}function nqe(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 ue("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={};N6(s,a),t.push(kV(s,a))}}return t}function N6(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()&&N6(o,t)&&(t[o.localName]=o.textContent)}return n}function kV(e,t){let n=new Yh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function iqe(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Yh;return o.data=e,o.description=n.innerHTML,[o]}var oqe=/<body>\s*<\/body>/im,rqe=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,sqe=/<title>([\s\S]*)<\/title>/im;function $fe(e){if(oqe.test(e)||rqe.test(e))return;let t,n=sqe.exec(e);n&&n.length>1&&(t=n[1]);let i=new Yh;return i.name=t,i.description=e,i.data=e,[i]}var BI=j6e;function QL(e){e=e??V.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(QL.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)}}});QL.prototype.getFromCache=function(e,t,n,i){let o=ede(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};QL.prototype.checkApproachingInterval=function(e,t,n,i){let o=ede(e,t,n),r=this._tilesRequestedForInterval,s=tde(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!nde(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};QL.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=tde(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=nde(this,c,r),a||s.push(c)}}};function ede(e,t,n){return`${e}-${t}-${n}`}function aqe(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function tde(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 nde(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=aqe(s),c=new pr({throttle:!1,throttleByServer:!0,type:Qs.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var wI=QL;var cqe=[3034,3035,3042,3043,3044],lqe=[4471,4559];function jh(e){if(e=e??V.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=Be.createIfNeeded(e.url),n=Be.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(jh.DefaultParameters,!0),n.setQueryParameters(jh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(ide(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(ide(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new wI({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return ode(i,s,a,c,u,f)},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 ui?"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&&!lqe.includes(a)||cqe.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof ui?"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 Vs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Vi({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??jh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function ode(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 uqe(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(jh.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}}});jh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};jh.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=ode(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};jh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return uqe(this,e,t,n,i,o,s)};jh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});jh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});jh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new BI("json","application/json")),Object.freeze(new BI("xml","text/xml")),Object.freeze(new BI("text","text/html"))]);function ide(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var kL=jh;var fqe=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function UL(e){e=e??V.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=Be.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(fqe),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 Rs({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 wI({clock:e.clock,times:e.times,requestImageFunction:function(c,u,f,h,m){return rde(s,c,u,f,h,m)},reloadFunction:function(){l(s._reload)&&s._reload()}})),this._errorEvent=new _e;let a=e.credit;this._credit=typeof a=="string"?new pt(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 rde(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(r)?r.data:void 0,h,m;if(!e._useKvp)m={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(m),l(u)&&h.setTemplateValues(u),l(f)&&h.setTemplateValues(f);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(u)&&(g=St(g,u)),l(f)&&(g=St(g,f)),m={s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(m)}return Ol.loadImage(e,h)}Object.defineProperties(UL.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())}}});UL.prototype.getTileCredits=function(e,t,n){};UL.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=rde(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};UL.prototype.pickFeatures=function(e,t,n,i,o){};var GL=UL;var UV={};UV.defaultApiKey=void 0;UV.mapTilesApiEndpoint=new Be({url:"https://tile.googleapis.com/"});UV.getDefaultCredit=function(){return new pt('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var yd=UV;var sde=/\/$/;function mg(e){e=e??V.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 ss?e.url:Be.createIfNeeded(e.url??yd.mapTilesApiEndpoint),n=t.getUrlComponent();sde.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 pt(o)));let r=new Vs({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=ade(e),i=ss._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},L6(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??yd.mapTilesApiEndpoint,e.key=e.key??yd.defaultApiKey;let t=e.overlayLayerType,n=await hqe(e);return new mg({...n,...e,credit:e.credit??yd.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(dqe(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 pt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function dqe(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(V.EMPTY_OBJECT)}).fetchJson()).copyright}function ade(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 hqe(e){let{language:t,region:n,key:i,url:o}=e,r=ade(e),s=o.url??o;sde.test(s)||(s+="/");let a=await Be.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...r,language:t,region:n})});return JSON.parse(a)}var zL=mg;var Aqe=/\/$/;function IT(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 ss?e.url:Be.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();Aqe.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 pt(r)));let s=new Vs({...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(IT.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}}});IT.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};IT.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])};IT.prototype.pickFeatures=function(e,t,n,i,o){};IT.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(mqe(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 pt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function mqe(e,t,n,i,o){return(await e.getDerivedResource({url:t,queryParameters:{zoom:o,bounds:"-180,-90,180,90"},data:JSON.stringify(V.EMPTY_OBJECT)}).fetchJson()).copyrights}var VL=IT;var pqe=async(e,t,n)=>LC.fromUrl(new ss(t,n)),gqe=async(e,{options:t})=>Ag.fromUrl(e,t),_qe=async(e,{options:t})=>RL.fromUrl(e,t),Cqe=async(e,{options:t})=>{let n=t.channel;return delete t.channel,LL.fromUrl(e,n,t)},yqe=async(e,{options:t})=>new OL({url:e,...t}),Eqe=async(e,{options:t})=>FL.fromUrl(e,t),Iqe=async(e,{options:t})=>LC.fromUrl(e,t),bqe=async(e,{options:t})=>new Vs({url:e,...t}),xqe=async(e,{options:t})=>new kL({url:e,...t}),Tqe=async(e,{options:t})=>new GL({url:e,...t}),L6=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new ss(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 zL({...t.options,url:i})},Sqe=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new ss(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 VL({...t.options,url:i})},Bqe={ARCGIS_MAPSERVER:gqe,BING:_qe,GOOGLE_EARTH:Cqe,MAPBOX:yqe,SINGLE_TILE:Eqe,TMS:Iqe,URL_TEMPLATE:bqe,WMS:xqe,WMTS:Tqe,GOOGLE_2D_MAPS:L6,AZURE_MAPS:Sqe,defaultFactoryCallback:pqe},bT=Object.freeze(Bqe);function Am(e){e=e??V.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 _e}Object.defineProperties(Am.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(){}}});Am.fromAssetId=async function(e,t){t=t??V.EMPTY_OBJECT;let n=ss._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Am._endpointCache[i];l(o)||(o=n.fetchJson(),Am._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ue(`Cesium ion asset ${e} is not an imagery asset.`);let s=r.externalType,a=bT.defaultFactoryCallback;r=Ve(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(s)&&(a=bT[s],!l(a)))throw new ue(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,r,n),f=new Am(t);return u.errorEvent.addEventListener(function(h){h.provider=f,f._errorEvent.raiseEvent(h)}),f._tileCredits=ss.getCreditsFromEndpoint(r,n),f._imageryProvider=u,f};Am.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Am.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Am.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Am._endpointCache={};var Fl=Am;var wqe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},pg=Object.freeze(wqe);function Dqe(e){e=e??V.EMPTY_OBJECT;let t=e.style??pg.AERIAL;return Fl.fromAssetId(t)}var gg=Dqe;function Ms(){Ae.throwInstantiationError()}Object.defineProperties(Ms.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 cde=[];Ms.getRegularGridIndices=function(e,t){let n=cde[e];l(n)||(cde[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),dde(e,t,i,0)),i};var lde=[];Ms.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=lde[e];l(n)||(lde[e]=n=[]);let i=n[t];if(!l(i)){let o=Ms.getRegularGridIndices(e,t),r=fde(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var ude=[];Ms.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=ude[e];l(n)||(ude[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,u=r+a,f=fde(e,t),h=f.westIndicesSouthToNorth,m=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,A=f.northIndicesWestToEast,_=Fe.createTypedArray(c,u);dde(e,t,_,0),Ms.addSkirtIndices(h,m,g,A,o,_,r),i=n[t]={indices:_,westIndicesSouthToNorth:h,southIndicesEastToWest:m,eastIndicesNorthToSouth:g,northIndicesWestToEast:A,indexCountWithoutSkirts:r}}return i};Ms.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Ms.getSkirtIndexCount=function(e){return(e-4)*2*3};Ms.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Ms.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=GV(e,a,r,s),a+=e.length,s=GV(t,a,r,s),a+=t.length,s=GV(n,a,r,s),a+=n.length,GV(i,a,r,s)};Ms.addSkirtIndicesWithFilledCorners=function(e,t,n,i,o,r,s){Ms.addSkirtIndices(e,t,n,i,o,r,s);let a=Ms.getSkirtVertexCount(e,t,n,i),c=Ms.getSkirtIndexCount(a),u=s+c,f=e[0],h=i[0],m=n[0],g=t[0],A=o,_=A+e.length-1,C=_+1,y=C+t.length-1,E=y+1,I=E+n.length-1,x=I+1,S=x+i.length-1;r[u+0]=f,r[u+1]=A,r[u+2]=y,r[u+3]=g,r[u+4]=C,r[u+5]=I,r[u+6]=m,r[u+7]=E,r[u+8]=S,r[u+9]=h,r[u+10]=x,r[u+11]=_};function fde(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 dde(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,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function GV(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}Ms.heightmapTerrainQuality=.25;Ms.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Ms.heightmapTerrainQuality/(t*n)};Ms.prototype.requestTileGeometry=Ae.throwInstantiationError;Ms.prototype.getLevelMaximumGeometricError=Ae.throwInstantiationError;Ms.prototype.getTileDataAvailable=Ae.throwInstantiationError;Ms.prototype.loadTileDataAvailability=Ae.throwInstantiationError;var zo=Ms;var HL=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var YL=`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 vqe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},Wn=Object.freeze(vqe);function xT(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=Wn.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}xT.createPlaceholder=function(e){let t=new xT(e,0,0,0);return t.addReference(),t.state=Wn.PLACEHOLDER,t};xT.prototype.addReference=function(){++this.referenceCount};xT.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(),de(this),0):this.referenceCount};xT.prototype.processStateMachine=function(e,t,n){this.state===Wn.UNLOADED&&!n&&(this.state=Wn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Wn.RECEIVED&&(this.state=Wn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Wn.READY&&t&&!this.texture;(this.state===Wn.TEXTURE_LOADED||i)&&(this.state=Wn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var TT=xT;function O6(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}O6.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};O6.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Wn.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!==Wn.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==Wn.FAILED&&r.state!==Wn.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===Wn.FAILED||i.state===Wn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var ST=O6;function Li(e,t){this._imageryProvider=e,this._readyEvent=new _e,this._errorEvent=new _e,t=t??V.EMPTY_OBJECT,e=e??V.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??Li.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Li.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Li.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Li.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Li.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Li.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Li.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Li.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ce.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new ST(TT.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??Li.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Li.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}}});Li.DEFAULT_BRIGHTNESS=1;Li.DEFAULT_CONTRAST=1;Li.DEFAULT_HUE=0;Li.DEFAULT_SATURATION=1;Li.DEFAULT_GAMMA=1;Li.DEFAULT_SPLIT=Lr.NONE;Li.DEFAULT_MINIFICATION_FILTER=Kt.LINEAR;Li.DEFAULT_MAGNIFICATION_FILTER=mi.LINEAR;Li.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Li.fromProviderAsync=function(e,t){let n=new Li(void 0,t);return Lqe(n,Promise.resolve(e)),n};Li.fromWorldImagery=function(e){return e=e??V.EMPTY_OBJECT,Li.fromProviderAsync(gg({style:e.style}),e)};Li.prototype.isBaseLayer=function(){return this._isBaseLayer};Li.prototype.isDestroyed=function(){return!1};Li.prototype.destroy=function(){return de(this)};var mde=new ce,hde=new ce,F6=new ce,pde=new ce;Li.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};Li.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 ui&&e.rectangle.north<ui.MaximumLatitude&&e.rectangle.south>-ui.MaximumLatitude,s=ce.intersection(o.rectangle,this._rectangle,mde),a=ce.intersection(e.rectangle,s,hde);if(!l(a)){if(!this.isBaseLayer())return!1;let T=s,B=e.rectangle;a=hde,B.south>=T.north?a.north=a.south=T.north:B.north<=T.south?a.north=a.south=T.south:(a.south=Math.max(B.south,T.south),a.north=Math.min(B.north,T.north)),B.west>=T.east?a.west=a.east=T.east:B.east<=T.west?a.west=a.east=T.west:(a.west=Math.max(B.west,T.west),a.east=Math.min(B.east,T.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),h=Mqe(this,f,c);h=Math.max(0,h);let m=o.maximumLevel;if(h>m&&(h=m),l(o.minimumLevel)){let T=o.minimumLevel;h<T&&(h=T)}let g=o.tilingScheme,A=g.positionToTileXY(ce.northwest(a),h),_=g.positionToTileXY(ce.southeast(a),h),C=e.rectangle.width/512,y=e.rectangle.height/512,E=g.tileXYToRectangle(A.x,A.y,h);Math.abs(E.south-e.rectangle.north)<y&&A.y<_.y&&++A.y,Math.abs(E.east-e.rectangle.west)<C&&A.x<_.x&&++A.x;let I=g.tileXYToRectangle(_.x,_.y,h);Math.abs(I.north-e.rectangle.south)<y&&_.y>A.y&&--_.y,Math.abs(I.west-e.rectangle.east)<C&&_.x>A.x&&--_.x;let x=ce.clone(e.rectangle,pde),S=g.tileXYToRectangle(A.x,A.y,h),w=ce.intersection(S,s,F6),v;r?(g.rectangleToNativeRectangle(x,x),g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(w,w),g.rectangleToNativeRectangle(s,s),v=g.tileXYToNativeRectangle.bind(g),C=x.width/512,y=x.height/512):v=g.tileXYToRectangle.bind(g);let P,N=0,L=1,p;!this.isBaseLayer()&&Math.abs(w.west-x.west)>=C&&(N=Math.min(1,(w.west-x.west)/x.width)),!this.isBaseLayer()&&Math.abs(w.north-x.north)>=y&&(L=Math.max(0,(w.north-x.south)/x.height));let b=L;for(let T=A.x;T<=_.x;T++)if(P=N,S=v(T,A.y,h),w=ce.simpleIntersection(S,s,F6),!!l(w)){N=Math.min(1,(w.east-x.west)/x.width),T===_.x&&(this.isBaseLayer()||Math.abs(w.east-x.east)<C)&&(N=1),L=b;for(let B=A.y;B<=_.y;B++){if(p=L,S=v(T,B,h),w=ce.simpleIntersection(S,s,F6),!l(w))continue;L=Math.max(0,(w.south-x.south)/x.height),B===_.y&&(this.isBaseLayer()||Math.abs(w.south-x.south)<y)&&(L=0);let R=new se(P,L,N,p),O=this.getImageryFromCache(T,B,h);i.imagery.splice(n,0,new ST(O,R,r)),++n}}return!0};Li.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,mde),i=c.rectangleToNativeRectangle(i,pde)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new se(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Li.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=Wn.RECEIVED,e.request=void 0,qo.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===hi.CANCELLED){e.state=Wn.UNLOADED,e.request=void 0;return}e.state=Wn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=qo.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:Qs.IMAGERY});e.request=s,e.state=Wn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=Wn.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()};Li.prototype._createTextureWebGL=function(e,t){let n=new Jt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Bt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Bt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?qe.RGBA:qe.RGB,sampler:n})};Li.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=Wn.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=Wn.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof ui?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=Wn.TEXTURE_LOADED};function Ade(e,t,n){return`${e}:${t}:${n}`}Li.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Kt.LINEAR&&i===mi.LINEAR&&!qe.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=Kt.LINEAR_MIPMAP_LINEAR;let r=Ft.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=Ade(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(ed.NICEST),t.sampler=u}else{let r=Ade(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Li.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 Gi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new hl({persists:!0,owner:this,preExecute:function(c){Rqe(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=Wn.READY,t.releaseReference()},canceled:function(){t.state=Wn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=Wn.READY};Li.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};Li.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Li.prototype.getImageryFromCache=function(e,t,n,i){let o=gde(e,t,n),r=this._imageryCache[o];return l(r)||(r=new TT(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Li.prototype.removeImageryFromCache=function(e){let t=gde(e.x,e.y,e.level);delete this._imageryCache[t]};function gde(e,t,n){return JSON.stringify([e,t,n])}var zV={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new F,texture:void 0},Pqe=zt.supportsTypedArrays()?new Float32Array(128):void 0;function Rqe(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),y=0;for(let w=0;w<64;++w){let v=w/63;C[y++]=0,C[y++]=v,C[y++]=1,C[y++]=v}let E={position:0,webMercatorT:1},I=zo.getRegularGridIndices(2,64),x=ut.createIndexBuffer({context:t,typedArray:I,usage:Oe.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});o.vertexArray=new oi({context:t,attributes:[{index:E.position,vertexBuffer:ut.createVertexBuffer({context:t,typedArray:C,usage:Oe.STATIC_DRAW}),componentsPerAttribute:2},{index:E.webMercatorT,vertexBuffer:ut.createVertexBuffer({context:t,sizeInBytes:512,usage:Oe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:x});let S=new We({sources:[YL]});o.shaderProgram=sn.fromCache({context:t,vertexShaderSource:S,fragmentShaderSource:HL,attributeLocations:E}),o.sampler=new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:mi.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;zV.textureDimensions.x=r,zV.textureDimensions.y=s,zV.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),h=new Bt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(r)&&D.isPowerOfTwo(s)&&h.generateMipmap(ed.NICEST);let m=i.south,g=i.north,A=Pqe,_=0;for(let C=0;C<64;++C){let y=C/63,E=D.lerp(m,g,y);a=Math.sin(E);let x=(.5*Math.log((1+a)/(1-a))-c)*f;A[_++]=x,A[_++]=x}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(A),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=zV,e.vertexArray=o.vertexArray}function Mqe(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Gi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Nqe(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Lqe(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Nqe(e._errorEvent,i)}}var ds=Li;var Q6=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},WL=Q6;var k6=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}},BT=k6;var Oqe=new ce,_de=new ce,Fqe=new ce,Qqe=new ce,kqe=new ce,Uqe=new ce,U6=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=ce.intersection(o.rectangle,n.rectangle,Oqe),a=o.tilingScheme,c=e._computeImageryRange(t,s,a,r),u=Qqe;a.rectangleToNativeRectangle(t,u);let f=kqe;a.rectangleToNativeRectangle(s,f);let h=(g,A,_)=>{let C=a.tileXYToRectangle(g,A,_),y=ce.intersection(C,s,Fqe);if(!l(y))return;let E=Uqe;return a.rectangleToNativeRectangle(y,E),E};return e._computeImageryCoverages(n,c,r,u,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(ce.northwest(r),o),a=i.positionToTileXY(ce.southeast(r),o),c=new BT;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let u=t.width/512,f=t.height/512,h=i.tileXYToRectangle(c.minX,c.minY,o);Math.abs(h.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(h.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let A=i.tileXYToRectangle(c.maxX,c.maxY,o);return Math.abs(A.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(A.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ce),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=ce.intersection(t,n,_de);return l(i)?i:e._clampRectangle(t,n,_de)}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 u=n.minY;u<=n.maxY;u++){let f=r(a,u,i);if(!l(f))continue;let h=e._localizeToCartesianRectangle(f,o,void 0),m=t.getImageryFromCache(a,u,i),g=new e(a,u,i,h,m);s.push(g)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new BT);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}},wT=U6;var G6=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 Xe;Xe.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=hg.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 d,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 ce);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 d;return e.map(t,r=>(M.multiplyByPoint(n,r,i),i))}static transformToCartographic(t,n){let i=new he;return e.map(t,r=>(n.cartesianToCartographic(r,i),i))}static createProjectedPositions(t,n){let i=new d;return e.map(t,r=>(n.project(r,i),i))}static computeTexCoords(t,n){let i=new F,o=1/n.width,r=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*o,u=(a.y-n.y)*r,f=Math.min(Math.max(c,0),1),h=Math.min(Math.max(u,0),1);return i.x=f,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:rt.TEXCOORD,setIndex:0,componentDatatype:q.FLOAT,type:Ut.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new F(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},DI=G6;var z6=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}},jL=z6;var V6=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new M,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=ut.createVertexBuffer({context:t,typedArray:r.typedArray,usage:Oe.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!M.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),u=c.length;for(let f=0;f<u;f++){let h=c[f],m=DI.createCartographicPositions(o,s,h),g=DI.computeCartographicBoundingRectangle(m),A=new jL(m,r,g,h);a.push(A)}return M.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=DI.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 wT.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 u=Math.log2(s*c/a);return wT._clampImageryLevel(i,u)}_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 u=0;u<c;u++){let h=a[u].imagery;h.state===Wn.READY||h.state===Wn.FAILED||h.state===Wn.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(),de(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new M);let o=t.sceneGraph;return M.clone(M.IDENTITY,i),M.multiply(i,t.modelMatrix,i),M.multiply(i,o.components.transform,i),M.multiply(i,o.axisCorrectionMatrix,i),M.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=Lt.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}},vI=V6;var H6=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},qL=H6;var Gqe=!1,zqe=new ce,Vqe=new ce,Y6=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=vI._extractProjections(s),c=[...new Set(a)],u=e._computeIndexMapping(a,c),f=e._createImageryInputs(s,r,u);if(f.length===0)return;f.length>10&&(At("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(r,t);let h=[];for(let m=0;m<s.length;m++)h.push(s.get(m));e._processImageryInputs(h,t,f,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,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}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,pe.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 WL;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]",pe.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",pe.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",pe.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",pe.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",pe.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",pe.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",pe.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",pe.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",pe.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",pe.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,pe.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));"]),Gqe&&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)",pe.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,u=r.textureTranslationAndScale;i.imageryTextures[o]=a,i.imageryTextureTranslationAndScale[o]=u,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 f=i.imageryTextureColorToAlpha[o];if(l(f)||(f=new se,i.imageryTextureColorToAlpha[o]=f),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let m=s.colorToAlpha;f.x=m.red,f.y=m.green,f.z=m.blue,f.w=s.colorToAlphaThreshold}else f.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],u=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(s);for(let h=0;h<f.length;h++){let m=f[h],g=e._createImageryInput(s,m,u,a);l(g)&&o.push(g)}}return o}static _createImageryInput(t,n,i,o){let r=n.imagery;if(r.state===Wn.FAILED||r.state===Wn.INVALID)return;let s=r.textureWebMercator;if(!l(s)&&(s=r.texture,!l(s))){r.state===Wn.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,u=new se(c.minX,c.minY,c.maxX,c.maxY);return new qL(t,s,a,u,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,zqe),s=o.rectangleToNativeRectangle(i,Vqe);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,u=t.width*i,f=t.height*o;return new se(a,c,u,f)}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}},KL=Y6;var JL=`#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 Hqe={UNLIT:0,PBR:1},mm=Object.freeze(Hqe);var Cde={name:"LightingPipelineStage"};Cde.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,pe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",pe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===mm.PBR?o.addDefine("LIGHTING_PBR",void 0,pe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,pe.FRAGMENT),o.addFragmentLines(JL)};var XL=Cde;var ZL=`// 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:Yqe,MetallicRoughness:W6,SpecularGlossiness:j6,Specular:yde,Clearcoat:Ede}=yn,Ide={name:"MaterialPipelineStage",_processTexture:yu,_processTextureTransform:bde};Ide.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:h}=n.context;jqe(i,r,s,u,f,h,c),l(i.specularGlossiness)?qqe(i.specularGlossiness,r,s,u,c):(l(i.specular)&&Lt.supportedExtensions.KHR_materials_specular&&Kqe(i.specular,r,s,u,c),l(i.anisotropy)&&Lt.supportedExtensions.KHR_materials_anisotropy&&Xqe(i.anisotropy,r,s,u,c),l(i.clearcoat)&&Lt.supportedExtensions.KHR_materials_clearcoat&&Zqe(i.clearcoat,r,s,u,c),$qe(i.metallicRoughness,r,s,u,c));let m=Lt.getAttributeBySemantic(t,rt.NORMAL),g=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading,A=e.lightingOptions;i.unlit||!m||a||g?A.lightingModel=mm.UNLIT:A.lightingModel=mm.PBR;let _=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=_;let C=e.alphaOptions;i.alphaMode===lm.BLEND?C.pass=we.TRANSLUCENT:i.alphaMode===lm.MASK&&(C.alphaCutoff=i.alphaCutoff),s.addFragmentLines(ZL),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,pe.BOTH)};function bde(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,pe.FRAGMENT),t[s]=function(){return n.transform}}function Wqe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,pe.FRAGMENT),t[s]=function(){return n.scale}}function yu(e,t,n,i,o,r){e.addUniform("sampler2D",i,pe.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,pe.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,c,pe.FRAGMENT);let f=n.transform;l(f)&&!X.equals(f,X.IDENTITY)&&bde(e,t,n,i,o);let{scale:h}=n;l(h)&&h!==1&&Wqe(e,t,n,i,o)}function jqe(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:u,occlusionTexture:f}=e;l(a)&&!d.equals(a,Yqe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",pe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,pe.FRAGMENT),l(c)&&!s&&yu(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(u)&&!s&&yu(n,t,u,"u_normalTexture","NORMAL",o),l(f)&&!s&&yu(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function qqe(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,pe.FRAGMENT),l(r)&&!o&&yu(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!se.equals(s,j6.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",pe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&yu(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!d.equals(c,j6.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",pe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(u)&&u!==j6.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",pe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,pe.FRAGMENT))}function Kqe(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,pe.FRAGMENT),l(r)&&!o&&yu(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==yde.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",pe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&yu(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!d.equals(c,yde.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",pe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,pe.FRAGMENT))}var Jqe=new d;function Xqe(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,pe.FRAGMENT),l(a)&&!o&&yu(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",pe.FRAGMENT),t.u_anisotropy=function(){return d.fromElements(c,u,r,Jqe)}}function Zqe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,pe.FRAGMENT),l(r)&&r!==Ede.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",pe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,pe.FRAGMENT)),l(s)&&!o&&yu(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==Ede.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",pe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT)),l(c)&&!o&&yu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&yu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function $qe(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,pe.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&yu(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!se.equals(s,W6.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",pe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,pe.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&yu(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==W6.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",pe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,pe.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==W6.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",pe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT))}var $L=Ide;var Ql={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"};Ql.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Ql.METADATA_PICKING_VALUE_TYPE,"float",pe.FRAGMENT),i.addDefine(Ql.METADATA_PICKING_VALUE_STRING,"0.0",pe.FRAGMENT),i.addDefine(Ql.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",pe.FRAGMENT),i.addDefine(Ql.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",pe.FRAGMENT),i.addDefine(Ql.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",pe.FRAGMENT),i.addDefine(Ql.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",pe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",pe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Ql.METADATA_PICKING_VALUE_TYPE} value = ${Ql.METADATA_PICKING_VALUE_TYPE}(${Ql.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Ql.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Ql.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Ql.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Ql.METADATA_PICKING_VALUE_COMPONENT_W};`],pe.FRAGMENT)};var lf=Ql;var eO=`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 bc={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)"};bc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,pe.VERTEX),rKe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let h=c[f],m=h.semantic;m!==rt.POSITION&&m!==rt.NORMAL&&m!==rt.TANGENT||(tKe(e,h,e.attributeIndex,a),e.attributeIndex++)}}sKe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,pe.VERTEX),n.addVertexLines(eO);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=St(s,e.uniformMap)};var eKe={attributeString:void 0,functionId:void 0};function tKe(e,t,n,i){let o=e.shaderBuilder;nKe(e,t,n);let r=iKe(t,eKe);oKe(o,r,i)}function nKe(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 iKe(e,t){switch(e.semantic){case rt.POSITION:t.attributeString="Position",t.functionId=bc.FUNCTION_ID_GET_MORPHED_POSITION;break;case rt.NORMAL:t.attributeString="Normal",t.functionId=bc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case rt.TANGENT:t.attributeString="Tangent",t.functionId=bc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function oKe(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 rKe(e){e.addFunction(bc.FUNCTION_ID_GET_MORPHED_POSITION,bc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,pe.VERTEX),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(bc.FUNCTION_ID_GET_MORPHED_NORMAL,bc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,pe.VERTEX),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(bc.FUNCTION_ID_GET_MORPHED_TANGENT,bc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,pe.VERTEX),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function sKe(e){e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var tO=bc;var xde={name:"PickingPipelineStage"};xde.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)aKe(e,t,a,i);else if(l(a))cKe(e,i);else{let c=Tde(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",pe.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function Tde(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(Fr.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 aKe(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Lt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Lt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",pe.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function cKe(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 m=Tde(e,h),g=t.createPickId(m);s.push(g),i[h]=g;let A=g.color;o[h*4+0]=G.floatToByte(A.red),o[h*4+1]=G.floatToByte(A.green),o[h*4+2]=G.floatToByte(A.blue),o[h*4+3]=G.floatToByte(A.alpha)}r._pickIds=i;let a=ut.createVertexBuffer({context:t,typedArray:o,usage:Oe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,pe.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var nO=xde;var lKe={ADD:0,REPLACE:1},ar=Object.freeze(lKe);var iO=`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 uKe=new se,Bde={name:"PointCloudStylingPipelineStage"};Bde.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,u=!l(a)&&c;if(l(r)&&!u){let _=AKe(a),C=mKe(r,_);pKe(i,C);let E=gKe(C).indexOf("normalMC")>=0,I=Lt.getAttributeBySemantic(t,rt.NORMAL);if(E&&!I)throw new ue("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,pe.VERTEX),C.styleTranslucent&&(e.alphaOptions.pass=we.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,pe.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,pe.VERTEX);let h,m,g;Fr.is3DTiles(o.type)&&(m=!0,h=o.content,g=h.tile.refine===ar.ADD),i.addUniform("vec4","model_pointCloudParameters",pe.VERTEX),i.addVertexLines(iO);let A=e.uniformMap;A.model_pointCloudParameters=function(){let _=uKe,C=1;m&&(C=g?5:h.tileset.memoryAdjustedScreenSpaceError),_.x=f.maximumAttenuation??C,_.x*=n.pixelRatio;let y=fKe(e,t,f,h);_.y=y*f.geometricErrorScale;let E=n.context,I=n.camera.frustum,x;return n.mode===oe.SCENE2D||I instanceof fn?x=Number.POSITIVE_INFINITY:x=E.drawingBufferHeight/n.camera.frustum.sseDenominator,_.z=x,m&&(_.w=h.tileset.timeSinceLoad),_}};var Sde=new d;function fKe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=Lt.getAttributeBySemantic(t,rt.POSITION),r=o.count,s=e.runtimeNode.transform,a=d.subtract(o.max,o.min,Sde);a=M.multiplyByPointAsVector(s,a,Sde);let c=a.x*a.y*a.z;return D.cbrt(c/r)}var dKe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},hKe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function AKe(e){let t=Ve(hKe);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 q6="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function mKe(e,t){let n=dKe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${q6})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${q6})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${q6})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function pKe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,pe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,pe.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,pe.VERTEX),e.addVertexLines(o))}function K6(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 gKe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&K6(t,o),l(n)&&K6(n,o),l(i)&&K6(i,o),o}var oO=Bde;var rO=`void primitiveOutlineStage() {
v_outlineCoordinates = a_outlineCoordinates;
}
`;var sO=`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 wde={name:"PrimitiveOutlinePipelineStage"};wde.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,pe.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",pe.FRAGMENT);let a=II.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",pe.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",pe.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(rO),i.addFragmentLines(sO)};var aO=wde;var Dde={name:"PrimitiveStatisticsPipelineStage",_countGeometry:vde,_count2DPositions:Pde,_countMorphTargetAttributes:Rde,_countMaterialTextures:Mde,_countFeatureIdTextures:Nde,_countBinaryMetadata:Lde};Dde.process=function(e,t,n){let i=e.model,o=i.statistics;vde(o,t),Pde(o,e.runtimePrimitive),Rde(o,t),Mde(o,t.material),Nde(o,t.featureIds),Lde(o,i)};function vde(e,t){let n=l(t.indices)?t.indices.count:Lt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Pe.POINTS?e.pointsLength+=n:Pe.isTriangles(i)&&(e.trianglesLength+=_Ke(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}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 _Ke(e,t){switch(e){case Pe.TRIANGLES:return t/3;case Pe.TRIANGLE_STRIP:case Pe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Pde(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Rde(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 u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Mde(e,t){let n=CKe(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 CKe(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 Nde(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof yn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Lde(e,t){let n=t.structuralMetadata;l(n)&&(yKe(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 yKe(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 u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var cO=Dde;var EKe=new M,IKe=new M,Ode={name:"SceneMode2DPipelineStage"};Ode.process=function(e,t,n){let i=Lt.getAttributeBySemantic(t,rt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=M.multiplyTransformation(s,a,EKe),u=TKe(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let h=e.runtimeNode.node.instances;if(l(h))return;if(l(i.typedArray)){let _=wKe(i,c,u,n);f.positionBuffer2D=_,r._modelResources.push(_),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,pe.VERTEX),o.addUniform("mat4","u_modelView2D",pe.VERTEX);let m=M.fromTranslation(u.center,new M),g=n.context,A={u_modelView2D:function(){return M.multiplyTransformation(g.uniformState.view,m,IKe)}};e.uniformMap=St(A,e.uniformMap)};var bKe=new d,xKe=new d;function TKe(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,bKe),o=to.computeActualEllipsoidPosition(n,i,i),r=M.multiplyByPoint(t,e.positionMax,xKe),s=to.computeActualEllipsoidPosition(n,r,r);return le.fromCornerPoints(o,s,new le)}var Fde=new d;function SKe(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=d.fromArray(e,s,Fde),c=d.multiplyComponents(a,r,a),u=d.add(c,o,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function BKe(e,t,n,i){let o;l(e.quantization)?o=SKe(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 u=d.fromArray(o,c,Fde);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=M.multiplyByPoint(t,u,u),h=to.computeActualEllipsoidPosition(i,f,f),m=d.subtract(h,n,h);o[c]=m.x,o[c+1]=m.y,o[c+2]=m.z}return o}function wKe(e,t,n,i){let o=Ve(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,s=BKe(e,t,r,o),a=ut.createVertexBuffer({context:i.context,typedArray:s,usage:Oe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var lO=Ode;var uO=`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 PI={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};PI.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,pe.VERTEX),vKe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,pe.VERTEX),n.addVertexLines(uO);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=St(r,e.uniformMap)};function DKe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===rt.JOINTS||r.semantic===rt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function vKe(e,t){e.addFunction(PI.FUNCTION_ID_GET_SKINNING_MATRIX,PI.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,pe.VERTEX),e.addFunctionLines(PI.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=DKe(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(PI.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(PI.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var fO=PI;var dO=`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 Qde={name:"VerticalExaggerationPipelineStage"},PKe=new F;Qde.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(dO),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,pe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",pe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return F.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,PKe)}};var hO=Qde;var J6={};function RKe(e){let t=Fe.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 MKe(e,t){let n=t.length,i=Fe.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 NKe(e){let t=e-2,n=2+t*4,i=Fe.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 LKe(e,t){let i=t.length-2,o=2+i*4,r=Fe.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=c}return r}function OKe(e){let t=e-2,n=2+t*4,i=Fe.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 FKe(e,t){let i=t.length-2,o=2+i*4,r=Fe.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}J6.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Pe.TRIANGLES)return i?MKe(t,n):RKe(t);if(e===Pe.TRIANGLE_STRIP)return i?LKe(t,n):NKe(t);if(e===Pe.TRIANGLE_FAN)return i?FKe(t,n):OKe(t)};J6.getWireframeIndicesCount=function(e,t){return e===Pe.TRIANGLES?t*2:e===Pe.TRIANGLE_STRIP||e===Pe.TRIANGLE_FAN?2+(t-2)*4:t};var DT=J6;var kde={name:"WireframePipelineStage"};kde.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,pe.FRAGMENT);let o=e.model,r=QKe(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=Pe.LINES,e.count=DT.getWireframeIndicesCount(a,c)};function QKe(e,t,n){let o=Lt.getAttributeBySemantic(e,rt.POSITION).count,r=n.context.webgl2,s;if(l(t)){let f=t.buffer,h=t.count;l(f)&&r?(s=f.sizeInBytes===h?new Uint8Array(h):Fe.createTypedArray(o,h),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=DT.createWireframeIndices(a,o,s),u=Fe.fromSizeInBytes(c.BYTES_PER_ELEMENT);return ut.createIndexBuffer({context:n.context,typedArray:c,usage:Oe.STATIC_DRAW,indexDatatype:u})}var AO=kde;function Ude(e){e=e??V.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=[]}Ude.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,u=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=l(n.morphTargets)&&n.morphTargets.length>0,m=l(i.skin),g=l(o.imageryLayers),A=l(r),C=!(A&&l(r.fragmentShaderText))||r.mode!==dg.REPLACE_MATERIAL,y=Lt.hasQuantizedAttributes(n.attributes),E=o.debugWireframe&&Pe.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),I=o.pointCloudShading,x=l(I)&&I.attenuation,S=l(I)&&I.backFaceCulling,w=n.primitiveType===Pe.POINTS&&(l(s)||x||S),v=o._enableShowOutline&&l(n.outlineCoordinates),P=l(n.edgeVisibility),N=kKe(o,i,n),L=l(o.classificationType);u&&t.push(lO),t.push(DL),E&&t.push(AO),L&&t.push(lL),h&&t.push(tO),m&&t.push(fO),w&&t.push(oO),y&&t.push(EL),g&&(v?At("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(KL)),C&&t.push($L),t.push(PC),t.push(_d),t.push(lf),N.hasPropertyTable&&(t.push(MC),t.push(cL),t.push(dL)),f&&t.push(hO),A&&t.push(CL),t.push(XL),o.allowPicking&&t.push(nO),v&&t.push(aO),P&&(e.edgeVisibilityRequested=!0,t.push(TL),t.push(bL)),t.push(aL),t.push(cO)};function kKe(e,t,n){let i;return l(t.instances)&&(i=Lt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Lt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var mO=Ude;function X6(e){e=e??V.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],UKe(this)}Object.defineProperties(X6.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 UKe(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 u=i[c].index,f=r[u];s.push(f);let h=n[c],m=Gde(f,h,new M);a.push(m)}}function Gde(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}X6.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]=Gde(i,o,e[n])}};var pO=X6;function GKe(){this.pass=void 0,this.alphaCutoff=void 0}var RI=GKe;function zKe(e){this.shaderBuilder=new xp,this.model=e,this.uniformMap={},this.alphaOptions=new RI,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var gO=zKe;var _O=`void silhouetteStage(inout vec4 color) {
if(model_silhouettePass) {
color = czm_gammaCorrect(model_silhouetteColor);
}
}`;var CO=`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 VV={name:"ModelSilhouettePipelineStage"};VV.silhouettesLength=0;VV.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++VV.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,pe.BOTH),i.addVertexLines(CO),i.addFragmentLines(_O),i.addUniform("vec4","model_silhouetteColor",pe.FRAGMENT),i.addUniform("float","model_silhouetteSize",pe.VERTEX),i.addUniform("bool","model_silhouettePass",pe.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=St(o,e.uniformMap),e.hasSilhouette=!0};var yO=VV;var EO=`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 HV={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};HV.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,pe.FRAGMENT),i.addFragmentLines(EO);let o={};i.addUniform("float",HV.SPLIT_DIRECTION_UNIFORM_NAME,pe.FRAGMENT),o[HV.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=St(o,e.uniformMap)};var IO=HV;function VKe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ve(e.uniformMap),this.alphaOptions=Ve(e.alphaOptions),this.renderStateOptions=Ve(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 bO=VKe;function HKe(e){e=e??V.EMPTY_OBJECT,this.lightingModel=e.lightingModel??mm.UNLIT}var xO=HKe;function YKe(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=Ve(e.uniformMap),this.alphaOptions=Ve(e.alphaOptions),this.renderStateOptions=Ve(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:Lt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Lt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=d.clone(i.min,new d),this.positionMax=d.clone(i.max,new d),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new xO,this.pickId=void 0}var TO=YKe;function $6(e){e=e??V.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!==Jn.CESIUM_3D_TILE,this._classifies3DTiles=o!==Jn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],KKe(this)}function WKe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:yt.KEEP,zFail:yt.DECREMENT_WRAP,zPass:yt.KEEP},backFunction:e,backOperation:{fail:yt.KEEP,zFail:yt.INCREMENT_WRAP,zPass:yt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},depthMask:!1}}var jKe={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND},qKe={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:yt.ZERO,zFail:yt.ZERO,zPass:yt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Hde=[];function KKe(e){let t=e._command,n=Hde;if(e._useDebugWireframe){t.pass=we.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=SO(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=we.TERRAIN_CLASSIFICATION,s=Z6(t,r),a=zde(t,r);n.length=0,n.push(s,a),e._commandListTerrain=SO(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Vde(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=we.CESIUM_3D_TILE_CLASSIFICATION,s=Z6(t,r),a=zde(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=SO(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Vde(e,n,e._commandList3DTilesPicking))}}function SO(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 u=o[c],f=r[c];for(let h=0;h<a;h++){let m=t[h],g=et.shallowClone(m);g.count=u,g.offset=f,n.push(g)}}return n}function Z6(e,t){let n=et.shallowClone(e);n.cull=!1,n.pass=t;let i=t===we.TERRAIN_CLASSIFICATION?Xn.ALWAYS:Xn.EQUAL,o=WKe(i);return n.renderState=ze.fromCache(o),n}function zde(e,t){let n=et.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(jKe),n}var JKe=[];function Vde(e,t,n){let i=ze.fromCache(qKe),o=t[0],r=t[1],s=et.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=et.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=JKe;return c.length=0,c.push(s,a),SO(e,c,n)}Object.defineProperties($6.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=M.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=le.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});$6.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){ei(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&ei(t,this._commandListTerrain),this._classifies3DTiles&&ei(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=Z6(this._command,o),s=Hde;s.length=0,s.push(r),this._commandListIgnoreShow=SO(this,s,this._commandListIgnoreShow)}ei(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&ei(t,this._commandListTerrainPicking),this._classifies3DTiles&&ei(t,this._commandList3DTilesPicking)),t};var BO=$6;function wO(e){e=e??V.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===we.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,h=c,m=l(n.edgeGeometry);this._command=t,this._modelMatrix=M.clone(t.modelMatrix),this._boundingVolume=le.clone(t.boundingVolume),this._modelMatrix2D=new M,this._boundingVolume2D=new le,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=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=h,this._needsEdgeCommands=m,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,XKe(this)}function pm(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}pm.clone=function(e){return new pm({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function XKe(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 pm({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new pm({command:oJe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new pm({command:fJe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new pm({command:dJe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new pm({command:rJe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new pm({command:sJe(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 pm({command:aJe(t,r,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand)}}Object.defineProperties(wO.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=M.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=le.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,$Ke(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,eJe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,tJe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,nJe(this))}}});function ZKe(e,t){let n=e._modelMatrix;e._modelMatrix2D=M.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=le.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function $Ke(e){let t=e.shadows,n=Tn.castShadows(t),i=Tn.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 eJe(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=Ve(r.renderState,!0);s.cull.enabled=t,r.renderState=ze.fromCache(s)}}}function tJe(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=Ve(r.renderState,!0);s.cull.face=t,r.renderState=ze.fromCache(s)}}}function nJe(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}}}wO.prototype.pushCommands=function(e,t){let n=eq(this,e);n&&!this._has2DCommands&&(iJe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(ZKe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Hh.ALL_OPAQUE&&NI(t,this._translucentCommand,n),i===Hh.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||NI(o._backfaceCommands,this._skipLodBackfaceCommand,n),cJe(this,r,n),NI(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){NI(t,this._silhouetteModelCommand,n);return}return NI(t,this._originalCommand,n),t}};wO.prototype.pushSilhouetteCommands=function(e,t){let n=eq(this,e);return NI(t,this._silhouetteColorCommand,n),t};wO.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=eq(this,e);return NI(t,this._edgeCommand,n),t};function NI(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function eq(e,t){if(t.mode!==oe.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*D.PI;return o<s&&r>s||o<-s&&r>-s}function MI(e,t){if(!l(t))return;let n=pm.clone(t),i=et.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 iJe(e){MI(e,e._originalCommand),MI(e,e._translucentCommand),MI(e,e._skipLodBackfaceCommand),MI(e,e._skipLodStencilCommand),MI(e,e._silhouetteModelCommand),MI(e,e._silhouetteColorCommand),MI(e,e._edgeCommand)}function oJe(e){let t=et.shallowClone(e);t.pass=we.TRANSLUCENT;let n=Ve(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=dn.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function rJe(e,t){let n=t._silhouetteId%255,i=et.shallowClone(e),o=Ve(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ee.ALWAYS,backFunction:ee.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ze.fromCache(o),i}function sJe(e,t){let n=t._silhouetteId%255,i=et.shallowClone(e),o=Ve(e.renderState,!0);o.cull.enabled=!1,(e.pass===we.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=we.TRANSLUCENT,o.depthMask=!1,o.blending=dn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ee.NOTEQUAL,backFunction:ee.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP}};let s=Ve(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function aJe(e,t){let n=t.edgeGeometry,i=et.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=Ve(e.uniformMap);return o.u_isEdgePass=function(){return!0},i.uniformMap=o,i.castShadows=!1,i.receiveShadows=!1,i}function cJe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=lJe(o);if(r!==s){let a=uJe(r),c=Ve(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function lJe(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function uJe(e){return Yt.CESIUM_3D_TILE_MASK|e<<Yt.SKIP_LOD_BIT_SHIFT}function fJe(e){let t=et.shallowClone(e),n=Ve(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Ni.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ve(t.uniformMap),o=new F(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ze.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function dJe(e){let t=et.shallowClone(e),n=Ve(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Yt.SKIP_LOD_MASK,i.reference=Yt.CESIUM_3D_TILE_MASK,i.frontFunction=Xn.GREATER_OR_EQUAL,i.frontOperation.zPass=yt.REPLACE,i.backFunction=Xn.GREATER_OR_EQUAL,i.backOperation.zPass=yt.REPLACE,n.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,t.renderState=ze.fromCache(n),t}var DO=wO;var vO=`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);
#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 PO=`
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 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 Yde(){}Yde.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=hJe(e,n,t),o=AJe(e,i,t),r=e.model;return l(r.classificationType)?new BO({primitiveRenderResources:e,command:o}):new DO({primitiveRenderResources:e,command:o})};function hJe(e,t,n){t.addVertexLines(vO),t.addFragmentLines(PO);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function AJe(e,t,n){let i=mJe(e),o=new oi({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===oe.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=M.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new M),f=e.runtimePrimitive.boundingSphere2D;else{let y=c?a._computedModelMatrix:a._computedModelMatrix2D;u=M.multiplyTransformation(y,e.runtimeNode.computedTransform,new M),f=le.transform(e.boundingSphere,u)}let h=Ve(ze.fromCache(e.renderStateOptions),!0);h.cull.face=Lt.getCullFace(u,e.primitiveType),h=ze.fromCache(h);let m=l(r.classificationType),g=m?!1:Tn.castShadows(r.shadows),A=m?!1:Tn.receiveShadows(r.shadows),_=m?void 0:e.pickId;return new et({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:_,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:A})}function mJe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var RO=Yde;function Kc(e){e=e??V.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=M.clone(M.IDENTITY),this._computedModelMatrix2D=M.clone(M.IDENTITY),this._axisCorrectionMatrix=Lt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M),this._runtimeArticulations={},pJe(this)}Object.defineProperties(Kc.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 pJe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Wde(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let E=0;E<s;E++){let I=r[E],x=new YN({articulation:I,sceneGraph:e}),S=x.name;a[S]=x}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let h=n.nodes.length,m=M.IDENTITY;for(let E=0;E<h;E++){let I=n.nodes[E],x=jde(e,I,m);e._rootNodes.push(x)}let g=t.skins,A=e._runtimeSkins,_=g.length;for(let E=0;E<_;E++){let I=g[E];A.push(new pO({skin:I,sceneGraph:e}))}let C=e._skinnedNodes,y=C.length;for(let E=0;E<y;E++){let I=C[E],x=e._runtimeNodes[I],w=c[I].skin.index;x._runtimeSkin=A[w],x.updateJointMatrices()}e.applyArticulations()}function Wde(e,t){let n=e._components,i=e._model;e._computedModelMatrix=M.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=M.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=M.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var gJe=new d;function _Je(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,gJe);if(!d.equals(i,d.ZERO))e._computedModelMatrix2D=It.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=It.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=M.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=le.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function jde(e,t,n){let i=[],o=Lt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let h=t.children[f],m=M.multiplyTransformation(n,o,new M),g=jde(e,h,m);i.push(g)}let s=new sL({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new mO({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,h=new ZN(f,s);f._nodesByName[u]=h}return c}var CJe=new d,yJe=new d,EJe=new d,IJe=new d;Kc.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};Kc.prototype.buildRenderResources=function(e){let t=this._model,n=new gO(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 bO(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 u=r.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,h=new TO(a,u);a.primitiveRenderResources[c]=h;for(let m=0;m<f.length;m++)f[m].process(h,u.primitive,e)}}return n};Kc.prototype.computeBoundingVolumes=function(e){let t=this._model,n=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,CJe),i=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,yJe);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 u=r.runtimePrimitives[c],f=s.primitiveRenderResources[c];u.boundingSphere=le.clone(f.boundingSphere,new le);let h=M.multiplyByPoint(a,f.positionMin,EJe),m=M.multiplyByPoint(a,f.positionMax,IJe);d.minimumByComponent(n,h,n),d.maximumByComponent(i,m,i)}}this._boundingSphere=le.fromCornerPoints(n,i,new le),this._boundingSphere=le.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=le.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=le.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Kc.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=RO.buildModelDrawCommand(a,t);s.drawCommand=c}}};Kc.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(vC),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(VN),n.isClippingEnabled()&&t.push(qN),n.isClippingPolygonsEnabled()&&t.push(XN),n.hasSilhouette(e)&&t.push(yO),l(n.splitDirection)&&n.splitDirection!==Lr.NONE&&t.push(IO),Fr.is3DTiles(n.type)&&t.push(QN),i&&t.push(GN))};Kc.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!==oe.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)}}};Kc.prototype.updateModelMatrix=function(e,t){Wde(this,e),t.mode!==oe.SCENE3D&&_Je(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Kc.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 qde(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);qde(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,o)}}function YV(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];qde(e,c,t,n,i)}}var bJe={backFaceCulling:void 0};Kc.prototype.updateBackFaceCulling=function(e){let t=bJe;t.backFaceCulling=e,YV(this,!1,xJe,t)};function xJe(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var TJe={shadowMode:void 0};Kc.prototype.updateShadows=function(e){let t=TJe;t.shadowMode=e,YV(this,!1,SJe,t)};function SJe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var BJe={debugShowBoundingVolume:void 0};Kc.prototype.updateShowBoundingVolume=function(e){let t=BJe;t.debugShowBoundingVolume=e,YV(this,!1,wJe,t)};function wJe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Kde=[],Jde=[],DJe={frameState:void 0,hasSilhouette:void 0};Kc.prototype.pushDrawCommands=function(e){let t=Kde;t.length=0;let n=Jde;n.length=0;let i=DJe;i.hasSilhouette=this._model.hasSilhouette(e),i.frameState=e,YV(this,!0,vJe,i),ei(e.commandList,t),ei(e.commandList,n)};function vJe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Kde,s=Jde,a=e.drawCommand;a.pushCommands(n,n.commandList),i&&!o.pick&&a.pushSilhouetteCommands(n,r),l(a.pushEdgeCommands)&&a.pushEdgeCommands(n,s)}Kc.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)};Kc.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var MO=Kc;function OC(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Pt}Object.defineProperties(OC.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}}});OC.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()};OC.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};OC.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};OC.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};OC.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};OC.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var NO=OC;var ehe=mr(SG(),1);var Xde={},LI=Uint32Array.BYTES_PER_ELEMENT;Xde.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=LI;let o=i.getUint32(t,!0);if(o!==1)throw new ue(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=LI,t+=LI;let r=i.getUint32(t,!0);if(r===0)throw new ue("Feature table must have a byte length greater than zero");t+=LI;let s=i.getUint32(t,!0);t+=LI;let a=i.getUint32(t,!0);t+=LI;let c=i.getUint32(t,!0);t+=LI;let u=Ir(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let h,m;a>0&&(h=Ir(n,t,a),Object.keys(h).length===0&&(h=void 0),t+=a,c>0&&(m=new Uint8Array(e,t,c),m=new Uint8Array(m),t+=c));let g=new zh(u,f),A=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=A,!l(A))throw new ue("Feature table global property: POINTS_LENGTH must be defined");let _=g.getGlobalProperty("RTC_CENTER",q.FLOAT,3);l(_)&&(_=d.unpack(_));let C=RJe(g,h);if(C.rtcCenter=_,C.pointsLength=A,!C.hasPositions){let y=MJe(g);C.positions=y,C.hasPositions=C.hasPositions||l(y)}if(!C.hasPositions)throw new ue("Either POSITION or POSITION_QUANTIZED must be defined.");if(!C.hasNormals){let y=LJe(g);C.normals=y,C.hasNormals=C.hasNormals||l(y)}if(!C.hasColors){let y=NJe(g);C.colors=y,C.hasColors=C.hasColors||l(y),C.hasConstantColor=l(C.constantColor),C.isTranslucent=l(y)&&y.isTranslucent}if(!C.hasBatchIds){let y=OJe(g);C.batchIds=y,C.hasBatchIds=C.hasBatchIds||l(y)}if(C.hasBatchIds){let y=g.getGlobalProperty("BATCH_LENGTH");if(!l(y))throw new ue("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");C.batchLength=y}return(l(h)||l(m))&&(C.batchTableJson=h,C.batchTableBinary=m),PJe(C),C};function PJe(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 RJe(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,u,f,h,m;if(l(s)){o=s.properties;let A=s.byteOffset,_=s.byteLength;if(!l(o)||!l(A)||!l(_))throw new ue("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(A,A+_),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),h=l(o.BATCH_ID),m=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:St(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:m,hasNormals:f,hasBatchIds:h}}function MJe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",q.FLOAT,3),{name:rt.POSITION,semantic:rt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:q.FLOAT,type:Ut.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",q.FLOAT,3);if(!l(i))throw new ue("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",q.FLOAT,3);if(!l(r))throw new ue("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:rt.POSITION,semantic:rt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:q.FLOAT,type:Ut.VEC3,quantizedRange:o,quantizedVolumeOffset:d.unpack(r),quantizedVolumeScale:d.unpack(i),quantizedComponentDatatype:q.UNSIGNED_SHORT,quantizedType:Ut.VEC3}}}function NJe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",q.UNSIGNED_BYTE,4),{name:rt.COLOR,semantic:rt.COLOR,setIndex:0,typedArray:n,componentDatatype:q.UNSIGNED_BYTE,type:Ut.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:rt.COLOR,setIndex:0,typedArray:n,componentDatatype:q.UNSIGNED_BYTE,type:Ut.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:rt.COLOR,setIndex:0,typedArray:n,componentDatatype:q.FLOAT,type:Ut.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",q.UNSIGNED_BYTE,4),o=i[3],r=G.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:rt.COLOR,semantic:rt.COLOR,setIndex:0,constantColor:r,componentDatatype:q.FLOAT,type:Ut.VEC4,isQuantized:!1,isTranslucent:s}}}function LJe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",q.FLOAT,3),{name:rt.NORMAL,semantic:rt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:q.FLOAT,type:Ut.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",q.UNSIGNED_BYTE,2),{name:rt.NORMAL,semantic:rt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Ut.VEC2,quantizedComponentDatatype:q.UNSIGNED_BYTE,componentDatatype:q.FLOAT,type:Ut.VEC3}}function OJe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",q.UNSIGNED_SHORT,1);return{name:rt.FEATURE_ID,semantic:rt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:q.fromTypedArray(n),type:Ut.SCALAR}}}var OI=Xde;var FJe=yn.Components,QJe=yn.Scene,kJe=yn.Node,UJe=yn.Primitive,GJe=yn.Attribute,Zde=yn.Quantization,zJe=yn.FeatureIdAttribute,VJe=yn.Material,HJe=yn.MetallicRoughness;function FC(e){e=e??V.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=dt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}l(Object.create)&&(FC.prototype=Object.create(Yi.prototype),FC.prototype.constructor=FC);Object.defineProperties(FC.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});FC.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=OI.parse(this._arrayBuffer,this._byteOffset),this._state=dt.PROCESSING,this._promise=Promise.resolve(this)};FC.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===dt.READY)return!0;if(this._state===dt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=YJe(this,e.context)}return!1};function YJe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=qp.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&WJe(e,i,r),iXe(e,t),e._state=dt.READY,e}).catch(function(r){e.unload(),e._state=dt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function WJe(e,t,n){e._state=dt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:rt.POSITION,typedArray:n.POSITION.array,componentDatatype:q.FLOAT,type:Ut.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=d.fromElements(c,c,c),f=d.unpack(a.minValues),h=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=h<=255?q.UNSIGNED_BYTE:q.UNSIGNED_SHORT,o.quantizedType=Ut.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:rt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:q.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=q.UNSIGNED_BYTE,o.quantizedType=Ut.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:rt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:q.UNSIGNED_BYTE,type:Ut.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:rt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:q.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:rt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:q.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 u=c.data;r[a]={byteOffset:u.byteOffset,type:jJe(u.componentsPerAttribute),componentType:qJe(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function jJe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function qJe(e){switch(e){case ee.BYTE:return"BYTE";case ee.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ee.SHORT:return"SHORT";case ee.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ee.INT:return"INT";case ee.UNSIGNED_INT:return"UNSIGNED_INT";case ee.DOUBLE:return"DOUBLE";case ee.FLOAT:return"FLOAT"}}function LO(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Zde,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Zde;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=d.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=d.divideByScalar(c,a,new d),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new GJe;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=bn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=G.pack(t.constantColor,a)}else{let a=ut.createVertexBuffer({typedArray:i,context:n,usage:Oe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===rt.POSITION&&s&&(r.typedArray=i),r}var $de,WV;function KJe(e){if(!l(WV)){$de=new ehe.default(0),WV=new Array(e);for(let t=0;t<e;++t)WV[t]=$de.random()}return WV}var JJe=new d,XJe=new d,ZJe=new d;function $Je(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=KJe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=d.fromElements(s,s,s,JJe),u=d.fromElements(a,a,a,XJe),f,h,m;if(e.isQuantized)c=d.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)h=Math.floor(r[f]*i),m=d.unpack(t,h*3,ZJe),d.minimumByComponent(c,m,c),d.maximumByComponent(u,m,u);e.min=d.clone(c),e.max=d.clone(u)}var eXe={name:rt.COLOR,semantic:rt.COLOR,setIndex:0,constantColor:G.DARKGRAY,componentDatatype:q.FLOAT,type:Ut.VEC4,isQuantized:!1,isTranslucent:!1};function tXe(e,t,n){let i=[],o,r=t.positions;return l(r)&&($Je(r),o=LO(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=LO(e,t.normals,n),i.push(o)),l(t.colors)?(o=LO(e,t.colors,n),i.push(o)):(o=LO(e,eXe,n),i.push(o)),l(t.batchIds)&&(o=LO(e,t.batchIds,n),i.push(o)),i}function nXe(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?cg({count:n??i,batchTable:o,binaryBody:r,parseAsPropertyAttributes:s,customAttributeOutput:t}):new xa({schema:{},propertyTables:[]})}function iXe(e,t){let n=e._parsedContent,i=new HJe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new VJe;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=lm.BLEND);let s=!l(n.normals);o.unlit=s;let a=new UJe;if(a.attributes=tXe(e,n,t),a.primitiveType=Pe.POINTS,a.material=o,l(n.batchIds)){let g=new zJe;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new kJe;c.index=0,c.primitives=[a];let u=new QJe;u.nodes=[c],u.upAxis=eo.Z,u.forwardAxis=eo.X;let f=new FJe;f.scene=u,f.nodes=[c];let h=[];f.structuralMetadata=nXe(n,h),h.length>0&&oXe(e,a,h,t),l(n.rtcCenter)&&(f.transform=M.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let m=n.positions;l(m)&&m.isQuantized&&(f.transform=M.multiplyByTranslation(f.transform,m.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function oXe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=ut.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Oe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}FC.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 OO=FC;var rXe=new d,sXe=new d,aXe=new d,cXe=new M,lXe=new M,uXe=new M,fXe=new he,dXe=new le;function vT(e,t,n,i,o,r,s){if(!e._ready||n.mode===oe.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,u=c._runtimeNodes;for(let f=0;f<u.length;f++){let h=u[f],m=h.node,g=M.clone(h.computedTransform,cXe),A=M.clone(c.computedModelMatrix,lXe),_=m.instances;l(_)&&_.transformInWorldSpace&&(A=M.multiplyTransformation(e.modelMatrix,c.components.transform,A),g=M.multiplyTransformation(c.axisCorrectionMatrix,h.computedTransform,g));let C=M.multiplyTransformation(A,g,uXe);n.mode!==oe.SCENE3D&&(C=It.basisTo2D(n.mapProjection,C,C));let y=[];if(l(_)){let I=_.attributes[0].count,x=_.attributes[0].componentDatatype,S=12,w=h.transformsTypedArray;if(!l(w)){let v=h.instancingTransformsBuffer;l(v)&&n.context.webgl2&&(w=q.createTypedArray(x,I*S),v.getBufferData(w))}if(l(w))for(let v=0;v<I;v++){let P=v*S,N=new M(w[P],w[P+1],w[P+2],w[P+3],w[P+4],w[P+5],w[P+6],w[P+7],w[P+8],w[P+9],w[P+10],w[P+11],0,0,0,1);_.transformInWorldSpace?(M.multiplyTransformation(N,g,N),M.multiplyTransformation(A,N,N)):M.multiplyTransformation(N,C,N),y.push(N)}}y.length===0&&y.push(C);let E=h.runtimePrimitives.length;for(let I=0;I<E;I++){let x=h.runtimePrimitives[I],S=x.primitive;if(l(x.boundingSphere)&&!l(_)){let W=le.transform(x.boundingSphere,C,dXe),Z=ci.raySphere(t,W);if(!l(Z))continue}let w=Lt.getAttributeBySemantic(S,rt.POSITION),v=w.byteOffset,P=w.byteStride,N=w.count;if(!l(S.indices))continue;let L=S.indices.typedArray;if(!l(L)){let W=S.indices.buffer,Z=S.indices.count,Y=S.indices.indexDatatype;l(W)&&n.context.webgl2&&(Y===Fe.UNSIGNED_BYTE?L=new Uint8Array(Z):Y===Fe.UNSIGNED_SHORT?L=new Uint16Array(Z):Y===Fe.UNSIGNED_INT&&(L=new Uint32Array(Z)),W.getBufferData(L))}let p=w.typedArray,b=w.componentDatatype,T=w.type,B=w.quantization;l(B)&&(b=w.quantization.componentDatatype,T=w.quantization.type);let R=Ut.getNumberOfComponents(T),O=q.getSizeInBytes(b),U=!l(p)&&l(P)&&P!==R*O,k=R,z=0;U&&(k=P/O,z=v/O);let Q=N*k;if(!l(p)){let W=w.buffer;l(W)&&n.context.webgl2&&(p=q.createTypedArray(b,Q),W.getBufferData(p,U?0:v,0,Q)),B&&w.normalized&&(p=bn.dequantize(p,b,T,N))}if(!l(L)||!l(p))return;r=r??te.default,i=i??1,o=o??0;let H=L.length;for(let W=0;W<H;W+=3){let Z=L[W],Y=L[W+1],$=L[W+2];for(let K of y){let fe=tq(p,Z,z,k,B,K,i,o,r,rXe),ge=tq(p,Y,z,k,B,K,i,o,r,sXe),ne=tq(p,$,z,k,B,K,i,o,r,aXe),Ce=ci.rayTriangleParametric(t,fe,ge,ne,e.backFaceCulling??!0);l(Ce)&&Ce<a&&Ce>=0&&(a=Ce)}}}}if(a!==Number.MAX_VALUE){if(s=gn.getPoint(t,a,s),n.mode!==oe.SCENE3D){d.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,h=f.ellipsoid,m=f.unproject(s,fXe);h.cartographicToCartesian(m,s)}return s}}function tq(e,t,n,i,o,r,s,a,c,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],l(o))if(o.octEncoded){if(u=bn.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let h=u.x;u.x=u.z,u.z=u.y,u.y=h}}else u=d.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=d.add(u,o.quantizedVolumeOffset,u);return u=M.multiplyByPoint(r,u,u),s!==1&&Eo.getPosition(u,c,s,a,u),u}var nq=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}},FO=nq;var iq=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,u=new vI(t,a,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}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 FO(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),de(this)}},QO=iq;function To(e){e=e??V.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Fr.GLTF,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.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=X.clone(X.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 NN(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=G.clone(e.color),this._colorBlendMode=e.colorBlendMode??Yc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??G.RED;this._silhouetteColor=G.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??we.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 le,this._initialRadius=void 0,this._heightReference=e.heightReference??$e.NONE,this._heightDirty=this._heightReference!==$e.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 fm(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?cs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=M.clone(M.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?Qh.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._modelImagery=new QO(this),this._lightColor=d.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new $E,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new ng(e.environmentMapOptions);ng.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Tn.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===Fr.GLTF&&At("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new pt(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Lr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??G.BLACK,this._classificationType=e.classificationType,this._statistics=new NO,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 _e,this._readyEvent=new _e,this._texturesReadyEvent=new _e,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function oq(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function hXe(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 FN({model:e,propertyTable:s});n.push(a)}return n}function AXe(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=Lt.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],u=Lt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function aq(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(To.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=Qt.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){aq(e,this._color)&&this.resetDrawCommands(),this._color=G.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(!G.equals(e,this._silhouetteColor)){let t=aq(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=G.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 ihe(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===Fr.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&&(cs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Qh.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=d.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&&(ng.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}}});To.prototype.getNode=function(e){return this._nodesByName[e]};To.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};To.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};To.prototype.getExtension=function(e){return this._loader.components.extensions[e]};To.prototype.makeStyleDirty=function(){this._styleDirty=!0};To.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var mXe=new M,pXe=new X,gXe=new M;To.prototype.update=function(e){let t=!1;try{t=_Xe(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")oq(this,i);else{let o=Lt.getError("model",this._resource,i);oq(this,o)}}if(CXe(this,e),yXe(this,e),EXe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=Lt.getError("model",this._resource,new ue("Failed to load model."));oq(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&hXe(this,o);let r=new MO({model:this,modelComponents:i});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!this._resourcesLoaded||e.mode===oe.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(IXe(this),bXe(this),xXe(this,e),TXe(this),SXe(this,e),BXe(this,e),wXe(this,e),DXe(this,e),vXe(this,e),PXe(this,e),RXe(this,e),this._defaultTexture=e.context.defaultTexture,MXe(this,e),NXe(this,e),LXe(this),OXe(this,e),UXe(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)),QXe(this),GXe(this,e),zXe(this),VXe(this,e)}};function _Xe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function CXe(e,t){l(e._customShader)&&e._customShader.update(t)}function yXe(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 EXe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function IXe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=AXe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function bXe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function xXe(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&&nhe(e)}function nhe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Hh.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function TXe(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 SXe(e,t){e._silhouetteDirty&&(ohe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function BXe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function wXe(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 DXe(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 vXe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function PXe(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function RXe(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 MXe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function NXe(e,t){M.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=M.clone(e.modelMatrix,e._modelMatrix))}var QC=new d,rq=new he;function LXe(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===$e.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??te.default,i=e.modelMatrix;QC.x=i[12],QC.y=i[13],QC.z=i[14];let o=n.cartesianToCartographic(QC);l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(i,new M)),e._removeUpdateHeightCallback=t.updateHeight(o,the(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=the(e,n,o);he.clone(o,rq),rq.height=r,s(rq)}e._heightDirty=!1,e._updateModelMatrix=!0}function OXe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;ihe(e,n),FXe(e,n,t)}function ihe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=d.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=le.transform(e._boundingSphere,t,e._boundingSphere)}function FXe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);M.getTranslation(t,QC),e._sceneMode!==oe.SCENE3D&&to.computeActualEllipsoidPosition(n,QC,QC);let s=e._boundingSphere.radius,a=HXe(QC,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 QXe(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 kXe=new X(1,0,0,0,0,1,0,-1,0);function UXe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=pXe,s=mXe;if(s=M.multiply(o.uniformState.view3D,i,s),r=M.getRotation(s,r),r=X.transpose(r,r),e._iblReferenceFrameMatrix=X.multiply(kXe,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=gXe;a=M.multiply(o.uniformState.view3D,i,a),a=M.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function GXe(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 zXe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=pt.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=pt.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=pt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function VXe(e,t){let n=WXe(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&&(jXe(e,t),e._sceneGraph.pushDrawCommands(t))}var sq=new le;function HXe(e,t,n){return sq.center=e,sq.radius=t,n.camera.getPixelSize(sq,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var jV=new d;function the(e,t,n){return function(i){hx(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,jV);let o=e._clampedModelMatrix;M.clone(e.modelMatrix,o),o[12]=jV.x,o[13]=jV.y,o[14]=jV.z,e._heightDirty=!0}}var YXe=new d;function WXe(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===oe.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=M.getTranslation(e.modelMatrix,YXe);to.computeActualEllipsoidPosition(t,s,s),r=d.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function jXe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}To.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};To.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function ohe(e){return e.context.stencilBuffer}To.prototype.hasSilhouette=function(e){return ohe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};To.prototype.hasSkipLevelOfDetail=function(e){if(!Fr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};To.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};To.prototype.pick=function(e,t,n,i,o){return vT(this,e,t,n,i,o)};To.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};To.prototype.isDestroyed=function(){return!1};To.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,de(this)};To.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};To.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};To.fromGltfAsync=async function(e){e=e??V.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=Be.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=Be.createIfNeeded(t);let r=new sf(n),a=l(e.content)?Fr.TILE_GLTF:Fr.GLTF,c=n.gltfResource,u=kO(r,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),Lt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let h=new To(u),m=h._resource.credits;if(l(m)){let g=m.length;for(let A=0;A<g;A++)h._resourceCredits.push(pt.clone(m[A]))}return h};To.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 TN(t);try{await n.load();let i=kO(n,Fr.TILE_B3DM,e);return new To(i)}catch(i){throw n.destroy(),i}};To.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new OO(t);try{await n.load();let i=kO(n,Fr.TILE_PNTS,e);return new To(i)}catch(i){throw n.destroy(),i}};To.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 wN(t);try{await n.load();let i=kO(n,Fr.TILE_I3DM,e);return new To(i)}catch(i){throw n.destroy(),i}};To.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new SN(t),i=kO(n,Fr.TILE_GEOJSON,e);return new To(i)};var qXe=new G;To.prototype.applyColorAndShow=function(e){let t=G.clone(this._color,qXe),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):G.clone(G.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,aq(t,this._color)&&this.resetDrawCommands()};To.prototype.applyStyle=function(e){let t=this.type===Fr.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),nhe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function kO(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 qh=To;function hs(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(hs.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}}});hs.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};hs.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};hs.prototype.getExtension=function(e){return this._model.getExtension(e)};hs.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};hs.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};hs.prototype.applyDebugSettings=function(e,t){t=e?t:G.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};hs.prototype.applyStyle=function(e){this._model.style=e};hs.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:gu.REPEAT}),this._ready=!0)};hs.prototype.isDestroyed=function(){return!1};hs.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),de(this)};hs.fromGltf=async function(e,t,n,i){let o=new hs(e,t,n),s=UO(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await qh.fromGltfAsync(s);return o._model=c,o};hs.fromB3dm=async function(e,t,n,i,o){let r=new hs(e,t,n),a=UO(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await qh.fromB3dm(a);return r._model=u,r};hs.fromI3dm=async function(e,t,n,i,o){let r=new hs(e,t,n),a=UO(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await qh.fromI3dm(a);return r._model=c,r};hs.fromPnts=async function(e,t,n,i,o){let r=new hs(e,t,n),a=UO(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await qh.fromPnts(a);return r._model=c,r};hs.fromGeoJson=async function(e,t,n,i){let o=new hs(e,t,n),s=UO(e,t,o,{geoJson:i,resource:n}),a=await qh.fromGeoJson(s);return o._model=a,o};hs.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,te.WGS84,n)};function UO(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:we.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 St(i,o)}var uf=hs;function Ed(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(Ed.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}}});Ed.fromJson=function(e,t,n,i){let o=new Ed(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Ed.prototype.hasProperty=function(e,t){return!1};Ed.prototype.getFeature=function(e){};Ed.prototype.applyDebugSettings=function(e,t){};Ed.prototype.applyStyle=function(e){};Ed.prototype.update=function(e,t){};Ed.prototype.pick=function(e,t,n){};Ed.prototype.isDestroyed=function(){return!1};Ed.prototype.destroy=function(){return de(this)};var GO=Ed;var zO=`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 VO=`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 KXe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Ns=KXe;function Kh(e){this._billboardCollection=e,this._id=void 0,this._loadState=Ns.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Kh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Ns.LOADED}},hasImage:{get:function(){return this._loadState!==Ns.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Kh.prototype.unload=async function(){this._loadState!==Ns.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Ns.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Kh.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===Ns.LOADING||t.loadState===Ns.LOADED){Kh.clone(s,this);return}l(s)||(s=new Kh(o),r.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Ns.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{a=await c.addImage(e,t,n,i)}catch(f){if(s._loadState=Ns.ERROR,s._loadError=f,this._id!==e)return;this._loadState=Ns.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=Ns.FAILED,s._index=-1,this._id!==e)return;this._loadState=Ns.FAILED,this._index=-1;return}s._index=a,s._loadState=Ns.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=Ns.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};Kh.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)};Kh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Ns.LOADING,i=await n}catch(o){this._loadState=Ns.ERROR,this._loadError=o;return}this._id===e&&(this._loadState=Ns.LOADED,this.setImageSubRegion(i,t))};Kh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Ns.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}};Kh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Kh.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 _g=Kh;function Bi(e,t){e=e??V.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ht.clone(n)),l(i)&&(i=Ht.clone(i)),l(o)&&(o=Ht.clone(o)),l(r)&&(r=Qt.clone(r)),this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._pixelOffset=F.clone(e.pixelOffset??F.ZERO),this._translate=new F(0,0),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._heightReference=e.heightReference??$e.NONE,this._verticalOrigin=e.verticalOrigin??Gn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Mi.CENTER,this._scale=e.scale??1,this._color=G.clone(e.color??G.WHITE),this._rotation=e.rotation??0,this._alignedAxis=d.clone(e.alignedAxis??d.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 _g(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=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=G.clone(e.outlineColor??G.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Lr.NONE,this._positionFromParent=!1}var rhe=Bi.SHOW_INDEX=0,KV=Bi.POSITION_INDEX=1,fhe=Bi.PIXEL_OFFSET_INDEX=2,JXe=Bi.EYE_OFFSET_INDEX=3,XXe=Bi.HORIZONTAL_ORIGIN_INDEX=4,ZXe=Bi.VERTICAL_ORIGIN_INDEX=5,$Xe=Bi.SCALE_INDEX=6,she=Bi.IMAGE_INDEX_INDEX=7,ahe=Bi.COLOR_INDEX=8,e7e=Bi.ROTATION_INDEX=9,t7e=Bi.ALIGNED_AXIS_INDEX=10,n7e=Bi.SCALE_BY_DISTANCE_INDEX=11,i7e=Bi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,o7e=Bi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,r7e=Bi.DISTANCE_DISPLAY_CONDITION=14,s7e=Bi.DISABLE_DEPTH_DISTANCE=15;Bi.TEXTURE_COORDINATE_BOUNDS=16;var che=Bi.SDF_INDEX=17,a7e=Bi.SPLIT_DIRECTION_INDEX=18;Bi.NUMBER_OF_PROPERTIES=19;function xr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Bi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,xr(this,rhe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),this._updateClamping(),xr(this,KV))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),xr(this,KV))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;F.equals(t,e)||(F.clone(e,t),xr(this,fhe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ht.equals(t,e)||(this._scaleByDistance=Ht.clone(e,t),xr(this,n7e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ht.equals(t,e)||(this._translucencyByDistance=Ht.clone(e,t),xr(this,i7e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Ht.equals(t,e)||(this._pixelOffsetScaleByDistance=Ht.clone(e,t),xr(this,o7e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;d.equals(t,e)||(d.clone(e,t),xr(this,JXe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,xr(this,XXe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,xr(this,ZXe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,xr(this,$Xe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;G.equals(t,e)||(G.clone(e,t),xr(this,ahe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,xr(this,e7e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;d.equals(t,e)||(d.clone(e,t),xr(this,t7e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,xr(this,she))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,xr(this,she))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,xr(this,ahe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Qt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Qt.clone(e,this._distanceDisplayCondition),xr(this,r7e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,xr(this,s7e))}},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=d.clone(e,this._actualClampedPosition),xr(this,KV)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,xr(this,rhe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),xr(this,che))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,xr(this,che))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,xr(this,a7e))}}});Bi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Bi.prototype._updateClamping=function(){Bi._updateClamping(this._billboardCollection,this)};var JV=new he;Bi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??te.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===$e.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===$e.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(u){let f=i.cartographicToCartesian(u,t._clampedPosition);hx(t._heightReference)&&(t._mode===oe.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,JV);let c=n.getHeight(s,t._heightReference);l(c)&&(JV.height=c),a(JV)};Bi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Bi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Bi.prototype.setImageTexture=function(e){_g.clone(e,this._imageTexture)};var lhe=512;Bi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=jn();return}let n;typeof t=="string"?n=t:t instanceof Be?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??jn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&c7e(n)&&(this._imageWidth=Math.min(this._width,lhe),this._imageHeight=Math.min(this._height,lhe))};function c7e(e){return l(e)?Ah(e)?e.startsWith("data:image/svg+xml"):mp(e)==="svg":!1}Bi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Bi.prototype._setTranslate=function(e){let t=this._translate;F.equals(t,e)||(F.clone(e,t),xr(this,fhe))};Bi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Bi.prototype._setActualPosition=function(e){l(this._clampedPosition)||d.clone(e,this._actualPosition),xr(this,KV)};var uhe=new se;Bi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(M.multiplyByPoint(i,t,uhe),to.computeActualEllipsoidPosition(n,uhe))};var dhe=new d;Bi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=M.multiplyByPoint(e,t,dhe),a=to.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return F.add(a,i,a),a};var qV=new F(0,0);Bi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new F),F.clone(this._pixelOffset,qV),F.add(qV,this._translate,qV);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,JV);o=a.cartographicToCartesian(c,dhe),i=M.IDENTITY}return Bi._computeScreenSpacePosition(i,o,this._eyeOffset,qV,e,t)};Bi.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===Mi.RIGHT?s-=i:e.horizontalOrigin===Mi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?a-=o:e.verticalOrigin===Gn.CENTER&&(a-=o*.5),l(n)||(n=new Xe),n.x=s,n.y=a,n.width=i,n.height=o,n};Bi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.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&&G.equals(this._color,e._color)&&F.equals(this._pixelOffset,e._pixelOffset)&&F.equals(this._translate,e._translate)&&d.equals(this._eyeOffset,e._eyeOffset)&&Ht.equals(this._scaleByDistance,e._scaleByDistance)&&Ht.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ht.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Qt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Bi.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 So=Bi;var l7e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Ko=Object.freeze(l7e);var u7e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Sa=Object.freeze(u7e);var f7e=So.SHOW_INDEX,HO=So.POSITION_INDEX,hhe=So.PIXEL_OFFSET_INDEX,Ahe=So.EYE_OFFSET_INDEX,d7e=So.HORIZONTAL_ORIGIN_INDEX,h7e=So.VERTICAL_ORIGIN_INDEX,A7e=So.SCALE_INDEX,FI=So.IMAGE_INDEX_INDEX,mhe=So.COLOR_INDEX,m7e=So.ROTATION_INDEX,p7e=So.ALIGNED_AXIS_INDEX,phe=So.SCALE_BY_DISTANCE_INDEX,ghe=So.TRANSLUCENCY_BY_DISTANCE_INDEX,_he=So.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Che=So.DISTANCE_DISPLAY_CONDITION,g7e=So.DISABLE_DEPTH_DISTANCE,_7e=So.TEXTURE_COORDINATE_BOUNDS,yhe=So.SDF_INDEX,Ehe=So.SPLIT_DIRECTION_INDEX,Aq=So.NUMBER_OF_PROPERTIES,Bo,C7e={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},y7e={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 bd(e){e=e??V.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new BE),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(Aq),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Ko.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW],this._highlightColor=G.clone(G.WHITE),this._coarseDepthTestDistance=te.default.minimumRadius/100,this._threePointDepthTestDistance=te.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(bd.prototype,{length:{get:function(){return mq(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 Ihe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}bd.prototype.add=function(e){let t=new So(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};bd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};bd.prototype.removeAll=function(){Ihe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function mq(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}}bd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};bd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};bd.prototype.get=function(e){return mq(this),this._billboards[e]};var cq;function E7e(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=ut.createIndexBuffer({context:e,typedArray:o,usage:Oe.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function I7e(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=ut.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Oe.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function b7e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=ut.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Oe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}bd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Aq;++i){let o=n[i]===0?Oe.STATIC_DRAW:Oe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function x7e(e,t,n,i,o,r){let s=[{index:Bo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[HO]},{index:Bo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[HO]},{index:Bo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[hhe]},{index:Bo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[ghe]},{index:Bo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[mhe]},{index:Bo.eyeOffset,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Ahe]},{index:Bo.scaleByDistance,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[phe]},{index:Bo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[_he]},{index:Bo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Che]},{index:Bo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[_7e]},{index:Bo.splitDirection,componentsPerAttribute:1,componentDatatype:q.FLOAT,usage:n[Ehe]}];i&&s.push({index:Bo.direction,componentsPerAttribute:2,componentDatatype:q.FLOAT,vertexBuffer:b7e(e)}),l(o)&&s.push({index:Bo.a_batchId,componentsPerAttribute:1,componentDatatype:q.FLOAT,bufferUsage:Oe.STATIC_DRAW}),r&&s.push({index:Bo.sdf,componentsPerAttribute:2,componentDatatype:q.FLOAT,usage:n[yhe]});let a=i?t:4*t;return new Tp(e,s,a,i)}var lq=new $n;function bhe(e,t,n,i){let o,r=n[Bo.positionHighAndScale],s=n[Bo.positionLowAndRotation],a=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),$n.fromCartesian(a,lq);let c=i.scale,u=i.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);let f=lq.high,h=lq.low;e._instanced?(o=i._index,r(o,f.x,f.y,f.z,c),s(o,h.x,h.y,h.z,u)):(o=i._index*4,r(o+0,f.x,f.y,f.z,c),r(o+1,f.x,f.y,f.z,c),r(o+2,f.x,f.y,f.z,c),r(o+3,f.x,f.y,f.z,c),s(o+0,h.x,h.y,h.z,u),s(o+1,h.x,h.y,h.z,u),s(o+2,h.x,h.y,h.z,u),s(o+3,h.x,h.y,h.z,u))}var Eu=new F,Id=32768,PT=65536,uq=4096,gm=256,T7e=128,S7e=32,B7e=8,XV=4,w7e=1/256,xhe=0,The=2,She=3,Bhe=1,pq=new Xe;function whe(e,t,n,i){let o,r=n[Bo.compressedAttribute0],s=i.pixelOffset,a=s.x,c=s.y,u=i._translate,f=u.x,h=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+f),Math.abs(-c+h));let m=i.horizontalOrigin,g=i._verticalOrigin,A=i.show&&i.clusterShow;i.color.alpha===0&&(A=!1),g===Gn.BASELINE&&(g=Gn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&m===Mi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&g===Gn.CENTER;let _=0,C=0,y=0,E=0;if(i.ready){let R=i.computeTextureCoordinates(pq);_=R.x,C=R.y,y=R.width,E=R.height}let I=_+y,x=C+E,S=Math.floor(D.clamp(a,-Id,Id)+Id)*T7e;S+=(m+1)*S7e,S+=(g+1)*B7e,S+=(A?1:0)*XV;let w=Math.floor(D.clamp(c,-Id,Id)+Id)*gm,v=Math.floor(D.clamp(f*XV,-Id,Id)+Id)*gm,P=(D.clamp(h*XV,-Id,Id)+Id)*w7e,N=Math.floor(P),L=Math.floor((P-N)*gm);w+=N,v+=L,Eu.x=_,Eu.y=C;let p=bn.compressTextureCoordinates(Eu);Eu.x=I;let b=bn.compressTextureCoordinates(Eu);Eu.y=x;let T=bn.compressTextureCoordinates(Eu);Eu.x=_;let B=bn.compressTextureCoordinates(Eu);e._instanced?(o=i._index,r(o,S,w,v,p)):(o=i._index*4,r(o+0,S+xhe,w,v,p),r(o+1,S+The,w,v,b),r(o+2,S+She,w,v,T),r(o+3,S+Bhe,w,v,B))}function Dhe(e,t,n,i){let o,r=n[Bo.compressedAttribute1],s=i.alignedAxis;d.equals(s,d.ZERO)||(e._shaderAlignedAxis=!0);let a=0,c=1,u=1,f=1,h=i.translucencyByDistance;l(h)&&(a=h.near,c=h.nearValue,u=h.far,f=h.farValue,(c!==1||f!==1)&&(e._shaderTranslucencyByDistance=!0));let m=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,m);let g=D.clamp(m,0,PT),A=0;Math.abs(d.magnitudeSquared(s)-1)<D.EPSILON6&&(A=bn.octEncodeFloat(s)),c=D.clamp(c,0,1),c=c===1?255:c*255|0,g=g*gm+c,f=D.clamp(f,0,1),f=f===1?255:f*255|0,A=A*gm+f,e._instanced?(o=i._index,r(o,g,A,a,u)):(o=i._index*4,r(o+0,g,A,a,u),r(o+1,g,A,a,u),r(o+2,g,A,a,u),r(o+3,g,A,a,u))}function dq(e,t,n,i){let o,r=n[Bo.compressedAttribute2],s=i.color,a=l(e._batchTable)?G.WHITE:i.getPickId(t.context).color,c=i.sizeInMeters?1:0,u=Math.abs(d.magnitudeSquared(i.alignedAxis)-1)<D.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&c===1;let f=i.height??0;e._maxSize=Math.max(e._maxSize,f);let h=i._labelHorizontalOrigin??-2;h+=2;let m=f*XV+h,g=G.floatToByte(s.red),A=G.floatToByte(s.green),_=G.floatToByte(s.blue),C=g*PT+A*gm+_;g=G.floatToByte(a.red),A=G.floatToByte(a.green),_=G.floatToByte(a.blue);let y=g*PT+A*gm+_,E=G.floatToByte(s.alpha)*PT+G.floatToByte(a.alpha)*gm;E+=c*2+u,e._instanced?(o=i._index,r(o,C,y,E,m)):(o=i._index*4,r(o+0,C,y,E,m),r(o+1,C,y,E,m),r(o+2,C,y,E,m),r(o+3,C,y,E,m))}function hq(e,t,n,i){let o,r=n[Bo.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==$e.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(Eu.x=0,Eu.y=0,i.ready){let u=i.computeTextureCoordinates(pq);Eu.x=u.width,Eu.y=u.height}let c=bn.compressTextureCoordinates(Eu);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 vhe(e,t,n,i){let o,r=n[Bo.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,u)):(o=i._index*4,r(o+0,s,a,c,u),r(o+1,s,a,c,u),r(o+2,s,a,c,u),r(o+3,s,a,c,u))}function Phe(e,t,n,i){let o,r=n[Bo.pixelOffsetScaleByDistance],s=0,a=1,c=1,u=1,f=i.pixelOffsetScaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,u)):(o=i._index*4,r(o+0,s,a,c,u),r(o+1,s,a,c,u),r(o+2,s,a,c,u),r(o+3,s,a,c,u))}function Rhe(e,t,n,i){let o,r=n[Bo.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 u=i.disableDepthTestDistance,f=od(i.heightReference)&&t.context.depthTexture;u*=u,(f||u>0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let h,m;l(i._labelDimensions)?(m=i._labelDimensions.x,h=i._labelDimensions.y):(m=i.width??0,h=i.height??0);let g=Math.floor(D.clamp(m,0,uq)),A=Math.floor(D.clamp(h,0,uq)),_=g*uq+A;e._instanced?(o=i._index,r(o,s,a,u,_)):(o=i._index*4,r(o+0,s,a,u,_),r(o+1,s,a,u,_),r(o+2,s,a,u,_),r(o+3,s,a,u,_))}function Mhe(e,t,n,i){if(od(i.heightReference)){let m=e._scene,g=t.context,A=t.globeTranslucencyState.translucent,_=l(m.globe)&&m.globe.depthTestAgainstTerrain;e._shaderClampToGround=g.depthTexture&&!A&&_}let o,r=n[Bo.textureCoordinateBoundsOrLabelTranslate];if(Ft.maximumVertexTextureImageUnits>0){let m=0,g=0;l(i._labelTranslate)&&(m=i._labelTranslate.x,g=i._labelTranslate.y),e._instanced?(o=i._index,r(o,m,g,0,0)):(o=i._index*4,r(o+0,m,g,0,0),r(o+1,m,g,0,0),r(o+2,m,g,0,0),r(o+3,m,g,0,0));return}let s=0,a=0,c=0,u=0;if(i.ready){let m=i.computeTextureCoordinates(pq);s=m.x,a=m.y,c=m.width,u=m.height}let f=s+c,h=a+u;e._instanced?(o=i._index,r(o,s,a,f,h)):(o=i._index*4,r(o+0,s,a,f,h),r(o+1,s,a,f,h),r(o+2,s,a,f,h),r(o+3,s,a,f,h))}function D7e(e,t,n,i){if(!l(e._batchTable))return;let o=n[Bo.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 Nhe(e,t,n,i){if(!e._sdf)return;let o,r=n[Bo.sdf],s=i.outlineColor,a=i.outlineWidth,c=G.floatToByte(s.red),u=G.floatToByte(s.green),f=G.floatToByte(s.blue),h=c*PT+u*gm+f,m=a/Sa.RADIUS,g=G.floatToByte(s.alpha)*PT+G.floatToByte(m)*gm;e._instanced?(o=i._index,r(o,h,g)):(o=i._index*4,r(o+0,h+xhe,g),r(o+1,h+The,g),r(o+2,h+She,g),r(o+3,h+Bhe,g))}function Lhe(e,t,n,i){let o=n[Bo.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 v7e(e,t,n,i){bhe(e,t,n,i),whe(e,t,n,i),Dhe(e,t,n,i),dq(e,t,n,i),hq(e,t,n,i),vhe(e,t,n,i),Phe(e,t,n,i),Rhe(e,t,n,i),Mhe(e,t,n,i),D7e(e,t,n,i),Nhe(e,t,n,i),Lhe(e,t,n,i)}function fq(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=So._computeActualPosition(u,f,i,o);l(h)&&(u._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function P7e(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&fq(e,i,i.length,t,r,!0)):n===oe.MORPHING?fq(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&fq(e,o,e._billboardsToUpdateIndex,t,r,!1)}function R7e(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 M7e(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=we.OVERLAY,i}var N7e=[];bd.prototype.update=function(e){if(mq(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,Bo=this._instanced?y7e:C7e,cq=this._instanced?I7e:E7e;let n=this._billboards,i=n.length,o=!0;for(let P=0;P<i;++P){let N=n[P];l(N.loadError)&&(console.error(`Error loading image for billboard: ${N.loadError}`),N.image=void 0),N.textureDirty&&this._updateBillboard(N,FI),N.show&&(o=o&&N.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;P7e(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let h,m=e.passes,g=m.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<Aq;++P)c[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=x7e(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let P=0;P<i;++P){let N=this._billboards[P];N._dirty=!1,N.textureDirty=!1,v7e(this,e,h,N)}this._vaf.commit(cq(t))}this._billboardsToUpdateIndex=0}else if(a>0){let P=N7e;P.length=0,(c[HO]||c[m7e]||c[A7e])&&P.push(bhe),(c[FI]||c[hhe]||c[d7e]||c[h7e]||c[f7e])&&(P.push(whe),this._instanced&&P.push(hq)),(c[FI]||c[p7e]||c[ghe])&&(P.push(Dhe),P.push(dq)),(c[FI]||c[mhe])&&P.push(dq),(c[FI]||c[Ahe])&&P.push(hq),c[phe]&&P.push(vhe),c[_he]&&P.push(Phe),(c[Che]||c[g7e]||c[FI]||c[HO])&&P.push(Rhe),(c[FI]||c[HO])&&P.push(Mhe),c[yhe]&&P.push(Nhe),c[Ehe]&&P.push(Lhe);let N=P.length;if(h=this._vaf.writers,a/i>.1){for(let L=0;L<a;++L){let p=s[L];p._dirty=!1,p.textureDirty=!1;for(let b=0;b<N;++b)P[b](this,e,h,p)}this._vaf.commit(cq(t))}else{for(let L=0;L<a;++L){let p=s[L];p._dirty=!1,p.textureDirty=!1;for(let b=0;b<N;++b)P[b](this,e,h,p);this._instanced?this._vaf.subCommit(p._index,1):this._vaf.subCommit(p._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,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let A,_=M.IDENTITY;e.mode===oe.SCENE3D?(_=this.modelMatrix,A=le.clone(this._baseVolumeWC,this._boundingVolume)):A=le.clone(this._baseVolume2D,this._boundingVolume),R7e(this,e,A);let C=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,C){this._blendOption===Ko.OPAQUE||this._blendOption===Ko.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Ko.TRANSLUCENT;this._blendOption===Ko.TRANSLUCENT||this._blendOption===Ko.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:P?ee.LEQUAL:ee.LESS},depthMask:P,blending:dn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let y,E,I,x,S,w=Ft.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){y=VO,E=zO,S=[],l(this._batchTable)&&(S.push("VECTOR_TILE"),y=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(y),E=this._batchTable.getFragmentShaderCallback(!1,void 0)(E)),I=new We({defines:S,sources:[y]}),this._instanced&&I.defines.push("INSTANCED"),this._shaderRotation&&I.defines.push("ROTATION"),this._shaderAlignedAxis&&I.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&I.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&I.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&I.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&I.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&I.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(w?I.defines.push("VS_THREE_POINT_DEPTH_CHECK"):I.defines.push("FS_THREE_POINT_DEPTH_CHECK"));let P=1-Sa.CUTOFF;this._sdf&&I.defines.push("SDF");let N=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Ko.OPAQUE_AND_TRANSLUCENT&&(x=new We({defines:["OPAQUE",N],sources:[E]}),this._shaderClampToGround&&(w?x.defines.push("VS_THREE_POINT_DEPTH_CHECK"):x.defines.push("FS_THREE_POINT_DEPTH_CHECK")),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${P}`)),this._sp=sn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:I,fragmentShaderSource:x,attributeLocations:Bo}),x=new We({defines:["TRANSLUCENT",N],sources:[E]}),this._shaderClampToGround&&(w?x.defines.push("VS_THREE_POINT_DEPTH_CHECK"):x.defines.push("FS_THREE_POINT_DEPTH_CHECK")),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=sn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:I,fragmentShaderSource:x,attributeLocations:Bo})),this._blendOption===Ko.OPAQUE&&(x=new We({defines:[N],sources:[E]}),this._shaderClampToGround&&(w?x.defines.push("VS_THREE_POINT_DEPTH_CHECK"):x.defines.push("FS_THREE_POINT_DEPTH_CHECK")),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${P}`)),this._sp=sn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:I,fragmentShaderSource:x,attributeLocations:Bo})),this._blendOption===Ko.TRANSLUCENT&&(x=new We({defines:[N],sources:[E]}),this._shaderClampToGround&&(w?x.defines.push("VS_THREE_POINT_DEPTH_CHECK"):x.defines.push("FS_THREE_POINT_DEPTH_CHECK")),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=sn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:I,fragmentShaderSource:x,attributeLocations:Bo})),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 v=e.commandList;if(m.render||m.pick){let P=this._colorCommands,N=this._blendOption===Ko.OPAQUE,L=this._blendOption===Ko.OPAQUE_AND_TRANSLUCENT,p=this._vaf.va,b=p.length,T=this._uniforms,B;l(this._batchTable)?(T=this._batchTable.getUniformMapCallback()(T),B=this._batchTable.getPickId()):B="v_pickColor",P.length=b;let R=L?b*2:b;for(let O=0;O<R;++O){let U=P[O];l(U)||(U=P[O]=new et);let k=N||L&&O%2===0;U.pass=k||!L?we.OPAQUE:we.TRANSLUCENT,U.owner=this;let z=L?Math.floor(O/2):O;U.boundingVolume=A,U.modelMatrix=_,U.count=p[z].indicesCount,U.shaderProgram=k?this._sp:this._spTranslucent,U.uniformMap=T,U.vertexArray=p[z].va,U.renderState=k?this._rsOpaque:this._rsTranslucent,U.debugShowBoundingVolume=this.debugShowBoundingVolume,U.pickId=B,this._instanced&&(U.count=6,U.instanceCount=i),v.push(U)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=M7e(this,e.context)),v.push(this.debugCommand))}this._allBillboardsReady=o};bd.prototype.isDestroyed=function(){return!1};bd.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(),Ihe(this._billboards),de(this)};var ff=bd;function L7e(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 QI=L7e;function Xa(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),RT(this)}var O7e=new he;Object.defineProperties(Xa.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=G.clone(e,this._color),RT(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,RT(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=G.clone(e,this._pointOutlineColor),RT(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,RT(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,O7e);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=G.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&&RT(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}}});Xa.defaultColor=G.WHITE;Xa.defaultPointOutlineColor=G.BLACK;Xa.defaultPointOutlineWidth=0;Xa.defaultPointSize=8;function RT(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??Xa.defaultColor,i=e._pointOutlineColor??Xa.defaultPointOutlineColor,o=e._pointOutlineWidth??Xa.defaultPointOutlineWidth,r=e._pointSize??Xa.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(G.equals(n,s)&&G.equals(i,a)&&o===c&&r===u)return;e._billboardColor=G.clone(n,e._billboardColor),e._billboardOutlineColor=G.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,h=n.toCssColorString(),m=i.toCssColorString(),g=JSON.stringify([h,r,m,o]);t.setImage(g,QI(f,h,m,o,r))}Xa.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Xa.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Xa.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Xa.prototype.getPropertyInherited=function(e){return Ia.getPropertyInherited(this._content,this._batchId,e)};Xa.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Xa.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Xa.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Xa.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Cg=Xa;function F7e(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=r.width+u|0,h=3*a,m=h/2;c.width=f,c.height=h;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,m)),o&&(g.fillStyle="black",g.fillText(t,u/2,m));let A=g.getImageData(0,0,f,h).data,_=A.length,C=f*4,y,E,I,x;for(y=0;y<_;++y)if(A[y]!==255){I=y/C|0;break}for(y=_-1;y>=0;--y)if(A[y]!==255){x=y/C|0;break}let S=-1;for(y=0;y<f&&S===-1;++y)for(E=0;E<h;++E){let w=y*4+E*C;if(A[w]!==255||A[w+1]!==255||A[w+2]!==255||A[w+3]!==255){S=y;break}}return{width:r.width,height:x-I,ascent:m-I,descent:x-m,minx:S-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var kI;function Q7e(e,t){if(e==="")return;t=t??V.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??G.TRANSPARENT,a=t.padding??0,c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(kI)||(l(f.imageSmoothingEnabled)?kI="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?kI="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?kI="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(kI="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[kI]=!1,u.style.visibility="hidden",document.body.appendChild(u);let h=F7e(f,e,n,i,o);u.dimensions=h,document.body.removeChild(u),u.style.visibility="";let m=-h.minx,g=Math.ceil(h.width)+m+c,A=h.height+c,_=A-h.ascent+a,C=A-_+c;if(u.width=g,u.height=A,f.font=n,f.lineJoin="round",f.lineWidth=r,f[kI]=!1,s!==G.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let y=t.strokeColor??G.BLACK;f.strokeStyle=y.toCssColorString(),f.strokeText(e,m+a,C)}if(o){let y=t.fillColor??G.WHITE;f.fillStyle=y.toCssColorString(),f.fillText(e,m+a,C)}return u}var UI=Q7e;var jhe=mr(khe(),1);var U7e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},cr=Object.freeze(U7e);var Uhe={},Ghe=0,G7e=256,z7e=new G(.165,.165,.165,.8),V7e=new F(7,5),Hs=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function GI(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function WO(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function jO(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Vhe(e){let t=Uhe[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(jO(n,"line-height"));isNaN(i)&&(i=void 0),t={family:jO(n,"font-family"),size:jO(n,"font-size").replace("px",""),style:jO(n,"font-style"),weight:jO(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Ghe<G7e&&(Uhe[e._font]=t,Ghe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Jh(e,t){e=e??V.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ht.clone(n)),l(i)&&(i=Ht.clone(i)),l(o)&&(o=Ht.clone(o)),l(r)&&(r=Qt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=G.clone(e.fillColor??G.WHITE),this._outlineColor=G.clone(e.outlineColor??G.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=G.clone(e.backgroundColor??z7e),this._backgroundPadding=F.clone(e.backgroundPadding??V7e),this._style=e.style??cr.FILL,this._verticalOrigin=e.verticalOrigin??Gn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Mi.LEFT,this._pixelOffset=F.clone(e.pixelOffset??F.ZERO),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._position=d.clone(e.position??d.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??$e.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,Vhe(this),this._updateClamping()}Object.defineProperties(Jh.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(!d.equals(t,e)){d.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),WO(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Jh.filterUnsupportedCharacters(e);this._renderedText=Jh.enableRightToLeftDetection?K7e(t):t,GI(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,GI(this),Vhe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;G.equals(t,e)||(G.clone(e,t),GI(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),GI(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,GI(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,GI(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!G.equals(t,e)){G.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;F.equals(t,e)||(F.clone(e,t),WO(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,GI(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!F.equals(t,e)){F.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(!Ht.equals(t,e)){this._translucencyByDistance=Ht.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(!Ht.equals(t,e)){this._pixelOffsetScaleByDistance=Ht.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(!Ht.equals(t,e)){this._scaleByDistance=Ht.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(!d.equals(t,e)){d.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,WO(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),WO(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),WO(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Qt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Qt.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=d.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)}}}});Jh.prototype._updateClamping=function(){So._updateClamping(this._labelCollection,this)};Jh.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new F);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return So._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};Jh.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===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?o-=s:e.verticalOrigin===Gn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,h=e._glyphs,m=h.length;for(let g=0;g<m;++g){let A=h[g],_=A.billboard;if(!l(_))continue;let C=t.x+_._translate.x,y=t.y-_._translate.y,E=A.dimensions.width*a,I=A.dimensions.height*a;e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?y-=I:e.verticalOrigin===Gn.CENTER&&(y-=I*.5),e._verticalOrigin===Gn.TOP?y+=Sa.PADDING*a:(e._verticalOrigin===Gn.BOTTOM||e._verticalOrigin===Gn.BASELINE)&&(y-=Sa.PADDING*a),i=Math.min(i,C),o=Math.min(o,y),u=Math.max(u,C+E),f=Math.max(f,y+I)}r=u-i,s=f-o}return l(n)||(n=new Xe),n.x=i,n.y=o,n.width=r,n.height=s,n};Jh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Jh.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&&d.equals(this._position,e._position)&&G.equals(this._fillColor,e._fillColor)&&G.equals(this._outlineColor,e._outlineColor)&&G.equals(this._backgroundColor,e._backgroundColor)&&F.equals(this._backgroundPadding,e._backgroundPadding)&&F.equals(this._pixelOffset,e._pixelOffset)&&d.equals(this._eyeOffset,e._eyeOffset)&&Ht.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ht.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ht.equals(this._scaleByDistance,e._scaleByDistance)&&Qt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Jh.prototype.isDestroyed=function(){return!1};Jh.enableRightToLeftDetection=!1;function H7e(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=Hs.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=Hs.RTL:n.test(f)?a=Hs.LTR:i.test(f)?a=Hs.BRACKETS:a=Hs.WEAK,u===0&&(s=a),s===a&&a!==Hs.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function Y7e(e){return e.split("").reverse().join("")}function qO(e,t,n){return e.slice(0,t)+n+e.slice(t)}function W7e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var j7e="\u05D0-\u05EA",q7e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",zhe=new RegExp(`[${j7e}${q7e}]`);function K7e(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=zhe.test(o.charAt(0)),s=H7e(o,zhe),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],h=f.Type===Hs.BRACKETS?W7e(f.Word):Y7e(f.Word);r?f.Type===Hs.RTL?(c=h+c,a=0):f.Type===Hs.LTR?(c=qO(c,a,f.Word),a+=f.Word.length):(f.Type===Hs.WEAK||f.Type===Hs.BRACKETS)&&(f.Type===Hs.WEAK&&s[u-1].Type===Hs.BRACKETS?c=h+c:s[u-1].Type===Hs.RTL?(c=h+c,a=0):s.length>u+1?s[u+1].Type===Hs.RTL?(c=h+c,a=0):(c=qO(c,a,f.Word),a+=f.Word.length):c=qO(c,0,h)):f.Type===Hs.RTL?c=qO(c,a,h):f.Type===Hs.LTR?(c+=f.Word,a=c.length):(f.Type===Hs.WEAK||f.Type===Hs.BRACKETS)&&(u>0&&s[u-1].Type===Hs.RTL?s.length>u+1?s[u+1].Type===Hs.RTL?c=qO(c,a,h):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=`
`)}return n}var kC=Jh;var qhe=mr(Hhe(),1);function X7e(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var Z7e=1.2,Yhe="ID_WHITE_PIXEL",gq=new F(4,4),$7e=new Xe(1,1,1,1);function eZe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=gq.x,o.height=gq.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(Yhe,o),n.addImageSubRegion(Yhe,$7e)}let i=e.add({collection:t});return i.setImageTexture(n),i}var yg={};function tZe(e,t,n,i,o,r){return yg.font=t,yg.fillColor=n,yg.strokeColor=i,yg.strokeWidth=o,yg.padding=Sa.PADDING,yg.fill=r===cr.FILL||r===cr.FILL_AND_OUTLINE,yg.stroke=r===cr.OUTLINE||r===cr.FILL_AND_OUTLINE,yg.backgroundColor=G.BLACK,UI(e,yg)}function _q(e,t){let n=t.billboard;l(n)&&(n.show=!1,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var nZe=new qhe.default,iZe=/\s/;function oZe(e,t){let n=t._renderedText,i=nZe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/Sa.FONT_SIZE,o<s)for(let m=o;m<s;++m)_q(e,r[m]);r.length=o;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=eZe(c,e),t._backgroundBillboard=a),rZe(c,t,a);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,h=e._textDimensionsCache;for(let m=0;m<o;++m){let g=i[m],A=t._verticalOrigin,_=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+A]),C=h[_],y=f.get(_);if(!l(y)||!l(C)){y=new _g(u),f.set(_,y);let S=`${t._fontStyle} ${t._fontWeight} ${Sa.FONT_SIZE}px ${t._fontFamily}`,w=tZe(g,S,G.WHITE,G.WHITE,0,cr.FILL);if(C=w.dimensions,h[_]=C,w.width>0&&w.height>0&&!iZe.test(g)){let v=(0,jhe.default)(w,{cutoff:Sa.CUTOFF,radius:Sa.RADIUS}),P=w.getContext("2d"),N=w.width,L=w.height,p=P.getImageData(0,0,N,L);for(let b=0;b<N;b++)for(let T=0;T<L;T++){let B=T*N+b,R=v[B]*255,O=B*4;p.data[O+0]=R,p.data[O+1]=R,p.data[O+2]=R,p.data[O+3]=R}P.putImageData(p,0,0),y.loadImage(_,w)}}let E=r[m];if(l(E)||(E=new X7e,E.dimensions=C,E.billboardTexture=y,r[m]=E),E.billboardTexture.id!==_&&(E.billboardTexture=y,E.dimensions=C),!y.hasImage){_q(e,E);continue}let I=E.billboard,x=e._spareBillboards;l(I)||(x.length>0?I=x.pop():(I=u.add({collection:e}),I._labelDimensions=new F,I._labelTranslate=new F,I._positionFromParent=!0),E.billboard=I),I.setImageTexture(y),I.show=t._show,I.position=t._position,I.eyeOffset=t._eyeOffset,I.pixelOffset=t._pixelOffset,I.horizontalOrigin=Mi.LEFT,I.verticalOrigin=t._verticalOrigin,I.heightReference=t._heightReference,I.scale=t.totalScale,I.pickPrimitive=t,I.id=t._id,I.translucencyByDistance=t._translucencyByDistance,I.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,I.scaleByDistance=t._scaleByDistance,I.distanceDisplayCondition=t._distanceDisplayCondition,I.disableDepthTestDistance=t._disableDepthTestDistance,I._batchIndex=t._batchIndex,I.outlineColor=t.outlineColor,t.style===cr.FILL_AND_OUTLINE?(I.color=t._fillColor,I.outlineWidth=t.outlineWidth):t.style===cr.FILL?(I.color=t._fillColor,I.outlineWidth=0):t.style===cr.OUTLINE&&(I.color=G.TRANSPARENT,I.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function rZe(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=Mi.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 Whe(e,t,n){return t===Mi.CENTER?-e/2:t===Mi.RIGHT?-(e+n.x):n.x}var Qr=new F,sZe=new F;function aZe(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,u=t.length,f=e._backgroundBillboard,h=F.clone(l(f)?e._backgroundPadding:F.ZERO,sZe);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let N=0;N<u;++N){if(n.charAt(N)===`
`){r.push(i),++c,i=0;continue}let p=t[N].dimensions;l(p)&&(a=Math.max(a,p.height-p.descent),s=Math.max(s,p.descent),i+=p.width-p.minx,N<u-1&&(i+=t[N+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let m=a+s,g=e.totalScale,A=e._horizontalOrigin,_=e._verticalOrigin,C=0,y=r[C],E=Whe(y,A,h),I=(l(e._lineHeight)?e._lineHeight:Z7e*e._fontSize)/e._relativeSize,x=I*(c-1),S=o,w=m+x;l(f)&&(S+=h.x*2,w+=h.y*2,f._labelHorizontalOrigin=A),Qr.x=E*g,Qr.y=0;let v=!0,P=0;for(let N=0;N<u;++N){if(n.charAt(N)===`
`){++C,P+=I,y=r[C],E=Whe(y,A,h),Qr.x=E*g,v=!0;continue}let L=t[N],p=L.dimensions;if(l(p)&&(_===Gn.TOP?(Qr.y=p.height-a-h.y,Qr.y+=Sa.PADDING):_===Gn.CENTER?Qr.y=(x+p.height-a)/2:_===Gn.BASELINE?(Qr.y=x,Qr.y-=Sa.PADDING):(Qr.y=x+s+h.y,Qr.y-=Sa.PADDING),Qr.y=(Qr.y-p.descent-P)*g,v&&(Qr.x-=Sa.PADDING*g,v=!1),l(L.billboard)&&(L.billboard._setTranslate(Qr),L.billboard._labelDimensions.x=S,L.billboard._labelDimensions.y=w,L.billboard._labelHorizontalOrigin=A),N<u-1)){let b=t[N+1];Qr.x+=(p.width-p.minx+b.dimensions.minx)*g}}if(l(f)&&n.split(`
`).join("").length>0&&(A===Mi.CENTER?E=-o/2-h.x:A===Mi.RIGHT?E=-(o+h.x*2):E=0,Qr.x=E*g,_===Gn.TOP?Qr.y=m-a-s:_===Gn.CENTER?Qr.y=(m-a)/2-s:_===Gn.BASELINE?Qr.y=-h.y-s:Qr.y=0,Qr.y=Qr.y*g,f.width=S,f.height=w,f._setTranslate(Qr),f._labelTranslate=F.clone(Qr,f._labelTranslate)),od(e.heightReference))for(let N=0;N<u;++N){let p=t[N].billboard;l(p)&&(p._labelTranslate=F.clone(Qr,p._labelTranslate))}}function Khe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)_q(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),de(t)}function _m(e){e=e??V.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new ff({scene:this._scene,textureAtlas:new BE({initialSize:gq})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new _g(t),this._glyphBillboardCollection=new ff({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=G.clone(G.WHITE),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Ko.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(_m.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}}});_m.prototype.add=function(e){let t=new kC(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};_m.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),Khe(this,e),!0}return!1};_m.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Khe(this,e[t]);e.length=0};_m.prototype.contains=function(e){return l(e)&&e._labelCollection===this};_m.prototype.get=function(e){return this._labels[e]};_m.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&&(oZe(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(aZe(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let o=n.length>0?Ko.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)};_m.prototype.isDestroyed=function(){return!1};_m.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),de(this)};var Cm=_m;var KO=`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 kl={};kl.numberOfPoints=function(e,t,n){let i=d.distance(e,t);return Math.ceil(i/n)};kl.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 cZe=new he;kl.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,cZe).height}return i};var lZe=new M,uZe=new d,Jhe=new d,fZe=new rn(d.UNIT_X,0),Xhe=new d,dZe=new rn(d.UNIT_X,0),hZe=new d,AZe=new d,yq=[];function $he(e,t,n){let i=yq;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 e4=new he,$V=new he,UC=new d,Eq=new d,mZe=new d,Cq=new vp,JO=new _c;function pZe(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Eq),u=i.scaleToGeodeticSurface(t,mZe),f=kl.numberOfPoints(e,t,n),h=i.cartesianToCartographic(c,e4),m=i.cartesianToCartographic(u,$V),g=$he(f,o,r);Cq.setEndPoints(h,m);let A=Cq.surfaceDistance/f,_=a;h.height=o;let C=i.cartographicToCartesian(h,UC);d.pack(C,s,_),_+=3;for(let y=1;y<f;y++){let E=Cq.interpolateUsingSurfaceDistance(y*A,$V);E.height=g[y],C=i.cartographicToCartesian(E,UC),d.pack(C,s,_),_+=3}return _}function gZe(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,e4),u=i.cartesianToCartographic(t,$V),f=kl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let h=$he(f,o,r);JO.ellipsoid.equals(i)||(JO=new _c(void 0,void 0,i)),JO.setEndPoints(c,u);let m=JO.surfaceDistance/f,g=a;c.height=o;let A=i.cartographicToCartesian(c,UC);d.pack(A,s,g),g+=3;for(let _=1;_<f;_++){let C=JO.interpolateUsingSurfaceDistance(_*m,$V);C.height=h[_],A=i.cartographicToCartesian(C,UC),d.pack(A,s,g),g+=3}return g}kl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??M.IDENTITY;let o=M.inverseTransformation(t,lZe),r=M.multiplyByPoint(o,d.ZERO,uZe),s=d.normalize(M.multiplyByPointAsVector(o,d.UNIT_Y,Jhe),Jhe),a=rn.fromPointNormal(r,s,fZe),c=d.normalize(M.multiplyByPointAsVector(o,d.UNIT_X,Xhe),Xhe),u=rn.fromPointNormal(r,c,dZe),f=1;n.push(d.clone(e[0]));let h=n[0],m=e.length;for(let g=1;g<m;++g){let A=e[g];if(rn.getPointDistance(u,h)<0||rn.getPointDistance(u,A)<0){let _=ci.lineSegmentPlane(h,A,a,hZe);if(l(_)){let C=d.multiplyByScalar(s,5e-9,AZe);rn.getPointDistance(a,h)<0&&d.negate(C,C),n.push(d.add(_,C,new d)),i.push(f+1),d.negate(C,C),n.push(d.add(_,C,new d)),f=1}}n.push(d.clone(e[g])),f++,h=A}i.push(f)}return{positions:n,lengths:i}};kl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let _=i.scaleToGeodeticSurface(t[0],Eq);if(o=r?o[0]:o,o!==0){let C=i.geodeticSurfaceNormal(_,UC);d.multiplyByScalar(C,o,C),d.add(_,C,_)}return[_.x,_.y,_.z]}let s=e.minDistance;if(!l(s)){let _=e.granularity??D.RADIANS_PER_DEGREE;s=D.chordLength(_,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=kl.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),h=0;for(c=0;c<n-1;c++){let _=t[c],C=t[c+1],y=r?o[c]:o,E=r?o[c+1]:o;h=pZe(_,C,s,i,y,E,f,h)}yq.length=0;let m=t[n-1],g=i.cartesianToCartographic(m,e4);g.height=r?o[n-1]:o;let A=i.cartographicToCartesian(g,UC);return d.pack(A,f,u-3),f};var Zhe=new he,_Ze=new he;kl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],Eq);if(o=r?o[0]:o,o!==0){let E=i.geodeticSurfaceNormal(y,UC);d.multiplyByScalar(E,o,E),d.add(y,E,y)}return[y.x,y.y,y.z]}let s=e.granularity??D.RADIANS_PER_DEGREE,a=0,c,u=i.cartesianToCartographic(t[0],Zhe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],_Ze),a+=kl.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,Zhe);let h=(a+1)*3,m=new Array(h),g=0;for(c=0;c<n-1;c++){let y=t[c],E=t[c+1],I=r?o[c]:o,x=r?o[c+1]:o;g=gZe(y,E,s,i,I,x,m,g)}yq.length=0;let A=t[n-1],_=i.cartesianToCartographic(A,e4);_.height=r?o[n-1]:o;let C=i.cartographicToCartesian(_,UC);return d.pack(C,m,h-3),m};kl.generateCartesianArc=function(e){let t=kl.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};kl.generateCartesianRhumbArc=function(e){let t=kl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};var Wi=kl;function df(e,t){e=e??V.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=uo.fromType(uo.ColorType,{color:new G(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Uo(n,d.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(d.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Wi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(tAe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=le.fromPoints(this._actualPositions),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new le}var eAe=df.POSITION_INDEX=0,CZe=df.SHOW_INDEX=1,yZe=df.WIDTH_INDEX=2,EZe=df.MATERIAL_INDEX=3,XO=df.POSITION_SIZE_INDEX=4,IZe=df.DISTANCE_DISPLAY_CONDITION=5,tAe=df.NUMBER_OF_PROPERTIES=6;function Eg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(df.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Eg(this,CZe))}},positions:{get:function(){return this._positions},set:function(e){let t=Uo(e,d.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(d.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Eg(this,XO),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=le.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Eg(this,eAe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Eg(this,EZe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Eg(this,yZe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!d.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(d.clone(t[0]))):t.length>2&&d.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Eg(this,XO)}}},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){Qt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Qt.clone(e,this._distanceDisplayCondition),Eg(this,IZe))}}});df.prototype.update=function(){let e=M.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[eAe]>0||this._propertiesChanged[XO]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=Wi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)Eg(this,XO);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){Eg(this,XO);break}}};df.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};df.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<tAe-1;++t)e[t]=0};df.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var xd=df;var bZe=xd.SHOW_INDEX,xZe=xd.WIDTH_INDEX,bq=xd.POSITION_INDEX,TZe=xd.MATERIAL_INDEX,nAe=xd.POSITION_SIZE_INDEX,SZe=xd.DISTANCE_DISPLAY_CONDITION,lAe=xd.NUMBER_OF_PROPERTIES,Iu={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 Xh(e){e=e??V.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.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(lAe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Oe.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=G.clone(G.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Xh.prototype,{length:{get:function(){return xq(this),this._polylines.length}}});Xh.prototype.add=function(e){let t=new xd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Xh.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};Xh.prototype.removeAll=function(){Tq(this),AAe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Xh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Xh.prototype.get=function(e){return xq(this),this._polylines[e]};function BZe(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:q.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:q.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:q.FLOAT,componentsPerAttribute:2}];e._batchTable=new RE(t,n,e._polylines.length)}var uAe=new $n,fAe=new se,dAe=new F;Xh.prototype.update=function(e){if(xq(this),this._polylines.length===0||!this.show)return;MZe(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Ft.maximumVertexTextureImageUnits===0)throw new ue("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");BZe(this,t),this._createBatchTable=!1}if(this._createVertexArray||DZe(this))rAe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[nAe]||o[TZe])rAe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let h=0;h<u;++h){i=c[h],o=i._propertiesChanged;let m=i._bucket,g=0;for(let A in f)if(f.hasOwnProperty(A)){if(f[A]===m){o[bq]&&m.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[A].lengthOfPositions}if((o[bZe]||o[xZe])&&this._batchTable.setBatchedAttribute(i._index,0,new F(i._width,i._show)),this._batchTable.attributes.length>2){if(o[bq]||o[nAe]){let A=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,_=$n.fromCartesian(A.center,uAe),C=se.fromElements(_.low.x,_.low.y,_.low.z,A.radius,fAe);this._batchTable.setBatchedAttribute(i._index,2,_.high),this._batchTable.setBatchedAttribute(i._index,3,C)}if(o[SZe]){let A=dAe;A.x=0,A.y=Number.MAX_VALUE;let _=i.distanceDisplayCondition;l(_)&&(A.x=_.near,A.y=_.far),this._batchTable.setBatchedAttribute(i._index,4,A)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<lAe;++c)o[c]=0;let r=M.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:dn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;wZe(this,e,c,r)}};var ZO=new le,iAe=new le;function wZe(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,m=e._batchTable.getUniformMapCallback(),g=u.length;for(let A=0;A<g;++A){let _=u[A],C=_.buckets,y=C.length;for(let E=0;E<y;++E){let I=C[E],x=I.offset,S=I.bucket.shaderProgram,w=I.bucket.polylines,v=w.length,P,N,L=0,p,b;for(let T=0;T<v;++T){let B=w[T],R=PZe(B._material);if(R!==P){if(l(P)&&L>0){let z=N.isTranslucent();a>=s?(p=new et({owner:e}),n.push(p)):p=n[a],++a,b=St(m(N._uniforms),e._uniformMap),p.boundingVolume=le.clone(ZO,p.boundingVolume),p.modelMatrix=i,p.shaderProgram=S,p.vertexArray=_.va,p.renderState=z?e._translucentRS:e._opaqueRS,p.pass=z?we.TRANSLUCENT:we.OPAQUE,p.debugShowBoundingVolume=f,p.pickId="v_pickColor",p.uniformMap=b,p.count=L,p.offset=x,x+=L,L=0,c=!0,r.push(p)}N=B._material,N.update(o),P=R}let O=B._locatorBuckets,U=O.length;for(let z=0;z<U;++z){let Q=O[z];Q.locator===I&&(L+=Q.count)}let k;t.mode===oe.SCENE3D?k=B._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?k=B._boundingVolume2D:t.mode===oe.SCENE2D?l(B._boundingVolume2D)&&(k=le.clone(B._boundingVolume2D,iAe),k.center.x=0):l(B._boundingVolumeWC)&&l(B._boundingVolume2D)&&(k=le.union(B._boundingVolumeWC,B._boundingVolume2D,iAe)),c?(c=!1,le.clone(k,ZO)):le.union(k,ZO,ZO)}l(P)&&L>0&&(a>=s?(p=new et({owner:e}),n.push(p)):p=n[a],++a,b=St(m(N._uniforms),e._uniformMap),p.boundingVolume=le.clone(ZO,p.boundingVolume),p.modelMatrix=i,p.shaderProgram=S,p.vertexArray=_.va,p.renderState=N.isTranslucent()?e._translucentRS:e._opaqueRS,p.pass=N.isTranslucent()?we.TRANSLUCENT:we.OPAQUE,p.debugShowBoundingVolume=f,p.pickId="v_pickColor",p.uniformMap=b,p.count=L,p.offset=x,c=!0,r.push(p)),P=void 0}}n.length=a}Xh.prototype.isDestroyed=function(){return!1};Xh.prototype.destroy=function(){return hAe(this),Tq(this),AAe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};function DZe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[bq]?(i.bufferUsage!==Oe.STREAM_DRAW&&(t=!0,i.bufferUsage=Oe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Oe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Oe.STATIC_DRAW):i.frameCount--),t}var oAe=[0,0,0];function rAe(e,t,n){e._createVertexArray=!1,Tq(e),hAe(e),RZe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,h=e._polylineBuckets,m,g;for(m in h)h.hasOwnProperty(m)&&(g=h[m],g.updateShader(t,r,s),f+=g.lengthOfPositions);if(f>0){let A=e._mode,_=new Float32Array(6*f*3),C=new Float32Array(f*4),y,E=0,I=0,x=0;for(m in h)if(h.hasOwnProperty(m)){g=h[m],g.write(_,C,E,I,x,r,t,n),A===oe.MORPHING&&(l(y)||(y=new Float32Array(6*f*3)),g.writeForMorph(y,E));let b=g.lengthOfPositions;E+=6*b*3,I+=b*4,x+=b*4,c=g.updateIndices(i,a,u,c)}let S=e._positionBufferUsage.bufferUsage,w=Oe.STATIC_DRAW;e._positionBuffer=ut.createVertexBuffer({context:t,typedArray:_,usage:S});let v;l(y)&&(v=ut.createVertexBuffer({context:t,typedArray:y,usage:S})),e._texCoordExpandAndBatchIndexBuffer=ut.createVertexBuffer({context:t,typedArray:C,usage:w});let P=3*Float32Array.BYTES_PER_ELEMENT,N=4*Float32Array.BYTES_PER_ELEMENT,L=0,p=i.length;for(let b=0;b<p;++b)if(o=i[b],o.length>0){let T=new Uint16Array(o),B=ut.createIndexBuffer({context:t,typedArray:T,usage:Oe.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});L+=a[b];let R=6*(b*(P*D.SIXTY_FOUR_KILOBYTES)-L*P),O=P+R,U=P+O,k=P+U,z=P+k,Q=P+z,H=b*(N*D.SIXTY_FOUR_KILOBYTES)-L*N,W=[{index:Iu.position3DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:R,strideInBytes:6*P},{index:Iu.position3DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Iu.position2DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:R,strideInBytes:6*P},{index:Iu.position2DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Iu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Iu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Iu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Iu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Iu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:z,strideInBytes:6*P},{index:Iu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:Q,strideInBytes:6*P},{index:Iu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:z,strideInBytes:6*P},{index:Iu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:Q,strideInBytes:6*P},{index:Iu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:H}],Z,Y,$,K;A===oe.SCENE3D?(Y=e._positionBuffer,Z="vertexBuffer",$=oAe,K="value"):A===oe.SCENE2D||A===oe.COLUMBUS_VIEW?(Y=oAe,Z="value",$=e._positionBuffer,K="vertexBuffer"):(Y=v,Z="vertexBuffer",$=e._positionBuffer,K="vertexBuffer"),W[0][Z]=Y,W[1][Z]=Y,W[2][K]=$,W[3][K]=$,W[4][Z]=Y,W[5][Z]=Y,W[6][K]=$,W[7][K]=$,W[8][Z]=Y,W[9][Z]=Y,W[10][K]=$,W[11][K]=$;let fe=new oi({context:t,attributes:W,indexBuffer:B});e._vertexArrays.push({va:fe,buckets:u[b]})}}}function vZe(e,t){return t instanceof Bt?t.id:t}var t4=[];function PZe(e){let t=uo._uniformList[e.type],n=t.length;t4.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];t4[i]=r,t4[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(t4,vZe)}`}function RZe(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,u=i[c.type];l(u)||(u=i[c.type]=new ym(c,t,n)),u.addPolyline(a)}}}function MZe(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function xq(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 Tq(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 hAe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Xh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function AAe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function Iq(e,t,n){this.count=e,this.offset=t,this.bucket=n}function ym(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}ym.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};ym.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"),zt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new We({defines:i,sources:[`in vec4 v_pickColor;
`,this.material.shaderSource,QE]}),r=t.getVertexShaderCallback()(KO),s=new We({defines:i,sources:[ef,r]});this.shaderProgram=sn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Iu})};function mAe(e){return d.dot(d.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(rn.ORIGIN_ZX_PLANE)===qt.INTERSECTING}ym.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!mAe(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 ia=new d,Td=new d,Sd=new d,n4=new d,NZe=new se,LZe=new F;ym.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*D.PI,f=this.polylines,h=f.length;for(let m=0;m<h;++m){let g=f[m],A=g.width,_=g.show&&A>0,C=g._index,y=this.getSegments(g,a),E=y.positions,I=y.lengths,x=E.length,S=g.getPickId(s).color,w=0,v=0,P;for(let U=0;U<x;++U){U===0?g._loop?P=E[x-2]:(P=n4,d.subtract(E[0],E[1],P),d.add(E[0],P,P)):P=E[U-1],d.clone(P,Td),d.clone(E[U],ia),U===x-1?g._loop?P=E[1]:(P=n4,d.subtract(E[x-1],E[x-2],P),d.add(E[x-1],P,P)):P=E[U+1],d.clone(P,Sd);let k=I[w];U===v+k&&(v+=k,++w);let z=U-v===0,Q=U===v+I[w]-1;c===oe.SCENE2D&&(Td.z=0,ia.z=0,Sd.z=0),(c===oe.SCENE2D||c===oe.MORPHING)&&(z||Q)&&u-Math.abs(ia.x)<1&&((ia.x<0&&Td.x>0||ia.x>0&&Td.x<0)&&d.clone(ia,Td),(ia.x<0&&Sd.x>0||ia.x>0&&Sd.x<0)&&d.clone(ia,Sd));let H=z?2:0,W=Q?2:4;for(let Z=H;Z<W;++Z){$n.writeElements(ia,e,n),$n.writeElements(Td,e,n+6),$n.writeElements(Sd,e,n+12);let Y=Z-2<0?-1:1;t[o]=U/(x-1),t[o+1]=2*(Z%2)-1,t[o+2]=Y,t[o+3]=C,n+=18,o+=4}}let N=NZe;N.x=G.floatToByte(S.red),N.y=G.floatToByte(S.green),N.z=G.floatToByte(S.blue),N.w=G.floatToByte(S.alpha);let L=LZe;L.x=A,L.y=_?1:0;let p=c===oe.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,b=$n.fromCartesian(p.center,uAe),T=b.high,B=se.fromElements(b.low.x,b.low.y,b.low.z,p.radius,fAe),R=dAe;R.x=0,R.y=Number.MAX_VALUE;let O=g.distanceDisplayCondition;l(O)&&(R.x=O.near,R.y=O.far),r.setBatchedAttribute(C,0,L),r.setBatchedAttribute(C,1,N),r.attributes.length>2&&(r.setBatchedAttribute(C,2,T),r.setBatchedAttribute(C,3,B),r.setBatchedAttribute(C,4,R))}};var OZe=new d,FZe=new d,QZe=new d,sAe=new d;ym.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,u=a.length,f=0,h=0;for(let m=0;m<u;++m){let g;m===0?s._loop?g=a[u-2]:(g=sAe,d.subtract(a[0],a[1],g),d.add(a[0],g,g)):g=a[m-1],g=M.multiplyByPoint(n,g,FZe);let A=M.multiplyByPoint(n,a[m],OZe),_;m===u-1?s._loop?_=a[1]:(_=sAe,d.subtract(a[u-1],a[u-2],_),d.add(a[u-1],_,_)):_=a[m+1],_=M.multiplyByPoint(n,_,QZe);let C=c[f];m===h+C&&(h+=C,++f);let y=m-h===0,E=m===h+c[f]-1,I=y?2:0,x=E?2:4;for(let S=I;S<x;++S)$n.writeElements(A,e,t),$n.writeElements(g,e,t+6),$n.writeElements(_,e,t+12),t+=18}}};var kZe=new Array(1);ym.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new Iq(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 u=this.polylines,f=u.length;for(let h=0;h<f;++h){let m=u[h];m._locatorBuckets=[];let g;if(this.mode===oe.SCENE3D){g=kZe;let _=m._actualPositions.length;if(_>0)g[0]=_;else continue}else g=m._segments.lengths;let A=g.length;if(A>0){let _=0;for(let C=0;C<A;++C){let y=g[C]-1;for(let E=0;E<y;++E)c+4>D.SIXTY_FOUR_KILOBYTES&&(m._locatorBuckets.push({locator:r,count:_}),_=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new Iq(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),_+=6,s+=6,i+=6,c+=4}m._locatorBuckets.push({locator:r,count:_}),c+4>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new Iq(0,0,this),n[++o]=[r])}m._clean()}return r.count=s,i};ym.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 MT={positions:void 0,lengths:void 0},aAe=new Array(1),UZe=new d,GZe=new he;ym.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return aAe[0]=n.length,MT.positions=n,MT.lengths=aAe,MT;mAe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=UZe;for(let u=0;u<s;++u)a=n[u],c=M.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,GZe)));if(o.length>0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new d(u.z,u.x,u.y)}return MT.positions=o,MT.lengths=e._segments.lengths,MT};var cAe;ym.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*D.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=cAe,c=6*s*3;!l(a)||a.length<c?a=cAe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,h=u.lengths,m=0,g=0,A=0,_;s=f.length;for(let C=0;C<s;++C){C===0?t._loop?_=f[s-2]:(_=n4,d.subtract(f[0],f[1],_),d.add(f[0],_,_)):_=f[C-1],d.clone(_,Td),d.clone(f[C],ia),C===s-1?t._loop?_=f[1]:(_=n4,d.subtract(f[s-1],f[s-2],_),d.add(f[s-1],_,_)):_=f[C+1],d.clone(_,Sd);let y=h[g];C===A+y&&(A+=y,++g);let E=C-A===0,I=C===A+h[g]-1;o===oe.SCENE2D&&(Td.z=0,ia.z=0,Sd.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(E||I)&&r-Math.abs(ia.x)<1&&((ia.x<0&&Td.x>0||ia.x>0&&Td.x<0)&&d.clone(ia,Td),(ia.x<0&&Sd.x>0||ia.x>0&&Sd.x<0)&&d.clone(ia,Sd));let x=E?2:0,S=I?2:4;for(let w=x;w<S;++w)$n.writeElements(ia,a,m),$n.writeElements(Td,a,m+6),$n.writeElements(Sd,a,m+12),m+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Zh=Xh;function GC(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 ff({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new Cm({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Zh,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(GC.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 zZe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ce.packedLength+te.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ce.pack(n,s,a),a+=ce.packedLength,te.pack(t,s,a),s}var VZe=new qn("createVectorTilePoints",5),HZe=new d;function YZe(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=zZe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=VZe.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let h=e._batchIds,m=n.length/3,g=e._heightReference??$e.NONE;for(let A=0;A<m;++A){let _=h[A],C=d.unpack(n,A*3,HZe),y=c.add();y.position=C,y._batchIndex=_,y.heightReference=g;let E=u.add();E.text=" ",E.position=C,E._batchIndex=_,E.heightReference=g;let I=f.add();I.positions=[d.clone(C),d.clone(C)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}GC.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],u=n.get(a),f=i.get(a),h=o.get(a);t[c]=new Cg(e,c,u,f,h)}};GC.prototype.applyDebugSettings=function(e,t){e?(G.clone(t,this._billboardCollection._highlightColor),G.clone(t,this._labelCollection._highlightColor),G.clone(t,this._polylineCollection._highlightColor)):(G.clone(G.WHITE,this._billboardCollection._highlightColor),G.clone(G.WHITE,this._labelCollection._highlightColor),G.clone(G.WHITE,this._polylineCollection._highlightColor))};function WZe(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=Cg.defaultPointSize,s.color=Cg.defaultColor,s.pointOutlineColor=Cg.defaultPointOutlineColor,s.pointOutlineWidth=Cg.defaultPointOutlineWidth,s.labelColor=G.WHITE,s.labelOutlineColor=G.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=cr.FILL,s.labelText=void 0,s.backgroundColor=new G(.165,.165,.165,.8),s.backgroundPadding=new F(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=G.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Mi.CENTER,s.verticalOrigin=Gn.CENTER,s.labelHorizontalOrigin=Mi.RIGHT,s.labelVerticalOrigin=Gn.BASELINE}}var jZe=new G,qZe=new G,KZe=new G,JZe=new G,XZe=new G,ZZe=new G,$O=new Ht,e1=new Ht,Sq=new Qt;GC.prototype.applyStyle=function(e,t){if(!l(e)){WZe(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,jZe)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,qZe)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,KZe)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,JZe)),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,XZe)),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)?($O.near=a.x,$O.nearValue=a.y,$O.far=a.z,$O.farValue=a.w,s.scaleByDistance=$O):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(e1.near=a.x,e1.nearValue=a.y,e1.far=a.z,e1.farValue=a.w,s.translucencyByDistance=e1):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Sq.near=a.x,Sq.far=a.y,s.distanceDisplayCondition=Sq):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,ZZe)),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))}};GC.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=YZe(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)};GC.prototype.isDestroyed=function(){return!1};GC.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(),de(this)};var t1=GC;function Ig(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??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??d.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=Jn.BOTH}Object.defineProperties(Ig.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 $Ze(e){let t=new Float64Array(3+d.packedLength+te.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,d.pack(e._center,t,n),n+=d.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ce.pack(e._rectangle,t,n),t}function e$e(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=$t.unpack(t,n),n+=$t.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=G.unpack(t,n);n+=G.packedLength;let u=t[n++],f=t[n++],h=t[n++],m=new Array(h);for(let g=0;g<h;++g)m[g]=t[n++];s[a]=new om({color:c,offset:u,count:f,batchIds:m})}}var t$e=new qn("createVectorTilePolygons",5),n$e=new G;function i$e(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(ce.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,A=s.length;for(let _=0;_<A;++_){let C=g.getColor(_,n$e);s[_]=C.toRgba()}a=e._packedBuffer=$Ze(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,h=e._polygonMaximumHeights;l(f)&&l(h)&&(f=f.slice(),h=h.slice(),c.push(f.buffer,h.buffer),u.minimumHeights=f,u.maximumHeights=h);let m=t$e.scheduleTask(u,c);if(l(m))return m.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let A=new Float64Array(g.packedBuffer),_=A[0];e$e(e,A),e._indices=Fe.getSizeInBytes(_)===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),o$e(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function o$e(e){l(e._primitive)||(e._primitive=new oI({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)}Ig.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Ig.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Ig.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Ig.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Ig.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=i$e(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)};Ig.prototype.isDestroyed=function(){return!1};Ig.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var n1=Ig;var i1=`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 $h(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.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=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties($h.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function r$e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+te.packedLength+d.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,te.pack(o,a,c),c+=te.packedLength,d.pack(r,a,c),a}var s$e=new qn("createVectorTilePolylines",5),NT={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function a$e(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=r$e(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},u=s$e.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let h=f.indexDatatype;e._indices=h===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),c$e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function c$e(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 u=ut.createVertexBuffer({context:t,typedArray:i,usage:Oe.STATIC_DRAW}),f=ut.createVertexBuffer({context:t,typedArray:n,usage:Oe.STATIC_DRAW}),h=ut.createVertexBuffer({context:t,typedArray:o,usage:Oe.STATIC_DRAW}),m=ut.createVertexBuffer({context:t,typedArray:r,usage:Oe.STATIC_DRAW}),g=ut.createVertexBuffer({context:t,typedArray:s,usage:Oe.STATIC_DRAW}),A=ut.createIndexBuffer({context:t,typedArray:a,usage:Oe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),_=[{index:NT.previousPosition,vertexBuffer:u,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:NT.currentPosition,vertexBuffer:f,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:NT.nextPosition,vertexBuffer:h,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:NT.expandAndWidth,vertexBuffer:m,componentDatatype:q.FLOAT,componentsPerAttribute:2},{index:NT.a_batchId,vertexBuffer:g,componentDatatype:q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:_,indexBuffer:A}),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 o1=new M,pAe=new d;function l$e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,o1),M.multiplyByPoint(o1,e._center,pAe),M.setTranslation(o1,pAe,o1),o1},u_highlightColor:function(){return e._highlightColor}})}function u$e(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:dn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var f$e=`uniform vec4 u_highlightColor;
void main()
{
out_FragColor = u_highlightColor;
}
`;function d$e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(i1),o=n.getFragmentShaderCallback(!1,void 0,!1)(f$e),r=new We({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[ef,i]}),s=new We({defines:["VECTOR_TILE"],sources:[o]});e._sp=sn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:NT})}function h$e(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new et({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:we.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}$h.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,u=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let h=o[r],m=o[r+1]-h;for(s=0;s<m;++s){let g=(h+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};$h.prototype.getPositions=function(e){return $h.getPolylinePositions(this,e)};$h.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 Ia(e,r)}};$h.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function A$e(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=G.WHITE}}var m$e=new G,p$e=G.WHITE,g$e=!0;$h.prototype.applyStyle=function(e,t){if(!l(e)){A$e(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,m$e):p$e,s.show=l(e.show)?e.show.evaluate(s):g$e}};$h.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=a$e(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}l$e(this,t),d$e(this,t),u$e(this);let n=e.passes;(n.render||n.pick)&&h$e(this,e)};$h.prototype.isDestroyed=function(){return!1};$h.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var zI=$h;var r1=`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 s1=`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 bg(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.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 F(Si._defaultMinTerrainHeight,Si._defaultMaxTerrainHeight),this._boundingVolume=$t.fromRectangle(e.rectangle,Si._defaultMinTerrainHeight,Si._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=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(bg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function _$e(e,t,n){let i=Si.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;$t.fromRectangle(c,o,r,n,a)}function C$e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+te.packedLength+d.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,te.pack(o,a,c),c+=te.packedLength,d.pack(r,a,c),a}var y$e=new qn("createVectorTileClampedPolylines"),zC={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function E$e(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=C$e(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},u=y$e.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let h=f.indexDatatype;e._indices=h===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),I$e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function I$e(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,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let h=ut.createVertexBuffer({context:t,typedArray:n,usage:Oe.STATIC_DRAW}),m=ut.createVertexBuffer({context:t,typedArray:i,usage:Oe.STATIC_DRAW}),g=ut.createVertexBuffer({context:t,typedArray:o,usage:Oe.STATIC_DRAW}),A=ut.createVertexBuffer({context:t,typedArray:r,usage:Oe.STATIC_DRAW}),_=ut.createVertexBuffer({context:t,typedArray:s,usage:Oe.STATIC_DRAW}),C=ut.createVertexBuffer({context:t,typedArray:a,usage:Oe.STATIC_DRAW}),y=ut.createVertexBuffer({context:t,typedArray:c,usage:Oe.STATIC_DRAW}),E=ut.createIndexBuffer({context:t,typedArray:u,usage:Oe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),I=[{index:zC.startEllipsoidNormal,vertexBuffer:h,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:zC.endEllipsoidNormal,vertexBuffer:m,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:zC.startPositionAndHeight,vertexBuffer:g,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:zC.endPositionAndHeight,vertexBuffer:A,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:zC.startFaceNormalAndVertexCorner,vertexBuffer:_,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:zC.endFaceNormalAndHalfWidth,vertexBuffer:C,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:zC.a_batchId,vertexBuffer:y,componentDatatype:q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:I,indexBuffer:E}),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 a1=new M,gAe=new d;function b$e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,a1),M.multiplyByPoint(a1,e._center,gAe),M.setTranslation(a1,gAe,a1),a1},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function _Ae(e){return ze.fromCache({cull:{enabled:!0,face:Ni.FRONT},blending:dn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Xn.EQUAL,frontOperation:{fail:yt.KEEP,zFail:yt.KEEP,zPass:yt.KEEP},backFunction:Xn.EQUAL,backOperation:{fail:yt.KEEP,zFail:yt.KEEP,zPass:yt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function x$e(e){l(e._rs)||(e._rs=_Ae(!1),e._rs3DTiles=_Ae(!0))}function T$e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(r1),o=n.getFragmentShaderCallback(!1,void 0,!0)(s1),r=new We({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[ef,i]}),s=new We({defines:["VECTOR_TILE"],sources:[o]});e._sp=sn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:zC})}function S$e(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new et({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:we.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=et.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=we.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Jn.TERRAIN||i===Jn.BOTH)&&t.commandList.push(n),(i===Jn.CESIUM_3D_TILE||i===Jn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}bg.prototype.getPositions=function(e){return zI.getPolylinePositions(this,e)};bg.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 Ia(e,r)}};bg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function B$e(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=G.WHITE}}var w$e=new G,D$e=G.WHITE,v$e=!0;bg.prototype.applyStyle=function(e,t){if(!l(e)){B$e(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,w$e):D$e,s.show=l(e.show)?e.show.evaluate(s):v$e}};function P$e(e){return Si.initialize().then(function(){_$e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}bg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=P$e(this).then(E$e(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}b$e(this,t),T$e(this,t),x$e(this);let n=e.passes;(n.render||n.pick)&&S$e(this,e)};bg.prototype.isDestroyed=function(){return!1};bg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var c1=bg;var Bq=32767,R$e=new he,M$e=new d;function N$e(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);bn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let h=s[f],m=a[f],g=c[f],A=D.lerp(t.west,t.east,h/Bq),_=D.lerp(t.south,t.north,m/Bq),C=D.lerp(n,i,g/Bq),y=he.fromRadians(A,_,C,R$e),E=o.cartographicToCartesian(y,M$e);d.pack(E,u,f*3)}return u}var l1=N$e;function tA(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,k$e(this,i,o)}Object.defineProperties(tA.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 L$e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function O$e(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 m=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let m=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let m=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,c)}let u=l(n)||l(i)||l(o),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new ue("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let m=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=m++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=m++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=m++}return{polygons:n,polylines:i,points:o}}var eA=Uint32Array.BYTES_PER_ELEMENT;function F$e(e){return new zI(e)}function Q$e(e){return new c1(e)}function k$e(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=eA;let r=o.getUint32(n,!0);if(r!==1)throw new ue(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=eA;let s=o.getUint32(n,!0);if(n+=eA,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=eA,a===0)throw new ue("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=eA;let u=o.getUint32(n,!0);n+=eA;let f=o.getUint32(n,!0);n+=eA;let h=o.getUint32(n,!0);n+=eA;let m=o.getUint32(n,!0);n+=eA;let g=o.getUint32(n,!0);n+=eA;let A=o.getUint32(n,!0);n+=eA;let _=Ir(i,n,a);n+=a;let C=new Uint8Array(t,n,c);n+=c;let y,E;u>0&&(y=Ir(i,n,u),n+=u,f>0&&(E=new Uint8Array(t,n,f),E=new Uint8Array(E),n+=f));let I=_.POLYGONS_LENGTH??0,x=_.POLYLINES_LENGTH??0,S=_.POINTS_LENGTH??0,w=I+x+S,v=new Nh(e,w,y,E,L$e(e));if(e._batchTable=v,w===0)return;let P=new zh(_,C),N=P.getGlobalProperty("REGION");if(!l(N))throw new ue("Feature table global property: REGION must be defined");let L=ce.unpack(N),p=N[4],b=N[5],T=e._tile.computedTransform,B=P.getGlobalProperty("RTC_CENTER",q.FLOAT,3);l(B)?(B=d.unpack(B),M.multiplyByPoint(T,B,B)):(B=ce.center(L),B.height=D.lerp(p,b,.5),B=te.WGS84.cartographicToCartesian(B));let R=O$e(_,C);if(n+=(4-n%4)%4,I>0){P.featuresLength=I;let U=P.getPropertyArray("POLYGON_COUNTS",q.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_COUNT",q.UNSIGNED_INT,1);if(!l(U))throw new ue("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=P.getPropertyArray("POLYGON_INDEX_COUNTS",q.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_INDEX_COUNT",q.UNSIGNED_INT,1);if(!l(k))throw new ue("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let z=U.reduce(function($,K){return $+K*2},0),Q=k.reduce(function($,K){return $+K},0),H=new Uint32Array(t,n,Q);n+=h;let W=new Uint16Array(t,n,z);n+=m;let Z,Y;l(_.POLYGON_MINIMUM_HEIGHTS)&&l(_.POLYGON_MAXIMUM_HEIGHTS)&&(Z=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",q.FLOAT,1),Y=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",q.FLOAT,1)),e._polygons=new n1({positions:W,counts:U,indexCounts:k,indices:H,minimumHeight:p,maximumHeight:b,polygonMinimumHeights:Z,polygonMaximumHeights:Y,center:B,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:R.polygons,modelMatrix:T})}let O=e._tileset;if(x>0){P.featuresLength=x;let U=P.getPropertyArray("POLYLINE_COUNTS",q.UNSIGNED_INT,1)??P.getPropertyArray("POLYLINE_COUNT",q.UNSIGNED_INT,1);if(!l(U))throw new ue("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let k=P.getPropertyArray("POLYLINE_WIDTHS",q.UNSIGNED_SHORT,1);if(!l(k)){k=new Uint16Array(x);for(let Z=0;Z<x;++Z)k[Z]=2}let z=U.reduce(function(Z,Y){return Z+Y*3},0),Q=new Uint16Array(t,n,z);n+=g;let H=O.examineVectorLinesFunction;if(l(H)){let Z=l1(new Uint16Array(Q),L,p,b,te.WGS84);U$e(Z,U,R.polylines,v,e.url,H)}let W=F$e;l(O.classificationType)&&(W=Q$e),e._polylines=W({positions:Q,widths:k,counts:U,batchIds:R.polylines,minimumHeight:p,maximumHeight:b,center:B,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,classificationType:O.classificationType,keepDecodedPositions:O.vectorKeepDecodedPositions})}if(S>0){let U=new Uint16Array(t,n,S*3);n+=A,e._points=new t1({positions:U,batchIds:R.points,minimumHeight:p,maximumHeight:b,rectangle:L,batchTable:v,heightReference:O.heightReference,scene:O.scene})}}function wq(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}}tA.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};tA.prototype.getFeature=function(e){return l(this._features)||wq(this),this._features[e]};tA.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)};tA.prototype.applyStyle=function(e){l(this._features)||wq(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)};tA.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)||wq(this),this._batchTable.update(e,t),this._ready=!0)};tA.prototype.pick=function(e,t,n){};tA.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};tA.prototype.isDestroyed=function(){return!1};tA.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(),de(this)};function U$e(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,r(f,n[c],o,i)}}var u1=tA;function Za(){}Za._maxSortingConcurrency=Math.max(zt.hardwareConcurrency-1,1);Za._sorterTaskProcessor=void 0;Za._taskProcessorReady=!1;Za._error=void 0;Za._getSorterTaskProcessor=function(){if(!l(Za._sorterTaskProcessor)){let e=new qn("gaussianSplatSorter",Za._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?Za._taskProcessorReady=!0:Za._error=new ue("Gaussian splat sorter could not be initialized.")}).catch(t=>{Za._error=t}),Za._sorterTaskProcessor=e}return Za._sorterTaskProcessor};Za.radixSortIndexes=function(e){let t=Za._getSorterTaskProcessor();if(l(Za._error))throw Za._error;if(Za._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var LT=Za;function $a(){}$a._maxSortingConcurrency=Math.max(zt.hardwareConcurrency-1,1);$a._textureTaskProcessor=void 0;$a._taskProcessorReady=!1;$a._error=void 0;$a._getTextureTaskProcessor=function(){if(!l($a._textureTaskProcessor)){let e=new qn("gaussianSplatTextureGenerator",$a._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?$a._taskProcessorReady=!0:$a._error=new ue("Gaussian splat sorter could not be initialized.")}).catch(t=>{$a._error=t}),$a._textureTaskProcessor=e}return $a._textureTaskProcessor};$a.generateFromAttributes=function(e){let t=$a._getTextureTaskProcessor();if(l($a._error))throw $a._error;if(!$a._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var f1=$a;function G$e(e){let t=new xp;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL}})),this.alphaOptions=new RI,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,pe.FRAGMENT)}var d1=G$e;var h1=`//
// 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 A1=`//
// 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 OT=new M,yAe=new M,VC=new M,z$e=new M,bu={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4};function V$e(e,t){return new Bt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:qe.RG_INTEGER,pixelDatatype:Ge.UNSIGNED_INT,flipY:!1,sampler:Jt.NEAREST})}function CAe(e,t){return new Bt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:qe.RGBA_INTEGER,pixelDatatype:Ge.UNSIGNED_INT,flipY:!1,sampler:Jt.NEAREST})}function hf(e){e=e??V.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 M,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=Lr.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=Lt.getAxisCorrectionMatrix(eo.Y,eo.X,new M),this._isDestroyed=!1,this._sorterState=bu.IDLE,this._sorterPromise=void 0,this._sorterError=void 0}Object.defineProperties(hf.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)}}});hf.prototype._wrappedUpdate=function(e){this._baseTilesetUpdate.call(this._tileset,e),this.update(e)};hf.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),de(this)};hf.prototype.isDestroyed=function(){return this._isDestroyed};hf.prototype.onTileLoad=function(e){this._dirty=!0};hf.prototype.onTileVisible=function(e){};hf.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=It.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let o=i._rootTransform,r=M.multiplyTransformation(t,i._axisCorrectionMatrix,OT);M.multiplyTransformation(r,e.content.worldTransform,r);let s=M.multiply(e.tileset.modelMatrix,o,yAe),a=M.inverse(s,VC),c=M.multiplyTransformation(a,r,OT),u=e.content.positions,f=e.content.rotations,h=e.content.scales,m=Lt.getAttributeBySemantic(n,rt.POSITION).typedArray,g=Lt.getAttributeBySemantic(n,rt.ROTATION).typedArray,A=Lt.getAttributeBySemantic(n,rt.SCALE).typedArray,_=new d,C=new Qe,y=new d;for(let E=0;E<m.length/3;++E)_.x=m[E*3],_.y=m[E*3+1],_.z=m[E*3+2],C.x=g[E*4],C.y=g[E*4+1],C.z=g[E*4+2],C.w=g[E*4+3],y.x=A[E*3],y.y=A[E*3+1],y.z=A[E*3+2],M.fromTranslationQuaternionRotationScale(_,C,y,VC),M.multiplyTransformation(c,VC,VC),M.getTranslation(VC,_),M.getRotation(VC,C),M.getScale(VC,y),u[E*3]=_.x,u[E*3+1]=_.y,u[E*3+2]=_.z,f[E*4]=C.x,f[E*4+1]=C.y,f[E*4+2]=C.z,f[E*4+3]=C.w,h[E*3]=y.x,h[E*3+1]=y.y,h[E*3+2]=y.z};hf.generateSplatTexture=function(e,t){e._gaussianSplatTexturePending=!0;let n=f1.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=CAe(t.context,i);else if(e._lastTextureHeight!==i.height||e._lastTextureWidth!==i.width){let o=e.gaussianSplatTexture;e._gaussianSplatTexture=CAe(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})};hf.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new d1(e),{shaderBuilder:o}=i,r=i.renderStateOptions;r.cull.enabled=!1,r.depthMask=!1,r.depthTest.enabled=!0,r.blending=dn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=we.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",pe.VERTEX),o.addVarying("float","v_splitDirection"),o.addUniform("highp usampler2D","u_splatAttributeTexture",pe.VERTEX),o.addUniform("float","u_sphericalHarmonicsDegree",pe.VERTEX),o.addUniform("float","u_splatScale",pe.VERTEX),o.addUniform("vec3","u_cameraPositionWC",pe.VERTEX),o.addUniform("mat3","u_inverseModelRotation",pe.VERTEX);let s=i.uniformMap,a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},e._sphericalHarmonicsDegree>0&&(o.addDefine("HAS_SPHERICAL_HARMONICS","1",pe.VERTEX),o.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",pe.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return d.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){let _=e._tileset,C=M.multiply(_.modelMatrix,e._rootTransform,OT);return M.getRotation(M.inverse(C,VC),z$e)},s.u_splitDirection=function(){return e.splitDirection},i.instanceCount=e._numSplats,i.count=4,i.primitiveType=Pe.TRIANGLE_STRIP,o.addVertexLines(h1),o.addFragmentLines(A1);let c=o.buildShaderProgram(t.context),u=Ve(ze.fromCache(i.renderStateOptions),!0);u.cull.face=Lt.getCullFace(n.modelMatrix,Pe.TRIANGLE_STRIP),u=ze.fromCache(u);let f={screenQuadPosition:0,splatIndex:2},h=new yn.Attribute;if(h.name="_SPLAT_INDEXES",h.typedArray=e._indexes,h.componentDatatype=q.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 _=new ht({attributes:{screenQuadPosition:new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...h,variableName:"splatIndex"}},primitiveType:Pe.TRIANGLE_STRIP});e._vertexArray=oi.fromGeometry({context:t.context,geometry:_,attributeLocations:f,bufferUsage:Oe.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=M.multiply(n.modelMatrix,e._rootTransform,yAe),g=e._vertexArray,A=new et({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:s,renderState:u,vertexArray:g,shaderProgram:c,cull:r.cull.enabled,pass:we.GAUSSIAN_SPLATS,count:i.count,owner:this,instanceCount:i.instanceCount,primitiveType:Pe.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=A};hf.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===bu.IDLE){if(!this._dirty&&M.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 u,f=0;for(let h of n){let m=h.content,g=a(m),A=l(c)?c:Ut.getNumberOfComponents(g.type),_=l(g.typedArray)?g.typedArray:g;l(u)||(u=q.createTypedArray(s,i*A)),u.set(_,f),f+=_.length}return u},r=()=>{let s=0;for(let a of n){let c=a.content.packedSphericalHarmonicsData;if(a.content.sphericalHarmonicsDegree>0){if(!l(this._shData)){let u;switch(a.content.sphericalHarmonicsDegree){case 1:u=9;break;case 2:u=24;break;case 3:u=45}this._shData=new Uint32Array(i*(u*(2/3)))}this._shData.set(c,s),s+=c.length}}};this._positions=o(q.FLOAT,s=>s.positions,3),this._scales=o(q.FLOAT,s=>s.scales,3),this._rotations=o(q.FLOAT,s=>s.rotations,4),this._colors=o(q.UNSIGNED_BYTE,s=>Lt.getAttributeBySemantic(s.gltfPrimitive,rt.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&&(hf.generateSplatTexture(this,e),l(this._shData))){let n=this.sphericalHarmonicsTexture,i=Ft.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 u=0;c<this._shData.length;u+=i*2)a.set(this._shData.subarray(c,c+s),u),c+=s;this.sphericalHarmonicsTexture=V$e(e.context,{data:a,width:i,height:Math.ceil(this._numSplats/r)}),l(n)&&n.destroy()}return}if(M.clone(e.camera.viewMatrix,this._prevViewMatrix),M.multiply(e.camera.viewMatrix,this._rootTransform,OT),l(this._sorterPromise)||(this._sorterPromise=LT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(OT),count:this._numSplats},sortType:"Index"})),!l(this._sorterPromise)){this._sorterState=bu.WAITING;return}this._sorterPromise.catch(n=>{this._sorterState=bu.ERROR,this._sorterError=n}),this._sorterPromise.then(n=>{this._indexes=n,this._sorterState=bu.SORTED})}else if(this._sorterState===bu.WAITING){if(l(this._sorterPromise)||(this._sorterPromise=LT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(OT),count:this._numSplats},sortType:"Index"})),!l(this._sorterPromise)){this._sorterState=bu.WAITING;return}this._sorterPromise.catch(n=>{this._sorterState=bu.ERROR,this._sorterError=n}),this._sorterPromise.then(n=>{this._indexes=n,this._sorterState=bu.SORTED}),this._sorterState=bu.SORTING}else{if(this._sorterState===bu.SORTING)return;if(this._sorterState===bu.SORTED)hf.buildGSplatDrawCommand(this,e),this._sorterState=bu.IDLE,this._dirty=!1,this._sorterPromise=void 0;else if(this._sorterState===bu.ERROR)throw this._sorterError}this._dirty=!1}}};var FT=hf;function Af(e,t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._loader=e,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new FT({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}Af.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")&&Ea("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(Af.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 H$e(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function Y$e(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 EAe=new ArrayBuffer(4),W$e=new Float32Array(EAe),j$e=new Uint32Array(EAe);function Dq(e){W$e[0]=e;let t=j$e[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 q$e(e){let t=H$e(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 K$e(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),o=new Uint32Array(i),r=e.gltfPrimitive.attributes.filter(u=>u.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((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=s*(2/3);for(let u=0;u<r.length;u++){let{l:f,n:h}=q$e(r[u].name);for(let m=0;m<e.pointsLength;m++){let g=a[f-1]*2/3,A=m*c+g+h*2,_=m*3;o[A]=Dq(r[u].typedArray[_])|Dq(r[u].typedArray[_+1])<<16,o[A+1]=Dq(r[u].typedArray[_+2])}}return o}Af.fromGltf=async function(e,t,n,i){let o=n,r=Be.createIfNeeded(o),s={releaseGltfJson:!1,upAxis:eo.Y,forwardAxis:eo.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=Be.createIfNeeded(i);let a=new sf(s);try{await a.load()}catch(c){throw a.destroy(),new ue(`Failed to load glTF: ${c.message}`)}return new Af(a,e,t,n)};Af.prototype.update=function(e,t){let n=this._loader;if(this._ready){!this._transformed&&e.root.content.ready&&(FT.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(Lt.getAttributeBySemantic(this.gltfPrimitive,rt.POSITION).typedArray),this._rotations=new Float32Array(Lt.getAttributeBySemantic(this.gltfPrimitive,rt.ROTATION).typedArray),this._scales=new Float32Array(Lt.getAttributeBySemantic(this.gltfPrimitive,rt.SCALE).typedArray);let{l:i,n:o}=Y$e(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=i,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=K$e(this);return}this._resourcesLoaded=n.process(t)};Af.prototype.hasProperty=function(e,t){return!1};Af.prototype.getFeature=function(e){};Af.prototype.applyDebugSettings=function(e,t){};Af.prototype.applyStyle=function(e){};Af.prototype.pick=function(e,t,n){};Af.prototype.isDestroyed=function(){return this.isDestroyed};Af.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),de(this)};var HC=Af;var IAe={b3dm:function(e,t,n,i,o){return uf.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return uf.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return uf.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return dM.fromTileType(e,t,n,i,o,IAe)},externalTileset:function(e,t,n,i){return GO.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new mM(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new u1(e,t,n,i,o)},subt:function(e,t,n,i,o){return Hx.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return Hx.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new ue("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return HC.tilesetRequiresGaussianSplattingExt(e)?HC.fromGltf(e,t,n,c):uf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return HC.tilesetRequiresGaussianSplattingExt(e)?HC.fromGltf(e,t,n,i):uf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return uf.fromGeoJson(e,t,n,i)}},VI=IAe;var J$e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},lr=Object.freeze(J$e);var nA={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"};nA.isBinaryFormat=function(e){switch(e){case nA.BATCHED_3D_MODEL:case nA.INSTANCED_3D_MODEL:case nA.COMPOSITE:case nA.POINT_CLOUD:case nA.VECTOR:case nA.GEOMETRY:case nA.IMPLICIT_SUBTREE:case nA.VOXEL_BINARY:case nA.GLTF_BINARY:return!0;default:return!1}};var oa=Object.freeze(nA);var X$e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Bd=Object.freeze(X$e);var Ba={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},xg=new Array(Ba.NUMBER_OF_PASSES);xg[Ba.RENDER]=Object.freeze({pass:Ba.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});xg[Ba.PICK]=Object.freeze({pass:Ba.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});xg[Ba.SHADOW]=Object.freeze({pass:Ba.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});xg[Ba.PRELOAD]=Object.freeze({pass:Ba.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});xg[Ba.PRELOAD_FLIGHT]=Object.freeze({pass:Ba.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});xg[Ba.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ba.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});xg[Ba.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ba.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});xg[Ba.MOST_DETAILED_PICK]=Object.freeze({pass:Ba.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ba.getPassOptions=function(e){return xg[e]};var nr=Object.freeze(Ba);function Em(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Em.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){}}});Em.prototype.hasProperty=function(e,t){return!1};Em.prototype.getFeature=function(e){};Em.prototype.applyDebugSettings=function(e,t){};Em.prototype.applyStyle=function(e){};Em.prototype.update=function(e,t){};Em.prototype.pick=function(e,t,n){};Em.prototype.isDestroyed=function(){return!1};Em.prototype.destroy=function(){return de(this)};var QT=Em;function Tg(e){e=e??V.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(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 Yn.hasProperty(e,this._properties,this._class)};Tg.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Tg.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};Tg.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};Tg.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var m1=Tg;function vq(e,t){let n=Ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){vq._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??V.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new m1({content:n,class:o})}}vq._oneTimeWarning=At;var HI=vq;function Z$e(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=Ii(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 YI=Z$e;function Sg(e){e=e??V.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(Sg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Sg.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Sg.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Sg.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Sg.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};Sg.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};Sg.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};Sg.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var p1=Sg;function Pq(e,t){let n=Ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Pq._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??V.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new p1({tile:n,class:o})}}Pq._oneTimeWarning=At;var g1=Pq;function $$e(e){let t=new Uint8Array(e),n=Mh(t);if(n==="glTF"&&(n="glb"),oa.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=eet(t);if(l(i.root))return{contentType:oa.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:oa.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:oa.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:oa.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:oa.VOXEL_JSON,jsonPayload:i};throw new ue("Invalid tile content.")}function eet(e){let t;try{t=Ir(e)}catch{throw new ue("Invalid tile content.")}return t}var Bg=$$e;function wd(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=Nc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(wd.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 Rq(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function bAe(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)}wd.prototype.requestInnerContents=function(){if(!tet(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;Rq(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=net(this,n,t,this._tile._contentState);return iet(this)};function tet(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)&&!Nc.serverHasOpenSlots(n,t[n]))return!1;return Nc.heapHasOpenSlots(e.length)}function net(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:Qs.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===hi.CANCELLED){bAe(e,i);return}return Rq(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===hi.CANCELLED){bAe(e,i);return}Rq(e,-1),xAe(e,t,f)}})}async function iet(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>oet(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 oet(e,t,n){if(l(t))try{let i=Bg(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===oa.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===oa.GEOMETRY||i.contentType===oa.VECTOR;let a,c=VI[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 u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,m=s.implicitCoordinates;a.metadata=h.getContentMetadataView(m,n)}else s.hasImplicitContent||(a.metadata=HI(o,u));let f=YI(o,u);return l(f)&&(a.group=new eI({metadata:f})),a}catch(i){xAe(e,n,i)}}function xAe(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}`))}wd.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};wd.prototype.hasProperty=function(e,t){return!1};wd.prototype.getFeature=function(e){};wd.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};wd.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};wd.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)};wd.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 u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};wd.prototype.isDestroyed=function(){return!1};wd.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var _1=wd;var TAe=Math.cos,SAe=Math.sin,ret=Math.sqrt,Mq={};Mq.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,h=TAe(f),m=SAe(f),g=a.z*m,A=c.longitude+i*e.granYSin+o*e.granXCos,_=h*TAe(A),C=h*SAe(A),y=a.x*_,E=a.y*C,I=ret(y*_+E*C+g*m);if(r.x=y/I,r.y=E/I,r.z=g/I,n){let x=e.stNwCorner;l(x)?(f=x.latitude-e.stGranYCos*i+o*e.stGranXSin,A=x.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(A-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(A-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var set=new zi,Dd=new d,aet=new he,i4=new d,C1=new Gi;function BAe(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),h=i*f,m=n*f;C1._ellipsoid=te.default,Dd=C1.project(e,Dd),Dd=d.subtract(Dd,i4,Dd);let g=zi.fromRotation(t,set);Dd=zi.multiplyByVector(g,Dd,Dd),Dd=d.add(Dd,i4,Dd),e=C1.unproject(Dd,e),r-=1,s-=1;let A=e.latitude,_=A+r*m,C=A-c*s,y=A-c*s+r*m,E=Math.max(A,_,C,y),I=Math.min(A,_,C,y),x=e.longitude,S=x+r*u,w=x+s*h,v=x+s*h+r*u,P=Math.max(x,S,w,v),N=Math.min(x,S,w,v);return{north:E,south:I,east:P,west:N,granYCos:c,granYSin:h,granXCos:u,granXSin:m,nwCorner:e}}Mq.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,u=e.north,f=e.south,h=!1,m=!1;u===D.PI_OVER_TWO&&(h=!0),f===-D.PI_OVER_TWO&&(m=!0);let g,A=u-f;c>a?g=D.TWO_PI-c+a:g=a-c;let _=Math.ceil(g/t)+1,C=Math.ceil(A/t)+1,y=g/(_-1),E=A/(C-1),I=ce.northwest(e,r),x=ce.center(e,aet);(n!==0||i!==0)&&(x.longitude<I.longitude&&(x.longitude+=D.TWO_PI),C1._ellipsoid=te.default,i4=C1.project(x,i4));let S=E,w=y,v=0,P=0,N=ce.clone(e,o),L={granYCos:S,granYSin:v,granXCos:w,granXSin:P,nwCorner:I,boundingRectangle:N,width:_,height:C,northCap:h,southCap:m};if(n!==0){let p=BAe(I,n,y,E,x,_,C);u=p.north,f=p.south,a=p.east,c=p.west,L.granYCos=p.granYCos,L.granYSin=p.granYSin,L.granXCos=p.granXCos,L.granXSin=p.granXSin,N.north=u,N.south=f,N.east=a,N.west=c}if(i!==0){n=n-i;let p=ce.northwest(N,s),b=BAe(p,n,y,E,x,_,C);L.stGranYCos=b.granYCos,L.stGranXCos=b.granXCos,L.stGranYSin=b.granYSin,L.stGranXSin=b.granXSin,L.stNwCorner=p,L.stWest=b.west,L.stSouth=b.south}return L};var ra=Mq;var cet=new le,uet=new le,fet=new d,det=new ce;function wAe(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;r&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*o+2*a-f;let h=new Float64Array(u*3),m=0,g=0,A,_=fet;if(r)ra.computePosition(t,n,!1,g,0,_),h[m++]=_.x,h[m++]=_.y,h[m++]=_.z;else for(A=0;A<o;A++)ra.computePosition(t,n,!1,g,A,_),h[m++]=_.x,h[m++]=_.y,h[m++]=_.z;for(A=o-1,g=1;g<i;g++)ra.computePosition(t,n,!1,g,A,_),h[m++]=_.x,h[m++]=_.y,h[m++]=_.z;if(g=i-1,!s)for(A=o-2;A>=0;A--)ra.computePosition(t,n,!1,g,A,_),h[m++]=_.x,h[m++]=_.y,h[m++]=_.z;for(A=0,g=i-2;g>0;g--)ra.computePosition(t,n,!1,g,A,_),h[m++]=_.x,h[m++]=_.y,h[m++]=_.z;let C=h.length/3*2,y=Fe.createTypedArray(h.length/3,C),E=0;for(let x=0;x<h.length/3-1;x++)y[E++]=x,y[E++]=x+1;y[E++]=h.length/3-1,y[E++]=0;let I=new ht({attributes:new pn,primitiveType:Pe.LINES});return I.attributes.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:h}),I.indices=y,I}function het(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=wAe(e,t),s=t.height,a=t.width,c=bi.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let h=bi.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(h,u),r.attributes.position.values=f;let m=t.northCap,g=t.southCap,A=4;m&&(A-=1),g&&(A-=1);let _=(f.length/3+A)*2,C=Fe.createTypedArray(f.length/3,_);u=f.length/6;let y=0;for(let I=0;I<u-1;I++)C[y++]=I,C[y++]=I+1,C[y++]=I+u,C[y++]=I+u+1;C[y++]=u-1,C[y++]=0,C[y++]=u+u-1,C[y++]=u,C[y++]=0,C[y++]=u;let E;if(m)E=s-1;else{let I=a-1;C[y++]=I,C[y++]=I+u,E=a+s-2}if(C[y++]=E,C[y++]=E+u,!g){let I=a+E-1;C[y++]=I,C[y]=I+u}return r.indices=C,r}function UT(e){e=e??V.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??D.RADIANS_PER_DEGREE,i=e.ellipsoid??te.default,o=e.rotation??0,r=e.height??0,s=e.extrudedHeight??r;this._rectangle=ce.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"}UT.packedLength=ce.packedLength+te.packedLength+5;UT.pack=function(e,t,n){return n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var DAe=new ce,vAe=te.clone(te.UNIT_SPHERE),kT={rectangle:DAe,ellipsoid:vAe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};UT.unpack=function(e,t,n){t=t??0;let i=ce.unpack(e,t,DAe);t+=ce.packedLength;let o=te.unpack(e,t,vAe);t+=te.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(kT.granularity=r,kT.height=s,kT.rotation=a,kT.extrudedHeight=c,kT.offsetAttribute=u===-1?void 0:u,new UT(kT))};var Aet=new he;UT.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=ra.computeOptions(t,e._granularity,e._rotation,0,det,Aet),o,r;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!D.equalsEpsilon(s,a,0,D.EPSILON2),u;if(c){if(o=het(e,i),l(e._offsetAttribute)){let m=o.attributes.position.values.length/3,g=new Uint8Array(m);e._offsetAttribute===un.TOP?g=g.fill(1,0,m/2):(u=e._offsetAttribute===un.NONE?0:1,g=g.fill(u)),o.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=le.fromRectangle3D(t,n,s,uet),h=le.fromRectangle3D(t,n,a,cet);r=le.union(f,h)}else{if(o=wAe(e,i),o.attributes.position.values=bi.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===un.NONE?0:1;let h=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=le.fromRectangle3D(t,n,s)}return new ht({attributes:o.attributes,indices:o.indices,primitiveType:Pe.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var WI=UT;function zT(e){this.rectangle=ce.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new d,this.northeastCornerCartesian=new d,this.westNormal=new d,this.southNormal=new d,this.eastNormal=new d,this.northNormal=new d;let t=e.ellipsoid??te.WGS84;Cet(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(zT.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});zT.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=$t.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)};var PAe=new d,o4=new d,RAe=new d,met=new d,pet=new d,get=new d,_et=new d,vd=new he,MAe=new rn(d.UNIT_X,0),GT=new gn;function Cet(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),vd.longitude=t.west,vd.latitude=(t.south+t.north)*.5,vd.height=0;let i=n.cartographicToCartesian(vd,get),o=d.cross(i,d.UNIT_Z,met);d.normalize(o,e.westNormal),vd.longitude=t.east;let r=n.cartographicToCartesian(vd,_et),s=d.cross(d.UNIT_Z,r,PAe);d.normalize(s,e.eastNormal);let a=d.subtract(i,r,PAe);d.magnitude(a)===0&&(a=d.clone(o,a));let c=d.normalize(a,pet),u=t.south,f;if(u>0){vd.longitude=(t.west+t.east)*.5,vd.latitude=u;let _=n.cartographicToCartesian(vd,GT.origin);d.clone(c,GT.direction);let C=rn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,MAe);ci.rayPlane(GT,C,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(_,o4)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),o4);let h=d.cross(f,a,RAe);d.normalize(h,e.southNormal);let m=t.north,g;if(m<0){vd.longitude=(t.west+t.east)*.5,vd.latitude=m;let _=n.cartographicToCartesian(vd,GT.origin);d.negate(c,GT.direction);let C=rn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,MAe);ci.rayPlane(GT,C,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(_,o4)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),o4);let A=d.cross(a,g,RAe);d.normalize(A,e.northNormal)}var yet=new d,Eet=new d,Iet=new d(0,-1,0),bet=new d(0,0,-1),NAe=new d;function xet(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,h=e.westNormal,m=e.southNormal,g=e.eastNormal,A=e.northNormal;t.mode!==oe.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),yet),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),Eet),f.z=f.y,f.y=f.x,f.x=0,h=Iet,g=d.UNIT_Y,m=bet,A=d.UNIT_Z);let _=d.subtract(i,u,NAe),C=d.dot(_,h),y=d.dot(_,m),E=d.subtract(i,f,NAe),I=d.dot(E,g),x=d.dot(E,A);C>0?r+=C*C:I>0&&(r+=I*I),y>0?r+=y*y:x>0&&(r+=x*x)}let s,a,c;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}zT.prototype.distanceToCamera=function(e){let t=xet(this,e);if(e.mode===oe.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};zT.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};zT.prototype.createDebugVolume=function(e){let t=new M.clone(M.IDENTITY),n=new WI({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Rt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Xt.fromColor(e)}});return new Ln({geometryInstances:i,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var mf=zT;var y1={},Tet=new d,LAe=new d,OAe=new d,FAe=new d,QAe=new $t;y1.validOutline=function(e){let n=$t.fromPoints(e,QAe).halfAxes,i=X.getColumn(n,0,LAe),o=X.getColumn(n,1,OAe),r=X.getColumn(n,2,FAe),s=d.magnitude(i),a=d.magnitude(o),c=d.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};y1.computeProjectTo2DArguments=function(e,t,n,i){let o=$t.fromPoints(e,QAe),r=o.halfAxes,s=X.getColumn(r,0,LAe),a=X.getColumn(r,1,OAe),c=X.getColumn(r,2,FAe),u=d.magnitude(s),f=d.magnitude(a),h=d.magnitude(c),m=Math.min(u,f,h);if(u===0&&(f===0||h===0)||f===0&&h===0)return!1;let g,A;return(m===f||m===h)&&(g=s),m===u?g=a:m===h&&(A=a),(m===u||m===f)&&(A=c),d.normalize(g,n),d.normalize(A,i),d.clone(o.center,t),!0};function kAe(e,t,n,i,o){let r=d.subtract(e,t,Tet),s=d.dot(n,r),a=d.dot(i,r);return F.fromElements(s,a,o)}y1.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=kAe(i[r],e,t,n);return o}};y1.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return kAe(i,e,t,n,o)}};var wg=y1;function Bet(e){let t=e.length,n=new Float64Array(t*3),i=Fe.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 pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:n})});return new ht({attributes:s,indices:i,primitiveType:Pe.LINES})}function jI(e){e=e??V.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Zn.computeHierarchyPackedLength(t,d)+1}jI.fromPositions=function(e){e=e??V.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new jI(t)};jI.pack=function(e,t,n){return n=n??0,n=Zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),t[n]=e.packedLength,t};var wet={polygonHierarchy:{}};jI.unpack=function(e,t,n){t=t??0;let i=Zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new jI(wet)),n._polygonHierarchy=i,n.packedLength=o,n};jI.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Uo(n,d.equalsEpsilon,!0),n.length<3||!wg.validOutline(n))return;let o=Zn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new Rt({geometry:Bet(o[c])});r.push(u)}let s=Un.combineInstances(r)[0],a=le.fromPoints(t.positions);return new ht({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Pd=jI;var r4=new he;function E1(e){let t=Hp.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??te.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=Fet(t,n,i,o);this._boundingPlanes=r;let s=Get(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=Gq(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=d.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=Gq(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=Gq(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();r4=o.cartesianToCartographic(c,r4),r4.height=(i+n)/2,this.center=o.cartographicToCartesian(r4,c),this._boundingSphere=le.fromPoints(s)}var Det=new d,vet=new he,Pet=new d,Ret=new he,Met=new d,Net=new d,Let=new d,Oet=new d;function Fet(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,Det),a=i.cartesianToCartographic(r,vet);a.height=n;let c=i.cartographicToCartesian(a,Pet),u=rn.fromPointNormal(c,s);o[0]=u;let f=0,h,m=[],g,A;for(h=0;h<4;h++){g=e.getVertex(h),m[h]=g,A=i.cartesianToCartographic(g,Ret),A.height=t;let C=rn.getPointDistance(u,i.cartographicToCartesian(A,Met));C<f&&(f=C)}let _=rn.clone(u);for(_.normal=d.negate(_.normal,_.normal),_.distance=_.distance*-1+f,o[1]=_,h=0;h<4;h++){g=m[h];let C=m[(h+1)%4],y=i.geodeticSurfaceNormal(g,Net),E=d.subtract(C,g,Oet),I=d.cross(E,y,Let);I=d.normalize(I,I),o[2+h]=rn.fromPointNormal(g,I)}return o}var qI=new d,KI=new d,JI=new d,Nq=new d,Lq=new d,Oq=new d,Qet=new d,ket=new d,Uet=new d,Fq=new d,Qq=new d,kq=new d,YC=new d,Im=new X;function UAe(e,t,n){qI=e.normal,KI=t.normal,JI=n.normal,Nq=d.multiplyByScalar(e.normal,-e.distance,Nq),Lq=d.multiplyByScalar(t.normal,-t.distance,Lq),Oq=d.multiplyByScalar(n.normal,-n.distance,Oq),Fq=d.multiplyByScalar(d.cross(KI,JI,Qet),d.dot(Nq,qI),Fq),Qq=d.multiplyByScalar(d.cross(JI,qI,ket),d.dot(Lq,KI),Qq),kq=d.multiplyByScalar(d.cross(qI,KI,Uet),d.dot(Oq,JI),kq),Im[0]=qI.x,Im[1]=KI.x,Im[2]=JI.x,Im[3]=qI.y,Im[4]=KI.y,Im[5]=JI.y,Im[6]=qI.z,Im[7]=KI.z,Im[8]=JI.z;let i=X.determinant(Im);return YC=d.add(Fq,Qq,YC),YC=d.add(YC,kq,YC),new d(YC.x/i,YC.y/i,YC.z/i)}function Get(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=UAe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=UAe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var Uq=new d,VT=new d;function Gq(e,t){let n=[];for(let i=0;i<4;i++)Uq=d.subtract(t[(i+1)%4],t[i],Uq),VT=d.cross(e.normal,Uq,VT),VT=d.normalize(VT,VT),n[i]=d.clone(VT);return n}Object.defineProperties(E1.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var zq=new d;E1.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;rn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):rn.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,rn.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=Vq(rn.projectPointOntoPlane(c,t,zq),i[0],c,o),d.distance(a,t);if(n.length===2){if(n[0]===0){let m=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=GAe(t,m[0],m[1]),d.distance(a,t)}let f=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=Vq(rn.projectPointOntoPlane(c,t,zq),i[r],c,this._edgeNormals[n[r]]),h=d.distanceSquared(a,t),h<f&&(f=h);return Math.sqrt(f)}else if(n.length>3)return a=Vq(rn.projectPointOntoPlane(this._boundingPlanes[1],t,zq),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),d.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?d.distance(t,this._vertices[(n[1]-2+u)%4]):d.distance(t,this._vertices[4+(n[1]-2+u)%4])};var zet=new d,Vet=new d;function GAe(e,t,n){let i=d.subtract(n,t,zet),o=d.subtract(e,t,Vet),r=d.dot(i,o);if(r<=0)return t;let s=d.dot(i,i);return r>=s?n:(r=r/s,new d((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var Het=new rn(d.UNIT_X,0);function Vq(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let u=rn.fromPointNormal(t[c],i[c],Het);rn.getPointDistance(u,e)<0||(a=GAe(e,t[c],t[(c+1)%4]),r=d.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}E1.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)d.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?qt.INSIDE:n===this._vertices.length?qt.OUTSIDE:qt.INTERSECTING};E1.prototype.createDebugVolume=function(e){let t=new M.clone(M.IDENTITY),n=new Pd({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Pd.createGeometry(n),o=new Rt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Xt.fromColor(e)}}),r=new Pd({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Pd.createGeometry(r),a=new Rt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Xt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Pd({polygonHierarchy:{positions:this._planeVertices[2+u]}}),h=Pd.createGeometry(f);c[u]=new Rt({geometry:h,id:"outline",modelMatrix:t,attributes:{color:Xt.fromColor(e)}})}return new Ln({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var I1=E1;var Yet=new d(1,1,1),s4=Math.cos,a4=Math.sin;function HT(e){e=e??V.EMPTY_OBJECT;let t=e.radii??Yet,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}HT.packedLength=2*d.packedLength+8;HT.pack=function(e,t,n){return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.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 zAe=new d,VAe=new d,Dg={radii:zAe,innerRadii:VAe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};HT.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,zAe);t+=d.packedLength;let o=d.unpack(e,t,VAe);t+=d.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],m=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=h,n._offsetAttribute=m===-1?void 0:m,n):(Dg.minimumClock=r,Dg.maximumClock=s,Dg.minimumCone=a,Dg.maximumCone=c,Dg.stackPartitions=u,Dg.slicePartitions=f,Dg.subdivisions=h,Dg.offsetAttribute=m===-1?void 0:m,new HT(Dg))};HT.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=te.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/D.TWO_PI),f=Math.round(f*Math.abs(s-r)/D.PI),u<2&&(u=2),f<2&&(f=2);let h=0,m=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,A=!1,_=!1;g&&(m=2,r>0&&(A=!0,h+=u),s<Math.PI&&(_=!0,h+=u));let C=a*m*(f+u),y=new Float64Array(C*3),E=2*(C+h-(u+f)*m),I=Fe.createTypedArray(C,E),x,S,w,v,P=0,N=new Array(f),L=new Array(f);for(x=0;x<f;x++)v=r+x*(s-r)/(f-1),N[x]=a4(v),L[x]=s4(v);let p=new Array(a),b=new Array(a);for(x=0;x<a;x++)w=i+x*(o-i)/(a-1),p[x]=a4(w),b[x]=s4(w);for(x=0;x<f;x++)for(S=0;S<a;S++)y[P++]=t.x*N[x]*b[S],y[P++]=t.y*N[x]*p[S],y[P++]=t.z*L[x];if(g)for(x=0;x<f;x++)for(S=0;S<a;S++)y[P++]=n.x*N[x]*b[S],y[P++]=n.y*N[x]*p[S],y[P++]=n.z*L[x];for(N.length=a,L.length=a,x=0;x<a;x++)v=r+x*(s-r)/(a-1),N[x]=a4(v),L[x]=s4(v);for(p.length=u,b.length=u,x=0;x<u;x++)w=i+x*(o-i)/(u-1),p[x]=a4(w),b[x]=s4(w);for(x=0;x<a;x++)for(S=0;S<u;S++)y[P++]=t.x*N[x]*b[S],y[P++]=t.y*N[x]*p[S],y[P++]=t.z*L[x];if(g)for(x=0;x<a;x++)for(S=0;S<u;S++)y[P++]=n.x*N[x]*b[S],y[P++]=n.y*N[x]*p[S],y[P++]=n.z*L[x];for(P=0,x=0;x<f*m;x++){let R=x*a;for(S=0;S<a-1;S++)I[P++]=R+S,I[P++]=R+S+1}let T=f*a*m;for(x=0;x<u;x++)for(S=0;S<a-1;S++)I[P++]=T+x+S*u,I[P++]=T+x+(S+1)*u;if(g)for(T=f*a*m+u*a,x=0;x<u;x++)for(S=0;S<a-1;S++)I[P++]=T+x+S*u,I[P++]=T+x+(S+1)*u;if(g){let R=f*a*m,O=R+a*u;if(A)for(x=0;x<u;x++)I[P++]=R+x,I[P++]=O+x;if(_)for(R+=a*u-u,O+=a*u-u,x=0;x<u;x++)I[P++]=R+x,I[P++]=O+x}let B=new pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:y})});if(l(e._offsetAttribute)){let R=y.length,O=e._offsetAttribute===un.NONE?0:1,U=new Uint8Array(R/3).fill(O);B.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}return new ht({attributes:B,indices:I,primitiveType:Pe.LINES,boundingSphere:le.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var pf=HT;function YT(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new pf(i),this._workerName="createSphereOutlineGeometry"}YT.packedLength=pf.packedLength;YT.pack=function(e,t,n){return pf.pack(e._ellipsoidGeometry,t,n)};var Wet=new pf,XI={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};YT.unpack=function(e,t,n){let i=pf.unpack(e,t,Wet);return XI.stackPartitions=i._stackPartitions,XI.slicePartitions=i._slicePartitions,XI.subdivisions=i._subdivisions,l(n)?(d.clone(i._radii,XI.radii),n._ellipsoidGeometry=new pf(XI),n):(XI.radius=i._radii.x,new YT(XI))};YT.createGeometry=function(e){return pf.createGeometry(e._ellipsoidGeometry)};var vg=YT;function WT(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new le(e,t)}Object.defineProperties(WT.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}}});WT.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,d.distance(t.center,e.camera.positionWC)-t.radius)};WT.prototype.intersectPlane=function(e){return le.intersectPlane(this._boundingSphere,e)};WT.prototype.update=function(e,t){d.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};WT.prototype.createDebugVolume=function(e){let t=new vg({radius:this.radius}),n=M.fromTranslation(this.center,new M.clone(M.IDENTITY)),i=new Rt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Xt.fromColor(e)}});return new Ln({geometryInstances:i,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var Pg=WT;var jet=new d,qet=new d,Ket=new d,Jet=new d;function ZI(e,t,n){n=d.cross(e,t,n);let i=d.magnitude(n);return d.multiplyByScalar(n,D.EPSILON7/i,n)}function Hq(e,t){let n=d.normalize(e,Jet),i=d.equalsEpsilon(n,d.UNIT_X,D.EPSILON6)?d.UNIT_Y:d.UNIT_X;return ZI(e,i,t)}function HAe(e){let t=X.getColumn(e,0,jet),n=X.getColumn(e,1,qet),i=X.getColumn(e,2,Ket),o=d.equals(t,d.ZERO),r=d.equals(n,d.ZERO),s=d.equals(i,d.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(o&&!r&&!s?t=ZI(n,i,t):!o&&r&&!s?n=ZI(t,i,n):!o&&!r&&s?i=ZI(n,t,i):o?r?s||(t=Hq(i,t),n=ZI(i,t,n)):(t=Hq(n,t),i=ZI(n,t,i)):(n=Hq(t,n),i=ZI(n,t,i)),X.setColumn(e,0,t,e),X.setColumn(e,1,n,e),X.setColumn(e,2,i,e),e)}function jT(e,t){t=HAe(t),this._orientedBoundingBox=new $t(e,t),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(jT.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});jT.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};jT.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};jT.prototype.update=function(e,t){d.clone(e,this._orientedBoundingBox.center),t=HAe(t),X.clone(t,this._orientedBoundingBox.halfAxes),le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};jT.prototype.createDebugVolume=function(e){let t=new bh({minimum:new d(-1,-1,-1),maximum:new d(1,1,1)}),n=M.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Rt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Xt.fromColor(e)}});return new Ln({geometryInstances:i,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var xu=jT;function Tr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||Ii(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=M.multiply(a,this.transform,new M),u=l(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(u,this.transform,new M),this.computedTransform=c,this.metadata=g1(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,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,Tr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let m;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&Tr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),m=n.refine.toUpperCase()==="REPLACE"?ar.REPLACE:ar.ADD):l(i)?m=i.refine:m=ar.REPLACE,this.refine=m,this.children=[],this.parent=i;let g,A=!1,_,C,y;if(t=Be.createIfNeeded(t),r)_=lr.UNLOADED,C=t.clone();else if(l(s)){let S=s.uri;l(s.url)&&(Tr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),S=s.url),S===""?(Tr._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 QT(e,this),A=!0,_=lr.READY):(_=lr.UNLOADED,C=t.getDerivedResource({url:S}),y=Nc.getServerKey(C.getUrlComponent()))}else g=new QT(e,this),A=!0,_=lr.READY;this._content=g,this._contentResource=C,this._contentState=_,this._expiredContent=void 0,this._serverKey=y,this.hasEmptyContent=A,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!A,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let E=n.expire,I,x;l(E)&&(I=E.duration,l(E.date)&&(x=J.fromIso8601(E.date))),this.expireDuration=I,this.expireDate=x,this.lastStyleTime=0,this._optimChildrenWithinParent=Bd.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=G.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}Tr._deprecationWarning=Ea;Object.defineProperties(Tr.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 G),G.clone(this._color)},set:function(e){this._color=G.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 WC=new d;function Xet(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=d.multiplyByScalar(s.directionWC,e._centerZDepth,WC),c=d.add(s.positionWC,a,WC),u=d.subtract(c,r,WC);if(d.magnitude(u)>o){let x=d.normalize(u,WC),S=d.multiplyByScalar(x,o,WC),w=d.add(r,S,WC),v=d.subtract(w,s.positionWC,WC),P=d.normalize(v,WC);e._foveatedFactor=1-Math.abs(d.dot(s.directionWC,P))}else e._foveatedFactor=0;let m=e.refine===ar.REPLACE,g=n.isSkippingLevelOfDetail;if(m&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&m&&g||n._pass===nr.PRELOAD_FLIGHT||n._pass===nr.PRELOAD)return!1;let A=1-Math.cos(s.frustum.fov*.5),_=n.foveatedConeSize*A;if(e._foveatedFactor<=_)return!1;let C=A-_,y=D.clamp((e._foveatedFactor-_)/C,0,1),E=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,y),I=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-E<=I}var KAe=new J;Tr.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,u=a.frustum,f=c.drawingBufferWidth,h=c.drawingBufferHeight*o,m;if(e.mode===oe.SCENE2D||u instanceof fn){let g=u.offCenterFrustum;l(g)&&(u=g);let A=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,h);m=s/A}else{let g=Math.max(this._distanceToCamera,D.EPSILON7),A=u.sseDenominator;if(m=s*h/(g*A),i.dynamicScreenSpaceError){let _=i._dynamicScreenSpaceErrorComputedDensity,C=i.dynamicScreenSpaceErrorFactor,y=D.fog(g,_)*C;m-=y}}return m/=e.pixelRatio,m};function Zet(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 $et(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}Tr.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:Gs.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!==Gs.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=$et(n,this),this._priorityProgressiveResolution=Zet(n,this),this.priorityDeferred=Xet(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Tr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=J.now(KAe);J.lessThan(this.expireDate,e)&&(this._contentState=lr.EXPIRED,this._expiredContent=this._content)}};function ett(e){if(!l(e.expireDuration))return;let t=J.now(KAe);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 ttt(e){return function(){return e._priority}}Tr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?ntt(this):ott(this)};function ntt(e){let t=e._content,n=e._tileset;if(!l(t)){let o=Ii(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new _1(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 itt(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===hi.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===hi.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await rtt(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 ott(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:Qs.TILES3D,priorityFunction:ttt(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 itt(e,o,i,n,r)}async function rtt(e,t){let n=Bg(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===oa.GEOMETRY||n.contentType===oa.VECTOR,(n.contentType===oa.IMPLICIT_SUBTREE||n.contentType===oa.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===oa.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=VI[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,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=HI(i,s));let a=YI(i,s);return l(a)&&(o.group=new eI({metadata:a})),o}Tr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Tr.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 JAe=new le;function Wq(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,JAe);e._boundingVolume2D=new Pg(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function stt(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,JAe);e._contentBoundingVolume2D=new Pg(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Tr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=Wq(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==qt.INSIDE,a===qt.OUTSIDE)return Gs.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==qt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Tr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return qt.INSIDE;if(this._visibilityPlaneMask===Gs.MASK_INSIDE)return qt.INSIDE;let t=e.cullingVolume,n=stt(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==qt.INSIDE,s===qt.OUTSIDE)return qt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==qt.OUTSIDE,s===qt.INSIDE)return qt.OUTSIDE}return t.computeVisibility(n)};Tr.prototype.distanceToTile=function(e){return Wq(this,e).distanceToCamera(e)};var att=new d;Tr.prototype.distanceToTileCenter=function(e){let n=Wq(this,e).boundingVolume,i=d.subtract(n.center,e.camera.positionWC,att);return d.dot(e.camera.directionWC,i)};Tr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var XAe=new X,ZAe=new d,ctt=new X,jq=new d,$Ae=new ce,eme=new $t,Yq=new M;function ltt(e,t,n){let i=d.fromElements(e[0],e[1],e[2],jq),o=X.fromArray(e,3,ctt);i=M.multiplyByPoint(t,i,i);let r=M.getMatrix3(t,XAe);return o=X.multiply(r,o,o),l(n)?(n.update(i,o),n):new xu(i,o)}function YAe(e,t,n,i){let o=ce.unpack(e,0,$Ae),r=e[4],s=e[5],a=$t.fromRectangle(o,r,s,te.WGS84,eme),c=a.center,u=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,Yq),Yq),c=M.multiplyByPoint(t,c,c);let f=M.getMatrix3(t,XAe);return u=X.multiply(f,u,u),l(i)&&i instanceof xu?(i.update(c,u),i):new xu(c,u)}function utt(e,t,n,i){if(!M.equalsEpsilon(t,n,D.EPSILON8))return i instanceof xu?YAe(e,t,n,i):YAe(e,t,n,void 0);let o=ce.unpack(e,0,$Ae);return i instanceof mf?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(te.WGS84),i):new mf({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function ftt(e,t,n){let i=d.fromElements(e[0],e[1],e[2],jq),o=e[3];i=M.multiplyByPoint(t,i,i);let r=M.getScale(t,ZAe),s=d.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new Pg(i,o)}Tr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=gC.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ue("boundingVolume must be defined");if(Ii(e,"3DTILES_bounding_volume_S2"))return new I1(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=ltt(r,t,n);return this._verticalExaggeration!==1&&WAe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=utt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof xu?WAe(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(te.WGS84))),c}if(l(a)){let c=ftt(a,t,n);if(this._verticalExaggeration!==1){let u=Eo.getPosition(c.center,te.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,jq),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new ue("boundingVolume must contain a sphere, region, or box")};var dtt=d.unpackArray(new Array(24).fill(0));function WAe(e,t,n){let i=e.boundingVolume.computeCorners(dtt).map(r=>Eo.getPosition(r,te.WGS84,t,n,r)),o=$t.fromPoints(i,eme);e.update(o.center,o.halfAxes)}Tr.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,Yq),i=!M.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&M.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()};Tr.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,ZAe),t=d.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function htt(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=G.WHITE:c=G.DARKGRAY:c=G.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Xt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(G.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(G.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=G.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function Att(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 mtt(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 ptt(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)}Tr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;mtt(this,e),ptt(this,e),htt(this,e,t,n),Att(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===we.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var jAe=[];Tr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(ett(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=jAe;try{this._content.update(e,t)}catch(i){throw this._contentState=lr.FAILED,i}jAe.length=0,t.commandList=n};function qAe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function c4(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}Tr.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,u=o,f=c+u,h=r,m=Math.pow(10,f),g=f+h,A=r,_=Math.pow(10,g),C=g+A,y=Math.pow(10,C),E=c4(this._depth,n.depth,i.depth);E=t?1-E:E;let x=!e.isSkippingLevelOfDetail&&this.refine===ar.REPLACE?c4(this._priorityHolder._distanceToCamera,n.distance,i.distance):c4(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),S=qAe(x,a,s),w=this._priorityProgressiveResolution?0:m,v=c4(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),P=qAe(v,u,c),N=this.priorityDeferred?_:0,L=e._pass===nr.PRELOAD_FLIGHT?0:y;this._priority=E+S+w+P+N+L};Tr.prototype.isDestroyed=function(){return!1};Tr.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(),de(this)};var Rd=Tr;function Rg(e){e=e??V.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(Rg.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}}});Rg.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Rg.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Rg.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Rg.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};Rg.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};Rg.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};Rg.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var qT=Rg;function Mg(e){e=e??V.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(Mg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Mg.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Mg.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Mg.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Mg.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};Mg.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};Mg.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};Mg.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var b1=Mg;function tme(e){e=e??V.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new b1({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new qT({group:f,class:n.classes[f.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(a.hasOwnProperty(f)){let h=a[f];s.push(new qT({id:f,group:a[f],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(tme.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 $I=tme;var nme={},gtt=new d;nme.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof xu||i instanceof mf){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Bd.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof xu||a instanceof mf)){e._optimChildrenWithinParent=Bd.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=d.subtract(c.center,o.center,gtt),f=d.magnitude(u);d.divideByScalar(u,f,u);let h=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),m=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(h<=m+f){e._optimChildrenWithinParent=Bd.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Bd.USE_OPTIMIZATION};var x1=nme;function T1(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(T1.prototype,{length:{get:function(){return this._length}}});function _tt(e,t,n){this.item=e,this.previous=t,this.next=n}T1.prototype.add=function(e){let t=new _tt(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 ime(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}T1.prototype.remove=function(e){l(e)&&(ime(this,e),--this._length)};T1.prototype.splice=function(e,t){if(e===t)return;ime(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 S1=T1;function e0(){this._list=new S1,this._sentinel=this._list.add(),this._trimTiles=!1}e0.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};e0.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};e0.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};e0.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};e0.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)}};e0.prototype.trim=function(){this._trimTiles=!0};var B1=e0;function l4(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 Kq(e,t){let n;return t==="_loadTimestamp"?n=J.toDate(e).getTime():n=e,n}l4.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=Kq(e,n),this._referenceMaximum[n]=Kq(t,n)};function Ctt(e,t){let n=e.tilePropertyName;if(l(n)){let i=Kq(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 qq=[new G(.1,.1,.1,1),new G(.153,.278,.878,1),new G(.827,.231,.49,1),new G(.827,.188,.22,1),new G(1,.592,.259,1),new G(1,.843,0,1)];l4.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Ctt(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+D.EPSILON7,c=D.clamp(i-o,0,s)/s,u=qq.length-1,f=c*u,h=Math.floor(f),m=Math.ceil(f),g=f-h,A=qq[h],_=qq[m],C=G.clone(G.WHITE);C.red=D.lerp(A.red,_.red,g),C.green=D.lerp(A.green,_.green,g),C.blue=D.lerp(A.blue,_.blue,g),e._debugColor=C};l4.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 w1=l4;function KT(){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}KT.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};KT.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])}};KT.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof uf))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])}};KT.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof uf))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])}};KT.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 iA=KT;function D1(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(D1.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});D1.prototype.makeDirty=function(){this._styleDirty=!0};D1.prototype.resetDirty=function(){this._styleDirty=!1};D1.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 v1=D1;function ytt(e,t,n){let i=Ii(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)&&!Ii(o,"3DTILES_bounding_volume_S2")&&!Ii(o,"3DTILES_bounding_volume_cylinder"))throw new ue("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 Be({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=Ett(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Ve(a,!0));let c=new Be({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Itt(t),this.subdivisionScheme=Ds[i.subdivisionScheme],this.branchingFactor=Ds.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Ett(e){if(Ii(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 Itt(e){let t=Ve(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 bm=ytt;var P1={};function ome(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function Jq(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function rme(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 Xq(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}P1.encode2D=function(e,t){return(ome(e)|ome(t)<<1)>>>0};P1.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=rme(e),t[1]=rme(e>>1),t};P1.encode3D=function(e,t,n){return Jq(e)|Jq(t)<<1|Jq(n)<<2};P1.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=Xq(e),t[1]=Xq(e>>1),t[2]=Xq(e>>2),t};var jC=P1;function ur(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===Ds.OCTREE&&(this.z=e.z)}Object.defineProperties(ur.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Ds.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Ds.OCTREE?jC.encode3D(this.x,this.y,this.z):jC.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Ds.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});ur.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===Ds.OCTREE){let o=(this.z<<e.level)+e.z;return new ur({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new ur({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};ur.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===Ds.OCTREE){let r=Math.floor(this.z/t);return new ur({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new ur({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};ur.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===Ds.OCTREE){let r=e.z%n;return new ur({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new ur({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};ur.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===Ds.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new ur({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new ur({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};ur.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};ur.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};ur.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===Ds.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};ur.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===Ds.OCTREE?this.z===e.z:!0)};ur.prototype.isImplicitTilesetRoot=function(){return this.level===0};ur.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};ur.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};ur.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Ds.OCTREE&&(e.z=this.z),e};var sme=[0,0,0];ur.fromMortonIndex=function(e,t,n,i){let o;return e===Ds.OCTREE?(o=jC.decode3D(i,sme),new ur({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=jC.decode2D(i,sme),new ur({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};ur.fromTileIndex=function(e,t,n){let i,o,r;return e===Ds.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(D.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),ur.fromMortonIndex(e,t,i,r)};var xm=ur;function Ng(){}Ng.selectTiles=function(e,t){Ae.throwInstantiationError()};Ng.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Ng.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Ng.selectTile=function(e,t){if(e.contentVisibility(t)===qt.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)};Ng.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Ng.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Ng.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!btt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function btt(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}Ng.updateTile=function(e,t){ame(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Stt(e),e._shouldSelect=!1,e._finalResolution=!0};function ame(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];ame(r,t),e._visible=r._visible;return}if(xtt(e,t)){e._visible=!1;return}let i=e.refine===ar.REPLACE,o=e._optimChildrenWithinParent===Bd.USE_OPTIMIZATION;if(i&&o&&n&&!Ttt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function xtt(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 Ttt(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 Stt(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 wa=Ng;function cme(){}var R1={stack:new Dl,stackMaximumLength:0};cme.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}=wa,s=R1.stack;for(s.push(i);s.length>0;){R1.stackMaximumLength=Math.max(R1.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===ar.ADD,u=a.refine===ar.REPLACE,f=Btt(a);f&&wtt(a,s,t),(c||u&&!f)&&(Dtt(e,a),o(a,t),vtt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return R1.stack.trim(R1.stackMaximumLength),n};function Btt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function wtt(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 Dtt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function vtt(e,t){e.contentAvailable&&e.contentVisibility(t)!==qt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var M1=cme;function lme(){}var N1={stack:new Dl,stackMaximumLength:0},L1={stack:new Dl,stackMaximumLength:0};lme.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(wa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Rtt(n,t),N1.stack.trim(N1.stackMaximumLength),L1.stack.trim(L1.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Zq(e,t){e.contentAvailable&&wa.selectTile(e,t)}function Ptt(e,t,n){let i=e.refine===ar.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=wa;for(let A=0;A<r.length;++A)s(r[A],n);r.sort(wa.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,h=!1,m=-1,g=Number.MAX_VALUE;for(let A=0;A<r.length;++A){let _=r[A];if(_.isVisible?(t.push(_),_._foveatedFactor<g&&(m=A,g=_._foveatedFactor),h=!0):(u||o.loadSiblings)&&(_._foveatedFactor<g&&(m=A,g=_._foveatedFactor),a(_,n),c(_,n)),u){let C;_._inRequestVolume?_.hasRenderableContent?C=_.contentAvailable:C=Mtt(_,n):C=!1,f=f&&C}}if(h||(f=!1),m!==-1&&i){let A=r[m];A._wasMinPriorityChild=!0;let _=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;_._foveatedFactor=Math.min(A._foveatedFactor,_._foveatedFactor),_._distanceToCamera=Math.min(A._distanceToCamera,_._distanceToCamera);for(let C=0;C<r.length;++C)r[C]._priorityHolder=_}return f}function Rtt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=wa,a=N1.stack;for(a.push(e);a.length>0;){N1.stackMaximumLength=Math.max(N1.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?Ptt(c,a,t)&&f:!1;let h=!c._refines&&f;c.hasRenderableContent?c.refine===ar.ADD?(Zq(c,t),o(c,t)):c.refine===ar.REPLACE&&(o(c,t),h&&Zq(c,t)):(n._emptyTiles.push(c),o(c,t),h&&Zq(c,t)),r(c,t),s(c,t)}}function Mtt(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=wa,s=!0,a=L1.stack;for(a.push(e);a.length>0;){L1.stackMaximumLength=Math.max(L1.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.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 m=0;m<f;++m){let g=u[m];a.push(g)}}return e.hasEmptyContent||s}var O1=lme;function ume(){}var F1={stack:new Dl,stackMaximumLength:0},Q1={stack:new Dl,stackMaximumLength:0},Lg={stack:new Dl,stackMaximumLength:0,ancestorStack:new Dl,ancestorStackMaximumLength:0},Ntt=2;ume.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(wa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Utt(n,t),Gtt(n,t),F1.stack.trim(F1.stackMaximumLength),Q1.stack.trim(Q1.stackMaximumLength),Lg.stack.trim(Lg.stackMaximumLength),Lg.ancestorStack.trim(Lg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Ltt(e,t){let{updateTile:n,touchTile:i,selectTile:o}=wa,r=Q1.stack;for(r.push(e);r.length>0;){Q1.stackMaximumLength=Math.max(Q1.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<Ntt&&r.push(u))}}}function u4(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Ltt(e,t)}function Ott(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 Ftt(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 Qtt(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=wa;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(wa.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function ktt(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 Utt(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}=wa,c=F1.stack;for(c.push(e);c.length>0;){F1.stackMaximumLength=Math.max(F1.stackMaximumLength,c.length);let u=c.pop();Ott(u,t);let f=u.parent,h=!l(f)||f._refines;u._refines=o(u)?Qtt(u,c,t)&&h:!1;let m=!u._refines&&h;u.hasRenderableContent?u.refine===ar.ADD?(u4(u,t),r(u,t)):u.refine===ar.REPLACE&&(ktt(u,i)?(r(u,t),m&&u4(u,t)):m?(u4(u,t),r(u,t)):Ftt(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),m&&u4(u,t)),s(u,t),a(u,t)}}function Gtt(e,t){let{selectTile:n,canTraverse:i}=wa,{stack:o,ancestorStack:r}=Lg,s;for(o.push(e);o.length>0||r.length>0;){if(Lg.stackMaximumLength=Math.max(Lg.stackMaximumLength,o.length),Lg.ancestorStackMaximumLength=Math.max(Lg.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,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 u=a.children;for(let f=0;f<u.length;++f){let h=u[f];h.isVisible&&o.push(h)}}}}var k1=ume;function sa(){this._layers=[],this.layerAdded=new _e,this.layerRemoved=new _e,this.layerMoved=new _e,this.layerShownOrHidden=new _e}Object.defineProperties(sa.prototype,{length:{get:function(){return this._layers.length}}});sa.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()})};sa.prototype.addImageryProvider=function(e,t){let n=new ds(e);return this.add(n,t),n};sa.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};sa.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=[]};sa.prototype.contains=function(e){return this.indexOf(e)!==-1};sa.prototype.indexOf=function(e){return this._layers.indexOf(e)};sa.prototype.get=function(e){return this._layers[e]};function f4(e,t){return e.indexOf(t)}function fme(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.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)}sa.prototype.raise=function(e){let t=f4(this._layers,e);fme(this,t,t+1)};sa.prototype.lower=function(e){let t=f4(this._layers,e);fme(this,t,t-1)};sa.prototype.raiseToTop=function(e){let t=f4(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))};sa.prototype.lowerToBottom=function(e){let t=f4(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 ztt=new ce;function dme(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];ce.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],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let h=ztt,m=1/1024;h.west=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-m),h.east=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+m),h.south=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-m),h.north=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+m),ce.contains(h,t)&&i(u)}}sa.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(dme(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};sa.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(dme(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 u=s[c],f=r[c];if(l(u)&&u.length>0)for(let h=0;h<u.length;++h){let m=u[h];m.imageryLayer=f,l(m.position)||(m.position=i),a.push(m)}}return a})};sa.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};sa.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};sa.prototype.isDestroyed=function(){return!1};sa.prototype.destroy=function(){return this.removeAll(!0),de(this)};sa.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 t0=sa;function ir(e){e=e??V.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 B1,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 Dl,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 v1,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new iA,this._statisticsLast=new iA,this._statisticsPerPass=new Array(nr.NUMBER_OF_PASSES);for(let o=0;o<nr.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new iA;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 w1(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=D.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??te.WGS84,this._initialClippingPlanesOriginMatrix=M.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new t0(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??D.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??Tn.ENABLED,this.show=e.show??!0,this.colorBlendMode=hu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new fm(e.pointCloudShading),this._pointCloudEyeDomeLighting=new rg,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e,this.tileLoad=new _e,this.tileUnload=new _e,this.tileFailed=new _e,this.tileVisible=new _e,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)&&cs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&Qh.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new $E,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new ng(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??G.BLACK,this.splitDirection=e.splitDirection??Lr.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){cs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Qh.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 Ea("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=M.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&&(M.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):M.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,yme(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 ss.fromAssetId(e);return ir.fromUrl(n,t)};ir.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=Be.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await ir.loadJson(n),r=await Vtt(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,yme(s);let c=l(o.asset.gltfUpAxis)?eo.fromName(o.asset.gltfUpAxis):eo.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??eo.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let m=s._root.createBoundingVolume(o.root.boundingVolume,M.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(m);return l(g)&&g.height>Si._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=It.eastNorthUpToFixedFrame(m)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};ir.loadJson=function(e){return Be.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 ue("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ue("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=hme(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 u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let h=u[f],m=hme(this,e,h,c);c.children.push(m),m._depth=c._depth+1,a.push(m)}this._cullWithChildrenBounds&&x1.checkChildrenWithinParent(c)}return s};function hme(e,t,n,i){if(!(l(n.implicitTiling)||Ii(n,"3DTILES_implicit_tiling")))return new Rd(e,t,n,i);let r=e.schema,s=new bm(t,n,r),a=new xm({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ve(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let h=new Rd(e,t,f,i);return h.implicitTileset=s,h.implicitCoordinates=a,h}async function Vtt(e,t){let n=Ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Di.getSchemaLoader({resource:e});else if(l(n.schema))i=Di.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new $I({schema:i.schema,metadataJson:n});return Di.unload(i),o}var Ame=new d,Htt=new he,Ytt=new M,Wtt=new d,jtt=new d,qtt=new d,Ktt=new d;function Jtt(e,t){let n,i,o,r,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof mf)n=d.normalize(a.positionWC,Ame),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let _=M.inverseTransformation(c.computedTransform,Ytt),C=t.mapProjection.ellipsoid,y=u.boundingVolume,E=M.multiplyByPoint(_,y.center,Wtt);if(d.magnitude(E)>C.minimumRadius){let I=he.fromCartesian(E,C,Htt);n=d.normalize(a.positionWC,Ame),i=a.directionWC,o=a.positionCartographic.height,r=0,s=I.height*2}else{let I=M.multiplyByPoint(_,a.positionWC,jtt);if(n=d.UNIT_Z,i=M.multiplyByPointAsVector(_,a.directionWC,qtt),i=d.normalize(i,i),o=I.z,u instanceof xu){let x=X.getColumn(y.halfAxes,2,Ktt),S=d.magnitude(x);r=E.z-S,s=E.z+S}else if(u instanceof Pg){let x=y.radius;r=E.z-x,s=E.z+x}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*f,m=s,g=D.clamp((o-h)/(m-h),0,1),A=1-Math.abs(d.dot(i,n));A=A*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*A}function Xtt(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=>{gme(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?fnt(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function pme(e,t){return e._priority-t._priority}ir.prototype.postPassesUpdate=function(e){l(this._root)&&(Ztt(this,e),hnt(this,e),this._cache.unloadTiles(this,Cme),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};ir.prototype.prePassesUpdate=function(e){if(!l(this._root))return;rnt(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&&Jtt(this,e),e.newFrame&&this._cache.reset()};function Ztt(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 $tt(e){let t=e._requestedTiles;t.sort(pme);for(let n=0;n<t.length;++n)Xtt(e,t[n])}function gme(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 ent(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 tnt=new he,nnt=new he,int=new d;function ont(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=he.clone(r.positionCartographic,tnt),c=he.fromCartesian(o.center,s,nnt);l(c)&&(a.height=c.height);let u=he.toCartesian(a,s,int);d.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{l(r.callback)&&r.callback(),r.invoked=!1}))}}function rnt(e,t){ent(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 u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,gme(f,e,u)}}e.totalMemoryUsageInBytes<i?ant(e):a&&n.length>0&&snt(e)}function snt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(pme)}function ant(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var d4=new d,cnt={maximumFractionDigits:3};function mme(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,cnt):Math.round(t).toLocaleString()}function $q(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=d.clone(i,d4);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=d.normalize(i,d4);r=d.multiplyByScalar(r,.75*n,d4),o=d.add(r,i,d4)}return o}function eK(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: ${mme(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${mme(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 lnt(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:$q(e.debugPickedTile),a=eK(e.debugPickedTile,e,s);a.pixelOffset=new F(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];eK(a,e,$q(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&eK(a,e,$q(a))}}e._tileDebugLabels.update(t)}function unt(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 ai({stencil:0,pass:we.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:Yt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,h=i.length;for(let A=0;A<s.length;++A){let _=s[A];f&&u.raiseEvent(_),ont(e,_,t),_.update(e,t,n),c.incrementSelectionCounts(_.content),++c.selected}let m=e._emptyTiles;for(let A=0;A<m.length;++A)m[A].update(e,t,n);let g=i.length-h;if(e._backfaceCommands.trim(),a){let A=e._backfaceCommands.values,_=A.length;i.length+=_;for(let C=g-1;C>=0;--C)i[h+_+C]=i[h+C];for(let C=0;C<_;++C)i[h+C]=A[C]}g=i.length-r,c.numberOfCommands=g,f&&(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 Cm),lnt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var _me=[];function fnt(e,t){let n=t,i=_me;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&&(dnt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Cme(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function dnt(e,t){e._cache.unloadTile(e,t,Cme),t.destroy()}ir.prototype.trimLoadedTiles=function(){this._cache.trim()};function hnt(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;iA.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 Ant(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 mnt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!M.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=M.clone(e.modelMatrix,e._previousModelMatrix)))}function pnt(e,t,n,i){if(t.mode===oe.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,Ant(e),mnt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&$tt(e),unt(e,t,i),iA.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 yme(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(pt.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 pt(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?M1:this.isSkippingLevelOfDetail?k1:O1};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,u=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let m=this._environmentMapManager;l(this._root)&&(m.position=this.boundingSphere.center),m.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=pnt(this,e,h,s)),a&&(c.length=u),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=_me;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,de(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 ue(`Unsupported 3D Tiles Extension: ${e[t]}`)};var gnt=new gn,_nt=new d,Cnt=new he;ir.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=te.WGS84);let i=gnt,o=n.cartographicToCartesian(e,i.direction);d.normalize(i.direction,i.direction),i.direction=d.normalize(o,i.direction),i.direction=d.negate(o,i.direction),i.origin=d.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,_nt);if(l(r))return n.cartesianToCartographic(r,Cnt)?.height};ir.prototype.updateHeight=function(e,t,n){n=n??te.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 ynt=new qr,Ent=new d;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 u=i[c],f=ci.raySphere(e,u.contentBoundingVolume.boundingSphere,ynt);!l(f)||!l(u.content)||r.push(u)}let s=r.length;r.sort((c,u)=>{let f=le.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-h});let a;for(let c=0;c<s;++c){let f=r[c].content.pick(e,t,Ent);if(l(f))return a=d.clone(f,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 Ys=ir;var Int=new M;function qC(e,t){t.collectionChanged.addEventListener(qC.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Pt,this._onCollectionChanged(t,t.values,[],[])}qC.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,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),h;f&&(h=s.computeModelMatrix(e,Int),c=Be.createIfNeeded(j.getValueOrUndefined(a._uri,e)));let m=l(u)?u.tilesetPrimitive:void 0;if(!f){l(m)&&(m.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(m)&&i.removeAndDestroy(m),delete n[s.id],bnt(c,n,s,i)),l(m)&&(m.show=!0,l(h)&&(m.modelMatrix=h),m.maximumScreenSpaceError=j.getValueOrDefault(a.maximumScreenSpaceError,e,m.maximumScreenSpaceError))}return!0};qC.prototype.isDestroyed=function(){return!1};qC.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qC.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)tK(this,e[i],t,n);return de(this)};qC.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return mt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(le.clone(i.boundingSphere,t),mt.DONE):mt.FAILED:mt.PENDING};qC.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):(tK(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],tK(this,r,a,c),s.remove(r.id)};function tK(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function bnt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await Ys.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 U1=qC;var xnt=G.WHITE,Tnt=G.BLACK,Snt=new F(2,2);function JT(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(JT.prototype,{isConstant:{get:function(){return j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:me("evenColor"),oddColor:me("oddColor"),repeat:me("repeat")});JT.prototype.getType=function(e){return"Checkerboard"};var Bnt=new J;JT.prototype.getValue=function(e,t){return l(e)||(e=J.now(Bnt)),l(t)||(t={}),t.lightColor=j.getValueOrClonedDefault(this._evenColor,e,xnt,t.lightColor),t.darkColor=j.getValueOrClonedDefault(this._oddColor,e,Tnt,t.darkColor),t.repeat=j.getValueOrDefault(this._repeat,e,Snt),t};JT.prototype.equals=function(e){return this===e||e instanceof JT&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._repeat,e._repeat)};var XT=JT;var Eme={id:void 0};function G1(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 Jc(e){this._owner=e,this._entities=new Pt,this._addedEntities=new Pt,this._removedEntities=new Pt,this._changedEntities=new Pt,this._suspendCount=0,this._collectionChanged=new _e,this._id=jn(),this._show=!0,this._firing=!1,this._refire=!1}Jc.prototype.suspendEvents=function(){this._suspendCount++};Jc.prototype.resumeEvents=function(){this._suspendCount--,G1(this)};Object.defineProperties(Jc.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}}});Jc.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})};Jc.prototype.add=function(e){e instanceof Er||(e=new Er(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(Jc.prototype._onEntityDefinitionChanged,this),G1(this),e};Jc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Jc.prototype.contains=function(e){return this._entities.get(e.id)===e};Jc.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(Jc.prototype._onEntityDefinitionChanged,this),G1(this),!0):!1};Jc.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(Jc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),G1(this)};Jc.prototype.getById=function(e){return this._entities.get(e)};Jc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Eme.id=e,t=new Er(Eme),this.add(t)),t};Jc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),G1(this)};var Da=Jc;var h4={id:void 0},ZT=new Array(2);function nK(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 Ime(e,t,n,i){ZT[0]=n,ZT[1]=i.id,t[JSON.stringify(ZT)]=i.definitionChanged.addEventListener(As.prototype._onDefinitionChanged,e)}function bme(e,t,n,i){ZT[0]=n,ZT[1]=i.id;let o=JSON.stringify(ZT);t[o](),t[o]=void 0}function KC(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,u,f=e._composite,h=new Da(e),m=e._eventHash,g;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(As.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],bme(e,m,g,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(As.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],Ime(e,m,g,s);let _=h.getById(s.id);l(_)||(_=f.getById(s.id),l(_)?nK(_):(h4.id=s.id,_=new Er(h4)),h.add(_)),_.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let A=h.values;for(r=0;r<A.length;r++)f.add(A[r]);f.resumeEvents()}function As(e,t){this._owner=t,this._composite=new Da(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=jn(),this._eventHash={},KC(this),this._shouldRecomposite=!1}Object.defineProperties(As.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}}});As.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),KC(this)};As.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),KC(this),!0):!1};As.prototype.removeAllCollections=function(){this._collections.length=0,KC(this)};As.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};As.prototype.contains=function(e){return this._composite.contains(e)};As.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};As.prototype.getCollection=function(e){return this._collections[e]};As.prototype.getCollectionsLength=function(){return this._collections.length};function A4(e,t){return e.indexOf(t)}function xme(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,KC(e)}As.prototype.raiseCollection=function(e){let t=A4(this._collections,e);xme(this,t,t+1)};As.prototype.lowerCollection=function(e){let t=A4(this._collections,e);xme(this,t,t-1)};As.prototype.raiseCollectionToTop=function(e){let t=A4(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),KC(this))};As.prototype.lowerCollectionToBottom=function(e){let t=A4(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),KC(this))};As.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};As.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(KC(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};As.prototype.computeAvailability=function(){return this._composite.computeAvailability()};As.prototype.getById=function(e){return this._composite.getById(e)};As.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,u,f=n.length,h=this._eventHash,m=e.id;for(s=0;s<f;s++){let A=n[s];bme(this,h,m,A);let _=A.id;for(a=o-1;a>=0;a--)c=i[a].getById(_),l(c)&&(l(u)||(u=r.getById(_),nK(u)),u.merge(c));l(u)||r.removeById(_),u=void 0}let g=t.length;for(s=0;s<g;s++){let A=t[s];Ime(this,h,m,A);let _=A.id;for(a=o-1;a>=0;a--)c=i[a].getById(_),l(c)&&(l(u)||(u=r.getById(_),l(u)?nK(u):(h4.id=_,u=new Er(h4),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};As.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],f=!l(u),h=!0;for(let m=s-1;m>=0;m--){let g=o[m].getById(e.id);if(l(g)){let A=g[t];if(l(A)){if(h)if(h=!1,l(A.merge)&&l(A.clone))u=A.clone(u);else{u=A;break}u.merge(A)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var iK=As;function oK(){this._removalFunctions=[]}oK.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)}};oK.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var kr=oK;function aK(e,t){return J.compare(e.start,t.start)}function ms(e){if(this._intervals=[],this._changedEvent=new _e,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(ms.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}}});ms.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof ms))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};ms.prototype.get=function(e){return this._intervals[e]};ms.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};ms.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};ms.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};ms.prototype.contains=function(e){return this.indexOf(e)>=0};var rK=new wn;ms.prototype.indexOf=function(e){let t=this._intervals;rK.start=e,rK.stop=e;let n=go(t,rK,aK);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)};ms.prototype.findInterval=function(e){e=e??V.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]}};ms.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=go(n,e,aK);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)};ms.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=go(t,e,aK);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};ms.prototype.intersect=function(e,t,n){let i=new ms,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],u=a[r];if(J.lessThan(c.stop,u.start))++o;else if(J.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=wn.intersect(c,u,new wn,n);f.isEmpty||i.addInterval(f,t)}J.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};ms.fromJulianDateArray=function(e,t){l(t)||(t=new ms);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,u,f=0;a&&(++f,u=new wn({start:Ke.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let h=0;h<i-1;++h){let m=n[h],g=n[h+1];u=new wn({start:m,stop:g,isStartIncluded:t.length===f?r:!0,isStopIncluded:h===i-2?s:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),m=g}return c&&(u=new wn({start:n[i-1],stop:Ke.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var Xc=new Ap,z1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function sK(e,t,n){l(n)||(n=new J),J.toGregorianDate(e,Xc);let i=Xc.millisecond+t.millisecond,o=Xc.second+t.second,r=Xc.minute+t.minute,s=Xc.hour+t.hour,a=Xc.day+t.day,c=Xc.month+t.month,u=Xc.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),z1[2]=dh(u)?29:28;a>z1[c]||c>=13;)a>z1[c]&&(a-=z1[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),z1[2]=dh(u)?29:28;return Xc.millisecond=i,Xc.second=o,Xc.minute=r,Xc.hour=s,Xc.day=a,Xc.month=c,Xc.year=u,J.fromGregorianDate(Xc,n)}var wnt=new J,Dnt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Tme(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(Dnt);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,wnt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var V1=new Ap;ms.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=J.fromIso8601(n[0]),o=J.fromIso8601(n[1]),r=[];if(!Tme(n[2],V1))r.push(i,o);else{let s=J.clone(i);for(r.push(s);J.compare(s,o)<0;)s=sK(s,V1),J.compare(o,s)<=0&&J.clone(o,s),r.push(s)}return ms.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};ms.fromIso8601DateArray=function(e,t){return ms.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)};ms.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,c=i.length;for(let u=0;u<c;++u)(Tme(i[u],V1)||u===0)&&(o&&l(a)?s=sK(a,V1):s=sK(n,V1),r.push(s),a=s);return ms.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var ps=ms;function vnt(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 n0(){this._eventHelper=new kr,this._definitionChanged=new _e,this._intervals=new ps,this._intervals.changedEvent.addEventListener(n0.prototype._intervalsChanged,this)}Object.defineProperties(n0.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Pnt=new J;n0.prototype.getValue=function(e,t){l(e)||(e=J.now(Pnt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};n0.prototype.equals=function(e){return this===e||e instanceof n0&&this._intervals.equals(e._intervals,j.equals)};n0.prototype._intervalsChanged=function(){vnt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Zc=n0;function JC(){this._definitionChanged=new _e,this._composite=new Zc,this._composite.definitionChanged.addEventListener(JC.prototype._raiseDefinitionChanged,this)}Object.defineProperties(JC.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});JC.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var Rnt=new J;JC.prototype.getValue=function(e,t){l(e)||(e=J.now(Rnt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};JC.prototype.equals=function(e){return this===e||e instanceof JC&&this._composite.equals(e._composite,j.equals)};JC.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var $T=JC;function XC(e){this._referenceFrame=e??$i.FIXED,this._definitionChanged=new _e,this._composite=new Zc,this._composite.definitionChanged.addEventListener(XC.prototype._raiseDefinitionChanged,this)}Object.defineProperties(XC.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 Mnt=new J;XC.prototype.getValue=function(e,t){return l(e)||(e=J.now(Mnt)),this.getValueInReferenceFrame(e,$i.FIXED,t)};XC.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};XC.prototype.equals=function(e){return this===e||e instanceof XC&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,j.equals)};XC.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ec=XC;var Nnt={ROUNDED:0,MITERED:1,BEVELED:2},ji=Object.freeze(Nnt);var tc=[new d,new d],Lnt=new d,Ont=new d,Fnt=new d,Qnt=new d,knt=new d,Unt=new d,Gnt=new d,znt=new d,Vnt=new d,eS=new d,m4=new d,H1={},cK=new he;function Hnt(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];cK=t.cartesianToCartographic(o,cK),n[i]=cK.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function lK(e,t,n,i){let o=e[0],r=e[1],s=d.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let h=(n-t)/a;for(u=1;u<a;u++){let m=t+u*h;c[u]=m}return c[0]=t,c.push(n),c}var p4=new d,g4=new d;function Ynt(e,t,n,i){let o=new Ss(n,i),r=o.projectPointOntoPlane(d.add(n,e,p4),p4),s=o.projectPointOntoPlane(d.add(n,t,g4),g4),a=F.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var Wnt=new d(-1,0,0),i0=new M,jnt=new M,uK=new X,qnt=X.IDENTITY.clone(),Knt=new d,Jnt=new se,Sme=new d;function Og(e,t,n,i,o,r,s,a){let c=Knt,u=Jnt;i0=It.eastNorthUpToFixedFrame(e,o,i0),c=M.multiplyByPointAsVector(i0,Wnt,c),c=d.normalize(c,c);let f=Ynt(c,t,e,o);uK=X.fromRotationZ(f,uK),Sme.z=r,i0=M.multiplyTransformation(i0,M.fromRotationTranslation(uK,Sme,jnt),i0);let h=qnt;h[0]=s;for(let m=0;m<a;m++)for(let g=0;g<n.length;g+=3)u=d.fromArray(n,g,u),u=X.multiplyByVector(h,u,u),u=M.multiplyByPoint(i0,u,u),i.push(u.x,u.y,u.z);return i}var Xnt=new d;function fK(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=d.fromArray(e,a,Xnt);i=Og(c,t,n,i,o,r[a/3],s,1)}return i}function Znt(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 u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function Bme(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 wme=new Qe,Dme=new d,vme=new X;function Pme(e,t,n,i,o,r,s,a,c,u){let f=d.angleBetween(d.subtract(t,e,eS),d.subtract(n,e,m4)),h=i===ji.BEVELED?0:Math.ceil(f/D.toRadians(5)),m;o?m=X.fromQuaternion(Qe.fromAxisAngle(d.negate(e,eS),f/(h+1),wme),vme):m=X.fromQuaternion(Qe.fromAxisAngle(e,f/(h+1),wme),vme);let g,A;if(t=d.clone(t,Dme),h>0){let _=u?2:1;for(let C=0;C<h;C++)t=X.multiplyByVector(m,t,t),g=d.subtract(t,e,eS),g=d.normalize(g,g),o||(g=d.negate(g,g)),A=r.scaleToGeodeticSurface(t,m4),s=Og(A,g,a,s,r,c,1,_)}else g=d.subtract(t,e,eS),g=d.normalize(g,g),o||(g=d.negate(g,g)),A=r.scaleToGeodeticSurface(t,m4),s=Og(A,g,a,s,r,c,1,1),n=d.clone(n,Dme),g=d.subtract(n,e,eS),g=d.normalize(g,g),o||(g=d.negate(g,g)),A=r.scaleToGeodeticSurface(n,m4),s=Og(A,g,a,s,r,c,1,1);return s}H1.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];F.equals(r,s)||n.push(s)}return n};H1.angleIsGreaterThanPi=function(e,t,n,i){let o=new Ss(n,i),r=o.projectPointOntoPlane(d.add(n,e,p4),p4),s=o.projectPointOntoPlane(d.add(n,t,g4),g4);return s.x*r.y-s.y*r.x>=0};var $nt=new d,eit=new d;H1.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=Hnt(e,r),a=i._granularity,c=i._cornerType,u=o?Znt(t,n):Bme(t,n),f=o?Bme(t,n):void 0,h=n.height/2,m=n.width/2,g=e.length,A=[],_=o?[]:void 0,C=Lnt,y=Ont,E=Fnt,I=Qnt,x=knt,S=Unt,w=Gnt,v=znt,P=Vnt,N=e[0],L=e[1];I=r.geodeticSurfaceNormal(N,I),C=d.subtract(L,N,C),C=d.normalize(C,C),v=d.cross(I,C,v),v=d.normalize(v,v);let p=s[0],b=s[1];o&&(_=Og(N,v,f,_,r,p+h,1,1)),P=d.clone(N,P),N=L,y=d.negate(C,y);let T,B;for(let U=1;U<g-1;U++){let k=o?2:1;if(L=e[U+1],N.equals(L)){At("Positions are too close and are considered equivalent with rounding error.");continue}C=d.subtract(L,N,C),C=d.normalize(C,C),I=r.geodeticSurfaceNormal(N,I);let z=d.multiplyByScalar(I,d.dot(C,I),$nt);d.subtract(C,z,z),d.normalize(z,z);let Q=d.multiplyByScalar(I,d.dot(y,I),eit);if(d.subtract(y,Q,Q),d.normalize(Q,Q),!D.equalsEpsilon(Math.abs(d.dot(z,Q)),1,D.EPSILON7)){E=d.add(C,y,E),E=d.normalize(E,E),E=d.cross(E,I,E),E=d.cross(I,E,E),E=d.normalize(E,E);let W=1/Math.max(.25,d.magnitude(d.cross(E,y,eS))),Z=H1.angleIsGreaterThanPi(C,y,N,r);Z?(x=d.add(N,d.multiplyByScalar(E,W*m,E),x),S=d.add(x,d.multiplyByScalar(v,m,S),S),tc[0]=d.clone(P,tc[0]),tc[1]=d.clone(S,tc[1]),T=lK(tc,p+h,b+h,a),B=Wi.generateArc({positions:tc,granularity:a,ellipsoid:r}),A=fK(B,v,u,A,r,T,1),v=d.cross(I,C,v),v=d.normalize(v,v),w=d.add(x,d.multiplyByScalar(v,m,w),w),c===ji.ROUNDED||c===ji.BEVELED?Pme(x,S,w,c,Z,r,A,u,b+h,o):(E=d.negate(E,E),A=Og(N,E,u,A,r,b+h,W,k)),P=d.clone(w,P)):(x=d.add(N,d.multiplyByScalar(E,W*m,E),x),S=d.add(x,d.multiplyByScalar(v,-m,S),S),tc[0]=d.clone(P,tc[0]),tc[1]=d.clone(S,tc[1]),T=lK(tc,p+h,b+h,a),B=Wi.generateArc({positions:tc,granularity:a,ellipsoid:r}),A=fK(B,v,u,A,r,T,1),v=d.cross(I,C,v),v=d.normalize(v,v),w=d.add(x,d.multiplyByScalar(v,-m,w),w),c===ji.ROUNDED||c===ji.BEVELED?Pme(x,S,w,c,Z,r,A,u,b+h,o):A=Og(N,E,u,A,r,b+h,W,k),P=d.clone(w,P)),y=d.negate(C,y)}else A=Og(P,v,u,A,r,p+h,1,1),P=N;p=b,b=s[U+1],N=L}tc[0]=d.clone(P,tc[0]),tc[1]=d.clone(N,tc[1]),T=lK(tc,p+h,b+h,a),B=Wi.generateArc({positions:tc,granularity:a,ellipsoid:r}),A=fK(B,v,u,A,r,T,1),o&&(_=Og(N,v,f,_,r,b+h,1,1)),g=A.length;let R=o?g+_.length:g,O=new Float64Array(R);return O.set(A),o&&O.set(_,g),O};var oA=H1;var hK={},tS=new d,Ome=new d,tit=new d,Rme=new d,Ul=[new d,new d],Fme=new d,Qme=new d,kme=new d,nit=new d,iit=new d,oit=new d,rit=new d,sit=new d,ait=new d,cit=new d,Mme=new Qe,Nme=new X;function _4(e,t,n,i,o){let r=d.angleBetween(d.subtract(t,e,tS),d.subtract(n,e,Ome)),s=i===ji.BEVELED?1:Math.ceil(r/D.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 u;o?u=X.fromQuaternion(Qe.fromAxisAngle(d.negate(e,tS),r/s,Mme),Nme):u=X.fromQuaternion(Qe.fromAxisAngle(e,r/s,Mme),Nme);let f=0;t=d.clone(t,tS);for(let h=0;h<s;h++)t=X.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function lit(e){let t=Fme,n=Qme,i=kme,o=e[1];n=d.fromArray(e[1],o.length-3,n),i=d.fromArray(e[0],0,i),t=d.midpoint(n,i,t);let r=_4(t,n,i,ji.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=d.fromArray(a,a.length-3,n),i=d.fromArray(o,0,i),t=d.midpoint(n,i,t);let c=_4(t,n,i,ji.ROUNDED,!1);return[r,c]}function Lme(e,t,n,i){let o=tS;return i?o=d.add(e,t,o):(t=d.negate(t,t),o=d.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function dK(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=d.multiplyByScalar(t,n,tS),a=d.negate(s,Ome),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let h=d.fromArray(e,f,tit),m=d.add(h,a,Rme);o[c++]=m.x,o[c++]=m.y,o[c++]=m.z;let g=d.add(h,s,Rme);r[u--]=g.z,r[u--]=g.y,r[u--]=g.x}return i.push(o,r),i}hK.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 uit=new d,fit=new d;hK.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Fme,c=Qme,u=kme,f=nit,h=iit,m=oit,g=rit,A=sit,_=ait,C=cit,y=[],E=s?[]:void 0,I=s?[]:void 0,x=n[0],S=n[1];c=d.normalize(d.subtract(S,x,c),c),a=i.geodeticSurfaceNormal(x,a),f=d.normalize(d.cross(a,c,f),f),s&&(E.push(f.x,f.y,f.z),I.push(a.x,a.y,a.z)),g=d.clone(x,g),x=S,u=d.negate(c,u);let w,v=[],P,N=n.length;for(P=1;P<N-1;P++){a=i.geodeticSurfaceNormal(x,a),S=n[P+1],c=d.normalize(d.subtract(S,x,c),c);let p=d.multiplyByScalar(a,d.dot(c,a),uit);d.subtract(c,p,p),d.normalize(p,p);let b=d.multiplyByScalar(a,d.dot(u,a),fit);if(d.subtract(u,b,b),d.normalize(b,b),!D.equalsEpsilon(Math.abs(d.dot(p,b)),1,D.EPSILON7)){h=d.normalize(d.add(c,u,h),h),h=d.cross(h,a,h),h=d.cross(a,h,h),h=d.normalize(h,h);let B=o/Math.max(.25,d.magnitude(d.cross(h,u,tS))),R=oA.angleIsGreaterThanPi(c,u,x,i);h=d.multiplyByScalar(h,B,h),R?(A=d.add(x,h,A),C=d.add(A,d.multiplyByScalar(f,o,C),C),_=d.add(A,d.multiplyByScalar(f,o*2,_),_),Ul[0]=d.clone(g,Ul[0]),Ul[1]=d.clone(C,Ul[1]),w=Wi.generateArc({positions:Ul,granularity:t,ellipsoid:i}),y=dK(w,f,o,y),s&&(E.push(f.x,f.y,f.z),I.push(a.x,a.y,a.z)),m=d.clone(_,m),f=d.normalize(d.cross(a,c,f),f),_=d.add(A,d.multiplyByScalar(f,o*2,_),_),g=d.add(A,d.multiplyByScalar(f,o,g),g),r===ji.ROUNDED||r===ji.BEVELED?v.push({leftPositions:_4(A,m,_,r,R)}):v.push({leftPositions:Lme(x,d.negate(h,h),_,R)})):(_=d.add(x,h,_),C=d.add(_,d.negate(d.multiplyByScalar(f,o,C),C),C),A=d.add(_,d.negate(d.multiplyByScalar(f,o*2,A),A),A),Ul[0]=d.clone(g,Ul[0]),Ul[1]=d.clone(C,Ul[1]),w=Wi.generateArc({positions:Ul,granularity:t,ellipsoid:i}),y=dK(w,f,o,y),s&&(E.push(f.x,f.y,f.z),I.push(a.x,a.y,a.z)),m=d.clone(A,m),f=d.normalize(d.cross(a,c,f),f),A=d.add(_,d.negate(d.multiplyByScalar(f,o*2,A),A),A),g=d.add(_,d.negate(d.multiplyByScalar(f,o,g),g),g),r===ji.ROUNDED||r===ji.BEVELED?v.push({rightPositions:_4(_,m,A,r,R)}):v.push({rightPositions:Lme(x,h,A,R)})),u=d.negate(c,u)}x=S}a=i.geodeticSurfaceNormal(x,a),Ul[0]=d.clone(g,Ul[0]),Ul[1]=d.clone(x,Ul[1]),w=Wi.generateArc({positions:Ul,granularity:t,ellipsoid:i}),y=dK(w,f,o,y),s&&(E.push(f.x,f.y,f.z),I.push(a.x,a.y,a.z));let L;return r===ji.ROUNDED&&(L=lit(y)),{positions:y,corners:v,lefts:E,normals:I,endPositions:L}};var io=hK;var zme=new d,Vme=new d,C4=new d,y4=new d,dit=new d,Hme=new d,ZC=new d,nS=new d;function Yme(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function rA(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,u=d.normalize(d.cross(n,t,ZC),ZC);r.normal&&io.addAttribute(s,t,i,o),r.tangent&&io.addAttribute(a,u,i,o),r.bitangent&&io.addAttribute(c,n,i,o)}function Wme(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new pn,u,f=0,h=0,m,g=0,A;for(m=0;m<i.length;m+=2)A=i[m].length-3,f+=A,g+=A*2,h+=i[m+1].length-3;for(f+=3,h+=3,m=0;m<o.length;m++){u=o[m];let K=o[m].leftPositions;l(K)?(A=K.length,f+=A,g+=A):(A=o[m].rightPositions.length,h+=A,g+=A)}let _=l(r),C;_&&(C=r[0].length-3,f+=C,h+=C,C/=3,g+=C*6);let y=f+h,E=new Float64Array(y),I=t.normal?new Float32Array(y):void 0,x=t.tangent?new Float32Array(y):void 0,S=t.bitangent?new Float32Array(y):void 0,w={normals:I,tangents:x,bitangents:S},v=0,P=y-1,N,L,p,b,T=zme,B=Vme,R,O,U=C/2,k=Fe.createTypedArray(y/3,g),z=0;if(_){O=C4,R=y4;let K=r[0];for(T=d.fromArray(a,0,T),B=d.fromArray(s,0,B),m=0;m<U;m++)O=d.fromArray(K,(U-1-m)*3,O),R=d.fromArray(K,(U+m)*3,R),io.addAttribute(E,R,v),io.addAttribute(E,O,void 0,P),rA(w,T,B,v,P,t),L=v/3,b=L+1,N=(P-2)/3,p=N-1,k[z++]=N,k[z++]=L,k[z++]=p,k[z++]=p,k[z++]=L,k[z++]=b,v+=3,P-=3}let Q=0,H=0,W=i[Q++],Z=i[Q++];E.set(W,v),E.set(Z,P-Z.length+1),B=d.fromArray(s,H,B);let Y,$;for(A=Z.length-3,m=0;m<A;m+=3)Y=n.geodeticSurfaceNormal(d.fromArray(W,m,ZC),ZC),$=n.geodeticSurfaceNormal(d.fromArray(Z,A-m,nS),nS),T=d.normalize(d.add(Y,$,T),T),rA(w,T,B,v,P,t),L=v/3,b=L+1,N=(P-2)/3,p=N-1,k[z++]=N,k[z++]=L,k[z++]=p,k[z++]=p,k[z++]=L,k[z++]=b,v+=3,P-=3;for(Y=n.geodeticSurfaceNormal(d.fromArray(W,A,ZC),ZC),$=n.geodeticSurfaceNormal(d.fromArray(Z,A,nS),nS),T=d.normalize(d.add(Y,$,T),T),H+=3,m=0;m<o.length;m++){let K;u=o[m];let fe=u.leftPositions,ge=u.rightPositions,ne,Ce,ye=Hme,De=C4,be=y4;if(T=d.fromArray(a,H,T),l(fe)){for(rA(w,T,B,void 0,P,t),P-=3,ne=b,Ce=p,K=0;K<fe.length/3;K++)ye=d.fromArray(fe,K*3,ye),k[z++]=ne,k[z++]=Ce-K-1,k[z++]=Ce-K,io.addAttribute(E,ye,void 0,P),De=d.fromArray(E,(Ce-K-1)*3,De),be=d.fromArray(E,ne*3,be),B=d.normalize(d.subtract(De,be,B),B),rA(w,T,B,void 0,P,t),P-=3;ye=d.fromArray(E,ne*3,ye),De=d.subtract(d.fromArray(E,Ce*3,De),ye,De),be=d.subtract(d.fromArray(E,(Ce-K)*3,be),ye,be),B=d.normalize(d.add(De,be,B),B),rA(w,T,B,v,void 0,t),v+=3}else{for(rA(w,T,B,v,void 0,t),v+=3,ne=p,Ce=b,K=0;K<ge.length/3;K++)ye=d.fromArray(ge,K*3,ye),k[z++]=ne,k[z++]=Ce+K,k[z++]=Ce+K+1,io.addAttribute(E,ye,v),De=d.fromArray(E,ne*3,De),be=d.fromArray(E,(Ce+K)*3,be),B=d.normalize(d.subtract(De,be,B),B),rA(w,T,B,v,void 0,t),v+=3;ye=d.fromArray(E,ne*3,ye),De=d.subtract(d.fromArray(E,(Ce+K)*3,De),ye,De),be=d.subtract(d.fromArray(E,Ce*3,be),ye,be),B=d.normalize(d.negate(d.add(be,De,B),B),B),rA(w,T,B,void 0,P,t),P-=3}for(W=i[Q++],Z=i[Q++],W.splice(0,3),Z.splice(Z.length-3,3),E.set(W,v),E.set(Z,P-Z.length+1),A=Z.length-3,H+=3,B=d.fromArray(s,H,B),K=0;K<Z.length;K+=3)Y=n.geodeticSurfaceNormal(d.fromArray(W,K,ZC),ZC),$=n.geodeticSurfaceNormal(d.fromArray(Z,A-K,nS),nS),T=d.normalize(d.add(Y,$,T),T),rA(w,T,B,v,P,t),b=v/3,L=b-1,p=(P-2)/3,N=p+1,k[z++]=N,k[z++]=L,k[z++]=p,k[z++]=p,k[z++]=L,k[z++]=b,v+=3,P-=3;v-=3,P+=3}if(T=d.fromArray(a,a.length-3,T),rA(w,T,B,v,P,t),_){v+=3,P-=3,O=C4,R=y4;let K=r[1];for(m=0;m<U;m++)O=d.fromArray(K,(C-m-1)*3,O),R=d.fromArray(K,m*3,R),io.addAttribute(E,O,void 0,P),io.addAttribute(E,R,v),rA(w,T,B,v,P,t),b=v/3,L=b-1,p=(P-2)/3,N=p+1,k[z++]=N,k[z++]=L,k[z++]=p,k[z++]=p,k[z++]=L,k[z++]=b,v+=3,P-=3}if(c.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:E}),t.st){let K=new Float32Array(y/3*2),fe,ge,ne=0;if(_){f/=3,h/=3;let Ce=Math.PI/(C+1);ge=1/(f-C+1),fe=1/(h-C+1);let ye,De=C/2;for(m=De+1;m<C+1;m++)ye=D.PI_OVER_TWO+Ce*m,K[ne++]=fe*(1+Math.cos(ye)),K[ne++]=.5*(1+Math.sin(ye));for(m=1;m<h-C+1;m++)K[ne++]=m*fe,K[ne++]=0;for(m=C;m>De;m--)ye=D.PI_OVER_TWO-m*Ce,K[ne++]=1-fe*(1+Math.cos(ye)),K[ne++]=.5*(1+Math.sin(ye));for(m=De;m>0;m--)ye=D.PI_OVER_TWO-Ce*m,K[ne++]=1-ge*(1+Math.cos(ye)),K[ne++]=.5*(1+Math.sin(ye));for(m=f-C;m>0;m--)K[ne++]=m*ge,K[ne++]=1;for(m=1;m<De+1;m++)ye=D.PI_OVER_TWO+Ce*m,K[ne++]=ge*(1+Math.cos(ye)),K[ne++]=.5*(1+Math.sin(ye))}else{for(f/=3,h/=3,ge=1/(f-1),fe=1/(h-1),m=0;m<h;m++)K[ne++]=m*fe,K[ne++]=0;for(m=f;m>0;m--)K[ne++]=(m-1)*ge,K[ne++]=1}c.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:K})}return t.normal&&(c.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:w.normals})),t.tangent&&(c.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:w.tangents})),t.bitangent&&(c.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:w.bitangents})),{attributes:c,indices:k}}function hit(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,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,m=t.bitangent?new Float32Array(s*6):void 0,g=zme,A=Vme,_=C4,C=y4,y=dit,E=Hme,I=c;for(u=0;u<s;u+=3){let x=I+c;g=d.fromArray(n,u,g),A=d.fromArray(n,u+s,A),_=d.fromArray(n,(u+3)%s,_),A=d.subtract(A,g,A),_=d.subtract(_,g,_),C=d.normalize(d.cross(A,_,C),C),t.normal&&(io.addAttribute(f,C,x),io.addAttribute(f,C,x+3),io.addAttribute(f,C,I),io.addAttribute(f,C,I+3)),(t.tangent||t.bitangent)&&(E=d.fromArray(i,u,E),t.bitangent&&(io.addAttribute(m,E,x),io.addAttribute(m,E,x+3),io.addAttribute(m,E,I),io.addAttribute(m,E,I+3)),t.tangent&&(y=d.normalize(d.cross(E,C,y),y),io.addAttribute(h,y,x),io.addAttribute(h,y,x+3),io.addAttribute(h,y,I),io.addAttribute(h,y,I+3))),I+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(m.set(o),m.set(o,s),e.bitangent.values=m):e.bitangent=void 0,t.tangent){let x=e.tangent.values;h.set(x),h.set(x,s),e.tangent.values=h}}if(t.st){let f=e.st.values,h=new Float32Array(a*6);h.set(f),h.set(f,a);let m=a*2;for(let g=0;g<2;g++){for(h[m++]=f[0],h[m++]=f[1],u=2;u<a;u+=2){let A=f[u],_=f[u+1];h[m++]=A,h[m++]=_,h[m++]=A,h[m++]=_}h[m++]=f[0],h[m++]=f[1]}e.st.values=h}return e}function AK(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 Ait(e,t){let n=new Re({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=io.computePositions(e),r=Wme(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,h=f.length,m=new Float64Array(h*6),g=new Float64Array(h);g.set(f);let A=new Float64Array(h*4);f=bi.scaleToGeodeticHeight(f,s,i),A=AK(f,0,A),g=bi.scaleToGeodeticHeight(g,a,i),A=AK(g,h*2,A),m.set(f),m.set(g,h),m.set(A,h*2),c.position.values=m,c=hit(c,t);let _,C=h/3;if(e.shadowVolume){let N=c.normal.values;h=N.length;let L=new Float32Array(h*6);for(_=0;_<h;_++)N[_]=-N[_];L.set(N,h),L=AK(N,h*4,L),c.extrudeDirection=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let N=new Uint8Array(C*6);if(e.offsetAttribute===un.TOP)N=N.fill(1,0,C).fill(1,C*2,C*4);else{let L=e.offsetAttribute===un.NONE?0:1;N=N.fill(L)}c.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}let y=u.length,E=C+C,I=Fe.createTypedArray(m.length/3,y*2+E*3);I.set(u);let x=y;for(_=0;_<y;_+=3){let N=u[_],L=u[_+1],p=u[_+2];I[x++]=p+C,I[x++]=L+C,I[x++]=N+C}let S,w,v,P;for(_=0;_<E;_+=2)S=_+E,w=S+E,v=S+1,P=w+1,I[x++]=S,I[x++]=w,I[x++]=v,I[x++]=v,I[x++]=w,I[x++]=P;return{attributes:c,indices:I}}var Ume=new d,Y1=new d,Nd=new he;function Gme(e,t,n,i,o,r){let s=d.subtract(t,e,Ume);d.normalize(s,s);let a=n.geodeticSurfaceNormal(e,Y1),c=d.cross(s,a,Ume);d.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,h=r.latitude,m=r.longitude;d.add(e,c,Y1),n.cartesianToCartographic(Y1,Nd);let g=Nd.latitude,A=Nd.longitude;u=Math.min(u,g),f=Math.min(f,A),h=Math.max(h,g),m=Math.max(m,A),d.subtract(e,c,Y1),n.cartesianToCartographic(Y1,Nd),g=Nd.latitude,A=Nd.longitude,u=Math.min(u,g),f=Math.min(f,A),h=Math.max(h,g),m=Math.max(m,A),o.latitude=u,o.longitude=f,r.latitude=h,r.longitude=m}var Md=new d,W1=new d,Tu=new he,Su=new he;function jme(e,t,n,i,o){e=Yme(e,t);let r=Uo(e,d.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ce;let a=n*.5;Tu.latitude=Number.POSITIVE_INFINITY,Tu.longitude=Number.POSITIVE_INFINITY,Su.latitude=Number.NEGATIVE_INFINITY,Su.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===ji.ROUNDED){let m=r[0];d.subtract(m,r[1],Md),d.normalize(Md,Md),d.multiplyByScalar(Md,a,Md),d.add(m,Md,W1),t.cartesianToCartographic(W1,Nd),c=Nd.latitude,u=Nd.longitude,Tu.latitude=Math.min(Tu.latitude,c),Tu.longitude=Math.min(Tu.longitude,u),Su.latitude=Math.max(Su.latitude,c),Su.longitude=Math.max(Su.longitude,u)}for(let m=0;m<s-1;++m)Gme(r[m],r[m+1],t,a,Tu,Su);let f=r[s-1];d.subtract(f,r[s-2],Md),d.normalize(Md,Md),d.multiplyByScalar(Md,a,Md),d.add(f,Md,W1),Gme(f,W1,t,a,Tu,Su),i===ji.ROUNDED&&(t.cartesianToCartographic(W1,Nd),c=Nd.latitude,u=Nd.longitude,Tu.latitude=Math.min(Tu.latitude,c),Tu.longitude=Math.min(Tu.longitude,u),Su.latitude=Math.max(Su.latitude,c),Su.longitude=Math.max(Su.longitude,u));let h=l(o)?o:new ce;return h.north=Su.latitude,h.south=Tu.latitude,h.east=Su.longitude,h.west=Tu.longitude,h}function Qg(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._vertexFormat=Re.clone(e.vertexFormat??Re.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ji.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*d.packedLength+te.packedLength+Re.packedLength+7}Qg.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+=d.packedLength)d.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.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 qme=te.clone(te.UNIT_SPHERE),Kme=new Re,Fg={positions:void 0,ellipsoid:qme,vertexFormat:Kme,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Qg.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let A=0;A<i;++A,t+=d.packedLength)o[A]=d.unpack(e,t);let r=te.unpack(e,t,qme);t+=te.packedLength;let s=Re.unpack(e,t,Kme);t+=Re.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],m=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=Re.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=h,n._shadowVolume=m,n._offsetAttribute=g===-1?void 0:g,n):(Fg.positions=o,Fg.width=a,Fg.height=c,Fg.extrudedHeight=u,Fg.cornerType=f,Fg.granularity=h,Fg.shadowVolume=m,Fg.offsetAttribute=g===-1?void 0:g,new Qg(Fg))};Qg.computeRectangle=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??te.default,r=e.cornerType??ji.ROUNDED;return jme(n,o,i,r,t)};Qg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Yme(t,i);let o=Uo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(r,s,0,D.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=Ait(u,c);else{let g=io.computePositions(u);if(f=Wme(g,c,i),f.attributes.position.values=bi.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let A=e._offsetAttribute===un.NONE?0:1,_=f.attributes.position.values.length,C=new Uint8Array(_/3).fill(A);f.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}}let h=f.attributes,m=le.fromVertices(h.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new ht({attributes:h,indices:f.indices,primitiveType:Pe.TRIANGLES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};Qg.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Qg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Re.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Qg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=jme(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var o0=Qg;var Jme=new d,Xme=new d,mit=new d;function pit(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Zme(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new pn,a,c=0,u=0,f,h=0,m;for(f=0;f<i.length;f+=2)m=i[f].length-3,c+=m,h+=m/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){a=o[f];let R=o[f].leftPositions;l(R)?(m=R.length,c+=m,h+=m/3*2):(m=o[f].rightPositions.length,u+=m,h+=m/3*2)}let g=l(r),A;g&&(A=r[0].length-3,c+=A,u+=A,A/=3,h+=A*4);let _=c+u,C=new Float64Array(_),y=0,E=_-1,I,x,S,w,v,P,N=A/2,L=Fe.createTypedArray(_/3,h+4),p=0;if(L[p++]=y/3,L[p++]=(E-2)/3,g){n.push(y/3),P=Jme,v=Xme;let R=r[0];for(f=0;f<N;f++)P=d.fromArray(R,(N-1-f)*3,P),v=d.fromArray(R,(N+f)*3,v),io.addAttribute(C,v,y),io.addAttribute(C,P,void 0,E),x=y/3,w=x+1,I=(E-2)/3,S=I-1,L[p++]=I,L[p++]=S,L[p++]=x,L[p++]=w,y+=3,E-=3}let b=0,T=i[b++],B=i[b++];for(C.set(T,y),C.set(B,E-B.length+1),m=B.length-3,n.push(y/3,(E-2)/3),f=0;f<m;f+=3)x=y/3,w=x+1,I=(E-2)/3,S=I-1,L[p++]=I,L[p++]=S,L[p++]=x,L[p++]=w,y+=3,E-=3;for(f=0;f<o.length;f++){let R;a=o[f];let O=a.leftPositions,U=a.rightPositions,k,z=mit;if(l(O)){for(E-=3,k=S,n.push(w),R=0;R<O.length/3;R++)z=d.fromArray(O,R*3,z),L[p++]=k-R-1,L[p++]=k-R,io.addAttribute(C,z,void 0,E),E-=3;n.push(k-Math.floor(O.length/6)),t===ji.BEVELED&&n.push((E-2)/3+1),y+=3}else{for(y+=3,k=w,n.push(S),R=0;R<U.length/3;R++)z=d.fromArray(U,R*3,z),L[p++]=k+R,L[p++]=k+R+1,io.addAttribute(C,z,y),y+=3;n.push(k+Math.floor(U.length/6)),t===ji.BEVELED&&n.push(y/3-1),E-=3}for(T=i[b++],B=i[b++],T.splice(0,3),B.splice(B.length-3,3),C.set(T,y),C.set(B,E-B.length+1),m=B.length-3,R=0;R<B.length;R+=3)w=y/3,x=w-1,S=(E-2)/3,I=S+1,L[p++]=I,L[p++]=S,L[p++]=x,L[p++]=w,y+=3,E-=3;y-=3,E+=3,n.push(y/3,(E-2)/3)}if(g){y+=3,E-=3,P=Jme,v=Xme;let R=r[1];for(f=0;f<N;f++)P=d.fromArray(R,(A-f-1)*3,P),v=d.fromArray(R,f*3,v),io.addAttribute(C,P,void 0,E),io.addAttribute(C,v,y),w=y/3,x=w-1,S=(E-2)/3,I=S+1,L[p++]=I,L[p++]=S,L[p++]=x,L[p++]=w,y+=3,E-=3;n.push(y/3)}else n.push(y/3,(E-2)/3);return L[p++]=y/3,L[p++]=(E-2)/3,s.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:C}),{attributes:s,indices:L,wallIndices:n}}function git(e){let t=e.ellipsoid,n=io.computePositions(e),i=Zme(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,h=new Float64Array(f);h.set(u);let m=new Float64Array(f*2);if(u=bi.scaleToGeodeticHeight(u,r,t),h=bi.scaleToGeodeticHeight(h,s,t),m.set(u),m.set(h,f),a.position.values=m,f/=3,l(e.offsetAttribute)){let I=new Uint8Array(f*2);if(e.offsetAttribute===un.TOP)I=I.fill(1,0,f);else{let x=e.offsetAttribute===un.NONE?0:1;I=I.fill(x)}a.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}let g,A=c.length,_=Fe.createTypedArray(m.length/3,(A+o.length)*2);_.set(c);let C=A;for(g=0;g<A;g+=2){let I=c[g],x=c[g+1];_[C++]=I+f,_[C++]=x+f}let y,E;for(g=0;g<o.length;g++)y=o[g],E=y+f,_[C++]=y,_[C++]=E;return{attributes:a,indices:_}}function j1(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ji.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*d.packedLength+te.packedLength+6}j1.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+=d.packedLength)d.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.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 $me=te.clone(te.UNIT_SPHERE),$C={positions:void 0,ellipsoid:$me,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};j1.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=d.packedLength)o[m]=d.unpack(e,t);let r=te.unpack(e,t,$me);t+=te.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=h===-1?void 0:h,n):($C.positions=o,$C.width=s,$C.height=a,$C.extrudedHeight=c,$C.cornerType=u,$C.granularity=f,$C.offsetAttribute=h===-1?void 0:h,new j1($C))};j1.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=pit(t,i);let o=Uo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(r,s,0,D.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=git(c);else{let m=io.computePositions(c);if(u=Zme(m,c.cornerType),u.attributes.position.values=bi.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,A=e._offsetAttribute===un.NONE?0:1,_=new Uint8Array(g/3).fill(A);u.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}}let f=u.attributes,h=le.fromVertices(f.position.values,void 0,3);return new ht({attributes:f,indices:u.indices,primitiveType:Pe.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var q1=j1;var _it=new li(0);function Gl(e){Ei.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Gl.prototype=Object.create(Ei.prototype),Gl.prototype.constructor=Gl);Object.defineProperties(Gl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Cl.isSupported(this._scene)};Gl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Gl.prototype._computeCenter=Ae.throwInstantiationError;Gl.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??_it,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 Dh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new JE(this._scene,a,r,s)}};Gl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Ei.prototype.destroy.call(this)};Gl.getGeometryHeight=function(e,t){if(!l(e)){t!==$e.NONE&&At(At.geometryHeightReference);return}return od(t)?0:e};Gl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==$e.NONE&&At(At.geometryExtrudedHeightReference);return}return od(t)?Gl.CLAMP_TO_GROUND:e};Gl.CLAMP_TO_GROUND="clamp";Gl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=$e.NONE),(!l(n)||!l(i))&&(i=$e.NONE);let o=0;if(t!==$e.NONE&&o++,i===$e.RELATIVE_TO_GROUND&&o++,o===2)return un.ALL;if(o===1)return un.TOP};var ti=Gl;var epe=new G,tpe=d.ZERO,npe=new d,ipe=new ce;function Cit(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 sA(e,t){ti.call(this,{entity:e,scene:t,geometryOptions:new Cit(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(sA.prototype=Object.create(ti.prototype),sA.prototype.constructor=sA);sA.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof jt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,epe)),l(o)||(o=G.WHITE),i.color=Xt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,tpe,npe))),new Rt({id:t,geometry:new o0(this._options),attributes:i})};sA.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,epe),o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,tpe,npe))),new Rt({id:t,geometry:new q1(this._options),attributes:o})};sA.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return d.clone(n[Math.floor(n.length/2)],t)};sA.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Ei.prototype._isHidden.call(this,e,t)};sA.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.width)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.cornerType)||!j.isConstant(t.zIndex)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof jt)};sA.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,Ke.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,$e.NONE),o=j.getValueOrUndefined(t.extrudedHeight,Ke.MINIMUM_VALUE),r=j.getValueOrDefault(t.extrudedHeightReference,Ke.MINIMUM_VALUE,$e.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof jt?hn.VERTEX_FORMAT:xo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ke.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ke.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,Ke.MINIMUM_VALUE),s.cornerType=j.getValueOrUndefined(t.cornerType,Ke.MINIMUM_VALUE),s.offsetAttribute=ti.computeGeometryOffsetAttribute(n,i,o,r),s.height=ti.getGeometryHeight(n,i),o=ti.getGeometryExtrudedHeight(o,r),o===ti.CLAMP_TO_GROUND&&(o=Si.getMinimumMaximumHeights(o0.computeRectangle(s,ipe)).minimumTerrainHeight),s.extrudedHeight=o};sA.DynamicGeometryUpdater=iS;function iS(e,t,n){yi.call(this,e,t,n)}l(Object.create)&&(iS.prototype=Object.create(yi.prototype),iS.prototype.constructor=iS);iS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||yi.prototype._isHidden.call(this,e,t,n)};iS.prototype._setOptions=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,$e.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,$e.NONE);l(s)&&!l(o)&&(o=0),i.positions=j.getValueOrUndefined(t.positions,n),i.width=j.getValueOrUndefined(t.width,n),i.granularity=j.getValueOrUndefined(t.granularity,n),i.cornerType=j.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=ti.computeGeometryOffsetAttribute(o,r,s,a),i.height=ti.getGeometryHeight(o,r),s=ti.getGeometryExtrudedHeight(s,a),s===ti.CLAMP_TO_GROUND&&(s=Si.getMinimumMaximumHeights(o0.computeRectangle(i,ipe)).minimumTerrainHeight),i.extrudedHeight=s};var K1=sA;function E4(){Ae.throwInstantiationError()}Object.defineProperties(E4.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}});E4.prototype.update=function(e){Ae.throwInstantiationError()};E4.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var gs=E4;function Tm(e,t){this._ellipsoid=e,this._cameraPosition=new d,this._cameraPositionInScaledSpace=new d,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Tm.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=d.magnitudeSquared(n)-1;d.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var ope=new d;Tm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,ope);return pK(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Tm.prototype.isScaledSpacePointVisible=function(e){return pK(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var yit=new d;Tm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=yit,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),pK(e,o,i)};Tm.prototype.computeHorizonCullingPoint=function(e,t,n){return ape(this._ellipsoid,e,t,n)};var rpe=te.clone(te.UNIT_SPHERE);Tm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=spe(this._ellipsoid,n,rpe);return ape(o,e,t,i)};Tm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return cpe(this._ellipsoid,e,t,n,i,o)};Tm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=spe(this._ellipsoid,o,rpe);return cpe(s,e,t,n,i,r)};var Eit=[];Tm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,Eit),o=le.fromPoints(i);if(!(d.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var Iit=new d;function spe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=d.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,Iit);e=te.fromCartesian3(i,n)}return e}function ape(e,t,n,i){l(i)||(i=new d);let o=fpe(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=lpe(e,c,o);if(u<0)return;r=Math.max(r,u)}return upe(o,r,i)}var I4=new d;function cpe(e,t,n,i,o,r){l(r)||(r=new d),i=i??3,o=o??d.ZERO;let s=fpe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){I4.x=n[c]+o.x,I4.y=n[c+1]+o.y,I4.z=n[c+2]+o.z;let f=lpe(e,I4,s);if(f<0)return;a=Math.max(a,f)}return upe(s,a,r)}function pK(e,t,n){let i=t,o=n,r=d.subtract(e,i,ope),s=-d.dot(r,i);return!(o<0?s>0:s>o&&s*s/d.magnitudeSquared(r)>o)}var bit=new d,xit=new d;function lpe(e,t,n){let i=e.transformPositionToScaledSpace(t,bit),o=d.magnitudeSquared(i),r=Math.sqrt(o),s=d.divideByScalar(i,r,xit);o=Math.max(1,o),r=Math.max(1,r);let a=d.dot(s,n),c=d.magnitude(d.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-c*f)}function upe(e,t,n){if(!(t<=0||t===1/0||t!==t))return d.multiplyByScalar(e,t,n)}var mK=new d;function fpe(e,t){return d.equals(t,d.ZERO)?t:(e.transformPositionToScaledSpace(t,mK),d.normalize(mK,mK))}var aA=Tm;function es(e,t){e=e??V.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Ht.clone(n)),l(i)&&(i=Ht.clone(i)),l(o)&&(o=Qt.clone(o)),this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._color=G.clone(e.color??G.WHITE),this._outlineColor=G.clone(e.outlineColor??G.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??Lr.NONE}var dpe=es.SHOW_INDEX=0,mpe=es.POSITION_INDEX=1,Tit=es.COLOR_INDEX=2,Sit=es.OUTLINE_COLOR_INDEX=3,Bit=es.OUTLINE_WIDTH_INDEX=4,wit=es.PIXEL_SIZE_INDEX=5,Dit=es.SCALE_BY_DISTANCE_INDEX=6,vit=es.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Pit=es.DISTANCE_DISPLAY_CONDITION_INDEX=8,Rit=es.DISABLE_DEPTH_DISTANCE_INDEX=9,Mit=es.SPLIT_DIRECTION_INDEX=10;es.NUMBER_OF_PROPERTIES=11;function gf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(es.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,gf(this,dpe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),gf(this,mpe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ht.equals(t,e)||(this._scaleByDistance=Ht.clone(e,t),gf(this,Dit))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ht.equals(t,e)||(this._translucencyByDistance=Ht.clone(e,t),gf(this,vit))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,gf(this,wit))}},color:{get:function(){return this._color},set:function(e){let t=this._color;G.equals(t,e)||(G.clone(e,t),gf(this,Tit))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),gf(this,Sit))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,gf(this,Bit))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Qt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Qt.clone(e,this._distanceDisplayCondition),gf(this,Pit))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,gf(this,Rit))}},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,gf(this,dpe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,gf(this,Mit))}}});es.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};es.prototype._getActualPosition=function(){return this._actualPosition};es.prototype._setActualPosition=function(e){d.clone(e,this._actualPosition),gf(this,mpe)};var hpe=new se;es._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(M.multiplyByPoint(n,e,hpe),to.computeActualEllipsoidPosition(t,hpe))};var Ape=new se;es._computeScreenSpacePosition=function(e,t,n,i){let o=M.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,Ape),Ape);return to.worldToWindowCoordinates(n,o,i)};es.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new F);let i=n.modelMatrix,o=es._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};es.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 Xe),n.x=r,n.y=s,n.width=a,n.height=c,n};es.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.equals(this._position,e._position)&&G.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&G.equals(this._outlineColor,e._outlineColor)&&Ht.equals(this._scaleByDistance,e._scaleByDistance)&&Ht.equals(this._translucencyByDistance,e._translucencyByDistance)&&Qt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};es.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var aa=es;var ey=`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 J1=`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 Nit=aa.SHOW_INDEX,CK=aa.POSITION_INDEX,ppe=aa.COLOR_INDEX,Lit=aa.OUTLINE_COLOR_INDEX,Oit=aa.OUTLINE_WIDTH_INDEX,Fit=aa.PIXEL_SIZE_INDEX,gpe=aa.SCALE_BY_DISTANCE_INDEX,_pe=aa.TRANSLUCENCY_BY_DISTANCE_INDEX,Cpe=aa.DISTANCE_DISPLAY_CONDITION_INDEX,Qit=aa.DISABLE_DEPTH_DISTANCE_INDEX,kit=aa.SPLIT_DIRECTION_INDEX,yK=aa.NUMBER_OF_PROPERTIES,$c={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Ld(e){e=e??V.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(yK),this._maxPixelSize=1,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Ko.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Ld.prototype,{length:{get:function(){return EK(this),this._pointPrimitives.length}}});function ype(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Ld.prototype.add=function(e){let t=new aa(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Ld.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Ld.prototype.removeAll=function(){ype(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function EK(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}}Ld.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Ld.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Ld.prototype.get=function(e){return EK(this),this._pointPrimitives[e]};Ld.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<yK;++i){let o=n[i]===0?Oe.STATIC_DRAW:Oe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Uit(e,t,n){return new Tp(e,[{index:$c.positionHighAndSize,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[CK]},{index:$c.positionLowAndShow,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[CK]},{index:$c.compressedAttribute0,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[ppe]},{index:$c.compressedAttribute1,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[_pe]},{index:$c.scaleByDistance,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[gpe]},{index:$c.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Cpe]}],t)}var gK=new $n;function Epe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),$n.fromCartesian(r,gK);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[$c.positionHighAndSize],u=gK.high;c(o,u.x,u.y,u.z,s);let f=n[$c.positionLowAndOutline],h=gK.low;f(o,h.x,h.y,h.z,a)}var b4=65536,X1=256;function Ipe(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=G.floatToByte(r.red),u=G.floatToByte(r.green),f=G.floatToByte(r.blue),h=c*b4+u*X1+f;c=G.floatToByte(a.red),u=G.floatToByte(a.green),f=G.floatToByte(a.blue);let m=c*b4+u*X1+f;c=G.floatToByte(s.red),u=G.floatToByte(s.green),f=G.floatToByte(s.blue);let g=c*b4+u*X1+f,A=G.floatToByte(r.alpha)*b4+G.floatToByte(a.alpha)*X1+G.floatToByte(s.alpha),_=n[$c.compressedAttribute0];_(o,h,m,g,A)}function bpe(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=D.clamp(s,0,1),s=s===1?255:s*255|0;let h=(f?1:0)*X1+s;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let m=c,g=n[$c.compressedAttribute1];g(o,h,m,r,a)}function xpe(e,t,n,i){let o=i._index,r=n[$c.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,u)}function Tpe(e,t,n,i){let o=i._index,r=n[$c.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 u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,h=i.splitDirection;l(h)&&(f=h),r(o,s,a,u,f)}function Git(e,t,n,i){Epe(e,t,n,i),Ipe(e,t,n,i),bpe(e,t,n,i),xpe(e,t,n,i),Tpe(e,t,n,i)}function _K(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=aa._computeActualPosition(f,i,o);l(h)&&(u._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function zit(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&_K(e,i,i.length,t,r,!0)):n===oe.MORPHING?_K(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&_K(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function Vit(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var Hit=[];Ld.prototype.update=function(e){if(EK(this),!this.show)return;this._maxTotalPointSize=Ft.maximumAliasedPointSize,zit(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let S=0;S<yK;++S)r[S]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Uit(c,n,this._buffersUsage),a=this._vaf.writers;for(let S=0;S<n;++S){let w=this._pointPrimitives[S];w._dirty=!1,Git(this,c,a,w)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let S=Hit;S.length=0,(r[CK]||r[Oit]||r[Fit])&&S.push(Epe),(r[ppe]||r[Lit])&&S.push(Ipe),(r[Nit]||r[_pe])&&S.push(bpe),r[gpe]&&S.push(xpe),(r[Cpe]||r[Qit]||r[kit])&&S.push(Tpe);let w=S.length;if(a=this._vaf.writers,o/n>.1){for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let N=0;N<w;++N)S[N](this,c,a,P)}this._vaf.commit()}else{for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let N=0;N<w;++N)S[N](this,c,a,P);this._vaf.subCommit(P._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,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,m=M.IDENTITY;e.mode===oe.SCENE3D?(m=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),Vit(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Ko.OPAQUE||this._blendOption===Ko.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Ko.TRANSLUCENT||this._blendOption===Ko.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!1,blending:dn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let A,_;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(A=new We({sources:[J1]}),this._shaderScaleByDistance&&A.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&A.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&A.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&A.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Ko.OPAQUE_AND_TRANSLUCENT&&(_=new We({defines:["OPAQUE"],sources:[ey]}),this._sp=sn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:_,attributeLocations:$c}),_=new We({defines:["TRANSLUCENT"],sources:[ey]}),this._spTranslucent=sn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:_,attributeLocations:$c})),this._blendOption===Ko.OPAQUE&&(_=new We({sources:[ey]}),this._sp=sn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:_,attributeLocations:$c})),this._blendOption===Ko.TRANSLUCENT&&(_=new We({sources:[ey]}),this._spTranslucent=sn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:_,attributeLocations:$c})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let C,y,E,I,x=e.commandList;if(u.render||f){let S=this._colorCommands,w=this._blendOption===Ko.OPAQUE,v=this._blendOption===Ko.OPAQUE_AND_TRANSLUCENT;C=this._vaf.va,y=C.length,S.length=y;let P=v?y*2:y;for(I=0;I<P;++I){let N=w||v&&I%2===0;E=S[I],l(E)||(E=S[I]=new et),E.primitiveType=Pe.POINTS,E.pass=N||!v?we.OPAQUE:we.TRANSLUCENT,E.owner=this;let L=v?Math.floor(I/2):I;E.boundingVolume=h,E.modelMatrix=m,E.shaderProgram=N?this._sp:this._spTranslucent,E.uniformMap=this._uniforms,E.vertexArray=C[L].va,E.renderState=N?this._rsOpaque:this._rsTranslucent,E.debugShowBoundingVolume=this.debugShowBoundingVolume,E.pickId="v_pickColor",x.push(E)}}};Ld.prototype.isDestroyed=function(){return!1};Ld.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(),ype(this._pointPrimitives),de(this)};var oS=Ld;var Spe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],IK=1,Z1=8,eF=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!==IK)throw new Error(`Got v${o} data when expected v${IK}.`);let r=Spe[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=Spe.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,Z1,t),this.coords=new this.ArrayType(this.data,Z1+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Z1+s+a+c),this.ids=new this.IndexArrayType(this.data,Z1,t),this.coords=new this.ArrayType(this.data,Z1+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(IK<<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 xK(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],u=[];for(;c.length;){let f=c.pop()||0,h=c.pop()||0,m=c.pop()||0;if(h-m<=a){for(let C=m;C<=h;C++){let y=s[2*C],E=s[2*C+1];y>=t&&y<=i&&E>=n&&E<=o&&u.push(r[C])}continue}let g=m+h>>1,A=s[2*g],_=s[2*g+1];A>=t&&A<=i&&_>=n&&_<=o&&u.push(r[g]),(f===0?t<=A:n<=_)&&(c.push(m),c.push(g-1),c.push(1-f)),(f===0?i>=A:o>=_)&&(c.push(g+1),c.push(h),c.push(1-f))}return u}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=[],u=i*i;for(;a.length;){let f=a.pop()||0,h=a.pop()||0,m=a.pop()||0;if(h-m<=s){for(let C=m;C<=h;C++)Bpe(r[2*C],r[2*C+1],t,n)<=u&&c.push(o[C]);continue}let g=m+h>>1,A=r[2*g],_=r[2*g+1];Bpe(A,_,t,n)<=u&&c.push(o[g]),(f===0?t-i<=A:n-i<=_)&&(a.push(m),a.push(g-1),a.push(1-f)),(f===0?t+i>=A:n+i>=_)&&(a.push(g+1),a.push(h),a.push(1-f))}return c}};function xK(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;wpe(e,t,s,i,o,r),xK(e,t,n,i,s-1,1-r),xK(e,t,n,s+1,o,1-r)}function wpe(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,h=Math.log(u),m=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*m*(u-m)/u)*(f-u/2<0?-1:1),A=Math.max(i,Math.floor(n-f*m/u+g)),_=Math.min(o,Math.floor(n+(u-f)*m/u+g));wpe(e,t,n,A,_,r)}let s=t[2*n+r],a=i,c=o;for($1(e,t,i,n),t[2*o+r]>s&&$1(e,t,i,o);a<c;){for($1(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?$1(e,t,i,c):(c++,$1(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function $1(e,t,n,i){bK(e,n,i),bK(t,2*n,2*i),bK(t,2*n+1,2*i+1)}function bK(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Bpe(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function cA(e){e=e??V.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 _e,this.show=e.show??!0}function Dpe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var Yit=new Xe;function vpe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=kC.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=So.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=aa.getScreenSpaceBoundingBox(e,t,o)),Dpe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Rpe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=kC.getScreenSpaceBoundingBox(s,t,Yit);Dpe(a,n),o=Xe.union(o,a,o)}return o}function Wit(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Rpe(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 Ppe(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 Rpe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function TK(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===oe.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),u=o._clusterBillboards&&l(a.id._billboard),f=o._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let h=a.computeScreenSpacePosition(n);l(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}var jit=new Xe,qit=new Xe,Kit=new Xe;function Jit(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 Cm({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new ff({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new oS;let u=e._pixelRange,f=e._minimumClusterSize,h=e._previousClusters,m=[],g=e._previousHeight,A=n.camera.positionCartographic.height,_=n.ellipsoid,C=n.camera.positionWC,y=new aA(_,C),E=[];e._clusterLabels&&TK(i,E,n,y,e),e._clusterBillboards&&TK(o,E,n,y,e),e._clusterPoints&&TK(r,E,n,y,e);let I,x,S,w,v,P,N,L,p,b,T,B;if(E.length>0){let R=new eF(E.length,64,Uint32Array);for(let O=0;O<E.length;++O)R.add(E[O].coord.x,E[O].coord.y);if(R.finish(),A<g)for(S=h.length,I=0;I<S;++I){let O=h[I];if(!y.isPointVisible(O.position))continue;let U=So._computeScreenSpacePosition(M.IDENTITY,O.position,d.ZERO,F.ZERO,n);if(!l(U))continue;let k=1-A/g,z=O.width=O.width*k,Q=O.height=O.height*k;z=Math.max(z,O.minimumWidth),Q=Math.max(Q,O.minimumHeight);let H=U.x-z*.5,W=U.y-Q*.5,Z=U.x+z,Y=U.y+Q;for(v=R.range(H,W,Z,Y),P=v.length,b=0,p=[],x=0;x<P;++x)N=v[x],L=E[N],L.clustered||(++b,T=L.collection,B=L.index,p.push(T.get(B).id));if(b>=f)for(Ppe(O.position,b,p,e),m.push(O),x=0;x<P;++x)E[v[x]].clustered=!0}for(S=E.length,I=0;I<S;++I){let O=E[I];if(O.clustered)continue;O.clustered=!0,T=O.collection,B=O.index;let U=T.get(B);w=vpe(U,O.coord,u,e,jit);let k=Xe.clone(w,qit);v=R.range(w.x,w.y,w.x+w.width,w.y+w.height),P=v.length;let z=d.clone(U.position);for(b=1,p=[U.id],x=0;x<P;++x)if(N=v[x],L=E[N],!L.clustered){let Q=L.collection.get(L.index),H=vpe(Q,L.coord,u,e,Kit);d.add(Q.position,z,z),Xe.union(k,H,k),++b,p.push(Q.id)}if(b>=f){let Q=d.multiplyByScalar(z,1/b,z);for(Ppe(Q,b,p,e),m.push({position:Q,width:k.width,height:k.height,minimumWidth:w.width,minimumHeight:w.height}),x=0;x<P;++x)E[v[x]].clustered=!0}else Wit(U,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=m,e._previousHeight=A}}cA.prototype._initialize=function(e){this._scene=e;let t=Jit(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(cA.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 BK(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,u=this[n];u.length>0?(a=u.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function wK(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}cA.prototype.getLabel=BK("_labelCollection",Cm,"_unusedLabelIndices","labelIndex");cA.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,wK(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};cA.prototype.getBillboard=BK("_billboardCollection",ff,"_unusedBillboardIndices","billboardIndex");cA.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,wK(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};cA.prototype.getPoint=BK("_pointCollection",oS,"_unusedPointIndices","pointIndex");cA.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,wK(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function SK(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Xit(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,SK(e._labelCollection),SK(e._billboardCollection),SK(e._pointCollection))}cA.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,Xit(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)};cA.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 _f=cA;function DK(e){this._name=e,this._clock=void 0,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Da(this),this._entityCluster=new _f}Object.defineProperties(DK.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){gs.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}}});DK.prototype.update=function(e){return!0};var tF=DK;var Mpe={};Mpe.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),f,h=0,m=0,g=o?a*3:0,A=o?(a+i)*3:i*3;for(f=0;f<i;f++){let _=f/i*D.TWO_PI,C=Math.cos(_),y=Math.sin(_),E=C*n,I=y*n,x=C*t,S=y*t;u[m+g]=E,u[m+g+1]=I,u[m+g+2]=s,u[m+A]=x,u[m+A+1]=S,u[m+A+2]=r,m+=3,o&&(u[h++]=E,u[h++]=I,u[h++]=s,u[h++]=x,u[h++]=S,u[h++]=r)}return u};var r0=Mpe;var vK=new F,Zit=new d,$it=new d,eot=new d,tot=new d;function kg(e){e=e??V.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??Re.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Re.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}kg.packedLength=Re.packedLength+5;kg.pack=function(e,t,n){return n=n??0,Re.pack(e._vertexFormat,t,n),n+=Re.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 Re,rS={vertexFormat:Npe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};kg.unpack=function(e,t,n){t=t??0;let i=Re.unpack(e,t,Npe);t+=Re.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Re.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(rS.length=o,rS.topRadius=r,rS.bottomRadius=s,rS.slices=a,rS.offsetAttribute=c===-1?void 0:c,new kg(rS))};kg.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,u=r0.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,h=o.normal?new Float32Array(c*3):void 0,m=o.tangent?new Float32Array(c*3):void 0,g=o.bitangent?new Float32Array(c*3):void 0,A,_=o.normal||o.tangent||o.bitangent;if(_){let v=o.tangent||o.bitangent,P=0,N=0,L=0,p=Math.atan2(i-n,t),b=Zit;b.z=Math.sin(p);let T=Math.cos(p),B=eot,R=$it;for(A=0;A<r;A++){let O=A/r*D.TWO_PI,U=T*Math.cos(O),k=T*Math.sin(O);_&&(b.x=U,b.y=k,v&&(B=d.normalize(d.cross(d.UNIT_Z,b,B),B)),o.normal&&(h[P++]=b.x,h[P++]=b.y,h[P++]=b.z,h[P++]=b.x,h[P++]=b.y,h[P++]=b.z),o.tangent&&(m[N++]=B.x,m[N++]=B.y,m[N++]=B.z,m[N++]=B.x,m[N++]=B.y,m[N++]=B.z),o.bitangent&&(R=d.normalize(d.cross(b,B,R),R),g[L++]=R.x,g[L++]=R.y,g[L++]=R.z,g[L++]=R.x,g[L++]=R.y,g[L++]=R.z))}for(A=0;A<r;A++)o.normal&&(h[P++]=0,h[P++]=0,h[P++]=-1),o.tangent&&(m[N++]=1,m[N++]=0,m[N++]=0),o.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(A=0;A<r;A++)o.normal&&(h[P++]=0,h[P++]=0,h[P++]=1),o.tangent&&(m[N++]=1,m[N++]=0,m[N++]=0),o.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let C=12*r-12,y=Fe.createTypedArray(c,C),E=0,I=0;for(A=0;A<r-1;A++)y[E++]=I,y[E++]=I+2,y[E++]=I+3,y[E++]=I,y[E++]=I+3,y[E++]=I+1,I+=2;for(y[E++]=s-2,y[E++]=0,y[E++]=1,y[E++]=s-2,y[E++]=1,y[E++]=s-1,A=1;A<r-1;A++)y[E++]=s+A+1,y[E++]=s+A,y[E++]=s;for(A=1;A<r-1;A++)y[E++]=a,y[E++]=a+A,y[E++]=a+A+1;let x=0;if(o.st){let v=Math.max(n,i);for(A=0;A<c;A++){let P=d.fromArray(u,A*3,tot);f[x++]=(P.x+v)/(2*v),f[x++]=(P.y+v)/(2*v)}}let S=new pn;o.position&&(S.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(S.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(S.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(S.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(S.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:f})),vK.x=t*.5,vK.y=Math.max(i,n);let w=new le(d.ZERO,F.magnitude(vK));if(l(e._offsetAttribute)){t=u.length;let v=e._offsetAttribute===un.NONE?0:1,P=new Uint8Array(t/3).fill(v);S.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}return new ht({attributes:S,indices:y,primitiveType:Pe.TRIANGLES,boundingSphere:w,offsetAttribute:e._offsetAttribute})};var PK;kg.getUnitCylinder=function(){return l(PK)||(PK=kg.createGeometry(new kg({topRadius:1,bottomRadius:1,length:1,vertexFormat:Re.POSITION_ONLY}))),PK};var nF=kg;var RK=new F;function sS(e){e=e??V.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"}sS.packedLength=6;sS.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 s0={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};sS.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):(s0.length=i,s0.topRadius=o,s0.bottomRadius=r,s0.slices=s,s0.numberOfVerticalLines=a,s0.offsetAttribute=c===-1?void 0:c,new sS(s0))};sS.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=r0.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let _=Math.min(r,o);u=Math.round(o/_),c+=_}let f=Fe.createTypedArray(s,c*2),h=0,m;for(m=0;m<o-1;m++)f[h++]=m,f[h++]=m+1,f[h++]=m+o,f[h++]=m+1+o;if(f[h++]=o-1,f[h++]=0,f[h++]=o+o-1,f[h++]=o,r>0)for(m=0;m<o;m+=u)f[h++]=m,f[h++]=m+o;let g=new pn;g.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:a}),RK.x=t*.5,RK.y=Math.max(i,n);let A=new le(d.ZERO,F.magnitude(RK));if(l(e._offsetAttribute)){t=a.length;let _=e._offsetAttribute===un.NONE?0:1,C=new Uint8Array(t/3).fill(_);g.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}return new ht({attributes:g,indices:f,primitiveType:Pe.LINES,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var iF=sS;var Lpe=d.ZERO,Ope=new d,not=new d,Fpe=new G;function iot(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 Cf(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new iot(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Cf.prototype=Object.create(Ei.prototype),Cf.prototype.constructor=Cf);Object.defineProperties(Cf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Cf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof jt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Fpe)),l(a)||(a=G.WHITE),s.color=Xt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Lpe,Ope))),new Rt({id:t,geometry:new nF(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Cf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Fpe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Lpe,Ope))),new Rt({id:t,geometry:new iF(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Cf.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Cf.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)};Cf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!j.isConstant(t.slices)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.numberOfVerticalLines)};Cf.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,$e.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof jt?hn.VERTEX_FORMAT:xo.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=j.getValueOrUndefined(t.slices,Ke.MINIMUM_VALUE),i.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,Ke.MINIMUM_VALUE),i.offsetAttribute=n!==$e.NONE?un.ALL:void 0};Cf.prototype._onEntityPropertyChanged=Qp;Cf.DynamicGeometryUpdater=aS;function aS(e,t,n){yi.call(this,e,t,n)}l(Object.create)&&(aS.prototype=Object.create(yi.prototype),aS.prototype.constructor=aS);aS.prototype._isHidden=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(e.position,n,not);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||yi.prototype._isHidden.call(this,e,t,n)};aS.prototype._setOptions=function(e,t,n){let i=j.getValueOrDefault(t.heightReference,n,$e.NONE),o=this._options;o.length=j.getValueOrUndefined(t.length,n),o.topRadius=j.getValueOrUndefined(t.topRadius,n),o.bottomRadius=j.getValueOrUndefined(t.bottomRadius,n),o.slices=j.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==$e.NONE?un.ALL:void 0};var oF=Cf;var oot={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},_s=Object.freeze(oot);var rot={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},No=Object.freeze(rot);var sot={NONE:0,HOLD:1,EXTRAPOLATE:2},yf=Object.freeze(sot);var Qpe=mr(Yu(),1);function aot(e){let t=new Qpe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Ug=aot;var cot=D.factorial;function MK(e,t,n,i,o,r){let s=0,a,c,u;if(i>0){for(c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(r.push(c),s+=MK(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,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var x4={type:"Hermite"};x4.getRequiredDataPoints=function(e,t){return t=t??0,Math.max(Math.floor((e+1)/(t+1)),2)};x4.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,u,f,h=t.length,m=new Array(i);for(r=0;r<i;r++){o[r]=0;let C=new Array(h);for(m[r]=C,s=0;s<h;s++)C[s]=[]}let g=h,A=new Array(g);for(r=0;r<g;r++)A[r]=r;let _=h-1;for(c=0;c<i;c++){for(s=0;s<g;s++)f=A[s]*i+c,m[c][0].push(n[f]);for(r=1;r<g;r++){let C=!1;for(s=0;s<g-r;s++){let y=t[A[s]],E=t[A[s+r]],I;E-y<=0?(f=A[s]*i+i*r+c,I=n[f],m[c][r].push(I/cot(r))):(I=m[c][r-1][s+1]-m[c][r-1][s],m[c][r].push(I/(E-y))),C=C||I!==0}C||(_=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=_;r++){let C=MK(e,A,t,a,r,[]);for(c=0;c<i;c++){let y=m[c][r][0];o[c+a*i]+=y*C}}return o};var lot=[];x4.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let y=0;y<a;y++)s[y]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let y=0;y<o+1;y++)u[f*(o+1)+y]=f;let h=u.length,m=lot,g=uot(m,u,t,n,i,o),A=[],_=h*(h+1)/2,C=Math.min(g,r);for(let y=0;y<=C;y++)for(f=y;f<=g;f++){A.length=0;let E=MK(e,u,t,y,f,A),I=Math.floor(f*(1-f)/2)+h*f;for(let x=0;x<i;x++){let S=Math.floor(x*_),w=m[S+I];s[x+y*i]+=w*E}}return s};function uot(e,t,n,i,o,r){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let h=0;h<o;h++){let m=Math.floor(h*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+h,e[m+s]=i[a];for(let g=1;g<u;g++){let A=0,_=Math.floor(g*(1-g)/2)+u*g,C=!1;for(s=0;s<u-g;s++){let y=n[t[s]],E=n[t[s+g]],I,x;if(E-y<=0)a=t[s]*o*(r+1)+o*g+h,I=i[a],x=I/D.factorial(g),e[m+_+A]=x,A++;else{let S=Math.floor((g-1)*(2-g)/2)+u*(g-1);I=e[m+S+s+1]-e[m+S+s],x=I/(E-y),e[m+_+A]=x,A++}C=C||I!==0}C&&(c=Math.max(c,g))}}return c}var rF=x4;var NK={type:"Lagrange"};NK.getRequiredDataPoints=function(e){return Math.max(e+1,2)};NK.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 u=t[r]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var sF=NK;var LK={type:"Linear"};LK.getRequiredDataPoints=function(e){return 2};LK.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],u=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-c*a)/(u-c);return o};var a0=LK;function el(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}el.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new el),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};el.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new el(e.clock,e.cone,e.magnitude)};el.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new el(e.clock,e.cone,1)};el.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};el.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};el.prototype.equals=function(e){return el.equals(this,e)};el.prototype.clone=function(e){return el.clone(this,e)};el.prototype.equalsEpsilon=function(e,t){return el.equalsEpsilon(this,e,t)};el.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var aF=el;var dF=mr(Yu(),1);var OK;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?OK=function(){return performance.now()}:OK=function(){return Date.now()};var Oi=OK;function FK(e){e=e??V.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??_s.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new _e,this.onStop=new _e,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Oi(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??No.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(FK.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){J.equals(this._currentTime,e)||(this._clockStep===No.SYSTEM_CLOCK&&(this._clockStep=No.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===No.SYSTEM_CLOCK&&(this._clockStep=No.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===No.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===No.SYSTEM_CLOCK&&(this._clockStep=No.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});FK.prototype.tick=function(){let e=Oi(),t=J.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===No.SYSTEM_CLOCK)t=J.now(t);else{let i=this._multiplier;if(n===No.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===_s.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===_s.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 lA=FK;function c0(){this._definitionChanged=new _e,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(c0.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Il("startTime"),stopTime:Il("stopTime"),currentTime:Il("currentTime"),clockRange:Il("clockRange"),clockStep:Il("clockStep"),multiplier:Il("multiplier")});c0.prototype.clone=function(e){return l(e)||(e=new c0),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};c0.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};c0.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};c0.prototype.getValue=function(e){return l(e)||(e=new lA),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 uA=c0;var fot=G.WHITE,dot=.1,hot=new F(8,8),Aot=new F(0,0),mot=new F(1,1);function cS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(cS.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._cellAlpha)&&j.isConstant(this._lineCount)&&j.isConstant(this._lineThickness)&&j.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),cellAlpha:me("cellAlpha"),lineCount:me("lineCount"),lineThickness:me("lineThickness"),lineOffset:me("lineOffset")});cS.prototype.getType=function(e){return"Grid"};var pot=new J;cS.prototype.getValue=function(e,t){return l(e)||(e=J.now(pot)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,fot,t.color),t.cellAlpha=j.getValueOrDefault(this._cellAlpha,e,dot),t.lineCount=j.getValueOrClonedDefault(this._lineCount,e,hot,t.lineCount),t.lineThickness=j.getValueOrClonedDefault(this._lineThickness,e,mot,t.lineThickness),t.lineOffset=j.getValueOrClonedDefault(this._lineOffset,e,Aot,t.lineOffset),t};cS.prototype.equals=function(e){return this===e||e instanceof cS&&j.equals(this._color,e._color)&&j.equals(this._cellAlpha,e._cellAlpha)&&j.equals(this._lineCount,e._lineCount)&&j.equals(this._lineThickness,e._lineThickness)&&j.equals(this._lineOffset,e._lineOffset)};var lS=cS;function uS(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(uS.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});uS.prototype.getType=function(e){return"PolylineArrow"};var got=new J;uS.prototype.getValue=function(e,t){return l(e)||(e=J.now(got)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,G.WHITE,t.color),t};uS.prototype.equals=function(e){return this===e||e instanceof uS&&j.equals(this._color,e._color)};var fS=uS;var _ot=G.WHITE,Cot=G.TRANSPARENT,yot=16,Eot=255;function dS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(dS.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._gapColor)&&j.isConstant(this._dashLength)&&j.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),gapColor:me("gapColor"),dashLength:me("dashLength"),dashPattern:me("dashPattern")});dS.prototype.getType=function(e){return"PolylineDash"};var Iot=new J;dS.prototype.getValue=function(e,t){return l(e)||(e=J.now(Iot)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,_ot,t.color),t.gapColor=j.getValueOrClonedDefault(this._gapColor,e,Cot,t.gapColor),t.dashLength=j.getValueOrDefault(this._dashLength,e,yot,t.dashLength),t.dashPattern=j.getValueOrDefault(this._dashPattern,e,Eot,t.dashPattern),t};dS.prototype.equals=function(e){return this===e||e instanceof dS&&j.equals(this._color,e._color)&&j.equals(this._gapColor,e._gapColor)&&j.equals(this._dashLength,e._dashLength)&&j.equals(this._dashPattern,e._dashPattern)};var hS=dS;var bot=G.WHITE,xot=.25,Tot=1;function AS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(AS.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),glowPower:me("glowPower"),taperPower:me("taperPower")});AS.prototype.getType=function(e){return"PolylineGlow"};var Sot=new J;AS.prototype.getValue=function(e,t){return l(e)||(e=J.now(Sot)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,bot,t.color),t.glowPower=j.getValueOrDefault(this._glowPower,e,xot,t.glowPower),t.taperPower=j.getValueOrDefault(this._taperPower,e,Tot,t.taperPower),t};AS.prototype.equals=function(e){return this===e||e instanceof AS&&j.equals(this._color,e._color)&&j.equals(this._glowPower,e._glowPower)&&j.equals(this._taperPower,e._taperPower)};var mS=AS;var Bot=G.WHITE,wot=G.BLACK,Dot=1;function pS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(pS.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._outlineColor)&&j.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth")});pS.prototype.getType=function(e){return"PolylineOutline"};var vot=new J;pS.prototype.getValue=function(e,t){return l(e)||(e=J.now(vot)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,Bot,t.color),t.outlineColor=j.getValueOrClonedDefault(this._outlineColor,e,wot,t.outlineColor),t.outlineWidth=j.getValueOrDefault(this._outlineWidth,e,Dot),t};pS.prototype.equals=function(e){return this===e||e instanceof pS&&j.equals(this._color,e._color)&&j.equals(this._outlineColor,e._outlineColor)&&j.equals(this._outlineWidth,e._outlineWidth)};var ty=pS;function Gg(e,t){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new kr,this._referenceFrame=t??$i.FIXED,this.setValue(e)}Object.defineProperties(Gg.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(!j.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Pot=new J;Gg.prototype.getValue=function(e,t){return l(e)||(e=J.now(Pot)),this.getValueInReferenceFrame(e,$i.FIXED,t)};Gg.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};Gg.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,Gg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Gg.prototype.equals=function(e){return this===e||e instanceof Gg&&this._referenceFrame===e._referenceFrame&&j.arrayEquals(this._value,e._value)};Gg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var zg=Gg;function ny(e){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new kr,this.setValue(e)}Object.defineProperties(ny.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(!j.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var Rot=new J;ny.prototype.getValue=function(e,t){l(e)||(e=J.now(Rot));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};ny.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,ny.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};ny.prototype.equals=function(e){return this===e||e instanceof ny&&j.arrayEquals(this._value,e._value)};ny.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var gS=ny;function l0(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(Ef.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 Ef(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new _e,e.collectionChanged.addEventListener(Ef.prototype._onCollectionChanged,this)}Object.defineProperties(Ef.prototype,{isConstant:{get:function(){return j.isConstant(l0(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=l0(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 l0(this)}}});Ef.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 Ef(e,n,i)};var Mot=new J;Ef.prototype.getValue=function(e,t){let n=l0(this);return l(e)||(e=J.now(Mot)),l(n)?n.getValue(e,t):void 0};Ef.prototype.getValueInReferenceFrame=function(e,t,n){let i=l0(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Ef.prototype.getType=function(e){let t=l0(this);return l(t)?t.getType(e):void 0};Ef.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};Ef.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Ef.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Ef.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=l0(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Vg=Ef;var Not={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-D.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+D.TWO_PI:o}},Od=Not;var kpe={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 Upe(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 Gpe(e,t){return e instanceof J?e:typeof e=="string"?J.fromIso8601(e):J.addSeconds(t,e,new J)}var QK=[],kK=[];function T4(e,t,n,i,o){let r=0,s,a,c,u,f,h;for(;r<i.length;){f=Gpe(i[r],e),c=go(t,f,J.compare);let m=0,g=0;if(c<0){for(c=~c,u=c*o,a=void 0,h=t[c];r<i.length&&(f=Gpe(i[r],e),!(l(a)&&J.compare(a,f)>=0||l(h)&&J.compare(f,h)>=0));){for(QK[m++]=f,r=r+1,s=0;s<o;s++)kK[g++]=i[r],r=r+1;a=f}m>0&&(kK.length=g,Upe(n,u,kK),QK.length=m,Upe(t,c,QK))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function Fd(e,t){let n=e;n===Number&&(n=kpe);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 u=t[c];u===Number&&(u=kpe);let f=u.packedLength;i+=f,o+=u.packedInterpolationLength??f,s[c]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=a0,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 _e,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=yf.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=yf.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Fd.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 Lot=new J;Fd.prototype.getValue=function(e,t){l(e)||(e=J.now(Lot));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=go(n,e,J.compare);if(a<0){if(a=~a,a===0){let x=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===yf.NONE||o!==0&&J.secondsDifference(x,e)>o)return;if(this._backwardExtrapolationType===yf.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let x=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===yf.NONE||o!==0&&J.secondsDifference(e,x)>o)return;if(this._forwardExtrapolationType===yf.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,h=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let x=Math.min(f.getRequiredDataPoints(this._interpolationDegree,m),i);x!==this._numberOfPoints&&(this._numberOfPoints=x,c.length=x,u.length=x*h)}let g=this._numberOfPoints-1;if(g<1)return;let A=0,_=i-1;if(_-A+1>=g+1){let x=a-(g/2|0)-1;x<A&&(x=A);let S=x+g;S>_&&(S=_,x=S-g,x<A&&(x=A)),A=x,_=S}let y=_-A+1;for(let x=0;x<y;++x)c[x]=J.secondsDifference(n[A+x],n[_]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,A,_,u);else{let x=0,S=this._packedLength,w=A*S,v=(_+1)*S;for(;w<v;)u[x]=s[w],w++,x++}let E=J.secondsDifference(e,n[_]),I;if(m===0||!l(f.interpolate))I=f.interpolateOrderZero(E,c,u,h,this._interpolationResult);else{let x=Math.floor(h/(m+1));I=f.interpolate(E,c,u,x,m,m,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(I,s,A,_,t):r.unpack(I,0,t)}return r.unpack(s,a*this._packedLength,t)};Fd.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))};Fd.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)}T4(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Fd.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 u=n[c],f=i.length;for(let h=0;h<f;h++)i[h].pack(u[h],a,a.length)}T4(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Fd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Fd.prototype.addSamplesPackedArray=function(e,t){T4(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Fd.prototype.removeSample=function(e){let t=go(this._times,e,J.compare);return t<0?!1:(zpe(this,t,1),!0)};function zpe(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)}Fd.prototype.removeSamples=function(e){let t=this._times,n=go(t,e.start,J.compare);n<0?n=~n:e.isStartIncluded||++n;let i=go(t,e.stop,J.compare);i<0?i=~i:e.isStopIncluded&&++i,zpe(this,n,i-n)};Fd.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 u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};Fd._mergeNewSamples=T4;var If=Fd;function Qd(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=d}this._numberOfDerivatives=t,this._property=new If(d,n),this._definitionChanged=new _e,this._referenceFrame=e??$i.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Qd.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 Oot=new J;Qd.prototype.getValue=function(e,t){return l(e)||(e=J.now(Oot)),this.getValueInReferenceFrame(e,$i.FIXED,t)};Qd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Th.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Qd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Qd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Qd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Qd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Qd.prototype.removeSample=function(e){return this._property.removeSample(e)};Qd.prototype.removeSamples=function(e){this._property.removeSamples(e)};Qd.prototype.equals=function(e){return this===e||e instanceof Qd&&j.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var nc=Qd;var Fot={HORIZONTAL:0,VERTICAL:1},fA=Object.freeze(Fot);var Qot=fA.HORIZONTAL,kot=G.WHITE,Uot=G.BLACK,Got=0,zot=1;function _S(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(_S.prototype,{isConstant:{get:function(){return j.isConstant(this._orientation)&&j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._offset)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:me("orientation"),evenColor:me("evenColor"),oddColor:me("oddColor"),offset:me("offset"),repeat:me("repeat")});_S.prototype.getType=function(e){return"Stripe"};var Vot=new J;_S.prototype.getValue=function(e,t){return l(e)||(e=J.now(Vot)),l(t)||(t={}),t.horizontal=j.getValueOrDefault(this._orientation,e,Qot)===fA.HORIZONTAL,t.evenColor=j.getValueOrClonedDefault(this._evenColor,e,kot,t.evenColor),t.oddColor=j.getValueOrClonedDefault(this._oddColor,e,Uot,t.oddColor),t.offset=j.getValueOrDefault(this._offset,e,Got),t.repeat=j.getValueOrDefault(this._repeat,e,zot),t};_S.prototype.equals=function(e){return this===e||e instanceof _S&&j.equals(this._orientation,e._orientation)&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._offset,e._offset)&&j.equals(this._repeat,e._repeat)};var CS=_S;function iy(e){this._definitionChanged=new _e,this._intervals=new ps,this._intervals.changedEvent.addEventListener(iy.prototype._intervalsChanged,this),this._referenceFrame=e??$i.FIXED}Object.defineProperties(iy.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 Hot=new J;iy.prototype.getValue=function(e,t){return l(e)||(e=J.now(Hot)),this.getValueInReferenceFrame(e,$i.FIXED,t)};iy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Th.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};iy.prototype.equals=function(e){return this===e||e instanceof iy&&this._intervals.equals(e._intervals,j.equals)&&this._referenceFrame===e._referenceFrame};iy.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Hg=iy;function u0(){this._definitionChanged=new _e,this._intervals=new ps,this._intervals.changedEvent.addEventListener(u0.prototype._intervalsChanged,this)}Object.defineProperties(u0.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Yot=new J;u0.prototype.getValue=function(e,t){l(e)||(e=J.now(Yot));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};u0.prototype.equals=function(e){return this===e||e instanceof u0&&this._intervals.equals(e._intervals,j.equals)};u0.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Yg=u0;function yS(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new _e,this._normalize=t??!0,this.position=e}Object.defineProperties(yS.prototype,{isConstant:{get:function(){return j.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 Wot=new d,Vpe=new d,Hpe=new J,jot=new J,UK=1/60;yS.prototype.getValue=function(e,t){return this._getValue(e,t)};yS.prototype._getValue=function(e,t,n){l(e)||(e=J.now(jot)),l(t)||(t=new d);let i=this._position;if(j.isConstant(i))return this._normalize?void 0:d.clone(d.ZERO,t);let o=i.getValue(e,Wot),r=i.getValue(J.addSeconds(e,UK,Hpe),Vpe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(J.addSeconds(e,-UK,Hpe),Vpe),!l(o)))return;if(d.equals(o,r))return this._normalize?void 0:d.clone(d.ZERO,t);l(n)&&o.clone(n);let s=d.subtract(r,o,t);return this._normalize?d.normalize(s,t):d.divideByScalar(s,UK,t)};yS.prototype.equals=function(e){return this===e||e instanceof yS&&j.equals(this._position,e._position)};var Wg=yS;function cF(e,t){this._velocityVectorProperty=new Wg(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new _e,this.ellipsoid=t??te.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(cF.prototype,{isConstant:{get:function(){return j.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 Ype=new d,qot=new d,Wpe=new X,Kot=new J;cF.prototype.getValue=function(e,t){l(e)||(e=J.now(Kot));let n=this._velocityVectorProperty._getValue(e,qot,Ype);if(l(n))return It.rotationMatrixFromPositionVelocity(Ype,n,this._ellipsoid,Wpe),Qe.fromRotationMatrix(Wpe,t)};cF.prototype.equals=function(e){return this===e||e instanceof cF&&j.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var lF=cF;var jg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};jg.validate=function(e){return e===jg.COMPLETE||e===jg.BELOW_ELLIPSOID_HORIZON||e===jg.ABOVE_ELLIPSOID_HORIZON};jg.toString=function(e){switch(e){case jg.COMPLETE:return"COMPLETE";case jg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case jg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new Ae("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var ES=jg;function oy(){}oy.packedLength=d.packedLength;oy.unpack=d.unpack;oy.pack=d.pack;var GK;function uF(e,t){return t[0]==="#"&&(t=GK+t),Vg.fromString(e,t)}function jpe(e,t,n){if(l(n.reference))return uF(t,n.reference);if(l(n.velocityReference)){let i=uF(t,n.velocityReference);switch(e){case d:case oy:return new Wg(i,e===oy);case Qe:return new lF(i)}}throw new ue(`${JSON.stringify(n)} is not valid CZML.`)}function Jot(e,t){return new Dh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var oo=new d,zl=new aF,tl=new he,f0=new wn,S4=new Qe;function Xot(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===G.packedLength)return[G.byteToFloat(n[0]),G.byteToFloat(n[1]),G.byteToFloat(n[2]),G.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=G.byteToFloat(n[o+1]),t[o+2]=G.byteToFloat(n[o+2]),t[o+3]=G.byteToFloat(n[o+3]),t[o+4]=G.byteToFloat(n[o+4]);return t}function qpe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):Be.createIfNeeded(n)}function Zot(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ce.packedLength)return[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=D.toRadians(n[o+1]),t[o+2]=D.toRadians(n[o+2]),t[o+3]=D.toRadians(n[o+3]),t[o+4]=D.toRadians(n[o+4]);return t}function $ot(e){let t=e.length;if(zl.magnitude=1,t===2)return zl.clock=e[0],zl.cone=e[1],d.fromSpherical(zl,oo),[oo.x,oo.y,oo.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],zl.clock=e[i+1],zl.cone=e[i+2],d.fromSpherical(zl,oo),n[o+1]=oo.x,n[o+2]=oo.y,n[o+3]=oo.z;return n}function ert(e){let t=e.length;if(t===3)return zl.clock=e[0],zl.cone=e[1],zl.magnitude=e[2],d.fromSpherical(zl,oo),[oo.x,oo.y,oo.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],zl.clock=e[i+1],zl.cone=e[i+2],zl.magnitude=e[i+3],d.fromSpherical(zl,oo),n[i+1]=oo.x,n[i+2]=oo.y,n[i+3]=oo.z;return n}function trt(e){let t=e.length;if(t===3)return tl.longitude=e[0],tl.latitude=e[1],tl.height=e[2],te.default.cartographicToCartesian(tl,oo),[oo.x,oo.y,oo.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],tl.longitude=e[i+1],tl.latitude=e[i+2],tl.height=e[i+3],te.default.cartographicToCartesian(tl,oo),n[i+1]=oo.x,n[i+2]=oo.y,n[i+3]=oo.z;return n}function nrt(e){let t=e.length;if(t===3)return tl.longitude=D.toRadians(e[0]),tl.latitude=D.toRadians(e[1]),tl.height=e[2],te.default.cartographicToCartesian(tl,oo),[oo.x,oo.y,oo.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],tl.longitude=D.toRadians(e[i+1]),tl.latitude=D.toRadians(e[i+2]),tl.height=e[i+3],te.default.cartographicToCartesian(tl,oo),n[i+1]=oo.x,n[i+2]=oo.y,n[i+3]=oo.z;return n}function zK(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 $ot(o);let r=e.spherical;if(l(r))return ert(r);let s=e.cartographicRadians;if(l(s))return trt(s);let a=e.cartographicDegrees;if(l(a))return nrt(a);throw new ue(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Kpe(e,t){d.unpack(e,t,oo),d.normalize(oo,oo),d.pack(oo,e,t)}function irt(e){let t=zK(e);if(t.length===3)return Kpe(t,0),t;for(let n=1;n<t.length;n+=4)Kpe(t,n);return t}function Jpe(e,t){Qe.unpack(e,t,S4),Qe.normalize(S4,S4),Qe.pack(S4,e,t)}function ort(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return Jpe(t,0),t;for(let n=1;n<t.length;n+=5)Jpe(t,n)}return t}function Xpe(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")?Xe:e.hasOwnProperty("cartesian2")?F:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?d:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?oy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?G:e.hasOwnProperty("arcType")?an:e.hasOwnProperty("classificationType")?Jn:e.hasOwnProperty("colorBlendMode")?Yc:e.hasOwnProperty("cornerType")?ji:e.hasOwnProperty("heightReference")?$e:e.hasOwnProperty("horizontalOrigin")?Mi:e.hasOwnProperty("date")?J:e.hasOwnProperty("labelStyle")?cr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Ht:e.hasOwnProperty("distanceDisplayCondition")?Qt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Qe:e.hasOwnProperty("shadowMode")?Tn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?fA:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?dF.default:e.hasOwnProperty("verticalOrigin")?Gn:Object}function rrt(e,t,n){switch(e){case an:return an[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case Xe:return t.boundingRectangle;case F:return t.cartesian2;case d:return zK(t);case oy:return irt(t);case G:return Xot(t);case Jn:return Jn[t.classificationType??t];case Yc:return Yc[t.colorBlendMode??t];case ji:return ji[t.cornerType??t];case $e:return $e[t.heightReference??t];case Mi:return Mi[t.horizontalOrigin??t];case Image:return qpe(t,n);case J:return J.fromIso8601(t.date??t);case cr:return cr[t.labelStyle??t];case Number:return t.number??t;case Ht:return t.nearFarScalar;case Qt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Qe:return ort(t);case Od:return t.number??t;case ES:return ES[t.portionToDisplay??t];case Tn:return Tn[t.shadowMode??t.shadows??t];case String:return t.string??t;case fA:return fA[t.stripeOrientation??t];case ce:return Zot(t);case dF.default:return qpe(t,n);case Gn:return Gn[t.verticalOrigin??t];default:throw new ue(`Unknown CzmlDataSource interval type: ${e}`)}}var srt={HERMITE:rF,LAGRANGE:sF,LINEAR:a0};function B4(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:srt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=yf[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=yf[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Zpe={iso8601:void 0};function Ur(e){if(l(e))return Zpe.iso8601=e,wn.fromIso8601(Zpe)}function VK(e){let t=Ke.MAXIMUM_INTERVAL.clone();return t.data=e,t}function $pe(e){let t=new Zc;return t.intervals.addInterval(VK(e)),t}function ege(e){let t=new ec(e.referenceFrame);return t.intervals.addInterval(VK(e)),t}function w4(e,t,n,i,o,r,s){let a=Ur(i.interval);l(o)&&(l(a)?a=wn.intersect(a,o,f0):a=o);let c,u,f,h=!l(i.reference)&&!l(i.velocityReference),m=l(a)&&!a.equals(Ke.MAXIMUM_INTERVAL);if(i.delete===!0){if(!m){t[n]=void 0;return}return fge(t[n],a)}let g=!1;if(h){if(u=rrt(e,i,r),!l(u))return;c=e.packedLength??1,f=u.length??1,g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let A=typeof e.unpack=="function"&&e!==Od;if(!g&&!m){h?t[n]=new li(A?e.unpack(u,0):u):t[n]=jpe(e,s,i);return}let _=t[n],C,y=i.epoch;if(l(y)&&(C=J.fromIso8601(y)),g&&!m){_ instanceof If||(t[n]=_=new If(e)),_.addSamplesPackedArray(u,C),B4(i,_);return}let E;if(!g&&m){a=a.clone(),h?a.data=A?e.unpack(u,0):u:a.data=jpe(e,s,i),l(_)||(t[n]=_=h?new Yg:new Zc),h&&_ instanceof Yg?_.intervals.addInterval(a):_ instanceof Zc?(h&&(a.data=new li(a.data)),_.intervals.addInterval(a)):(t[n]=_=$pe(_),h&&(a.data=new li(a.data)),_.intervals.addInterval(a));return}l(_)||(t[n]=_=new Zc),_ instanceof Zc||(t[n]=_=$pe(_));let I=_.intervals;E=I.findInterval(a),(!l(E)||!(E.data instanceof If))&&(E=a.clone(),E.data=new If(e),I.addInterval(E)),E.data.addSamplesPackedArray(u,C),B4(i,E.data)}function fge(e,t){if(e instanceof If){e.removeSamples(t);return}else if(e instanceof Yg){e.intervals.removeInterval(t);return}else if(e instanceof Zc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=wn.intersect(n.get(i),t,f0);o.isEmpty||fge(o.data,t)}n.removeInterval(t);return}}function Ee(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)w4(e,t,n,i[a],o,r,s);else w4(e,t,n,i,o,r,s)}function tge(e,t,n,i,o,r){let s=Ur(n.interval);l(i)&&(l(s)?s=wn.intersect(s,i,f0):s=i);let a=l(n.cartesianVelocity)?1:0,c=d.packedLength*(a+1),u,f,h=!l(n.reference),m=l(s)&&!s.equals(Ke.MAXIMUM_INTERVAL);if(n.delete===!0){if(!m){e[t]=void 0;return}return dge(e[t],s)}let g,A=!1;if(h&&(l(n.referenceFrame)&&(g=$i[n.referenceFrame]),g=g??$i.FIXED,u=zK(n),f=u.length??1,A=f>c),!A&&!m){h?e[t]=new El(d.unpack(u),g):e[t]=uF(r,n.reference);return}let _=e[t],C,y=n.epoch;if(l(y)&&(C=J.fromIso8601(y)),A&&!m){(!(_ instanceof nc)||l(g)&&_.referenceFrame!==g)&&(e[t]=_=new nc(g,a)),_.addSamplesPackedArray(u,C),B4(n,_);return}let E;if(!A&&m){s=s.clone(),h?s.data=d.unpack(u):s.data=uF(r,n.reference),l(_)||(h?_=new Hg(g):_=new ec(g),e[t]=_),h&&_ instanceof Hg&&l(g)&&_.referenceFrame===g?_.intervals.addInterval(s):_ instanceof ec?(h&&(s.data=new El(s.data,g)),_.intervals.addInterval(s)):(e[t]=_=ege(_),h&&(s.data=new El(s.data,g)),_.intervals.addInterval(s));return}l(_)?_ instanceof ec||(e[t]=_=ege(_)):e[t]=_=new ec(g);let I=_.intervals;E=I.findInterval(s),(!l(E)||!(E.data instanceof nc)||l(g)&&E.data.referenceFrame!==g)&&(E=s.clone(),E.data=new nc(g,a),I.addInterval(E)),E.data.addSamplesPackedArray(u,C),B4(n,E.data)}function dge(e,t){if(e instanceof nc){e.removeSamples(t);return}else if(e instanceof Hg){e.intervals.removeInterval(t);return}else if(e instanceof ec){let n=e.intervals;for(let i=0;i<n.length;++i){let o=wn.intersect(n.get(i),t,f0);o.isEmpty||dge(o.data,t)}n.removeInterval(t);return}}function hge(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)tge(e,t,n[s],i,o,r);else tge(e,t,n,i,o,r)}function nge(e,t,n,i){l(n.references)?D4(e,t,n.references,n.interval,i,gS,Zc):(l(n.cartesian2)?n.array=F.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=F.unpackArray(n.cartesian)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function ige(e,t,n,i,o,r){let s=Ur(n.interval);l(i)&&(l(s)?s=wn.intersect(s,i,f0):s=i);let a=e[t],c,u;if(l(s)){a instanceof $T||(a=new $T,e[t]=a);let h=a.intervals;u=h.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),h.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof jt||(c=new jt),f=n.solidColor,Ee(G,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof lS||(c=new lS),f=n.grid,Ee(G,c,"color",f.color,void 0,o,r),Ee(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),Ee(F,c,"lineCount",f.lineCount,void 0,o,r),Ee(F,c,"lineThickness",f.lineThickness,void 0,o,r),Ee(F,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof J_||(c=new J_),f=n.image,Ee(Image,c,"image",f.image,void 0,o,r),Ee(F,c,"repeat",f.repeat,void 0,o,r),Ee(G,c,"color",f.color,void 0,o,r),Ee(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof CS||(c=new CS),f=n.stripe,Ee(fA,c,"orientation",f.orientation,void 0,o,r),Ee(G,c,"evenColor",f.evenColor,void 0,o,r),Ee(G,c,"oddColor",f.oddColor,void 0,o,r),Ee(Number,c,"offset",f.offset,void 0,o,r),Ee(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof ty||(c=new ty),f=n.polylineOutline,Ee(G,c,"color",f.color,void 0,o,r),Ee(G,c,"outlineColor",f.outlineColor,void 0,o,r),Ee(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof mS||(c=new mS),f=n.polylineGlow,Ee(G,c,"color",f.color,void 0,o,r),Ee(Number,c,"glowPower",f.glowPower,void 0,o,r),Ee(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof fS||(c=new fS),f=n.polylineArrow,Ee(G,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof hS||(c=new hS),f=n.polylineDash,Ee(G,c,"color",f.color,void 0,void 0,r),Ee(G,c,"gapColor",f.gapColor,void 0,void 0,r),Ee(Number,c,"dashLength",f.dashLength,void 0,o,r),Ee(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof XT||(c=new XT),f=n.checkerboard,Ee(G,c,"evenColor",f.evenColor,void 0,o,r),Ee(G,c,"oddColor",f.oddColor,void 0,o,r),Ee(F,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function bf(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)ige(e,t,n[s],i,o,r);else ige(e,t,n,i,o,r)}function art(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function crt(e,t,n,i){let o=t.description;l(o)&&Ee(String,e,"description",o,void 0,i,n)}function lrt(e,t,n,i){let o=t.position;l(o)&&hge(e,"position",o,void 0,i,n)}function urt(e,t,n,i){let o=t.viewFrom;l(o)&&Ee(d,e,"viewFrom",o,void 0,i,n)}function frt(e,t,n,i){let o=t.orientation;l(o)&&Ee(Qe,e,"orientation",o,void 0,i,n)}function drt(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new bl);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)w4(Xpe(s[a]),e.properties,r,s[a],void 0,i,n);else w4(Xpe(s),e.properties,r,s,void 0,i,n)}}}function D4(e,t,n,i,o,r,s){let a=n.map(function(c){return uF(o,c)});if(l(i)){i=Ur(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(VK(c)),e[t]=c=u}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function oge(e,t,n,i){let o=n.references;l(o)?D4(e,t,o,n.interval,i,gS,Zc):Ee(Array,e,t,n,void 0,void 0,i)}function rge(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)oge(e,t,n[o],i);else oge(e,t,n,i)}function sge(e,t,n,i){let o=n.references;l(o)?D4(e,t,o,n.interval,i,zg,ec):(l(n.cartesian)?n.array=d.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=d.fromRadiansArrayHeights(n.cartographicRadians,te.default):l(n.cartographicDegrees)&&(n.array=d.fromDegreesArrayHeights(n.cartographicDegrees,te.default)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function hF(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)sge(e,t,n[o],i);else sge(e,t,n,i)}function hrt(e){return d.unpackArray(e)}function Art(e){return d.fromRadiansArrayHeights(e,te.default)}function mrt(e){return d.fromDegreesArrayHeights(e,te.default)}function age(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return D4(a,"positions",s,n.interval,i,zg,ec),a.positions});e[t]=new zg(r)}else l(n.cartesian)?n.array=n.cartesian.map(hrt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(Art):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(mrt)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function prt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)age(e,t,n[o],i);else age(e,t,n,i)}function grt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)nge(e,t,n[o],i);else nge(e,t,n,i)}function _rt(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 ps),r.addInterval(Ur(o[s]));else r=new ps,r.addInterval(Ur(o));e.availability=r}function Crt(e,t,n,i,o){l(t)&&Ee(oy,e,"alignedAxis",t,n,i,o)}function yrt(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=Ur(o.interval),s=e.billboard;l(s)||(e.billboard=s=new Qc),Ee(Boolean,s,"show",o.show,r,i,n),Ee(Image,s,"image",o.image,r,i,n),Ee(Number,s,"scale",o.scale,r,i,n),Ee(F,s,"pixelOffset",o.pixelOffset,r,i,n),Ee(d,s,"eyeOffset",o.eyeOffset,r,i,n),Ee(Mi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ee(Gn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(G,s,"color",o.color,r,i,n),Ee(Od,s,"rotation",o.rotation,r,i,n),Crt(s,o.alignedAxis,r,i,n),Ee(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),Ee(Number,s,"width",o.width,r,i,n),Ee(Number,s,"height",o.height,r,i,n),Ee(Ht,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ee(Ht,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ee(Ht,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ee(Xe,s,"imageSubRegion",o.imageSubRegion,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Ert(e,t,n,i){let o=t.box;if(!l(o))return;let r=Ur(o.interval),s=e.box;l(s)||(e.box=s=new UE),Ee(Boolean,s,"show",o.show,r,i,n),Ee(d,s,"dimensions",o.dimensions,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(Boolean,s,"fill",o.fill,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Boolean,s,"outline",o.outline,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Irt(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=Ur(o.interval),s=e.corridor;l(s)||(e.corridor=s=new zE),Ee(Boolean,s,"show",o.show,r,i,n),hF(s,"positions",o.positions,n),Ee(Number,s,"width",o.width,r,i,n),Ee(Number,s,"height",o.height,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ee($e,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(ji,s,"cornerType",o.cornerType,r,i,n),Ee(Number,s,"granularity",o.granularity,r,i,n),Ee(Boolean,s,"fill",o.fill,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Boolean,s,"outline",o.outline,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Jn,s,"classificationType",o.classificationType,r,i,n),Ee(Number,s,"zIndex",o.zIndex,r,i,n)}function brt(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=Ur(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new VE),Ee(Boolean,s,"show",o.show,r,i,n),Ee(Number,s,"length",o.length,r,i,n),Ee(Number,s,"topRadius",o.topRadius,r,i,n),Ee(Number,s,"bottomRadius",o.bottomRadius,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(Boolean,s,"fill",o.fill,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Boolean,s,"outline",o.outline,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ee(Number,s,"slices",o.slices,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function xrt(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 ue("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new ue("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 Trt(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=Ur(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new HE),Ee(Boolean,s,"show",o.show,r,i,n),Ee(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),Ee(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),Ee(Number,s,"height",o.height,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ee($e,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Od,s,"rotation",o.rotation,r,i,n),Ee(Od,s,"stRotation",o.stRotation,r,i,n),Ee(Number,s,"granularity",o.granularity,r,i,n),Ee(Boolean,s,"fill",o.fill,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Boolean,s,"outline",o.outline,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Jn,s,"classificationType",o.classificationType,r,i,n),Ee(Number,s,"zIndex",o.zIndex,r,i,n)}function Srt(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=Ur(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new YE),Ee(Boolean,s,"show",o.show,r,i,n),Ee(d,s,"radii",o.radii,r,i,n),Ee(d,s,"innerRadii",o.innerRadii,r,i,n),Ee(Number,s,"minimumClock",o.minimumClock,r,i,n),Ee(Number,s,"maximumClock",o.maximumClock,r,i,n),Ee(Number,s,"minimumCone",o.minimumCone,r,i,n),Ee(Number,s,"maximumCone",o.maximumCone,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(Boolean,s,"fill",o.fill,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Boolean,s,"outline",o.outline,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,s,"stackPartitions",o.stackPartitions,r,i,n),Ee(Number,s,"slicePartitions",o.slicePartitions,r,i,n),Ee(Number,s,"subdivisions",o.subdivisions,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Brt(e,t,n,i){let o=t.label;if(!l(o))return;let r=Ur(o.interval),s=e.label;l(s)||(e.label=s=new Sh),Ee(Boolean,s,"show",o.show,r,i,n),Ee(String,s,"text",o.text,r,i,n),Ee(String,s,"font",o.font,r,i,n),Ee(cr,s,"style",o.style,r,i,n),Ee(Number,s,"scale",o.scale,r,i,n),Ee(Boolean,s,"showBackground",o.showBackground,r,i,n),Ee(G,s,"backgroundColor",o.backgroundColor,r,i,n),Ee(F,s,"backgroundPadding",o.backgroundPadding,r,i,n),Ee(F,s,"pixelOffset",o.pixelOffset,r,i,n),Ee(d,s,"eyeOffset",o.eyeOffset,r,i,n),Ee(Mi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ee(Gn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(G,s,"fillColor",o.fillColor,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Ht,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ee(Ht,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ee(Ht,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function wrt(e,t,n,i){let o=t.model;if(!l(o))return;let r=Ur(o.interval),s=e.model;l(s)||(e.model=s=new Lp),Ee(Boolean,s,"show",o.show,r,i,n),Ee(dF.default,s,"uri",o.gltf,r,i,n),Ee(Number,s,"scale",o.scale,r,i,n),Ee(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),Ee(Number,s,"maximumScale",o.maximumScale,r,i,n),Ee(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Ee(Boolean,s,"runAnimations",o.runAnimations,r,i,n),Ee(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(G,s,"silhouetteColor",o.silhouetteColor,r,i,n),Ee(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),Ee(G,s,"color",o.color,r,i,n),Ee(Yc,s,"colorBlendMode",o.colorBlendMode,r,i,n),Ee(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)cge(s,u[a],r,i,n);else cge(s,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)lge(s,f[a],r,i,n);else lge(s,f,r,i,n)}function cge(e,t,n,i,o){let r=Ur(t.interval);l(n)&&(l(r)?r=wn.intersect(r,n,f0):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let h=t[f];if(!l(h))continue;l(s)||(e.nodeTransformations=s=new bl),s.hasProperty(f)||s.addProperty(f);let m=s[f];l(m)||(s[f]=m=new WE),Ee(d,m,"translation",h.translation,r,i,o),Ee(Qe,m,"rotation",h.rotation,r,i,o),Ee(d,m,"scale",h.scale,r,i,o)}}function lge(e,t,n,i,o){let r=Ur(t.interval);l(n)&&(l(r)?r=wn.intersect(r,n,f0):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let h=t[f];l(h)&&(l(s)||(e.articulations=s=new bl),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,h,r,i,o))}}function Drt(e,t,n,i){let o=t.path;if(!l(o))return;let r=Ur(o.interval),s=e.path;l(s)||(e.path=s=new Op),Ee(Boolean,s,"show",o.show,r,i,n),Ee(Number,s,"leadTime",o.leadTime,r,i,n),Ee(Number,s,"trailTime",o.trailTime,r,i,n),Ee(Number,s,"width",o.width,r,i,n),Ee(Number,s,"resolution",o.resolution,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function vrt(e,t,n,i){let o=t.point;if(!l(o))return;let r=Ur(o.interval),s=e.point;l(s)||(e.point=s=new qE),Ee(Boolean,s,"show",o.show,r,i,n),Ee(Number,s,"pixelSize",o.pixelSize,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(G,s,"color",o.color,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Ht,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ee(Ht,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function fF(e){this.polygon=e,this._definitionChanged=new _e}Object.defineProperties(fF.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}}});fF.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 Cc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Cc(n,i)};fF.prototype.equals=function(e){return this===e||e instanceof fF&&j.equals(this.polygon._positions,e.polygon._positions)&&j.equals(this.polygon._holes,e.polygon._holes)};function Prt(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=Ur(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Bh),Ee(Boolean,s,"show",o.show,r,i,n),hF(s,"_positions",o.positions,n),prt(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new fF(s)),Ee(Number,s,"height",o.height,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ee($e,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Od,s,"stRotation",o.stRotation,r,i,n),Ee(Number,s,"granularity",o.granularity,r,i,n),Ee(Boolean,s,"fill",o.fill,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Boolean,s,"outline",o.outline,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),Ee(Boolean,s,"closeTop",o.closeTop,r,i,n),Ee(Boolean,s,"closeBottom",o.closeBottom,r,i,n),Ee(an,s,"arcType",o.arcType,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Jn,s,"classificationType",o.classificationType,r,i,n),Ee(Number,s,"zIndex",o.zIndex,r,i,n)}function Rrt(e){return e?an.GEODESIC:an.NONE}function Mrt(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=Ur(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Uc),Ee(Boolean,s,"show",o.show,r,i,n),hF(s,"positions",o.positions,n),Ee(Number,s,"width",o.width,r,i,n),Ee(Number,s,"granularity",o.granularity,r,i,n),bf(s,"material",o.material,r,i,n),bf(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),Ee(an,s,"arcType",o.arcType,r,i,n),Ee(Boolean,s,"clampToGround",o.clampToGround,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Jn,s,"classificationType",o.classificationType,r,i,n),Ee(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};Ee(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=Jot(a.followSurface,Rrt)}}function Nrt(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=Ur(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new KE),hF(s,"positions",o.positions,n),grt(s,"shape",o.shape,n),Ee(Boolean,s,"show",o.show,r,i,n),Ee(ji,s,"cornerType",o.cornerType,r,i,n),Ee(Boolean,s,"fill",o.fill,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Boolean,s,"outline",o.outline,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,s,"granularity",o.granularity,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Lrt(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=Ur(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new wh),Ee(Boolean,s,"show",o.show,r,i,n),Ee(ce,s,"coordinates",o.coordinates,r,i,n),Ee(Number,s,"height",o.height,r,i,n),Ee($e,s,"heightReference",o.heightReference,r,i,n),Ee(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ee($e,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Od,s,"rotation",o.rotation,r,i,n),Ee(Od,s,"stRotation",o.stRotation,r,i,n),Ee(Number,s,"granularity",o.granularity,r,i,n),Ee(Boolean,s,"fill",o.fill,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Boolean,s,"outline",o.outline,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Jn,s,"classificationType",o.classificationType,r,i,n),Ee(Number,s,"zIndex",o.zIndex,r,i,n)}function Ort(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=Ur(o.interval),s=e.tileset;l(s)||(e.tileset=s=new jE),Ee(Boolean,s,"show",o.show,r,i,n),Ee(dF.default,s,"uri",o.uri,r,i,n),Ee(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function Frt(e,t,n,i){let o=t.wall;if(!l(o))return;let r=Ur(o.interval),s=e.wall;l(s)||(e.wall=s=new Fp),Ee(Boolean,s,"show",o.show,r,i,n),hF(s,"positions",o.positions,n),rge(s,"minimumHeights",o.minimumHeights,n),rge(s,"maximumHeights",o.maximumHeights,n),Ee(Number,s,"granularity",o.granularity,r,i,n),Ee(Boolean,s,"fill",o.fill,r,i,n),bf(s,"material",o.material,r,i,n),Ee(Boolean,s,"outline",o.outline,r,i,n),Ee(G,s,"outlineColor",o.outlineColor,r,i,n),Ee(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ee(Tn,s,"shadows",o.shadows,r,i,n),Ee(Qt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function uge(e,t,n,i,o){let r=e.id;if(l(r)||(r=jn()),GK=r,!l(o._version)&&r!=="document")throw new ue("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")xrt(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)}GK=void 0}function Qrt(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 uA,t.startTime=J.clone(r),t.stopTime=J.clone(s),t.clockRange=_s.LOOP_STOP,t.multiplier=c,t.currentTime=J.clone(r),t.clockStep=No.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new uA,t.startTime=Ke.MINIMUM_VALUE.clone(),t.stopTime=Ke.MAXIMUM_VALUE.clone(),t.currentTime=Ke.MINIMUM_VALUE.clone(),t.clockRange=_s.LOOP_STOP,t.clockStep=No.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Ur(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=_s[n.range]??_s.LOOP_STOP),l(n.step)&&(t.clockStep=No[n.step]??No.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Age(e,t,n,i){n=n??V.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new pt(s)),e._credit=s,typeof t=="string"||t instanceof Be){t=Be.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return r=Be.createIfNeeded(r),gs.setLoading(e,!0),Promise.resolve(o).then(function(a){return krt(e,a,r,i)}).catch(function(a){return gs.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function krt(e,t,n,i){gs.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new mge,o.removeAll()),Ws._processCzml(t,o,n,void 0,e);let r=Qrt(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=Ug(n.getUrlComponent()),r=!0),gs.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function mge(){this.name=void 0,this.clock=void 0}function Ws(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._clock=void 0,this._documentPacket=new mge,this._version=void 0,this._entityCollection=new Da(this),this._entityCluster=new _f,this._credit=void 0,this._resourceCredits=[]}Ws.load=function(e,t){return new Ws().load(e,t)};Object.defineProperties(Ws.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}}});Ws.updaters=[yrt,Ert,Irt,brt,Trt,Srt,Brt,wrt,art,crt,Drt,vrt,Prt,Mrt,Nrt,drt,Lrt,lrt,Ort,urt,Frt,frt,_rt];Ws.registerUpdater=function(e){Ws.updaters.includes(e)||Ws.updaters.push(e)};Ws.unregisterUpdater=function(e){if(Ws.updaters.includes(e)){let t=Ws.updaters.indexOf(e);Ws.updaters.splice(t,1)}};Ws.prototype.process=function(e,t){return Age(this,e,t,!1)};Ws.prototype.load=function(e,t){return Age(this,e,t,!0)};Ws.prototype.update=function(e){return!0};Ws.processPacketData=Ee;Ws.processPositionPacketData=hge;Ws.processMaterialPacketData=bf;Ws._processCzml=function(e,t,n,i,o){if(i=i??Ws.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)uge(e[r],t,i,n,o);else uge(e,t,i,n,o)};var AF=Ws;function Vl(){this._dataSources=[],this._dataSourceAdded=new _e,this._dataSourceRemoved=new _e,this._dataSourceMoved=new _e}Object.defineProperties(Vl.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}}});Vl.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})};Vl.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};Vl.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=[]};Vl.prototype.contains=function(e){return this.indexOf(e)!==-1};Vl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Vl.prototype.get=function(e){return this._dataSources[e]};Vl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function v4(e,t){return e.indexOf(t)}function pge(e,t,n){let i=e._dataSources,o=i.length-1;if(t=D.clamp(t,0,o),n=D.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}Vl.prototype.raise=function(e){let t=v4(this._dataSources,e);pge(this,t,t+1)};Vl.prototype.lower=function(e){let t=v4(this._dataSources,e);pge(this,t,t-1)};Vl.prototype.raiseToTop=function(e){let t=v4(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))};Vl.prototype.lowerToBottom=function(e){let t=v4(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Vl.prototype.isDestroyed=function(){return!1};Vl.prototype.destroy=function(){return this.removeAll(!0),de(this)};var mF=Vl;function ic(e){e=e??V.EMPTY_OBJECT,this._primitives=[],this._guid=jn(),this._primitiveAdded=new _e,this._primitiveRemoved=new _e,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(ic.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});ic.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};ic.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};ic.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};ic.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=[]};ic.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function P4(e,t){return e._primitives.indexOf(t)}ic.prototype.raise=function(e){if(l(e)){let t=P4(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};ic.prototype.raiseToTop=function(e){if(l(e)){let t=P4(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};ic.prototype.lower=function(e){if(l(e)){let t=P4(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};ic.prototype.lowerToBottom=function(e){if(l(e)){let t=P4(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};ic.prototype.get=function(e){return this._primitives[e]};ic.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};ic.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)}};ic.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)}};ic.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)}};ic.prototype.isDestroyed=function(){return!1};ic.prototype.destroy=function(){return this.removeAll(),de(this)};var Hl=ic;function Sm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Sm.prototype,{length:{get:function(){return this._length}}});Sm.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Hl({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};Sm.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Sm.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};Sm.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};Sm.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Sm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Sm.prototype.isDestroyed=function(){return!1};Sm.prototype.destroy=function(){return this.removeAll(),de(this)};var pF=Sm;function IS(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Pt}IS.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};IS.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};IS.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};IS.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};IS.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):mt.FAILED};var d0=IS;var YK={},R4=new d,gge=new d,_ge=new Qe,Cge=new X;function bS(e,t,n,i,o,r,s,a,c,u){let f=e+t;d.multiplyByScalar(i,Math.cos(f),R4),d.multiplyByScalar(n,Math.sin(f),gge),d.add(R4,gge,R4);let h=Math.cos(e);h=h*h;let m=Math.sin(e);m=m*m;let A=r/Math.sqrt(s*h+o*m)/a;return Qe.fromAxisAngle(R4,A,_ge),X.fromQuaternion(_ge,Cge),X.multiplyByVector(Cge,c,u),d.normalize(u,u),d.multiplyByScalar(u,a,u),u}var yge=new d,Ege=new d,HK=new d,Urt=new d;YK.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,u=n?c:0;for(let f=0;f<c;f+=3){let h=f+1,m=f+2,g=d.fromArray(e,f,yge);i.scaleToGeodeticSurface(g,g);let A=d.clone(g,Ege),_=i.geodeticSurfaceNormal(g,Urt),C=d.multiplyByScalar(_,o,HK);d.add(g,C,g),n&&(d.multiplyByScalar(_,r,C),d.add(A,C,A),a[f+u]=A.x,a[h+u]=A.y,a[m+u]=A.z),a[f]=g.x,a[h]=g.y,a[m]=g.z}return a};var Grt=new d,zrt=new d,Vrt=new d;YK.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,u=o*o,f=o*i,h=d.magnitude(s),m=d.normalize(s,Grt),g=d.cross(d.UNIT_Z,s,zrt);g=d.normalize(g,g);let A=d.cross(m,g,Vrt),_=1+Math.ceil(D.PI_OVER_TWO/a),C=D.PI_OVER_TWO/(_-1),y=D.PI_OVER_TWO-_*C;y<0&&(_-=Math.ceil(Math.abs(y)/C));let E=2*(_*(_+2)),I=t?new Array(E*3):void 0,x=0,S=yge,w=Ege,v=_*4*3,P=v-1,N=0,L=n?new Array(v):void 0,p,b,T,B,R;for(y=D.PI_OVER_TWO,S=bS(y,r,A,g,c,f,u,h,m,S),t&&(I[x++]=S.x,I[x++]=S.y,I[x++]=S.z),n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x),y=D.PI_OVER_TWO-C,p=1;p<_+1;++p){if(S=bS(y,r,A,g,c,f,u,h,m,S),w=bS(Math.PI-y,r,A,g,c,f,u,h,m,w),t){for(I[x++]=S.x,I[x++]=S.y,I[x++]=S.z,T=2*p+2,b=1;b<T-1;++b)B=b/(T-1),R=d.lerp(S,w,B,HK),I[x++]=R.x,I[x++]=R.y,I[x++]=R.z;I[x++]=w.x,I[x++]=w.y,I[x++]=w.z}n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x,L[N++]=w.x,L[N++]=w.y,L[N++]=w.z),y=D.PI_OVER_TWO-(p+1)*C}for(p=_;p>1;--p){if(y=D.PI_OVER_TWO-(p-1)*C,S=bS(-y,r,A,g,c,f,u,h,m,S),w=bS(y+Math.PI,r,A,g,c,f,u,h,m,w),t){for(I[x++]=S.x,I[x++]=S.y,I[x++]=S.z,T=2*(p-1)+2,b=1;b<T-1;++b)B=b/(T-1),R=d.lerp(S,w,B,HK),I[x++]=R.x,I[x++]=R.y,I[x++]=R.z;I[x++]=w.x,I[x++]=w.y,I[x++]=w.z}n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x,L[N++]=w.x,L[N++]=w.y,L[N++]=w.z)}y=D.PI_OVER_TWO,S=bS(-y,r,A,g,c,f,u,h,m,S);let O={};return t&&(I[x++]=S.x,I[x++]=S.y,I[x++]=S.z,O.positions=I,O.numPts=_),n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x,O.outerPositions=L),O};var Bu=YK;var xS=new d,WK=new d,jK=new d,Ige=new d,ca=new F,bge=new X,Hrt=new X,qK=new Qe,xge=new d,Tge=new d,Sge=new d,L4=new he,Bge=new d,wge=new F,Dge=new F;function vge(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,h=i.st?new Float32Array(u*2):void 0,m=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,A=i.bitangent?new Float32Array(u*3):void 0,_=f?new Float32Array(u*3):void 0,C=0,y=xge,E=Tge,I=Sge,x=new Gi(a),S=x.project(a.cartesianToCartographic(o,L4),Bge),w=a.scaleToGeodeticSurface(o,xS);a.geodeticSurfaceNormal(w,w);let v=bge,P=Hrt;if(c!==0){let R=Qe.fromAxisAngle(w,c,qK);v=X.fromQuaternion(R,v),R=Qe.fromAxisAngle(w,-c,qK),P=X.fromQuaternion(R,P)}else v=X.clone(X.IDENTITY,v),P=X.clone(X.IDENTITY,P);let N=F.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,wge),L=F.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Dge),p=e.length,b=n?p:0,T=b/3*2;for(let R=0;R<p;R+=3){let O=R+1,U=R+2,k=d.fromArray(e,R,xS);if(i.st){let z=X.multiplyByVector(v,k,WK),Q=x.project(a.cartesianToCartographic(z,L4),jK);d.subtract(Q,S,Q),ca.x=(Q.x+r)/(2*r),ca.y=(Q.y+s)/(2*s),N.x=Math.min(ca.x,N.x),N.y=Math.min(ca.y,N.y),L.x=Math.max(ca.x,L.x),L.y=Math.max(ca.y,L.y),n&&(h[C+T]=ca.x,h[C+1+T]=ca.y),h[C++]=ca.x,h[C++]=ca.y}(i.normal||i.tangent||i.bitangent||f)&&(y=a.geodeticSurfaceNormal(k,y),f&&(_[R+b]=-y.x,_[O+b]=-y.y,_[U+b]=-y.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(E=d.normalize(d.cross(d.UNIT_Z,y,E),E),X.multiplyByVector(P,E,E)),i.normal&&(m[R]=y.x,m[O]=y.y,m[U]=y.z,n&&(m[R+b]=-y.x,m[O+b]=-y.y,m[U+b]=-y.z)),i.tangent&&(g[R]=E.x,g[O]=E.y,g[U]=E.z,n&&(g[R+b]=-E.x,g[O+b]=-E.y,g[U+b]=-E.z)),i.bitangent&&(I=d.normalize(d.cross(y,E,I),I),A[R]=I.x,A[O]=I.y,A[U]=I.z,n&&(A[R+b]=I.x,A[O+b]=I.y,A[U+b]=I.z))))}if(i.st){p=h.length;for(let R=0;R<p;R+=2)h[R]=(h[R]-N.x)/(L.x-N.x),h[R+1]=(h[R+1]-N.y)/(L.y-N.y)}let B=new pn;if(i.position){let R=Bu.raisePositionsToHeight(e,t,n);B.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:R})}if(i.st&&(B.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(B.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:m})),i.tangent&&(B.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(B.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:A})),f&&(B.extrudeDirection=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:_})),n&&l(t.offsetAttribute)){let R=new Uint8Array(u);if(t.offsetAttribute===un.TOP)R=R.fill(1,0,u/2);else{let O=t.offsetAttribute===un.NONE?0:1;R=R.fill(O)}B.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return B}function Pge(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 h0=new d;function Yrt(e){let t=e.center;h0=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,h0),e.height,h0),h0=d.add(t,h0,h0);let n=new le(h0,e.semiMajorAxis),i=Bu.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=vge(o,e,!1),a=Pge(r);return a=Fe.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function Wrt(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,h=new Float64Array(f*3),m=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,A=n.tangent?new Float32Array(f*3):void 0,_=n.bitangent?new Float32Array(f*3):void 0,C=t.shadowVolume,y=C?new Float32Array(f*3):void 0,E=0,I=xge,x=Tge,S=Sge,w=new Gi(s),v=w.project(s.cartesianToCartographic(i,L4),Bge),P=s.scaleToGeodeticSurface(i,xS);s.geodeticSurfaceNormal(P,P);let N=Qe.fromAxisAngle(P,u,qK),L=X.fromQuaternion(N,bge),p=F.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,wge),b=F.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Dge),T=e.length,B=T/3*2;for(let O=0;O<T;O+=3){let U=O+1,k=O+2,z=d.fromArray(e,O,xS),Q;if(n.st){let W=X.multiplyByVector(L,z,WK),Z=w.project(s.cartesianToCartographic(W,L4),jK);d.subtract(Z,v,Z),ca.x=(Z.x+o)/(2*o),ca.y=(Z.y+r)/(2*r),p.x=Math.min(ca.x,p.x),p.y=Math.min(ca.y,p.y),b.x=Math.max(ca.x,b.x),b.y=Math.max(ca.y,b.y),m[E+B]=ca.x,m[E+1+B]=ca.y,m[E++]=ca.x,m[E++]=ca.y}z=s.scaleToGeodeticSurface(z,z),Q=d.clone(z,WK),I=s.geodeticSurfaceNormal(z,I),C&&(y[O+T]=-I.x,y[U+T]=-I.y,y[k+T]=-I.z);let H=d.multiplyByScalar(I,a,Ige);if(z=d.add(z,H,z),H=d.multiplyByScalar(I,c,H),Q=d.add(Q,H,Q),n.position&&(h[O+T]=Q.x,h[U+T]=Q.y,h[k+T]=Q.z,h[O]=z.x,h[U]=z.y,h[k]=z.z),n.normal||n.tangent||n.bitangent){S=d.clone(I,S);let W=d.fromArray(e,(O+3)%T,Ige);d.subtract(W,z,W);let Z=d.subtract(Q,z,jK);I=d.normalize(d.cross(Z,W,I),I),n.normal&&(g[O]=I.x,g[U]=I.y,g[k]=I.z,g[O+T]=I.x,g[U+T]=I.y,g[k+T]=I.z),n.tangent&&(x=d.normalize(d.cross(S,I,x),x),A[O]=x.x,A[U]=x.y,A[k]=x.z,A[O+T]=x.x,A[O+1+T]=x.y,A[O+2+T]=x.z),n.bitangent&&(_[O]=S.x,_[U]=S.y,_[k]=S.z,_[O+T]=S.x,_[U+T]=S.y,_[k+T]=S.z)}}if(n.st){T=m.length;for(let O=0;O<T;O+=2)m[O]=(m[O]-p.x)/(b.x-p.x),m[O+1]=(m[O+1]-p.y)/(b.y-p.y)}let R=new pn;if(n.position&&(R.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(R.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:m})),n.normal&&(R.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(R.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(R.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:_})),C&&(R.extrudeDirection=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),l(t.offsetAttribute)){let O=new Uint8Array(f);if(t.offsetAttribute===un.TOP)O=O.fill(1,0,f/2);else{let U=t.offsetAttribute===un.NONE?0:1;O=O.fill(U)}R.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return R}function jrt(e){let t=e.length/3,n=Fe.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 M4=new le,N4=new le;function qrt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,xS),e.height,xS);M4.center=d.add(t,o,M4.center),M4.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N4.center=d.add(t,o,N4.center),N4.radius=i;let r=Bu.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,u=le.union(M4,N4),f=vge(s,e,!0),h=Pge(a),m=h.length;h.length=m*2;let g=s.length/3;for(let x=0;x<m;x+=3)h[x+m]=h[x+2]+g,h[x+1+m]=h[x+1]+g,h[x+2+m]=h[x]+g;let A=Fe.createTypedArray(g*2/3,h),_=new ht({attributes:f,indices:A,primitiveType:Pe.TRIANGLES}),C=Wrt(c,e);h=jrt(c);let y=Fe.createTypedArray(c.length*2/3,h),E=new ht({attributes:C,indices:y,primitiveType:Pe.TRIANGLES}),I=Un.combineInstances([new Rt({geometry:_}),new Rt({geometry:E})]);return{boundingSphere:u,attributes:I[0].attributes,indices:I[0].indices}}function Rge(e,t,n,i,o,r,s){let c=Bu.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let m=0;m<u;++m)f[m]=d.fromArray(c,m*3);let h=ce.fromCartesianArray(f,r,s);return h.width>D.PI&&(h.north=h.north>0?D.PI_OVER_TWO-D.EPSILON7:h.north,h.south=h.south<0?D.EPSILON7-D.PI_OVER_TWO:h.south,h.east=D.PI,h.west=-D.PI),h}function wm(e){e=e??V.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,s=e.vertexFormat??Re.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Re.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}wm.packedLength=d.packedLength+te.packedLength+Re.packedLength+9;wm.pack=function(e,t,n){return n=n??0,d.pack(e._center,t,n),n+=d.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.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 Mge=new d,Nge=new te,Lge=new Re,Bm={center:Mge,ellipsoid:Nge,vertexFormat:Lge,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};wm.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Mge);t+=d.packedLength;let o=te.unpack(e,t,Nge);t+=te.packedLength;let r=Re.unpack(e,t,Lge);t+=Re.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],m=e[t++],g=e[t++]===1,A=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=Re.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=h,n._extrudedHeight=m,n._shadowVolume=g,n._offsetAttribute=A===-1?void 0:A,n):(Bm.height=f,Bm.extrudedHeight=m,Bm.granularity=h,Bm.stRotation=u,Bm.rotation=c,Bm.semiMajorAxis=s,Bm.semiMinorAxis=a,Bm.shadowVolume=g,Bm.offsetAttribute=A===-1?void 0:A,new wm(Bm))};wm.computeRectangle=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??te.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??D.RADIANS_PER_DEGREE,a=e.rotation??0;return Rge(n,o,r,a,s,i,t)};wm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.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=qrt(o);else if(r=Yrt(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===un.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ht({attributes:r.attributes,indices:r.indices,primitiveType:Pe.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};wm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new wm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Re.POSITION_ONLY,shadowVolume:!0})};function Krt(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Bu.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]=d.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return ht._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(wm.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Rge(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Krt(this)),this._textureCoordinateRotationPoints}}});var Yl=wm;var Oge=new d,A0=new d;function Jrt(e){let t=e.center;A0=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,A0),e.height,A0),A0=d.add(t,A0,A0);let n=new le(A0,e.semiMajorAxis),i=Bu.computeEllipsePositions(e,!1,!0).outerPositions,o=new pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:Bu.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Fe.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 O4=new le,F4=new le;function Xrt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,Oge),e.height,Oge);O4.center=d.add(t,o,O4.center),O4.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),F4.center=d.add(t,o,F4.center),F4.radius=i;let r=Bu.computeEllipsePositions(e,!1,!0).outerPositions,s=new pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:Bu.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=le.union(O4,F4),c=r.length/3;if(l(e.offsetAttribute)){let A=new Uint8Array(c);if(e.offsetAttribute===un.TOP)A=A.fill(1,0,c/2);else{let _=e.offsetAttribute===un.NONE?0:1;A=A.fill(_)}s.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let u=e.numberOfVerticalLines??16;u=D.clamp(u,0,c/2);let f=Fe.createTypedArray(c,c*2+u*2);c/=2;let h=0,m;for(m=0;m<c;++m)f[h++]=m,f[h++]=(m+1)%c,f[h++]=m+c,f[h++]=(m+1)%c+c;let g;if(u>0){let A=Math.min(u,c);g=Math.round(c/A);let _=Math.min(g*u,c);for(m=0;m<_;m+=g)f[h++]=m,f[h++]=m+c}return{boundingSphere:a,attributes:s,indices:f}}function TS(e){e=e??V.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.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"}TS.packedLength=d.packedLength+te.packedLength+8;TS.pack=function(e,t,n){return n=n??0,d.pack(e._center,t,n),n+=d.packedLength,te.pack(e._ellipsoid,t,n),n+=te.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 Fge=new d,Qge=new te,qg={center:Fge,ellipsoid:Qge,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};TS.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Fge);t+=d.packedLength;let o=te.unpack(e,t,Qge);t+=te.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],m=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=h,n._offsetAttribute=m===-1?void 0:m,n):(qg.height=c,qg.extrudedHeight=f,qg.granularity=u,qg.rotation=a,qg.semiMajorAxis=r,qg.semiMinorAxis=s,qg.numberOfVerticalLines=h,qg.offsetAttribute=m===-1?void 0:m,new TS(qg))};TS.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.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=Xrt(o);else if(r=Jrt(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===un.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ht({attributes:r.attributes,indices:r.indices,primitiveType:Pe.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var xf=TS;var kge=new G,Uge=d.ZERO,Gge=new d,zge=new ce;function Zrt(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 dA(e,t){ti.call(this,{entity:e,scene:t,geometryOptions:new Zrt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(dA.prototype=Object.create(ti.prototype),dA.prototype.constructor=dA);dA.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof jt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,kge)),l(o)||(o=G.WHITE),i.color=Xt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Uge,Gge))),new Rt({id:t,geometry:new Yl(this._options),attributes:i})};dA.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,kge),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Uge,Gge))),new Rt({id:t,geometry:new xf(this._options),attributes:r})};dA.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};dA.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)};dA.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!j.isConstant(t.rotation)||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.stRotation)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.numberOfVerticalLines)||!j.isConstant(t.zIndex)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof jt)};dA.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,Ke.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,$e.NONE),o=j.getValueOrUndefined(t.extrudedHeight,Ke.MINIMUM_VALUE),r=j.getValueOrDefault(t.extrudedHeightReference,Ke.MINIMUM_VALUE,$e.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof jt?hn.VERTEX_FORMAT:xo.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=j.getValueOrUndefined(t.rotation,Ke.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,Ke.MINIMUM_VALUE),s.stRotation=j.getValueOrUndefined(t.stRotation,Ke.MINIMUM_VALUE),s.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,Ke.MINIMUM_VALUE),s.offsetAttribute=ti.computeGeometryOffsetAttribute(n,i,o,r),s.height=ti.getGeometryHeight(n,i),o=ti.getGeometryExtrudedHeight(o,r),o===ti.CLAMP_TO_GROUND&&(o=Si.getMinimumMaximumHeights(Yl.computeRectangle(s,zge)).minimumTerrainHeight),s.extrudedHeight=o};dA.DynamicGeometryUpdater=SS;function SS(e,t,n){yi.call(this,e,t,n)}l(Object.create)&&(SS.prototype=Object.create(yi.prototype),SS.prototype.constructor=SS);SS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||yi.prototype._isHidden.call(this,e,t,n)};SS.prototype._setOptions=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,$e.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,$e.NONE);l(s)&&!l(o)&&(o=0),i.center=j.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=j.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=j.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=j.getValueOrUndefined(t.rotation,n),i.granularity=j.getValueOrUndefined(t.granularity,n),i.stRotation=j.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=ti.computeGeometryOffsetAttribute(o,r,s,a),i.height=ti.getGeometryHeight(o,r),s=ti.getGeometryExtrudedHeight(s,a),s===ti.CLAMP_TO_GROUND&&(s=Si.getMinimumMaximumHeights(Yl.computeRectangle(i,zge)).minimumTerrainHeight),i.extrudedHeight=s};var gF=dA;var $rt=new d,est=new d,tst=new d,nst=new d,ist=new d,ost=new d(1,1,1),Vge=Math.cos,Hge=Math.sin;function Kg(e){e=e??V.EMPTY_OBJECT;let t=e.radii??ost,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??Re.DEFAULT;this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Re.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Kg.packedLength=2*d.packedLength+Re.packedLength+7;Kg.pack=function(e,t,n){return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.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 Yge=new d,Wge=new d,jge=new Re,ry={radii:Yge,innerRadii:Wge,vertexFormat:jge,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Kg.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Yge);t+=d.packedLength;let o=d.unpack(e,t,Wge);t+=d.packedLength;let r=Re.unpack(e,t,jge);t+=Re.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],m=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._vertexFormat=Re.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=h,n._offsetAttribute=m===-1?void 0:m,n):(ry.minimumClock=s,ry.maximumClock=a,ry.minimumCone=c,ry.maximumCone=u,ry.stackPartitions=f,ry.slicePartitions=h,ry.offsetAttribute=m===-1?void 0:m,new Kg(ry))};Kg.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,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/D.TWO_PI),u=Math.round(u*Math.abs(s-r)/D.PI),c<2&&(c=2),u<2&&(u=2);let f,h,m=0,g=[r],A=[i];for(f=0;f<u;f++)g.push(r+f*(s-r)/(u-1));for(g.push(s),h=0;h<c;h++)A.push(i+h*(o-i)/(c-1));A.push(o);let _=g.length,C=A.length,y=0,E=1,I=n.x!==t.x||n.y!==t.y||n.z!==t.z,x=!1,S=!1,w=!1;I&&(E=2,r>0&&(x=!0,y+=c-1),s<Math.PI&&(S=!0,y+=c-1),(o-i)%D.TWO_PI?(w=!0,y+=(u-1)*2+1):y+=1);let v=C*_*E,P=new Float64Array(v*3),N=new Array(v).fill(!1),L=new Array(v).fill(!1),p=c*u*E,b=6*(p+y+1-(c+u)*E),T=Fe.createTypedArray(p,b),B=a.normal?new Float32Array(v*3):void 0,R=a.tangent?new Float32Array(v*3):void 0,O=a.bitangent?new Float32Array(v*3):void 0,U=a.st?new Float32Array(v*2):void 0,k=new Array(_),z=new Array(_);for(f=0;f<_;f++)k[f]=Hge(g[f]),z[f]=Vge(g[f]);let Q=new Array(C),H=new Array(C);for(h=0;h<C;h++)H[h]=Vge(A[h]),Q[h]=Hge(A[h]);for(f=0;f<_;f++)for(h=0;h<C;h++)P[m++]=t.x*k[f]*H[h],P[m++]=t.y*k[f]*Q[h],P[m++]=t.z*z[f];let W=v/2;if(I)for(f=0;f<_;f++)for(h=0;h<C;h++)P[m++]=n.x*k[f]*H[h],P[m++]=n.y*k[f]*Q[h],P[m++]=n.z*z[f],N[W]=!0,f>0&&f!==_-1&&h!==0&&h!==C-1&&(L[W]=!0),W++;m=0;let Z,Y;for(f=1;f<_-2;f++)for(Z=f*C,Y=(f+1)*C,h=1;h<C-2;h++)T[m++]=Y+h,T[m++]=Y+h+1,T[m++]=Z+h+1,T[m++]=Y+h,T[m++]=Z+h+1,T[m++]=Z+h;if(I){let Ue=_*C;for(f=1;f<_-2;f++)for(Z=Ue+f*C,Y=Ue+(f+1)*C,h=1;h<C-2;h++)T[m++]=Y+h,T[m++]=Z+h,T[m++]=Z+h+1,T[m++]=Y+h,T[m++]=Z+h+1,T[m++]=Y+h+1}let $,K;if(I){if(x)for(K=_*C,f=1;f<C-2;f++)T[m++]=f,T[m++]=f+1,T[m++]=K+f+1,T[m++]=f,T[m++]=K+f+1,T[m++]=K+f;if(S)for($=_*C-C,K=_*C*E-C,f=1;f<C-2;f++)T[m++]=$+f+1,T[m++]=$+f,T[m++]=K+f,T[m++]=$+f+1,T[m++]=K+f,T[m++]=K+f+1}if(w){for(f=1;f<_-2;f++)K=C*_+C*f,$=C*f,T[m++]=K,T[m++]=$+C,T[m++]=$,T[m++]=K,T[m++]=K+C,T[m++]=$+C;for(f=1;f<_-2;f++)K=C*_+C*(f+1)-1,$=C*(f+1)-1,T[m++]=$+C,T[m++]=K,T[m++]=$,T[m++]=$+C,T[m++]=K+C,T[m++]=K}let fe=new pn;a.position&&(fe.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:P}));let ge=0,ne=0,Ce=0,ye=0,De=v/2,be,Ne=te.fromCartesian3(t),ke=te.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<v;f++){be=N[f]?ke:Ne;let Ue=d.fromArray(P,f*3,$rt),He=be.geodeticSurfaceNormal(Ue,est);if(L[f]&&d.negate(He,He),a.st){let Et=F.negate(He,ist);U[ge++]=Math.atan2(Et.y,Et.x)/D.TWO_PI+.5,U[ge++]=Math.asin(He.z)/Math.PI+.5}if(a.normal&&(B[ne++]=He.x,B[ne++]=He.y,B[ne++]=He.z),a.tangent||a.bitangent){let Et=tst,Ye=0,nt;if(N[f]&&(Ye=De),!x&&f>=Ye&&f<Ye+C*2?nt=d.UNIT_X:nt=d.UNIT_Z,d.cross(nt,He,Et),d.normalize(Et,Et),a.tangent&&(R[Ce++]=Et.x,R[Ce++]=Et.y,R[Ce++]=Et.z),a.bitangent){let Ct=d.cross(He,Et,nst);d.normalize(Ct,Ct),O[ye++]=Ct.x,O[ye++]=Ct.y,O[ye++]=Ct.z}}}a.st&&(fe.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:U})),a.normal&&(fe.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:B})),a.tangent&&(fe.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:R})),a.bitangent&&(fe.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:O}))}if(l(e._offsetAttribute)){let Ue=P.length,He=e._offsetAttribute===un.NONE?0:1,Et=new Uint8Array(Ue/3).fill(He);fe.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Et})}return new ht({attributes:fe,indices:T,primitiveType:Pe.TRIANGLES,boundingSphere:le.fromEllipsoid(Ne),offsetAttribute:e._offsetAttribute})};var KK;Kg.getUnitEllipsoid=function(){return l(KK)||(KK=Kg.createGeometry(new Kg({radii:new d(1,1,1),vertexFormat:Re.POSITION_ONLY}))),KK};var va=Kg;var rst=new jt(G.WHITE),JK=d.ZERO,XK=new d,sst=new d,ast=new d,ZK=new G,cst=new d(1,1,1);function lst(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 Tf(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new lst(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Tf.prototype=Object.create(Ei.prototype),Tf.prototype.constructor=Tf);Object.defineProperties(Tf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Tf.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Kn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof jt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,ZK)),l(f)||(f=G.WHITE),r=Xt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,JK,XK))),new Rt({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:u})};Tf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,ZK),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(r),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,JK,XK))),new Rt({id:i,geometry:new pf(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Tf.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Tf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Ei.prototype._isHidden.call(this,e,t)};Tf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.radii.isConstant||!j.isConstant(t.innerRadii)||!j.isConstant(t.stackPartitions)||!j.isConstant(t.slicePartitions)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.minimumClock)||!j.isConstant(t.maximumClock)||!j.isConstant(t.minimumCone)||!j.isConstant(t.maximumCone)||!j.isConstant(t.subdivisions)};Tf.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,$e.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof jt?hn.VERTEX_FORMAT:xo.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ke.MINIMUM_VALUE,i.radii),i.innerRadii=j.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=j.getValueOrUndefined(t.minimumClock,Ke.MINIMUM_VALUE),i.maximumClock=j.getValueOrUndefined(t.maximumClock,Ke.MINIMUM_VALUE),i.minimumCone=j.getValueOrUndefined(t.minimumCone,Ke.MINIMUM_VALUE),i.maximumCone=j.getValueOrUndefined(t.maximumCone,Ke.MINIMUM_VALUE),i.stackPartitions=j.getValueOrUndefined(t.stackPartitions,Ke.MINIMUM_VALUE),i.slicePartitions=j.getValueOrUndefined(t.slicePartitions,Ke.MINIMUM_VALUE),i.subdivisions=j.getValueOrUndefined(t.subdivisions,Ke.MINIMUM_VALUE),i.offsetAttribute=n!==$e.NONE?un.ALL:void 0};Tf.prototype._onEntityPropertyChanged=Qp;Tf.DynamicGeometryUpdater=_F;function _F(e,t,n){yi.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new M,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 d,this._material={}}l(Object.create)&&(_F.prototype=Object.create(yi.prototype),_F.prototype.constructor=_F);_F.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!j.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=j.getValueOrUndefined(n.radii,e,sst),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=j.getValueOrDefault(n.fill,e,!0),s=j.getValueOrDefault(n.outline,e,!1),a=j.getValueOrClonedDefault(n.outlineColor,e,G.BLACK,ZK),c=yr.getValue(e,n.material??rst,this._material),u=j.getValueOrUndefined(n.innerRadii,e,ast),f=j.getValueOrUndefined(n.minimumClock,e),h=j.getValueOrUndefined(n.maximumClock,e),m=j.getValueOrUndefined(n.minimumCone,e),g=j.getValueOrUndefined(n.maximumCone,e),A=j.getValueOrUndefined(n.stackPartitions,e),_=j.getValueOrUndefined(n.slicePartitions,e),C=j.getValueOrUndefined(n.subdivisions,e),y=j.getValueOrDefault(n.outlineWidth,e,1),E=j.getValueOrDefault(n.heightReference,e,$e.NONE),I=E!==$e.NONE?un.ALL:void 0,x=this._scene.mode,S=x===oe.SCENE3D&&E===$e.NONE,w=this._options,v=this._geometryUpdater.shadowsProperty.getValue(e),N=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=j.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,JK,XK);if(!S||this._lastSceneMode!==x||!l(this._primitive)||w.stackPartitions!==A||w.slicePartitions!==_||l(u)&&!d.equals(w.innerRadii!==u)||w.minimumClock!==f||w.maximumClock!==h||w.minimumCone!==m||w.maximumCone!==g||w.subdivisions!==C||this._lastOutlineWidth!==y||w.offsetAttribute!==I){let b=this._primitives;b.removeAndDestroy(this._primitive),b.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=x,this._lastOutlineWidth=y,w.stackPartitions=A,w.slicePartitions=_,w.subdivisions=C,w.offsetAttribute=I,w.radii=d.clone(S?cst:i,w.radii),l(u)?S?w.innerRadii=d.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,w.innerRadii):w.innerRadii=d.clone(u,w.innerRadii):w.innerRadii=void 0,w.minimumClock=f,w.maximumClock=h,w.minimumCone=m,w.maximumCone=g;let T=new xo({material:c,translucent:c.isTranslucent(),closed:!0});w.vertexFormat=T.vertexFormat;let B=this._geometryUpdater.createFillGeometryInstance(e,S,this._modelMatrix);this._primitive=b.add(new Ln({geometryInstances:B,appearance:T,asynchronous:!1,shadows:v}));let R=this._geometryUpdater.createOutlineGeometryInstance(e,S,this._modelMatrix);this._outlinePrimitive=b.add(new Ln({geometryInstances:R,appearance:new hn({flat:!0,translucent:R.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(y)}}),asynchronous:!1,shadows:v})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=G.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=N,this._lastOffset=d.clone(L,this._lastOffset)}else if(this._primitive.ready){let b=this._primitive,T=this._outlinePrimitive;b.show=!0,T.show=!0,b.appearance.material=c;let B=this._attributes;l(B)||(B=b.getGeometryInstanceAttributes(t),this._attributes=B),r!==this._lastShow&&(B.show=xn.toValue(r,B.show),this._lastShow=r);let R=this._outlineAttributes;l(R)||(R=T.getGeometryInstanceAttributes(t),this._outlineAttributes=R),s!==this._lastOutlineShow&&(R.show=xn.toValue(s,R.show),this._lastOutlineShow=s),G.equals(a,this._lastOutlineColor)||(R.color=Xt.toValue(a,R.color),G.clone(a,this._lastOutlineColor)),Qt.equals(N,this._lastDistanceDisplayCondition)||(B.distanceDisplayCondition=Kn.toValue(N,B.distanceDisplayCondition),R.distanceDisplayCondition=Kn.toValue(N,R.distanceDisplayCondition),Qt.clone(N,this._lastDistanceDisplayCondition)),d.equals(L,this._lastOffset)||(B.offset=po.toValue(L,B.offset),R.offset=po.toValue(L,B.offset),d.clone(L,this._lastOffset))}S&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=M.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var CF=Tf;function BS(e){e=e??V.EMPTY_OBJECT;let t=e.vertexFormat??Re.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}BS.packedLength=Re.packedLength;BS.pack=function(e,t,n){return n=n??0,Re.pack(e._vertexFormat,t,n),t};var qge=new Re,ust={vertexFormat:qge};BS.unpack=function(e,t,n){t=t??0;let i=Re.unpack(e,t,qge);return l(n)?(n._vertexFormat=Re.clone(i,n._vertexFormat),n):new BS(ust)};var Q4=new d(-.5,-.5,0),k4=new d(.5,.5,0);BS.createGeometry=function(e){let t=e._vertexFormat,n=new pn,i,o;if(t.position){if(o=new Float64Array(12),o[0]=Q4.x,o[1]=Q4.y,o[2]=0,o[3]=k4.x,o[4]=Q4.y,o[5]=0,o[6]=k4.x,o[7]=k4.y,o[8]=0,o[9]=Q4.x,o[10]=k4.y,o[11]=0,n.position=new ve({componentDatatype:q.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 ve({componentDatatype:q.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 ve({componentDatatype:q.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 ve({componentDatatype:q.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 ve({componentDatatype:q.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 ht({attributes:n,indices:i,primitiveType:Pe.TRIANGLES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var yF=BS;function wS(){this._workerName="createPlaneOutlineGeometry"}wS.packedLength=0;wS.pack=function(e,t){return t};wS.unpack=function(e,t,n){return l(n)?n:new wS};var sy=new d(-.5,-.5,0),U4=new d(.5,.5,0);wS.createGeometry=function(){let e=new pn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=sy.x,n[1]=sy.y,n[2]=sy.z,n[3]=U4.x,n[4]=sy.y,n[5]=sy.z,n[6]=U4.x,n[7]=U4.y,n[8]=sy.z,n[9]=sy.x,n[10]=U4.y,n[11]=sy.z,e.position=new ve({componentDatatype:q.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 ht({attributes:e,indices:t,primitiveType:Pe.LINES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var EF=wS;var fst=new d,Kge=new G;function dst(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function kd(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new dst(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(kd.prototype=Object.create(Ei.prototype),kd.prototype.constructor=kd);kd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof jt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Kge)),l(g)||(g=G.WHITE),o=Xt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),h=j.getValueOrDefault(c.plane,e,u.plane),m=j.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=m,f=$K(h,m,f,f),new Rt({id:t,geometry:new yF(this._options),modelMatrix:f,attributes:i})};kd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Kge),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=j.getValueOrDefault(r.plane,e,s.plane),u=j.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=$K(c,u,a,a),new Rt({id:t,geometry:new EF,modelMatrix:a,attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(o)}})};kd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Ei.prototype._isHidden.call(this,e,t)};kd.prototype._getIsClosed=function(e){return!1};kd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};kd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof jt,i=this._options;i.vertexFormat=n?hn.VERTEX_FORMAT:xo.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ke.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ke.MINIMUM_VALUE,i.dimensions)};kd.DynamicGeometryUpdater=DS;function DS(e,t,n){yi.call(this,e,t,n)}l(Object.create)&&(DS.prototype=Object.create(yi.prototype),DS.prototype.constructor=DS);DS.prototype._isHidden=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(e.position,n,fst);return!l(o)||!l(i.plane)||!l(i.dimensions)||yi.prototype._isHidden.call(this,e,t,n)};DS.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=j.getValueOrDefault(t.plane,n,i.plane),i.dimensions=j.getValueOrUndefined(t.dimensions,n,i.dimensions)};var hst=new d,Ast=new d,mst=new d,pst=new d,gst=new X,_st=new X,Cst=new M;function $K(e,t,n,i){let o=e.normal,r=e.distance,s=d.multiplyByScalar(o,-r,mst),a=d.clone(d.UNIT_Z,Ast);D.equalsEpsilon(Math.abs(d.dot(a,o)),1,D.EPSILON8)&&(a=d.clone(d.UNIT_Y,a));let c=d.cross(a,o,hst);a=d.cross(o,c,a),d.normalize(c,c),d.normalize(a,a);let u=gst;X.setColumn(u,0,c,u),X.setColumn(u,1,a,u),X.setColumn(u,2,o,u);let f=d.fromElements(t.x,t.y,1,pst),h=X.multiplyByScale(u,f,_st),m=M.fromRotationTranslation(h,s,Cst);return M.multiplyTransformation(n,m,i)}kd.createPrimitiveMatrix=$K;var IF=kd;var yst=new d,Est=new Xe,Ist=new F,bst=new F,xst=new d,Tst=new d,Sst=new d,bF=new d,Bst=new d,wst=new d,Jge=new Qe,Dst=new X,vst=new X,Pst=new d;function Rst(e,t,n,i,o,r,s,a,c){let u=e.positions,f=bi.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let h=Fe.createTypedArray(u.length,f.length);h.set(f);let m=Dst;if(i!==0){let p=Qe.fromAxisAngle(s,i,Jge);if(m=X.fromQuaternion(p,m),t.tangent||t.bitangent){p=Qe.fromAxisAngle(s,-i,Jge);let b=X.fromQuaternion(p,vst);a=d.normalize(X.multiplyByVector(b,a,a),a),t.bitangent&&(c=d.normalize(d.cross(s,a,c),c))}}else m=X.clone(X.IDENTITY,m);let g=bst;t.st&&(g.x=n.x,g.y=n.y);let A=u.length,_=A*3,C=new Float64Array(_),y=t.normal?new Float32Array(_):void 0,E=t.tangent?new Float32Array(_):void 0,I=t.bitangent?new Float32Array(_):void 0,x=t.st?new Float32Array(A*2):void 0,S=0,w=0,v=0,P=0,N=0;for(let p=0;p<A;p++){let b=u[p];if(C[S++]=b.x,C[S++]=b.y,C[S++]=b.z,t.st)if(l(o)&&o.positions.length===A)x[N++]=o.positions[p].x,x[N++]=o.positions[p].y;else{let T=X.multiplyByVector(m,b,yst),B=r(T,Ist);F.subtract(B,g,B);let R=D.clamp(B.x/n.width,0,1),O=D.clamp(B.y/n.height,0,1);x[N++]=R,x[N++]=O}t.normal&&(y[w++]=s.x,y[w++]=s.y,y[w++]=s.z),t.tangent&&(E[P++]=a.x,E[P++]=a.y,E[P++]=a.z),t.bitangent&&(I[v++]=c.x,I[v++]=c.y,I[v++]=c.z)}let L=new pn;return t.position&&(L.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:C})),t.normal&&(L.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),t.tangent&&(L.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:E})),t.bitangent&&(L.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:I})),t.st&&(L.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:x})),new ht({attributes:L,indices:h,primitiveType:Pe.TRIANGLES})}function m0(e){e=e??V.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Re.DEFAULT;this._vertexFormat=Re.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Zn.computeHierarchyPackedLength(t,d)+Re.packedLength+te.packedLength+(l(n)?Zn.computeHierarchyPackedLength(n,F):1)+2}m0.fromPositions=function(e){e=e??V.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new m0(t)};m0.pack=function(e,t,n){return n=n??0,n=Zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),te.pack(e._ellipsoid,t,n),n+=te.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Zn.packPolygonHierarchy(e._textureCoordinates,t,n,F):t[n++]=-1,t[n++]=e.packedLength,t};var Mst=te.clone(te.UNIT_SPHERE),Nst=new Re,Lst={polygonHierarchy:{}};m0.unpack=function(e,t,n){t=t??0;let i=Zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,Mst);t+=te.packedLength;let r=Re.unpack(e,t,Nst);t+=Re.packedLength;let s=e[t++],a=e[t]===-1?void 0:Zn.unpackPolygonHierarchy(e,t,F);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new m0(Lst)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=Re.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};m0.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=Uo(s,d.equalsEpsilon,!0),s.length<3)return;let a=xst,c=Tst,u=Sst,f=Bst,h=wst;if(!wg.computeProjectTo2DArguments(s,bF,f,h))return;if(a=d.cross(f,h,a),a=d.normalize(a,a),!d.equalsEpsilon(bF,d.ZERO,D.EPSILON6)){let N=e._ellipsoid.geodeticSurfaceNormal(bF,Pst);d.dot(a,N)<0&&(a=d.negate(a,a),f=d.negate(f,f))}let g=wg.createProjectPointsTo2DFunction(bF,f,h),A=wg.createProjectPointTo2DFunction(bF,f,h);t.tangent&&(c=d.clone(f,c)),t.bitangent&&(u=d.clone(h,u));let _=Zn.polygonsFromHierarchy(n,r,g,!1),C=_.hierarchy,y=_.polygons,E=function(N){return N},I=r?Zn.polygonsFromHierarchy(o,!0,E,!1).polygons:void 0;if(C.length===0)return;s=C[0].outerRing;let x=le.fromPoints(s),S=Zn.computeBoundingRectangle(a,A,s,i,Est),w=[];for(let N=0;N<y.length;N++){let L=new Rt({geometry:Rst(y[N],t,S,i,r?I[N]:void 0,A,a,c,u)});w.push(L)}let v=Un.combineInstances(w)[0];v.attributes.position.values=new Float64Array(v.attributes.position.values),v.indices=Fe.createTypedArray(v.attributes.position.values.length/3,v.indices);let P=v.attributes;return t.position||delete P.position,new ht({attributes:P,indices:v.indices,primitiveType:v.primitiveType,boundingSphere:x})};var xF=m0;var Xge=[],G4=[];function Ost(e,t,n,i,o){let s=Ss.fromPoints(t,e).projectPointsOntoPlane(t,Xge);bi.computeWindingOrder2D(s)===ks.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let A=t[u],_=t[(u+1)%f];c[h++]=A.x,c[h++]=A.y,c[h++]=A.z,c[h++]=_.x,c[h++]=_.y,c[h++]=_.z}else{let A=0;if(o===an.GEODESIC)for(u=0;u<f;u++)A+=Zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===an.RHUMB)for(u=0;u<f;u++)A+=Zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(A*3),u=0;u<f;u++){let _;o===an.GEODESIC?_=Zn.subdivideLine(t[u],t[(u+1)%f],n,G4):o===an.RHUMB&&(_=Zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,G4));let C=_.length;for(let y=0;y<C;++y)c[h++]=_[y]}}f=c.length/3;let m=f*2,g=Fe.createTypedArray(f,m);for(h=0,u=0;u<f-1;u++)g[h++]=u,g[h++]=u+1;return g[h++]=f-1,g[h++]=0,new Rt({geometry:new ht({attributes:new pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Pe.LINES})})}function Fst(e,t,n,i,o){let s=Ss.fromPoints(t,e).projectPointsOntoPlane(t,Xge);bi.computeWindingOrder2D(s)===ks.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=new Array(f),m=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){h[u]=m/3;let C=t[u],y=t[(u+1)%f];c[m++]=C.x,c[m++]=C.y,c[m++]=C.z,c[m++]=y.x,c[m++]=y.y,c[m++]=y.z}else{let C=0;if(o===an.GEODESIC)for(u=0;u<f;u++)C+=Zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===an.RHUMB)for(u=0;u<f;u++)C+=Zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(C*3*2),u=0;u<f;++u){h[u]=m/3;let y;o===an.GEODESIC?y=Zn.subdivideLine(t[u],t[(u+1)%f],n,G4):o===an.RHUMB&&(y=Zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,G4));let E=y.length;for(let I=0;I<E;++I)c[m++]=y[I]}}f=c.length/6;let g=h.length,A=(f*2+g)*2,_=Fe.createTypedArray(f+g,A);for(m=0,u=0;u<f;++u)_[m++]=u,_[m++]=(u+1)%f,_[m++]=u+f,_[m++]=(u+1)%f+f;for(u=0;u<g;u++){let C=h[u];_[m++]=C,_[m++]=C+f}return new Rt({geometry:new ht({attributes:new pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:_,primitiveType:Pe.LINES})})}function p0(e){let t=e.polygonHierarchy,n=e.ellipsoid??te.default,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),s=e.arcType??an.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!r){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=te.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=Zn.computeHierarchyPackedLength(t,d)+te.packedLength+8}p0.pack=function(e,t,n){return n=n??0,n=Zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),te.pack(e._ellipsoid,t,n),n+=te.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 Qst=te.clone(te.UNIT_SPHERE),kst={polygonHierarchy:{}};p0.unpack=function(e,t,n){t=t??0;let i=Zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,Qst);t+=te.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],h=e[t++],m=e[t];return l(n)||(n=new p0(kst)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=h===-1?void 0:h,n.packedLength=m,n};p0.fromPositions=function(e){e=e??V.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 p0(t)};p0.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Zn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],u=D.chordLength(n,t.maximumRadius),f=e._height,h=e._extrudedHeight,m=e._perPositionHeightExtrude||!D.equalsEpsilon(f,h,0,D.EPSILON2),g,A;if(m)for(A=0;A<s.length;A++){if(a=Fst(t,s[A],u,o,r),a.geometry=Zn.scaleToGeodeticHeightExtruded(a.geometry,f,h,t,o),l(e._offsetAttribute)){let y=a.geometry.attributes.position.values.length/3,E=new Uint8Array(y);e._offsetAttribute===un.TOP?E=E.fill(1,0,y/2):(g=e._offsetAttribute===un.NONE?0:1,E=E.fill(g)),a.geometry.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}c.push(a)}else for(A=0;A<s.length;A++){if(a=Ost(t,s[A],u,o,r),a.geometry.attributes.position.values=bi.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let y=a.geometry.attributes.position.values.length;g=e._offsetAttribute===un.NONE?0:1;let E=new Uint8Array(y/3).fill(g);a.geometry.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}c.push(a)}let _=Un.combineInstances(c)[0],C=le.fromVertices(_.attributes.position.values);return new ht({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:C,offsetAttribute:e._offsetAttribute})};var TF=p0;var Zge="Entity polygons cannot have both height and perPositionHeight. height will be ignored",$ge="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",e_e=new G,t_e=d.ZERO,n_e=new d,i_e=new ce,Ust=[],Gst=new F;function zst(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 Sf(e,t){ti.call(this,{entity:e,scene:t,geometryOptions:new zst(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Sf.prototype=Object.create(ti.prototype),Sf.prototype.constructor=Sf);Sf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof jt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,e_e)),l(s)||(s=G.WHITE),o.color=Xt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,t_e,n_e)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new xF(i):r=new eg(i),new Rt({id:t,geometry:r,attributes:o})};Sf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,e_e),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(o),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,t_e,n_e)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Pd(i):a=new TF(i),new Rt({id:t,geometry:a,attributes:s})};Sf.prototype._computeCenter=function(e,t){let n=j.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,Ust),a=s.length,c=0,u=a-1,f=new F;for(let m=0;m<a;u=m++){let g=s[m],A=s[u],_=g.x*A.y-A.x*g.y,C=F.add(g,A,Gst);C=F.multiplyByScalar(C,_,C),f=F.add(f,C,f),c+=_}let h=1/(c*3);return f=F.multiplyByScalar(f,h,f),r.projectPointOntoEllipsoid(f,t)};Sf.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Ei.prototype._isHidden.call(this,e,t)};Sf.prototype._isOnTerrain=function(e,t){let n=ti.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Ke.MINIMUM_VALUE):!0);return n&&!o};Sf.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.stRotation)||!j.isConstant(t.textureCoordinates)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.perPositionHeight)||!j.isConstant(t.closeTop)||!j.isConstant(t.closeBottom)||!j.isConstant(t.zIndex)||!j.isConstant(t.arcType)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof jt)};Sf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof jt,i=this._options;i.vertexFormat=n?hn.VERTEX_FORMAT:xo.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ke.MINIMUM_VALUE),r=j.getValueOrUndefined(t.height,Ke.MINIMUM_VALUE),s=j.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,$e.NONE),a=j.getValueOrUndefined(t.extrudedHeight,Ke.MINIMUM_VALUE),c=j.getValueOrDefault(t.extrudedHeightReference,Ke.MINIMUM_VALUE,$e.NONE),u=j.getValueOrDefault(t.perPositionHeight,Ke.MINIMUM_VALUE,!1);r=ti.getGeometryHeight(r,s);let f;if(u?(l(r)&&(r=void 0,At(Zge)),s!==$e.NONE&&u&&(r=void 0,At($ge))):(l(a)&&!l(r)&&(r=0),f=ti.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=j.getValueOrUndefined(t.granularity,Ke.MINIMUM_VALUE),i.stRotation=j.getValueOrUndefined(t.stRotation,Ke.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=j.getValueOrDefault(t.closeTop,Ke.MINIMUM_VALUE,!0),i.closeBottom=j.getValueOrDefault(t.closeBottom,Ke.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=j.getValueOrDefault(t.arcType,Ke.MINIMUM_VALUE,an.GEODESIC),i.textureCoordinates=j.getValueOrUndefined(t.textureCoordinates,Ke.MINIMUM_VALUE),a=ti.getGeometryExtrudedHeight(a,c),a===ti.CLAMP_TO_GROUND){let h=eg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,i_e);a=Si.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=a};Sf.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)};Sf.DynamicGeometryUpdater=vS;function vS(e,t,n){yi.call(this,e,t,n)}l(Object.create)&&(vS.prototype=Object.create(yi.prototype),vS.prototype.constructor=vS);vS.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||yi.prototype._isHidden.call(this,e,t,n)};vS.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=j.getValueOrUndefined(t.hierarchy,n);let o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,$e.NONE),s=j.getValueOrDefault(t.extrudedHeightReference,n,$e.NONE),a=j.getValueOrUndefined(t.extrudedHeight,n),c=j.getValueOrUndefined(t.perPositionHeight,n);o=ti.getGeometryHeight(o,s);let u;if(c?(l(o)&&(o=void 0,At(Zge)),r!==$e.NONE&&c&&(o=void 0,At($ge))):(l(a)&&!l(o)&&(o=0),u=ti.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=j.getValueOrUndefined(t.granularity,n),i.stRotation=j.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=j.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=j.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=j.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=j.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=j.getValueOrDefault(t.arcType,n,an.GEODESIC),a=ti.getGeometryExtrudedHeight(a,s),a===ti.CLAMP_TO_GROUND){let f=eg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,i_e);a=Si.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var SF=Sf;function Vst(e,t,n,i){let o=new pn;i.position&&(o.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=bi.triangulate(t),u=(a-1)*r*6+c.length*2,f=Fe.createTypedArray(s,u),h,m,g,A,_,C,y=r*2,E=0;for(h=0;h<a-1;h++){for(m=0;m<r-1;m++)g=m*2+h*r*2,C=g+y,A=g+1,_=A+y,f[E++]=A,f[E++]=g,f[E++]=_,f[E++]=_,f[E++]=g,f[E++]=C;g=r*2-2+h*r*2,A=g+1,_=A+y,C=g+y,f[E++]=A,f[E++]=g,f[E++]=_,f[E++]=_,f[E++]=g,f[E++]=C}if(i.st||i.tangent||i.bitangent){let S=new Float32Array(s*2),w=1/(a-1),v=1/n.height,P=n.height/2,N,L,p=0;for(h=0;h<a;h++){for(N=h*w,L=v*(t[0].y+P),S[p++]=N,S[p++]=L,m=1;m<r;m++)L=v*(t[m].y+P),S[p++]=N,S[p++]=L,S[p++]=N,S[p++]=L;L=v*(t[0].y+P),S[p++]=N,S[p++]=L}for(m=0;m<r;m++)N=0,L=v*(t[m].y+P),S[p++]=N,S[p++]=L;for(m=0;m<r;m++)N=(a-1)*w,L=v*(t[m].y+P),S[p++]=N,S[p++]=L;o.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:new Float32Array(S)})}let I=s-r*2;for(h=0;h<c.length;h+=3){let S=c[h]+I,w=c[h+1]+I,v=c[h+2]+I;f[E++]=S,f[E++]=w,f[E++]=v,f[E++]=v+r,f[E++]=w+r,f[E++]=S+r}let x=new ht({attributes:o,indices:f,boundingSphere:le.fromVertices(e),primitiveType:Pe.TRIANGLES});if(i.normal&&(x=Un.computeNormal(x)),i.tangent||i.bitangent){try{x=Un.computeTangentAndBitangent(x)}catch{At("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(x.attributes.tangent=void 0),i.bitangent||(x.attributes.bitangent=void 0),i.st||(x.attributes.st=void 0)}return x}function wF(e){e=e??V.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??ji.ROUNDED,this._vertexFormat=Re.clone(e.vertexFormat??Re.DEFAULT),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*F.packedLength,this.packedLength=i+te.packedLength+Re.packedLength+2}wF.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+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=F.packedLength)F.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var o_e=te.clone(te.UNIT_SPHERE),r_e=new Re,BF={polylinePositions:void 0,shapePositions:void 0,ellipsoid:o_e,vertexFormat:r_e,cornerType:void 0,granularity:void 0};wF.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=F.packedLength)s[i]=F.unpack(e,t);let a=te.unpack(e,t,o_e);t+=te.packedLength;let c=Re.unpack(e,t,r_e);t+=Re.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=te.clone(a,n._ellipsoid),n._vertexFormat=Re.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(BF.polylinePositions=r,BF.shapePositions=s,BF.cornerType=u,BF.granularity=f,new wF(BF))};var Hst=new Xe;wF.createGeometry=function(e){let t=e._positions,n=Uo(t,d.equalsEpsilon),i=e._shape;if(i=oA.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;bi.computeWindingOrder2D(i)===ks.CLOCKWISE&&i.reverse();let o=Xe.fromPoints(i,Hst),r=oA.computePositions(n,i,o,e,!0);return Vst(r,i,o,e._vertexFormat)};var DF=wF;function Yst(e,t){let n=new pn;n.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Fe.createTypedArray(o,2*i*(s+1)),c,u,f=0;c=0;let h=c*i;for(u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,c=s-1,h=c*i,u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,c=0;c<s-1;c++){let g=i*c,A=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+A}return new ht({attributes:n,indices:Fe.createTypedArray(o,a),boundingSphere:le.fromVertices(e),primitiveType:Pe.LINES})}function PF(e){e=e??V.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??ji.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*F.packedLength,this.packedLength=i+te.packedLength+2}PF.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+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=F.packedLength)F.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var s_e=te.clone(te.UNIT_SPHERE),vF={polylinePositions:void 0,shapePositions:void 0,ellipsoid:s_e,height:void 0,cornerType:void 0,granularity:void 0};PF.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=F.packedLength)s[i]=F.unpack(e,t);let a=te.unpack(e,t,s_e);t+=te.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=te.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(vF.polylinePositions=r,vF.shapePositions=s,vF.cornerType=c,vF.granularity=u,new PF(vF))};var Wst=new Xe;PF.createGeometry=function(e){let t=e._positions,n=Uo(t,d.equalsEpsilon),i=e._shape;if(i=oA.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;bi.computeWindingOrder2D(i)===ks.CLOCKWISE&&i.reverse();let o=Xe.fromPoints(i,Wst),r=oA.computePositions(n,i,o,e,!1);return Yst(r,i)};var RF=PF;var a_e=new G;function jst(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 Dm(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new jst(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Dm.prototype=Object.create(Ei.prototype),Dm.prototype.constructor=Dm);Dm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof jt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,a_e)),l(c)||(c=G.WHITE),o=Xt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Rt({id:t,geometry:new DF(this._options),attributes:i})};Dm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,a_e),o=this._distanceDisplayConditionProperty.getValue(e);return new Rt({id:t,geometry:new RF(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(o)}})};Dm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Ei.prototype._isHidden.call(this,e,t)};Dm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!j.isConstant(t.granularity)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.cornerType)};Dm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof jt;o.vertexFormat=r?hn.VERTEX_FORMAT:xo.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};Dm.DynamicGeometryUpdater=PS;function PS(e,t,n){yi.call(this,e,t,n)}l(Object.create)&&(PS.prototype=Object.create(yi.prototype),PS.prototype.constructor=PS);PS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||yi.prototype._isHidden.call(this,e,t,n)};PS.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=j.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=j.getValueOrUndefined(t.shape,n),i.granularity=j.getValueOrUndefined(t.granularity,n),i.cornerType=j.getValueOrUndefined(t.cornerType,n)};var MF=Dm;var eJ=new d,u_e=new d,f_e=new d,d_e=new d,h_e=new ce,qst=new F,Kst=new le,Jst=new le;function A_e(e,t){let n=new ht({attributes:new pn,primitiveType:Pe.TRIANGLES});return n.attributes.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function Xst(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,u=d_e,f=f_e,h=u_e;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<o;m+=3){let g=d.fromArray(e,m,eJ),A=c+1,_=c+2;h=n.geodeticSurfaceNormal(g,h),(t.tangent||t.bitangent)&&(d.cross(d.UNIT_Z,h,f),X.multiplyByVector(i,f,f),d.normalize(f,f),t.bitangent&&d.normalize(d.cross(h,f,u),u)),t.normal&&(r[c]=h.x,r[A]=h.y,r[_]=h.z),t.tangent&&(s[c]=f.x,s[A]=f.y,s[_]=f.z),t.bitangent&&(a[c]=u.x,a[A]=u.y,a[_]=u.z),c+=3}return A_e(t,{positions:e,normals:r,tangents:s,bitangents:a})}var tJ=new d,m_e=new d;function Zst(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,u=0,f=!0,h=d_e,m=f_e,g=u_e;if(t.normal||t.tangent||t.bitangent)for(let A=0;A<i;A+=6){let _=d.fromArray(e,A,eJ),C=d.fromArray(e,(A+6)%i,tJ);if(f){let y=d.fromArray(e,(A+3)%i,m_e);d.subtract(C,_,C),d.subtract(y,_,y),g=d.normalize(d.cross(y,C,g),g),f=!1}d.equalsEpsilon(C,_,D.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(_,h),t.tangent&&(m=d.normalize(d.cross(h,g,m),m))),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++]=m.x,r[c++]=m.y,r[c++]=m.z,r[c++]=m.x,r[c++]=m.y,r[c++]=m.z),t.bitangent&&(s[u++]=h.x,s[u++]=h.y,s[u++]=h.z,s[u++]=h.x,s[u++]=h.y,s[u++]=h.z)}return A_e(t,{positions:e,normals:o,tangents:r,bitangents:s})}function p_e(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,u=o,f=o,h=0;s&&(c=1,f-=1,h+=1),a&&(u-=1,f-=1,h+=1),h+=r*f;let m=n.position?new Float64Array(h*3):void 0,g=n.st?new Float32Array(h*2):void 0,A=0,_=0,C=eJ,y=qst,E=Number.MAX_VALUE,I=Number.MAX_VALUE,x=-Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let b=c;b<u;++b)for(let T=0;T<r;++T)ra.computePosition(t,i,n.st,b,T,C,y),m[A++]=C.x,m[A++]=C.y,m[A++]=C.z,n.st&&(g[_++]=y.x,g[_++]=y.y,E=Math.min(E,y.x),I=Math.min(I,y.y),x=Math.max(x,y.x),S=Math.max(S,y.y));if(s&&(ra.computePosition(t,i,n.st,0,0,C,y),m[A++]=C.x,m[A++]=C.y,m[A++]=C.z,n.st&&(g[_++]=y.x,g[_++]=y.y,E=y.x,I=y.y,x=y.x,S=y.y)),a&&(ra.computePosition(t,i,n.st,o-1,0,C,y),m[A++]=C.x,m[A++]=C.y,m[A]=C.z,n.st&&(g[_++]=y.x,g[_]=y.y,E=Math.min(E,y.x),I=Math.min(I,y.y),x=Math.max(x,y.x),S=Math.max(S,y.y))),n.st&&(E<0||I<0||x>1||S>1))for(let b=0;b<g.length;b+=2)g[b]=(g[b]-E)/(x-E),g[b+1]=(g[b+1]-I)/(S-I);let w=Xst(m,n,i,t.tangentRotationMatrix),v=6*(r-1)*(f-1);s&&(v+=3*(r-1)),a&&(v+=3*(r-1));let P=Fe.createTypedArray(h,v),N=0,L=0,p;for(p=0;p<f-1;++p){for(let b=0;b<r-1;++b){let T=N,B=T+r,R=B+1,O=T+1;P[L++]=T,P[L++]=B,P[L++]=O,P[L++]=O,P[L++]=B,P[L++]=R,++N}++N}if(s||a){let b=h-1,T=h-1;s&&a&&(b=h-2);let B,R;if(N=0,s)for(p=0;p<r-1;p++)B=N,R=B+1,P[L++]=b,P[L++]=B,P[L++]=R,++N;if(a)for(N=(f-1)*r,p=0;p<r-1;p++)B=N,R=B+1,P[L++]=B,P[L++]=T,P[L++]=R,++N}return w.indices=P,n.st&&(w.attributes.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:g})),w}function RS(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 MS(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 nJ=new Re;function $st(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Ye=Re.clone(o,nJ);Ye.normal=!0,e._vertexFormat=Ye}let h=p_e(e,t);n&&(e._vertexFormat=o);let m=bi.scaleToGeodeticHeight(h.attributes.position.values,s,a,!1);m=new Float64Array(m);let g=m.length,A=g*2,_=new Float64Array(A);_.set(m);let C=bi.scaleToGeodeticHeight(h.attributes.position.values,r,a);_.set(C,g),h.attributes.position.values=_;let y=o.normal?new Float32Array(A):void 0,E=o.tangent?new Float32Array(A):void 0,I=o.bitangent?new Float32Array(A):void 0,x=o.st?new Float32Array(A/3*2):void 0,S,w;if(o.normal){for(w=h.attributes.normal.values,y.set(w),f=0;f<g;f++)w[f]=-w[f];y.set(w,g),h.attributes.normal.values=y}if(n){w=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let Ye=new Float32Array(A);for(f=0;f<g;f++)w[f]=-w[f];Ye.set(w,g),h.attributes.extrudeDirection=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:Ye})}let v,P=l(i);if(P){let Ye=g/3*2,nt=new Uint8Array(Ye);i===un.TOP?nt=nt.fill(1,0,Ye/2):(v=i===un.NONE?0:1,nt=nt.fill(v)),h.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:nt})}if(o.tangent){let Ye=h.attributes.tangent.values;for(E.set(Ye),f=0;f<g;f++)Ye[f]=-Ye[f];E.set(Ye,g),h.attributes.tangent.values=E}if(o.bitangent){let Ye=h.attributes.bitangent.values;I.set(Ye),I.set(Ye,g),h.attributes.bitangent.values=I}o.st&&(S=h.attributes.st.values,x.set(S),x.set(S,g/3*2),h.attributes.st.values=x);let N=h.indices,L=N.length,p=g/3,b=Fe.createTypedArray(A/3,L*2);for(b.set(N),f=0;f<L;f+=3)b[f+L]=N[f+2]+p,b[f+1+L]=N[f+1]+p,b[f+2+L]=N[f]+p;h.indices=b;let T=t.northCap,B=t.southCap,R=c,O=2,U=0,k=4,z=4;T&&(O-=1,R-=1,U+=1,k-=2,z-=1),B&&(O-=1,R-=1,U+=1,k-=2,z-=1),U+=O*u+2*R-k;let Q=(U+z)*2,H=new Float64Array(Q*3),W=n?new Float32Array(Q*3):void 0,Z=P?new Uint8Array(Q):void 0,Y=o.st?new Float32Array(Q*2):void 0,$=i===un.TOP;P&&!$&&(v=i===un.ALL?1:0,Z=Z.fill(v));let K=0,fe=0,ge=0,ne=0,Ce=u*R,ye;for(f=0;f<Ce;f+=u)ye=f*3,H=RS(H,K,ye,m,C),K+=6,o.st&&(Y=MS(Y,fe,f*2,S),fe+=4),n&&(ge+=3,W[ge++]=w[ye],W[ge++]=w[ye+1],W[ge++]=w[ye+2]),$&&(Z[ne++]=1,ne+=1);if(B){let Ye=T?Ce+1:Ce;for(ye=Ye*3,f=0;f<2;f++)H=RS(H,K,ye,m,C),K+=6,o.st&&(Y=MS(Y,fe,Ye*2,S),fe+=4),n&&(ge+=3,W[ge++]=w[ye],W[ge++]=w[ye+1],W[ge++]=w[ye+2]),$&&(Z[ne++]=1,ne+=1)}else for(f=Ce-u;f<Ce;f++)ye=f*3,H=RS(H,K,ye,m,C),K+=6,o.st&&(Y=MS(Y,fe,f*2,S),fe+=4),n&&(ge+=3,W[ge++]=w[ye],W[ge++]=w[ye+1],W[ge++]=w[ye+2]),$&&(Z[ne++]=1,ne+=1);for(f=Ce-1;f>0;f-=u)ye=f*3,H=RS(H,K,ye,m,C),K+=6,o.st&&(Y=MS(Y,fe,f*2,S),fe+=4),n&&(ge+=3,W[ge++]=w[ye],W[ge++]=w[ye+1],W[ge++]=w[ye+2]),$&&(Z[ne++]=1,ne+=1);if(T){let Ye=Ce;for(ye=Ye*3,f=0;f<2;f++)H=RS(H,K,ye,m,C),K+=6,o.st&&(Y=MS(Y,fe,Ye*2,S),fe+=4),n&&(ge+=3,W[ge++]=w[ye],W[ge++]=w[ye+1],W[ge++]=w[ye+2]),$&&(Z[ne++]=1,ne+=1)}else for(f=u-1;f>=0;f--)ye=f*3,H=RS(H,K,ye,m,C),K+=6,o.st&&(Y=MS(Y,fe,f*2,S),fe+=4),n&&(ge+=3,W[ge++]=w[ye],W[ge++]=w[ye+1],W[ge++]=w[ye+2]),$&&(Z[ne++]=1,ne+=1);let De=Zst(H,o,a);o.st&&(De.attributes.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:Y})),n&&(De.attributes.extrudeDirection=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:W})),P&&(De.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z}));let be=Fe.createTypedArray(Q,U*6),Ne,ke,Ue,He;g=H.length/3;let Et=0;for(f=0;f<g-1;f+=2){Ne=f,He=(Ne+2)%g;let Ye=d.fromArray(H,Ne*3,tJ),nt=d.fromArray(H,He*3,m_e);d.equalsEpsilon(Ye,nt,D.EPSILON10)||(ke=(Ne+1)%g,Ue=(ke+2)%g,be[Et++]=Ne,be[Et++]=ke,be[Et++]=He,be[Et++]=He,be[Et++]=ke,be[Et++]=Ue)}return De.indices=be,De=Un.combineInstances([new Rt({geometry:h}),new Rt({geometry:De})]),De[0]}var eat=[new d,new d,new d,new d],g_e=new he,tat=new he;function iJ(e,t,n,i,o){if(n===0)return ce.clone(e,o);let r=ra.computeOptions(e,t,n,0,h_e,g_e),s=r.height,a=r.width,c=eat;return ra.computePosition(r,i,!1,0,0,c[0]),ra.computePosition(r,i,!1,0,a-1,c[1]),ra.computePosition(r,i,!1,s-1,0,c[2]),ra.computePosition(r,i,!1,s-1,a-1,c[3]),ce.fromCartesianArray(c,i,o)}function vm(e){e=e??V.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ce.clone(t),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Re.clone(e.vertexFormat??Re.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}vm.packedLength=ce.packedLength+te.packedLength+Re.packedLength+7;vm.pack=function(e,t,n){return n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.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 __e=new ce,C_e=te.clone(te.UNIT_SPHERE),ay={rectangle:__e,ellipsoid:C_e,vertexFormat:nJ,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};vm.unpack=function(e,t,n){t=t??0;let i=ce.unpack(e,t,__e);t+=ce.packedLength;let o=te.unpack(e,t,C_e);t+=te.packedLength;let r=Re.unpack(e,t,nJ);t+=Re.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++]===1,m=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=Re.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=h,n._offsetAttribute=m===-1?void 0:m,n):(ay.granularity=s,ay.height=a,ay.rotation=c,ay.stRotation=u,ay.extrudedHeight=f,ay.shadowVolume=h,ay.offsetAttribute=m===-1?void 0:m,new vm(ay))};vm.computeRectangle=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.ellipsoid??te.default,r=e.rotation??0;return iJ(n,i,r,o,t)};var nat=new X,c_e=new Qe,iat=new he;vm.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=ra.computeOptions(t,e._granularity,i,o,h_e,g_e,tat),a=nat;if(o!==0||i!==0){let g=ce.center(t,iat),A=n.geodeticSurfaceNormalCartographic(g,tJ);Qe.fromAxisAngle(A,-o,c_e),X.fromQuaternion(c_e,a)}else X.clone(X.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let h,m;if(t=e._rectangle,f){h=$st(e,s);let g=le.fromRectangle3D(t,n,c,Jst),A=le.fromRectangle3D(t,n,u,Kst);m=le.union(g,A)}else{if(h=p_e(e,s),h.attributes.position.values=bi.scaleToGeodeticHeight(h.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=h.attributes.position.values.length,A=e._offsetAttribute===un.NONE?0:1,_=new Uint8Array(g/3).fill(A);h.attributes.applyOffset=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}m=le.fromRectangle3D(t,n,c)}return r.position||delete h.attributes.position,new ht({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:m,offsetAttribute:e._offsetAttribute})};vm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new vm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Re.POSITION_ONLY,shadowVolume:!0})};var l_e=new ce,oat=[new F,new F,new F],rat=new zi,sat=new he;function aat(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,l_e),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=iJ(t,n,o,i,l_e),s=oat;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=zi.fromRotation(e._stRotation,rat),u=ce.center(a,sat);for(let A=0;A<3;++A){let _=s[A];_.x-=u.longitude,_.y-=u.latitude,zi.multiplyByVector(c,_,_),_.x+=u.longitude,_.y+=u.latitude,_.x=(_.x-a.west)/a.width,_.y=(_.y-a.south)/a.height}let f=s[0],h=s[1],m=s[2],g=new Array(6);return F.pack(f,g),F.pack(h,g,2),F.pack(m,g,4),g}Object.defineProperties(vm.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=iJ(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=aat(this)),this._textureCoordinateRotationPoints}}});var g0=vm;var y_e=new G,E_e=d.ZERO,I_e=new d,b_e=new ce,cat=new ce,lat=new he;function uat(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 hA(e,t){ti.call(this,{entity:e,scene:t,geometryOptions:new uat(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(hA.prototype=Object.create(ti.prototype),hA.prototype.constructor=hA);hA.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof jt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,y_e)),l(o)||(o=G.WHITE),i.color=Xt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,E_e,I_e))),new Rt({id:t,geometry:new g0(this._options),attributes:i})};hA.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,y_e),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=po.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,E_e,I_e))),new Rt({id:t,geometry:new WI(this._options),attributes:r})};hA.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.rectangle.coordinates,e,cat);if(!l(n))return;let i=ce.center(n,lat);return he.toCartesian(i,te.default,t)};hA.prototype._isHidden=function(e,t){return!l(t.coordinates)||Ei.prototype._isHidden.call(this,e,t)};hA.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.stRotation)||!j.isConstant(t.rotation)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.zIndex)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof jt)};hA.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof jt,i=j.getValueOrUndefined(t.height,Ke.MINIMUM_VALUE),o=j.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,$e.NONE),r=j.getValueOrUndefined(t.extrudedHeight,Ke.MINIMUM_VALUE),s=j.getValueOrDefault(t.extrudedHeightReference,Ke.MINIMUM_VALUE,$e.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?hn.VERTEX_FORMAT:xo.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ke.MINIMUM_VALUE,a.rectangle),a.granularity=j.getValueOrUndefined(t.granularity,Ke.MINIMUM_VALUE),a.stRotation=j.getValueOrUndefined(t.stRotation,Ke.MINIMUM_VALUE),a.rotation=j.getValueOrUndefined(t.rotation,Ke.MINIMUM_VALUE),a.offsetAttribute=ti.computeGeometryOffsetAttribute(i,o,r,s),a.height=ti.getGeometryHeight(i,o),r=ti.getGeometryExtrudedHeight(r,s),r===ti.CLAMP_TO_GROUND&&(r=Si.getMinimumMaximumHeights(g0.computeRectangle(a,b_e)).minimumTerrainHeight),a.extrudedHeight=r};hA.DynamicGeometryUpdater=NS;function NS(e,t,n){yi.call(this,e,t,n)}l(Object.create)&&(NS.prototype=Object.create(yi.prototype),NS.prototype.constructor=NS);NS.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||yi.prototype._isHidden.call(this,e,t,n)};NS.prototype._setOptions=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,$e.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,$e.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=j.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=j.getValueOrUndefined(t.granularity,n),i.stRotation=j.getValueOrUndefined(t.stRotation,n),i.rotation=j.getValueOrUndefined(t.rotation,n),i.offsetAttribute=ti.computeGeometryOffsetAttribute(o,r,s,a),i.height=ti.getGeometryHeight(o,r),s=ti.getGeometryExtrudedHeight(s,a),s===ti.CLAMP_TO_GROUND&&(s=Si.getMinimumMaximumHeights(g0.computeRectangle(i,b_e)).minimumTerrainHeight),i.extrudedHeight=s};var NF=hA;var x_e={};function fat(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var dat=new he,hat=new he;function Aat(e,t,n,i){t=Uo(t,d.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),u=new Array(o),f=t[0];a[0]=f;let h=e.cartesianToCartographic(f,dat);s&&(h.height=n[0]),c[0]=h.height,r?u[0]=i[0]:u[0]=0;let m=c[0],g=u[0],A=m===g,_=1;for(let C=1;C<o;++C){let y=t[C],E=e.cartesianToCartographic(y,hat);s&&(E.height=n[C]),A=A&&E.height===0,fat(h,E)?h.height<E.height&&(c[_-1]=E.height):(a[_]=y,c[_]=E.height,r?u[_]=i[C]:u[_]=0,A=A&&c[_]===u[_],he.clone(E,h),++_)}if(!(A||_<2))return a.length=_,c.length=_,u.length=_,{positions:a,topHeights:c,bottomHeights:u}}var mat=new Array(2),pat=new Array(2),gat={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};x_e.computePositions=function(e,t,n,i,o,r){let s=Aat(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,h=D.chordLength(o,e.maximumRadius),m=gat;if(m.minDistance=h,m.ellipsoid=e,r){let g=0,A;for(A=0;A<a-1;A++)g+=Wi.numberOfPoints(t[A],t[A+1],h)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let _=mat,C=pat;m.positions=_,m.height=C;let y=0;for(A=0;A<a-1;A++){_[0]=t[A],_[1]=t[A+1],C[0]=n[A],C[1]=n[A+1];let E=Wi.generateArc(m);u.set(E,y),C[0]=i[A],C[1]=i[A+1],f.set(Wi.generateArc(m),y),y+=E.length}}else m.positions=t,m.height=n,u=new Float64Array(Wi.generateArc(m)),m.height=i,f=new Float64Array(Wi.generateArc(m));return{bottomPositions:f,topPositions:u,numCorners:c}};var _0=x_e;var oJ=new d,z4=new d,_at=new d,T_e=new d,Cat=new d,yat=new d,Eat=new d;function C0(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??Re.DEFAULT,r=e.granularity??D.RADIANS_PER_DEGREE,s=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Re.clone(o),this._granularity=r,this._ellipsoid=te.clone(s),this._workerName="createWallGeometry";let a=1+t.length*d.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+te.packedLength+Re.packedLength+1}C0.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+=d.packedLength)d.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 te.pack(e._ellipsoid,t,n),n+=te.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.packedLength,t[n]=e._granularity,t};var S_e=te.clone(te.UNIT_SPHERE),B_e=new Re,LF={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:S_e,vertexFormat:B_e,granularity:void 0};C0.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.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=te.unpack(e,t,S_e);t+=te.packedLength;let u=Re.unpack(e,t,B_e);t+=Re.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=te.clone(c,n._ellipsoid),n._vertexFormat=Re.clone(u,n._vertexFormat),n._granularity=f,n):(LF.positions=r,LF.minimumHeights=s,LF.maximumHeights=a,LF.granularity=f,new C0(LF))};C0.fromConstantHeights=function(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new C0(c)};C0.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=_0.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,h=u.length,m=h*2,g=o.position?new Float64Array(m):void 0,A=o.normal?new Float32Array(m):void 0,_=o.tangent?new Float32Array(m):void 0,C=o.bitangent?new Float32Array(m):void 0,y=o.st?new Float32Array(m/3*2):void 0,E=0,I=0,x=0,S=0,w=0,v=Eat,P=yat,N=Cat,L=!0;h/=3;let p,b=0,T=1/(h-f-1);for(p=0;p<h;++p){let k=p*3,z=d.fromArray(u,k,oJ),Q=d.fromArray(c,k,z4);if(o.position&&(g[E++]=Q.x,g[E++]=Q.y,g[E++]=Q.z,g[E++]=z.x,g[E++]=z.y,g[E++]=z.z),o.st&&(y[w++]=b,y[w++]=0,y[w++]=b,y[w++]=1),o.normal||o.tangent||o.bitangent){let H=d.clone(d.ZERO,T_e),W=d.subtract(z,s.geodeticSurfaceNormal(z,z4),z4);if(p+1<h&&(H=d.fromArray(u,k+3,T_e)),L){let Z=d.subtract(H,z,_at),Y=d.subtract(W,z,oJ);v=d.normalize(d.cross(Y,Z,v),v),L=!1}d.equalsEpsilon(z,H,D.EPSILON10)?L=!0:(b+=T,o.tangent&&(P=d.normalize(d.subtract(H,z,P),P)),o.bitangent&&(N=d.normalize(d.cross(v,P,N),N))),o.normal&&(A[I++]=v.x,A[I++]=v.y,A[I++]=v.z,A[I++]=v.x,A[I++]=v.y,A[I++]=v.z),o.tangent&&(_[S++]=P.x,_[S++]=P.y,_[S++]=P.z,_[S++]=P.x,_[S++]=P.y,_[S++]=P.z),o.bitangent&&(C[x++]=N.x,C[x++]=N.y,C[x++]=N.z,C[x++]=N.x,C[x++]=N.y,C[x++]=N.z)}}let B=new pn;o.position&&(B.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(B.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:A})),o.tangent&&(B.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:_})),o.bitangent&&(B.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:C})),o.st&&(B.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:y}));let R=m/3;m-=6*(f+1);let O=Fe.createTypedArray(R,m),U=0;for(p=0;p<R-2;p+=2){let k=p,z=p+2,Q=d.fromArray(g,k*3,oJ),H=d.fromArray(g,z*3,z4);if(d.equalsEpsilon(Q,H,D.EPSILON10))continue;let W=p+1,Z=p+3;O[U++]=W,O[U++]=k,O[U++]=Z,O[U++]=Z,O[U++]=k,O[U++]=z}return new ht({attributes:B,indices:O,primitiveType:Pe.TRIANGLES,boundingSphere:new le.fromVertices(g)})};var OF=C0;var w_e=new d,D_e=new d;function y0(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=te.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*d.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+te.packedLength+1}y0.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+=d.packedLength)d.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 te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n]=e._granularity,t};var v_e=te.clone(te.UNIT_SPHERE),FF={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:v_e,granularity:void 0};y0.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.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=te.unpack(e,t,v_e);t+=te.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=te.clone(c,n._ellipsoid),n._granularity=u,n):(FF.positions=r,FF.minimumHeights=s,FF.maximumHeights=a,FF.granularity=u,new y0(FF))};y0.fromConstantHeights=function(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new y0(c)};y0.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=_0.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,h=new Float64Array(f),m=0;u/=3;let g;for(g=0;g<u;++g){let E=g*3,I=d.fromArray(c,E,w_e),x=d.fromArray(a,E,D_e);h[m++]=x.x,h[m++]=x.y,h[m++]=x.z,h[m++]=I.x,h[m++]=I.y,h[m++]=I.z}let A=new pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:h})}),_=f/3;f=2*_-4+_;let C=Fe.createTypedArray(_,f),y=0;for(g=0;g<_-2;g+=2){let E=g,I=g+2,x=d.fromArray(h,E*3,w_e),S=d.fromArray(h,I*3,D_e);if(d.equalsEpsilon(x,S,D.EPSILON10))continue;let w=g+1,v=g+3;C[y++]=w,C[y++]=E,C[y++]=w,C[y++]=v,C[y++]=E,C[y++]=I}return C[y++]=_-2,C[y++]=_-1,new ht({attributes:A,indices:C,primitiveType:Pe.LINES,boundingSphere:new le.fromVertices(h)})};var QF=y0;var P_e=new G;function Iat(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 AA(e,t){Ei.call(this,{entity:e,scene:t,geometryOptions:new Iat(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(AA.prototype=Object.create(Ei.prototype),AA.prototype.constructor=AA);AA.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof jt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,P_e)),l(c)||(c=G.WHITE),o=Xt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Rt({id:t,geometry:new OF(this._options),attributes:i})};AA.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,P_e),o=this._distanceDisplayConditionProperty.getValue(e);return new Rt({id:t,geometry:new QF(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Xt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(o)}})};AA.prototype._isHidden=function(e,t){return!l(t.positions)||Ei.prototype._isHidden.call(this,e,t)};AA.prototype._getIsClosed=function(e){return!1};AA.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!j.isConstant(t.minimumHeights)||!j.isConstant(t.maximumHeights)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.granularity)};AA.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof jt,s=this._options;s.vertexFormat=r?hn.VERTEX_FORMAT:xo.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};AA.DynamicGeometryUpdater=LS;function LS(e,t,n){yi.call(this,e,t,n)}l(Object.create)&&(LS.prototype=Object.create(yi.prototype),LS.prototype.constructor=LS);LS.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||yi.prototype._isHidden.call(this,e,t,n)};LS.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=j.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=j.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=j.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=j.getValueOrUndefined(t.granularity,n)};var kF=AA;var E0=[nM,oF,K1,gF,CF,IF,SF,MF,NF,kF];function I0(e,t){this.entity=e,this.scene=t;let n=new Array(E0.length),i=new _e,o=new kr;for(let r=0;r<n.length;r++){let s=new E0[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(I0.prototype._onEntityPropertyChanged,this)}I0.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)};I0.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};I0.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),de(this)};I0.registerUpdater=function(e){E0.includes(e)||E0.push(e)};I0.unregisterUpdater=function(e){if(E0.includes(e)){let t=E0.indexOf(e);E0.splice(t,1)}};var b0=I0;var R_e=new G,bat=new Qt,xat=new Qt,Tat=d.ZERO,Sat=new d;function mA(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 Pt,this.updaters=new Pt,this.updatersWithAttributes=new Pt,this.attributes=new Pt,this.subscriptions=new Pt,this.showsUpdated=new Pt,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(mA.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}mA.prototype.onMaterialChanged=function(){this.invalidated=!0};mA.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};mA.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||!j.isConstant(e.distanceDisplayConditionProperty)||!j.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)}))}};mA.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};mA.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 Ln({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 jt)&&(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 u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let C=u.fillMaterialProperty.color,y=j.getValueOrDefault(C,e,G.WHITE,R_e);G.equals(h._lastColor,y)||(h._lastColor=G.clone(y,h._lastColor),h.color=Xt.toValue(y,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof jt&&(!u.depthFailMaterialProperty.isConstant||c)){let C=u.depthFailMaterialProperty.color,y=j.getValueOrDefault(C,e,G.WHITE,R_e);G.equals(h._lastDepthFailColor,y)||(h._lastDepthFailColor=G.clone(y,h._lastDepthFailColor),h.depthFailColor=Xt.toValue(y,h.depthFailColor))}let m=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=h.show[0]===1;m!==g&&(h.show=xn.toValue(m,h.show));let A=u.distanceDisplayConditionProperty;if(!j.isConstant(A)){let C=j.getValueOrDefault(A,e,xat,bat);Qt.equals(C,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Qt.clone(C,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Kn.toValue(C,h.distanceDisplayCondition))}let _=u.terrainOffsetProperty;if(!j.isConstant(_)){let C=j.getValueOrDefault(_,e,Tat,Sat);d.equals(C,h._lastOffset)||(h._lastOffset=d.clone(C,h._lastOffset),h.offset=po.toValue(C,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};mA.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=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};mA.prototype.contains=function(e){return this.updaters.contains(e.id)};mA.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return mt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?mt.FAILED:(i.boundingSphere.clone(t),mt.DONE)};mA.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 OS(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}OS.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 mA(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function M_e(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}OS.prototype.remove=function(e){M_e(this._solidItems,e)||M_e(this._translucentItems,e)};function N_e(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 u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function V4(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 u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}OS.prototype.update=function(e){let t=V4(this,this._solidItems,e,!0);t=V4(this,this._translucentItems,e,t)&&t;let n=N_e(this,this._solidItems,e),i=N_e(this,this._translucentItems,e);return(n||i)&&(t=V4(this,this._solidItems,e,t)&&t,t=V4(this,this._translucentItems,e,t)&&t),t};function L_e(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 mt.FAILED}OS.prototype.getBoundingSphere=function(e,t){let n=L_e(this._solidItems,e,t);return n===mt.FAILED?L_e(this._translucentItems,e,t):n};function O_e(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}OS.prototype.removeAllPrimitives=function(){O_e(this._solidItems),O_e(this._translucentItems)};var Ud=OS;var Bat=new Qt,wat=new Qt,Dat=d.ZERO,vat=new d;function pA(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 Pt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Pt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Pt,this.attributes=new Pt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(pA.prototype.onMaterialChanged,this),this.subscriptions=new Pt,this.showsUpdated=new Pt}pA.prototype.onMaterialChanged=function(){this.invalidated=!0};pA.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};pA.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||!j.isConstant(t.distanceDisplayConditionProperty)||!j.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};pA.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 Pat=new G;pA.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 Ln({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 jt)&&(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],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof jt&&!c.depthFailMaterialProperty.isConstant){let C=c.depthFailMaterialProperty.color,y=j.getValueOrDefault(C,e,G.WHITE,Pat);G.equals(h._lastDepthFailColor,y)||(h._lastDepthFailColor=G.clone(y,h._lastDepthFailColor),h.depthFailColor=Xt.toValue(y,h.depthFailColor))}let m=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;m!==g&&(h.show=xn.toValue(m,h.show));let A=c.distanceDisplayConditionProperty;if(!j.isConstant(A)){let C=j.getValueOrDefault(A,e,wat,Bat);Qt.equals(C,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Qt.clone(C,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Kn.toValue(C,h.distanceDisplayCondition))}let _=c.terrainOffsetProperty;if(!j.isConstant(_)){let C=j.getValueOrDefault(_,e,Dat,vat);d.equals(C,h._lastOffset)||(h._lastOffset=d.clone(C,h._lastOffset),h.offset=po.toValue(C,h.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};pA.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,u=a.show[0]===1;c!==u&&(a.show=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};pA.prototype.contains=function(e){return this.updaters.contains(e.id)};pA.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return mt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?mt.FAILED:(i.boundingSphere.clone(t),mt.DONE)};pA.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 FS(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}FS.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 pA(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};FS.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}}};FS.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};FS.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 mt.FAILED};FS.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 Gd=FS;function H4(e,t,n=0,i=e.length-1,o=Rat){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),h=.5*Math.exp(2*f/3),m=.5*Math.sqrt(f*h*(c-h)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*h/c+m)),A=Math.min(i,Math.floor(t+(c-u)*h/c+m));H4(e,t,g,A,o)}let r=e[t],s=n,a=i;for(UF(e,n,t),o(e[i],r)>0&&UF(e,n,i);s<a;){for(UF(e,s,a),s++,a--;o(e[s],r)<0;)s++;for(;o(e[a],r)>0;)a--}o(e[n],r)===0?UF(e,n,a):(a++,UF(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function UF(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Rat(e,t){return e<t?-1:e>t?1:0}var VF=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(!W4(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;W4(t,c)&&(n.leaf?i.push(a):sJ(t,c)?this._all(a,i):r.push(a))}n=r.pop()}return i}collides(t){let n=this.data;if(!W4(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(W4(t,s)){if(n.leaf||sJ(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=kS([]),this}remove(t,n){if(!t)return this;let i=this.data,o=this.toBBox(t),r=[],s=[],a,c,u;for(;i||r.length;){if(i||(i=r.pop(),c=r[r.length-1],a=s.pop(),u=!0),i.leaf){let f=Mat(t,i.children,n);if(f!==-1)return i.children.splice(f,1),r.push(i),this._condense(r),this}!u&&!i.leaf&&sJ(i,o)?(r.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],u=!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=kS(t.slice(n,i+1)),QS(a,this.toBBox),a;o||(o=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,o-1))),a=kS([]),a.leaf=!1,a.height=o;let c=Math.ceil(r/s),u=c*Math.ceil(Math.sqrt(s));F_e(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let h=Math.min(f+u-1,i);F_e(t,f,h,c,this.compareMinY);for(let m=f;m<=h;m+=c){let g=Math.min(m+c-1,h);a.children.push(this._build(t,m,g,o-1))}}return QS(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 u=n.children[c],f=rJ(u),h=Oat(t,u)-f;h<s?(s=h,r=f<r?f:r,a=u):h===s&&f<r&&(r=f,a=u)}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),zF(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=kS(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,QS(i,this.toBBox),QS(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=kS([t,n]),this.data.height=t.height+1,this.data.leaf=!1,QS(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=GF(t,0,a,this.toBBox),u=GF(t,a,i,this.toBBox),f=Fat(c,u),h=rJ(c)+rJ(u);f<r?(r=f,o=a,s=h<s?h:s):f===r&&h<s&&(s=h,o=a)}return o||i-n}_chooseSplitAxis(t,n,i){let o=t.leaf?this.compareMinX:Nat,r=t.leaf?this.compareMinY:Lat,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=GF(t,0,n,r),a=GF(t,i-n,i,r),c=Y4(s)+Y4(a);for(let u=n;u<i-n;u++){let f=t.children[u];zF(s,t.leaf?r(f):f),c+=Y4(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];zF(a,t.leaf?r(f):f),c+=Y4(a)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)zF(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():QS(t[n],this.toBBox)}};function Mat(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 QS(e,t){GF(e,0,e.children.length,t,e)}function GF(e,t,n,i,o){o||(o=kS(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];zF(o,e.leaf?i(s):s)}return o}function zF(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 Nat(e,t){return e.minX-t.minX}function Lat(e,t){return e.minY-t.minY}function rJ(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Y4(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Oat(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 Fat(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 sJ(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function W4(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function kS(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function F_e(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;H4(e,s,t,n,o),r.push(t,s,s,n)}}function j4(){this._tree=new VF}function x0(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}x0.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};j4.prototype.insert=function(e,t){let n=x0.fromRectangleAndId(e,t,new x0);this._tree.insert(n)};function Qat(e,t){return e.id===t.id}var kat=new x0;j4.prototype.remove=function(e,t){let n=x0.fromRectangleAndId(e,t,kat);this._tree.remove(n,Qat)};var Uat=new x0;j4.prototype.collides=function(e){let t=x0.fromRectangleAndId("",e,Uat);return this._tree.collides(t)};var T0=j4;var Gat=new G,zat=new Qt,Vat=new Qt;function Jg(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 Pt,this.updaters=new Pt,this.updatersWithAttributes=new Pt,this.attributes=new Pt,this.subscriptions=new Pt,this.showsUpdated=new Pt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new T0}Jg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Jg.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||!j.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)}))}};Jg.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};Jg.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 Cl({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 u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let _=u.fillMaterialProperty.color,C=j.getValueOrDefault(_,e,G.WHITE,Gat);G.equals(h._lastColor,C)||(h._lastColor=G.clone(C,h._lastColor),h.color=Xt.toValue(C,h.color))}let m=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=h.show[0]===1;m!==g&&(h.show=xn.toValue(m,h.show));let A=u.distanceDisplayConditionProperty;if(!j.isConstant(A)){let _=j.getValueOrDefault(A,e,Vat,zat);Qt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Qt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Kn.toValue(_,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Jg.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=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Jg.prototype.contains=function(e){return this.updaters.contains(e.id)};Jg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return mt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),mt.DONE):mt.FAILED};Jg.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 US(e,t){this._batches=[],this._primitives=e,this._classificationType=t}US.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=j.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 Jg(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};US.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};US.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 u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.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};US.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 mt.FAILED};US.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var GS=US;var Hat=new Qt,Yat=new Qt;function Pm(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Pt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Pt,this.material=void 0,this.updatersWithAttributes=new Pt,this.attributes=new Pt,this.subscriptions=new Pt,this.showsUpdated=new Pt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new T0}Pm.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Pm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof jt&&t instanceof jt?!0:l(t)&&t.equals(n)};Pm.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||!j.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};Pm.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};Pm.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 Cl({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],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h));let m=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;m!==g&&(h.show=xn.toValue(m,h.show));let A=c.distanceDisplayConditionProperty;if(!j.isConstant(A)){let _=j.getValueOrDefault(A,e,Yat,Hat);Qt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Qt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Kn.toValue(_,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Pm.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,u=a.show[0]===1;c!==u&&(a.show=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Pm.prototype.contains=function(e){return this.updaters.contains(e.id)};Pm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return mt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?mt.FAILED:(i.boundingSphere.clone(t),mt.DONE)};Pm.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 zS(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}zS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=$u.shouldUseSphericalCoordinates(o.geometry.rectangle),s=j.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new Pm(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};zS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};zS.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};zS.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 mt.FAILED};zS.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 HF=zS;var Wat=new G,jat=new Qt,qat=new Qt,Kat=d.ZERO,Jat=new d;function Xg(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 Pt,this.updaters=new Pt,this.updatersWithAttributes=new Pt,this.attributes=new Pt,this.itemsToRemove=[],this.subscriptions=new Pt,this.showsUpdated=new Pt}Xg.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||!j.isConstant(e.distanceDisplayConditionProperty)||!j.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)}))}};Xg.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};Xg.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 Ln({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new hn({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 u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.outlineColorProperty.isConstant||c){let C=u.outlineColorProperty,y=j.getValueOrDefault(C,e,G.WHITE,Wat);G.equals(h._lastColor,y)||(h._lastColor=G.clone(y,h._lastColor),h.color=Xt.toValue(y,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let m=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=h.show[0]===1;m!==g&&(h.show=xn.toValue(m,h.show));let A=u.distanceDisplayConditionProperty;if(!j.isConstant(A)){let C=j.getValueOrDefault(A,e,qat,jat);Qt.equals(C,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Qt.clone(C,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Kn.toValue(C,h.distanceDisplayCondition))}let _=u.terrainOffsetProperty;if(!j.isConstant(_)){let C=j.getValueOrDefault(_,e,Kat,Jat);d.equals(C,h._lastOffset)||(h._lastOffset=d.clone(C,h._lastOffset),h.offset=po.toValue(C,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Xg.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=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Xg.prototype.contains=function(e){return this.updaters.contains(e.id)};Xg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return mt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?mt.FAILED:(i.boundingSphere.clone(t),mt.DONE)};Xg.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 VS(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Pt,this._translucentBatches=new Pt}VS.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 Xg(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 Xg(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};VS.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};VS.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,u,f=!0,h=!1;do{for(h=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let m=u.length;if(m>0)for(h=!0,t=0;t<m;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let m=u.length;if(m>0)for(h=!0,t=0;t<m;t++)i=u[t],o.remove(i),this.add(e,i)}}while(h);return f};VS.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 mt.FAILED};VS.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 HS=VS;var Xat=[];function wu(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 Pt,this._removedObjects=new Pt,this._changedObjects=new Pt;let o=Tn.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=Er.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new HS(n,e,s,!1),this._outlineBatches[o+s]=new HS(n,e,s,!0),this._closedColorBatches[s]=new Ud(n,hn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Ud(n,hn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Gd(n,xo,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Gd(n,xo,void 0,!0,s,!1),this._openColorBatches[s]=new Ud(n,hn,void 0,!1,s,!0),this._openColorBatches[o+s]=new Ud(n,hn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Gd(n,xo,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Gd(n,xo,void 0,!1,s,!1);let a=Jn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new HF(i,s,xo)),c[s]=new GS(i,s);else for(s=0;s<a;++s)c[s]=new GS(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new d0(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Pt,this._updaterSets=new Pt,this._entityCollection=t,t.collectionChanged.addEventListener(wu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Xat)}wu.registerUpdater=function(e){b0.registerUpdater(e)};wu.unregisterUpdater=function(e){b0.unregisterUpdater(e)};wu.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,u,f,h=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(_){h._removeUpdater(_),h._insertUpdaterIntoBatch(e,_)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new b0(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(_){h._insertUpdaterIntoBatch(e,_)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(wu._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let m=!0,g=this._batches,A=g.length;for(a=0;a<A;a++)m=g[a].update(e)&&m;return m};var Zat=[],$at=new le;wu.prototype.getBoundingSphere=function(e,t){let n=Zat,i=$at,o=0,r=mt.DONE,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let h=u[f];for(let m=0;m<a;m++){if(r=s[m].getBoundingSphere(h,i),r===mt.PENDING)return mt.PENDING;r===mt.DONE&&(n[o]=le.clone(i,n[o]),o++)}}return o===0?mt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),mt.DONE)};wu.prototype.isDestroyed=function(){return!1};wu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(wu.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(),de(this)};wu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};wu.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=Tn.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 jt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof jt?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 jt?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)};wu._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)};wu.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 YF=wu;var ect=1,tct="30px sans-serif",nct=cr.FILL,ict=G.WHITE,oct=G.BLACK,rct=1,sct=!1,act=new G(.165,.165,.165,.8),cct=new F(7,5),lct=F.ZERO,uct=d.ZERO,fct=$e.NONE,dct=Mi.CENTER,hct=Gn.CENTER,Act=new d,mct=new G,pct=new G,gct=new G,_ct=new F,Cct=new d,yct=new F,Ect=new Ht,Ict=new Ht,bct=new Ht,xct=new Qt;function Q_e(e){this.entity=e,this.label=void 0,this.index=void 0}function cy(e,t){t.collectionChanged.addEventListener(cy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Pt,this._onCollectionChanged(t,t.values,[],[])}cy.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,u=r.label,f=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),h;if(f&&(h=j.getValueOrUndefined(s._position,e,Act),c=j.getValueOrUndefined(a._text,e),f=l(h)&&l(c)),!f){aJ(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let m=!1,g=j.getValueOrDefault(a._heightReference,e,fct);l(u)||(u=n.getLabel(s),u.id=s,r.label=u,m=d.equals(u.position,h)&&u.heightReference===g),u.show=!0,u.position=h,u.text=c,u.scale=j.getValueOrDefault(a._scale,e,ect),u.font=j.getValueOrDefault(a._font,e,tct),u.style=j.getValueOrDefault(a._style,e,nct),u.fillColor=j.getValueOrDefault(a._fillColor,e,ict,mct),u.outlineColor=j.getValueOrDefault(a._outlineColor,e,oct,pct),u.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,rct),u.showBackground=j.getValueOrDefault(a._showBackground,e,sct),u.backgroundColor=j.getValueOrDefault(a._backgroundColor,e,act,gct),u.backgroundPadding=j.getValueOrDefault(a._backgroundPadding,e,cct,_ct),u.pixelOffset=j.getValueOrDefault(a._pixelOffset,e,lct,yct),u.eyeOffset=j.getValueOrDefault(a._eyeOffset,e,uct,Cct),u.heightReference=g,u.horizontalOrigin=j.getValueOrDefault(a._horizontalOrigin,e,dct),u.verticalOrigin=j.getValueOrDefault(a._verticalOrigin,e,hct),u.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,Ect),u.pixelOffsetScaleByDistance=j.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Ict),u.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,bct),u.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,xct),u.disableDepthTestDistance=j.getValueOrUndefined(a._disableDepthTestDistance,e),m&&u._updateClamping()}return!0};cy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return mt.FAILED;let i=n.label;return t.center=d.clone(i._clampedPosition??i.position,t.center),t.radius=0,mt.DONE};cy.prototype.isDestroyed=function(){return!1};cy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(cy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return de(this)};cy.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 Q_e(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 Q_e(r)):(aJ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],aJ(s.get(r.id),r,a),s.remove(r.id)};function aJ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var WF=cy;var Tct=1,Sct=!0,Bct=0,wct=!0,Dct=!0,vct=Tn.ENABLED,Pct=$e.NONE,Rct=G.RED,Mct=0,Nct=G.WHITE,Lct=Yc.HIGHLIGHT,Oct=.5,Fct=new F(1,1),k_e={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Qct=new M,kct=new M,U_e=new G,G_e=new Array(4),Uct=new d;function ly(e,t){t.collectionChanged.addEventListener(ly.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Pt,this._onCollectionChanged(t,t.values,[],[])}async function Gct(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await qh.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}}ly.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,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),h;if(f&&(h=s.computeModelMatrix(e,Qct),c=Be.createIfNeeded(j.getValueOrUndefined(a._uri,e)),f=l(h)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...k_e}},n[s.id]=u;let A=j.getValueOrDefault(a._incrementallyLoadTextures,e,wct),_=j.getValueOrDefault(a._environmentMapOptions,e,k_e,u.environmentMapOptionsScratch);Gct(this,s,c,A,_)}let m=u.modelPrimitive;if(!l(m))continue;m.show=!0,m.scale=j.getValueOrDefault(a._scale,e,Tct),m.enableVerticalExaggeration=j.getValueOrDefault(a._enableVerticalExaggeration,e,Sct),m.minimumPixelSize=j.getValueOrDefault(a._minimumPixelSize,e,Bct),m.maximumScale=j.getValueOrUndefined(a._maximumScale,e),m.modelMatrix=M.clone(h,m.modelMatrix),m.shadows=j.getValueOrDefault(a._shadows,e,vct),m.heightReference=j.getValueOrDefault(a._heightReference,e,Pct),m.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e),m.silhouetteColor=j.getValueOrDefault(a._silhouetteColor,e,Rct,U_e),m.silhouetteSize=j.getValueOrDefault(a._silhouetteSize,e,Mct),m.color=j.getValueOrDefault(a._color,e,Nct,U_e),m.colorBlendMode=j.getValueOrDefault(a._colorBlendMode,e,Lct),m.colorBlendAmount=j.getValueOrDefault(a._colorBlendAmount,e,Oct),m.clippingPlanes=j.getValueOrUndefined(a._clippingPlanes,e),m.clampAnimations=j.getValueOrDefault(a._clampAnimations,e,Dct),m.imageBasedLighting.imageBasedLightingFactor=j.getValueOrDefault(a._imageBasedLightingFactor,e,Fct);let g=j.getValueOrUndefined(a._lightColor,e);if(l(g)&&(G.pack(g,G_e,0),g=d.unpack(G_e,0,Uct)),m.lightColor=g,m.customShader=j.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,m.ready){let A=j.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==A&&(A?m.activeAnimations.addAll({loop:gu.REPEAT}):m.activeAnimations.removeAll(),u.animationsRunning=A);let _=j.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(_)){let E=Object.keys(_);for(let I=0,x=E.length;I<x;++I){let S=E[I],w=_[S];if(!l(w))continue;let v=m.getNode(S);if(!l(v))continue;let P=M.fromTranslationRotationScale(w,kct);v.matrix=M.multiply(v.originalMatrix,P,P)}}let C=!1,y=j.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(y)){let E=Object.keys(y);for(let I=0,x=E.length;I<x;++I){let S=E[I],w=y[S];l(w)&&(C=!0,m.setArticulationStage(S,w))}}C&&m.applyArticulations()}}return!0};ly.prototype.isDestroyed=function(){return!1};ly.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ly.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)cJ(this,e[i],t,n);return de(this)};var q4=new d,zct=new he;ly.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return mt.FAILED;if(n.loadFailed)return mt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return mt.PENDING;if(!i.ready||!n.modelUpdated)return mt.PENDING;let o=this._scene,r=o.ellipsoid??te.default;if(i.heightReference!==$e.NONE){let a=i.modelMatrix;q4.x=a[12],q4.y=a[13],q4.z=a[14];let c=r.cartesianToCartographic(q4,zct),u=o.getHeight(c,i.heightReference);return l(u)&&(od(i.heightReference)?c.height=u:c.height+=u),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),mt.DONE}return le.clone(i.boundingSphere,t),mt.DONE};ly.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)?(Vct(r,a),s.set(r.id,r)):(cJ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],cJ(this,r,a,c),s.remove(r.id)};function cJ(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Vct(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var jF=ly;function uy(e){this._definitionChanged=new _e,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(uy.prototype,{isConstant:{get:function(){return j.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:$i.FIXED}}});var Hct=new J;uy.prototype.getValue=function(e,t){return l(e)||(e=J.now(Hct)),this.getValueInReferenceFrame(e,$i.FIXED,t)};uy.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))};uy.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?te.default.scaleToGeodeticSurface(n,n):void 0};uy.prototype.equals=function(e){return this===e||e instanceof uy&&this._value===e._value};uy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Rm=uy;var Yct=60,Wct=1,V_e=new wn,lJ=new wn,uJ=new wn;function z_e(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function jct(e,t,n,i,o,r,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,r,c[u]),l(f)&&(c[u++]=f);let h=!l(o)||J.lessThanOrEquals(o,t)||J.greaterThanOrEquals(o,n),m=0,g=i.length,A=i[m],_=n,C=!1,y,E,I;for(;m<g;){if(!h&&J.greaterThanOrEquals(A,o)&&(f=e.getValueInReferenceFrame(o,r,c[u]),l(f)&&(c[u++]=f),h=!0),J.greaterThan(A,t)&&J.lessThan(A,_)&&!A.equals(o)&&(f=e.getValueInReferenceFrame(A,r,c[u]),l(f)&&(c[u++]=f)),m<g-1){if(s>0&&!C){let x=i[m+1],S=J.secondsDifference(x,A);C=S>s,C&&(y=Math.ceil(S/s),E=0,I=S/Math.max(y,2),y=Math.max(y-1,1))}if(C&&E<y){A=J.addSeconds(A,I,new J),E++;continue}}C=!1,m++,A=i[m]}return f=e.getValueInReferenceFrame(n,r,c[u]),l(f)&&(c[u++]=f),u}function qct(e,t,n,i,o,r,s,a){let c,u=0,f=s,h=t,m=!l(i)||J.lessThanOrEquals(i,t)||J.greaterThanOrEquals(i,n);for(;J.lessThan(h,n);)!m&&J.greaterThanOrEquals(h,i)&&(m=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,a[f]),l(c)&&(a[f]=c,f++),u++,h=J.addSeconds(t,r*u,new J);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Kct(e,t,n,i,o,r,s,a){let c,u=0,f=s,h=t,m=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[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,a[f]),l(c)&&(a[f]=c,f++),u++,h=J.addSeconds(t,m*u,new J);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Jct(e,t,n,i,o,r,s,a){uJ.start=t,uJ.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!wn.intersect(h,uJ,V_e).isEmpty){let m=h.start;h.isStartIncluded||(h.isStopIncluded?m=h.stop:m=J.addSeconds(h.start,J.secondsDifference(h.stop,h.start)/2,new J));let g=e.getValueInReferenceFrame(m,o,a[c]);l(g)&&(a[c]=g,c++)}}return c}function Xct(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Zct(e,t,n,i,o,r,s,a){lJ.start=t,lJ.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!wn.intersect(h,lJ,V_e).isEmpty){let m=h.start,g=h.stop,A=t;J.greaterThan(m,A)&&(A=m);let _=n;J.lessThan(g,_)&&(_=g),c=H_e(h.data,A,_,i,o,r,c,a)}}return c}function H_e(e,t,n,i,o,r,s,a){for(;e instanceof Vg;)e=e.resolvedProperty;if(e instanceof nc){let c=e._property._times;s=jct(e,t,n,c,i,o,r,s,a)}else e instanceof iM?s=qct(e,t,n,i,o,r,s,a):e instanceof ec?s=Zct(e,t,n,i,o,r,s,a):e instanceof Hg?s=Jct(e,t,n,i,o,r,s,a):e instanceof El||e instanceof Rm&&j.isConstant(e)?s=Xct(e,t,n,i,o,r,s,a):s=Kct(e,t,n,i,o,r,s,a);return s}function Y_e(e,t,n,i,o,r,s){l(s)||(s=[]);let a=H_e(e,t,n,i,o,r,0,s);return s.length=a,s}var $ct=new X;function qF(e,t){this._unusedIndexes=[],this._polylineCollection=new Zh,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}qF.prototype.update=function(e){if(this._referenceFrame===$i.INERTIAL){let t=It.computeIcrfToCentralBodyFixedMatrix(e,$ct);M.fromRotationTranslation(t,d.ZERO,this._polylineCollection.modelMatrix)}};qF.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let h=j.getValueOrUndefined(i._leadTime,e),m=j.getValueOrUndefined(i._trailTime,e),g=n._availability,A=l(g),_=l(h),C=l(m);if(u=A||_&&C,u){if(C&&(r=J.addSeconds(e,-m,new J)),_&&(s=J.addSeconds(e,h,new J)),A){let y=g.start,E=g.stop;(!C||J.greaterThan(y,r))&&(r=y),(!_||J.lessThan(E,s))&&(s=E)}u=J.lessThan(r,s)}}if(!u){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 f=j.getValueOrDefault(i._resolution,e,Yct);c.show=!0,c.positions=Y_e(o,r,s,e,this._referenceFrame,f,c.positions.slice()),c.material=yr.getValue(e,i._material,c.material),c.width=j.getValueOrDefault(i._width,e,Wct),c.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};qF.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)};qF.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),de(this)};function fy(e,t){t.collectionChanged.addEventListener(fy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Pt,this._onCollectionChanged(t,t.values,[],[])}fy.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,u=$i.FIXED;this._scene.mode===oe.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(f)||(f=new qF(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,l(f)&&f.updateObject(e,r)}return!0};fy.prototype.isDestroyed=function(){return!1};fy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(fy.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return de(this)};fy.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 z_e(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 z_e(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))};fy._subSample=Y_e;var KF=fy;var W_e=G.WHITE,j_e=G.BLACK,q_e=0,K_e=1,J_e=0,X_e=Lr.NONE,Z_e=new G,elt=new d,$_e=new G,eCe=new Ht,tCe=new Ht,nCe=new Qt;function iCe(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 dy(e,t){t.collectionChanged.addEventListener(dy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Pt,this._onCollectionChanged(t,t.values,[],[])}dy.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,u=r.billboard,f=j.getValueOrDefault(a._heightReference,e,$e.NONE),h=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),m;if(h&&(m=j.getValueOrUndefined(s._position,e,elt),h=l(m)),!h){JF(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,A=!1;if(f!==$e.NONE&&!l(u)?(l(c)&&(JF(r,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,g=!0,A=d.equals(u.position,m)&&u.heightReference===f):f===$e.NONE&&!l(c)&&(l(u)&&(JF(r,s,n),u=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=m,c.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,eCe),c.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,tCe),c.color=j.getValueOrDefault(a._color,e,W_e,Z_e),c.outlineColor=j.getValueOrDefault(a._outlineColor,e,j_e,$_e),c.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,q_e),c.pixelSize=j.getValueOrDefault(a._pixelSize,e,K_e),c.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,nCe),c.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,J_e),c.splitDirection=j.getValueOrDefault(a._splitDirection,e,X_e);else if(l(u)){u.show=!0,u.position=m,u.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,eCe),u.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,tCe),u.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,nCe),u.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,J_e),u.splitDirection=j.getValueOrDefault(a._splitDirection,e,X_e),u.heightReference=f;let _=j.getValueOrDefault(a._color,e,W_e,Z_e),C=j.getValueOrDefault(a._outlineColor,e,j_e,$_e),y=Math.round(j.getValueOrDefault(a._outlineWidth,e,q_e)),E=Math.max(1,Math.round(j.getValueOrDefault(a._pixelSize,e,K_e)));if(y>0?(u.scale=1,g=g||y!==r.outlineWidth||E!==r.pixelSize||!G.equals(_,r.color)||!G.equals(C,r.outlineColor)):(u.scale=E/50,E=50,g=g||y!==r.outlineWidth||!G.equals(_,r.color)||!G.equals(C,r.outlineColor)),g){r.color=G.clone(_,r.color),r.outlineColor=G.clone(C,r.outlineColor),r.pixelSize=E,r.outlineWidth=y;let I=_.alpha,x=_.toCssColorString(),S=C.toCssColorString(),w=JSON.stringify([x,E,S,y]);u.setImage(w,QI(I,x,S,y,E))}A&&u._updateClamping()}}return!0};dy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return mt.FAILED;if(l(n.pointPrimitive))t.center=d.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return mt.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,mt.DONE};dy.prototype.isDestroyed=function(){return!1};dy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(dy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return de(this)};dy.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 iCe(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 iCe(r)):(JF(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],JF(s.get(r.id),r,a),s.remove(r.id)};function JF(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 XF=dy;var cCe=[];function tlt(e,t,n,i,o){let r=cCe;r.length=o;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,h=i.red,m=i.green,g=i.blue,A=i.alpha;if(G.equals(n,i)){for(s=0;s<o;s++)r[s]=G.clone(n);return r}let _=(h-a)/o,C=(m-c)/o,y=(g-u)/o,E=(A-f)/o;for(s=0;s<o;s++)r[s]=new G(a+s*_,c+s*C,u+s*y,f+s*E);return r}function ZF(e){e=e??V.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=Re.clone(e.vertexFormat??Re.DEFAULT),this._arcType=e.arcType??an.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createPolylineGeometry";let r=1+t.length*d.packedLength;r+=l(n)?1+n.length*G.packedLength:1,this.packedLength=r+te.packedLength+Re.packedLength+4}ZF.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+=d.packedLength)d.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+=G.packedLength)G.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var lCe=te.clone(te.UNIT_SPHERE),uCe=new Re,S0={positions:void 0,colors:void 0,ellipsoid:lCe,vertexFormat:uCe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};ZF.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=G.packedLength)s[i]=G.unpack(e,t);let a=te.unpack(e,t,lCe);t+=te.packedLength;let c=Re.unpack(e,t,uCe);t+=Re.packedLength;let u=e[t++],f=e[t++]===1,h=e[t++],m=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=te.clone(a,n._ellipsoid),n._vertexFormat=Re.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=h,n._granularity=m,n):(S0.positions=r,S0.colors=s,S0.width=u,S0.colorsPerVertex=f,S0.arcType=h,S0.granularity=m,new ZF(S0))};var oCe=new d,rCe=new d,sCe=new d,aCe=new d;ZF.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,u,f,h=[],m=Uo(e._positions,d.equalsEpsilon,!1,h);if(l(i)&&h.length>0){let R=0,O=h[0];i=i.filter(function(U,k){let z=!1;return o?z=k===O||k===0&&O===1:z=k+1===O,z?(R++,O=h[R],!1):!0})}let g=m.length;if(g<2||t<=0)return;if(r===an.GEODESIC||r===an.RHUMB){let R,O;r===an.GEODESIC?(R=D.chordLength(s,a.maximumRadius),O=Wi.numberOfPoints):(R=s,O=Wi.numberOfPointsRhumbLine);let U=Wi.extractHeights(m,a);if(l(i)){let k=1;for(c=0;c<g-1;++c)k+=O(m[c],m[c+1],R);let z=new Array(k),Q=0;for(c=0;c<g-1;++c){let H=m[c],W=m[c+1],Z=i[c],Y=O(H,W,R);if(o&&c<k){let $=i[c+1],K=tlt(H,W,Z,$,Y),fe=K.length;for(u=0;u<fe;++u)z[Q++]=K[u]}else for(u=0;u<Y;++u)z[Q++]=G.clone(Z)}z[Q]=G.clone(i[i.length-1]),i=z,cCe.length=0}r===an.GEODESIC?m=Wi.generateCartesianArc({positions:m,minDistance:R,ellipsoid:a,height:U}):m=Wi.generateCartesianRhumbArc({positions:m,granularity:R,ellipsoid:a,height:U})}g=m.length;let A=g*4-4,_=new Float64Array(A*3),C=new Float64Array(A*3),y=new Float64Array(A*3),E=new Float32Array(A*2),I=n.st?new Float32Array(A*2):void 0,x=l(i)?new Uint8Array(A*4):void 0,S=0,w=0,v=0,P=0,N;for(u=0;u<g;++u){u===0?(N=oCe,d.subtract(m[0],m[1],N),d.add(m[0],N,N)):N=m[u-1],d.clone(N,sCe),d.clone(m[u],rCe),u===g-1?(N=oCe,d.subtract(m[g-1],m[g-2],N),d.add(m[g-1],N,N)):N=m[u+1],d.clone(N,aCe);let R,O;l(x)&&(u!==0&&!o?R=i[u-1]:R=i[u],u!==g-1&&(O=i[u]));let U=u===0?2:0,k=u===g-1?2:4;for(f=U;f<k;++f){d.pack(rCe,_,S),d.pack(sCe,C,S),d.pack(aCe,y,S),S+=3;let z=f-2<0?-1:1;if(E[w++]=2*(f%2)-1,E[w++]=z*t,n.st&&(I[v++]=u/(g-1),I[v++]=Math.max(E[w-2],0)),l(x)){let Q=f<2?R:O;x[P++]=G.floatToByte(Q.red),x[P++]=G.floatToByte(Q.green),x[P++]=G.floatToByte(Q.blue),x[P++]=G.floatToByte(Q.alpha)}}}let L=new pn;L.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:_}),L.prevPosition=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:C}),L.nextPosition=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:y}),L.expandAndWidth=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:E}),n.st&&(L.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:I})),l(x)&&(L.color=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:4,values:x,normalize:!0}));let p=Fe.createTypedArray(A,g*6-6),b=0,T=0,B=g-1;for(u=0;u<B;++u)p[T++]=b,p[T++]=b+2,p[T++]=b+1,p[T++]=b+1,p[T++]=b+2,p[T++]=b+3,b+=4;return new ht({attributes:L,indices:p,primitiveType:Pe.TRIANGLES,boundingSphere:le.fromPoints(m),geometryType:Xf.POLYLINES})};var Zg=ZF;var nlt=new li(0),K4={},fCe=new G,ilt=new jt(G.WHITE),olt=new li(!0),rlt=new li(Tn.DISABLED),slt=new li(new Qt),alt=new li(Jn.BOTH);function clt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function llt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function gA(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(gA.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new _e,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 clt,this._groundGeometryOptions=new llt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Er.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(gA.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)&&j.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}}});gA.prototype.isOutlineVisible=function(e){return!1};gA.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};gA.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof jt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,fCe)),l(a)||(a=G.WHITE),s.color=Xt.fromColor(a)),this.clampToGround?new Rt({id:t,geometry:new OE(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof jt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,fCe)),l(a)||(a=G.WHITE),s.depthFailColor=Xt.fromColor(a)),new Rt({id:t,geometry:new Zg(this._geometryOptions),attributes:s}))};gA.prototype.createOutlineGeometryInstance=function(e){};gA.prototype.isDestroyed=function(){return!1};gA.prototype.destroy=function(){this._entitySubscription(),de(this)};gA.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??ilt,u=c instanceof jt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??olt,this._shadowsProperty=o.shadows??rlt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??slt,this._classificationTypeProperty=o.classificationType??alt,this._fillEnabled=!0,this._zIndex=a??nlt;let f=o.width,h=o.arcType,m=o.clampToGround,g=o.granularity;if(!r.isConstant||!j.isConstant(f)||!j.isConstant(h)||!j.isConstant(g)||!j.isConstant(m)||!j.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let A=this._geometryOptions,_=r.getValue(Ke.MINIMUM_VALUE,A.positions);if(!l(_)||_.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let C;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof jt)?C=Bs.VERTEX_FORMAT:C=ja.VERTEX_FORMAT,A.vertexFormat=C,A.positions=_,A.width=l(f)?f.getValue(Ke.MINIMUM_VALUE):void 0,A.arcType=l(h)?h.getValue(Ke.MINIMUM_VALUE):void 0,A.granularity=l(g)?g.getValue(Ke.MINIMUM_VALUE):void 0;let y=this._groundGeometryOptions;y.positions=_,y.width=A.width,y.arcType=A.arcType,y.granularity=A.granularity,this._clampToGround=l(m)?m.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)}};gA.prototype.createDynamicUpdater=function(e,t){return new $F(e,t,this)};var YS={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function $F(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 dCe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=K4[n];!l(i)||i.isDestroyed()?(i=new Zh,K4[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}$F.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=j.getValueOrUndefined(o,e,this._positions);t._clampToGround=j.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=j.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=j.getValueOrDefault(i._arcType,e,an.GEODESIC),t._groundGeometryOptions.granularity=j.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)||!j.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let h=t.fillMaterialProperty,m;if(h instanceof jt)m=new Bs;else{let g=yr.getValue(e,h,this._material);m=new ja({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new xh({geometryInstances:t.createFillGeometryInstance(e),appearance:m,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),j.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=dCe(this);if(!n.isShowing||!n.isAvailable(e)||!j.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=an.GEODESIC;c=j.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==an.NONE&&l(u)&&(YS.ellipsoid=f,YS.positions=r,YS.granularity=j.getValueOrUndefined(i._granularity,e),YS.height=Wi.extractHeights(r,f),c===an.GEODESIC?r=Wi.generateCartesianArc(YS):r=Wi.generateCartesianRhumbArc(YS)),a.show=!0,a.positions=r.slice(),a.material=yr.getValue(e,t.fillMaterialProperty,a.material),a.width=j.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};$F.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 le.clone(n.boundingSphere,e),mt.DONE}return l(t)&&!t.ready?mt.PENDING:mt.DONE}else{let t=dCe(this);if(t.show&&t.positions.length>0)return le.fromPoints(t.positions,e),mt.DONE}return mt.FAILED};$F.prototype.isDestroyed=function(){return!1};$F.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=K4[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete K4[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),de(this)};var eQ=gA;var ult=new G,flt=new Qt,dlt=new Qt;function _A(e,t,n,i,o){let r;n instanceof jt?r=Bs:r=ja,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Pt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Pt,this.material=void 0,this.updatersWithAttributes=new Pt,this.attributes=new Pt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(_A.prototype.onMaterialChanged,this),this.subscriptions=new Pt,this.showsUpdated=new Pt,this.zIndex=i,this._asynchronous=o}_A.prototype.onMaterialChanged=function(){this.invalidated=!0};_A.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof jt&&t instanceof jt?!0:l(t)&&t.equals(n)};_A.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||!j.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};_A.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};_A.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 xh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===ja&&(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===ja&&(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],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!c.fillMaterialProperty.isConstant){let _=c.fillMaterialProperty.color,C=j.getValueOrDefault(_,e,G.WHITE,ult);G.equals(h._lastColor,C)||(h._lastColor=G.clone(C,h._lastColor),h.color=Xt.toValue(C,h.color))}let m=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;m!==g&&(h.show=xn.toValue(m,h.show));let A=c.distanceDisplayConditionProperty;if(!j.isConstant(A)){let _=j.getValueOrDefault(A,e,dlt,flt);Qt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Qt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Kn.toValue(_,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};_A.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,u=a.show[0]===1;c!==u&&(a.show=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};_A.prototype.contains=function(e){return this.updaters.contains(e.id)};_A.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return mt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?mt.FAILED:(i.boundingSphere.clone(t),mt.DONE)};_A.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 WS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}WS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=j.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 _A(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};WS.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}}};WS.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};WS.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 mt.FAILED};WS.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 tQ=WS;var hlt=[];function hCe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function ACe(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 jt?1:2);let r;l(i)&&(r=i+o*Tn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof jt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Mm(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 Pt,this._removedObjects=new Pt,this._changedObjects=new Pt;let o,r=Tn.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 Ud(n,Bs,void 0,!1,o),this._materialBatches[o]=new Gd(n,ja,void 0,!1,o),this._colorBatches[o+r]=new Ud(n,Bs,Bs,!1,o),this._materialBatches[o+r]=new Gd(n,ja,Bs,!1,o),this._colorBatches[o+r*2]=new Ud(n,Bs,ja,!1,o),this._materialBatches[o+r*2]=new Gd(n,ja,ja,!1,o);this._dynamicBatch=new d0(n,i);let s=Jn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new tQ(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Pt,this._updaters=new Pt,this._entityCollection=t,t.collectionChanged.addEventListener(Mm.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,hlt)}Mm.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,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(hCe(this,f),ACe(this,e,f)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaters.get(u),hCe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new eQ(c,this._scene),this._updaters.set(u,f),ACe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Mm._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,m=this._batches,g=m.length;for(a=0;a<g;a++)h=m[a].update(e)&&h;return h};var Alt=[],mlt=new le;Mm.prototype.getBoundingSphere=function(e,t){let n=Alt,i=mlt,o=0,r=mt.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(c,i),r===mt.PENDING)return mt.PENDING;r===mt.DONE&&(n[o]=le.clone(i,n[o]),o++)}return o===0?mt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),mt.DONE)};Mm.prototype.isDestroyed=function(){return!1};Mm.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Mm.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(),de(this)};Mm._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)};Mm.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 nQ=Mm;function Du(e){Cl.initializeTerrainHeights(),xh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new kr,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??Du.defaultVisualizersCallback;let i=!1,o=new Hl,r=new Hl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new tF;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var jS=[];Du.registerVisualizer=function(e){jS.includes(e)||jS.push(e)};Du.unregisterVisualizer=function(e){if(jS.includes(e)){let t=jS.indexOf(e);jS.splice(t,1)}};Du.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new HP(t,i),new YF(e,i,n._primitives,n._groundPrimitives),new WF(t,i),new jF(e,i),new U1(e,i),new XF(t,i),new KF(e,i),new nQ(e,i,n._primitives,n._groundPrimitives),...jS.map(o=>new o(e,i))]};Object.defineProperties(Du.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}}});Du.prototype.isDestroyed=function(){return!1};Du.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)),de(this)};Du.prototype.update=function(e){if(!Si.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};Du.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 plt=[],glt=new le;Du.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return mt.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let m=this._dataSourceCollection;for(o=m.length,i=0;i<o;i++){let g=m.get(i);if(g.entities.contains(e)){r=g;break}}}if(!l(r))return mt.FAILED;let s=plt,a=glt,c=0,u=mt.DONE,f=r._visualizers,h=f.length;for(i=0;i<h;i++){let m=f[i];if(l(m.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===mt.PENDING)return mt.PENDING;u===mt.DONE&&(s[c]=le.clone(a,s[c]),c++)}}return c===0?mt.FAILED:(s.length=c,le.fromBoundingSpheres(s,n),mt.DONE)};Du.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Hl),s=o.add(new pF);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Du.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 u=0;u<c;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Du.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 iQ=Du;function fJ(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}fJ.clone=function(e,t){if(l(e))return l(t)||(t=new fJ),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var zd=fJ;var mCe=new X,pCe=new X,gCe=new X,_lt=new M,J4=new d,_Ce=new d,dJ=new d,hJ=new d,CCe=new d,yCe=new d,Clt=new Qe,ylt=new d,Elt=new X,qS=new J,Ilt=1.25;function blt(e,t,n,i,o,r,s,a,c,u){let f=e.scene.mode,h=o.getValue(c,e._lastCartesian);if(l(h)){let m=!1,g=!1,A,_,C;if(f===oe.SCENE3D){J.addSeconds(c,.001,qS);let v=o.getValue(qS,J4);if(l(v)||(J.addSeconds(c,-.001,qS),v=o.getValue(qS,J4),g=!0),l(v)){let P=It.computeFixedToIcrfMatrix(c,mCe),N=It.computeFixedToIcrfMatrix(qS,pCe),L;!l(P)||!l(N)?(L=It.computeTemeToPseudoFixedMatrix(c,gCe),P=X.transpose(L,mCe),N=It.computeTemeToPseudoFixedMatrix(qS,pCe),X.transpose(N,N)):L=X.transpose(P,gCe);let p=X.multiplyByVector(P,h,CCe),b=X.multiplyByVector(N,v,yCe);d.subtract(p,b,hJ);let T=d.magnitude(hJ)*1e3,B=D.GRAVITATIONALPARAMETER,R=-B/(T*T-2*B/d.magnitude(p));R<0||R>Ilt*u.maximumRadius?(A=_Ce,d.normalize(h,A),d.negate(A,A),C=d.clone(d.UNIT_Z,dJ),_=d.cross(C,A,J4),d.magnitude(_)>D.EPSILON7&&(d.normalize(A,A),d.normalize(_,_),C=d.cross(A,_,dJ),d.normalize(C,C),m=!0)):d.equalsEpsilon(h,v,D.EPSILON7)||(C=_Ce,d.normalize(p,C),d.normalize(b,b),_=d.cross(C,b,dJ),g&&(_=d.multiplyByScalar(_,-1,_)),d.equalsEpsilon(_,d.ZERO,D.EPSILON7)||(A=d.cross(_,C,J4),X.multiplyByVector(L,A,A),X.multiplyByVector(L,_,_),X.multiplyByVector(L,C,C),d.normalize(A,A),d.normalize(_,_),d.normalize(C,C),m=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let y,E,I;i&&(y=d.clone(t.position,hJ),E=d.clone(t.direction,CCe),I=d.clone(t.up,yCe));let x=_lt,S;l(s)&&(S=s.getValue(c,Clt));let w=r.getValue(c,ylt);if(a===Dp.INERTIAL&&l(S))M.fromTranslationQuaternionRotationScale(h,S,d.ONE,x);else if(a===Dp.VELOCITY&&l(w)){let v=It.rotationMatrixFromPositionVelocity(h,w,u,Elt);M.fromRotationTranslation(v,h,x)}else a===Dp.ENU||!m?It.eastNorthUpToFixedFrame(h,u,x):(x[0]=A.x,x[1]=A.y,x[2]=A.z,x[3]=0,x[4]=_.x,x[5]=_.y,x[6]=_.z,x[7]=0,x[8]=C.x,x[9]=C.y,x[10]=C.z,x[11]=0,x[12]=h.x,x[13]=h.y,x[14]=h.z,x[15]=0);t._setTransform(x),i&&(d.clone(y,t.position),d.clone(E,t.direction),d.clone(I,t.up),d.cross(E,I,t.right))}if(n){let m=f===oe.SCENE2D||d.equals(e._offset3D,d.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,m)}}function oQ(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??te.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new d,this._defaultOffset3D=void 0,this._velocityProperty=new Wg(e.position,!0),this._offset3D=new d}Object.defineProperties(oQ,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=d.clone(e,new d)}}});oQ.defaultOffset3D=new d(-14e3,3500,3500);var X4=new zd,xlt=new d;oQ.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,h=o!==this._mode,m=n.camera,g=f||h,A=!0;if(f){let _=r.viewFrom,C=l(_);if(!C&&l(t)){X4.pitch=-D.PI_OVER_FOUR,X4.range=0;let y=a.getValue(e,xlt);if(l(y)){let E=2-1/Math.max(1,d.magnitude(y)/i.maximumRadius);X4.pitch*=E}m.viewBoundingSphere(t,X4),this.boundingSphere=t,g=!1,A=!1}else(!C||!l(_.getValue(e,this._offset3D)))&&d.clone(oQ._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&d.clone(m.position,this._offset3D);this._lastEntity=r,this._mode=o,blt(this,m,g,A,a,c,u,s,e,i)};var rQ=oQ;function aQ(){this._cache={}}aQ.prototype.fromColor=function(e,t){return Z4(void 0,void 0,e,t,this._cache)};aQ.prototype.fromUrl=function(e,t,n){return Z4(e,void 0,t,n,this._cache)};aQ.prototype.fromMakiIconId=function(e,t,n){return Z4(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};aQ.prototype.fromText=function(e,t,n){return Z4(void 0,e,t,n,this._cache)};var Tlt=new G;function Slt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Tlt).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 ECe(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=G.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=G.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var sQ=new Array(4);function Z4(e,t,n,i,o){sQ[0]=e,sQ[1]=t,sQ[2]=n,sQ[3]=i;let r=JSON.stringify(sQ),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(Slt(c,n,i),l(e)){let f=Be.createIfNeeded(e).fetchImage().then(function(h){return ECe(c,h,i),o[r]=a,a});return o[r]=f,f}else if(l(t)){let u=UI(t,{font:`bold ${i}px sans-serif`});ECe(c,u,i)}return o[r]=a,a}var $g=aQ;var xCe=mr(bCe(),1);function eH(e){return d.fromDegrees(e[0],e[1],e[2])}var AJ={"urn:ogc:def:crs:OGC:1.3:CRS84":eH,"EPSG:4326":eH,"urn:ogc:def:crs:EPSG::4326":eH},TCe={},SCe={},mJ=48,pJ,gJ=G.ROYALBLUE,_J=G.YELLOW,CJ=2,yJ=G.fromBytes(255,255,0,100),EJ=!1,Blt={small:24,medium:48,large:64},wlt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function BCe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||wlt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${BCe(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 Dlt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function vlt(e,t){return new Dh(Dlt(BCe,e,t),!0)}function tH(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=jn();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 u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let h=f.toLowerCase();if(u>1&&h==="title"){u=1,s=f;break}else u>2&&h==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new li(c):n(r,s))}return o}function IJ(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var wCe={Feature:vCe,FeatureCollection:Plt,GeometryCollection:PCe,LineString:OCe,MultiLineString:FCe,MultiPoint:NCe,MultiPolygon:UCe,Point:MCe,Polygon:kCe,Topology:GCe},DCe={GeometryCollection:PCe,LineString:OCe,MultiLineString:FCe,MultiPoint:NCe,MultiPolygon:UCe,Point:MCe,Polygon:kCe,Topology:GCe};function vCe(e,t,n,i,o){if(t.geometry===null){tH(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ue("feature.geometry is required.");let r=t.geometry.type,s=DCe[r];if(!l(s))throw new ue(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Plt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)vCe(e,r[s],void 0,i,o)}function PCe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],u=c.type,f=DCe[u];if(!l(f))throw new ue(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function RCe(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=G.fromCssColorString(g)),a=Blt[c["marker-size"]]??a;let A=c["marker-symbol"];l(A)&&(r=A)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new Qc;f.verticalOrigin=new li(Gn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=$e.CLAMP_TO_GROUND);let h=tH(t,e._entityCollection,o.describe);h.billboard=f,h.position=new El(n(i));let m=Promise.resolve(u).then(function(g){f.image=new li(g)}).catch(function(){f.image=new li(e._pinBuilder.fromColor(s,a))});e._promises.push(m)}function MCe(e,t,n,i,o){RCe(e,t,i,n.coordinates,o)}function NCe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)RCe(e,t,i,r[s],o)}function LCe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new li(f));let h,m=a.stroke;l(m)&&(h=G.fromCssColorString(m));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(h)||(h=r.color.getValue().clone()),h.alpha=g),l(h)&&(r=new jt(h))}let c=tH(t,e._entityCollection,o.describe),u=new Uc;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new li(IJ(i,n)),u.arcType=an.RHUMB}function OCe(e,t,n,i,o){LCe(e,t,i,n.coordinates,o)}function FCe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)LCe(e,t,i,r[s],o)}function QCe(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 li(g));let A,_=c.stroke;l(_)&&(A=G.fromCssColorString(_));let C=c["stroke-opacity"];l(C)&&C!==1&&(l(A)||(A=r.getValue().clone()),A.alpha=C),l(A)&&(r=new li(A));let y,E=c.fill,I=s.color.getValue();l(E)&&(y=G.fromCssColorString(E),y.alpha=I.alpha),C=c["fill-opacity"],l(C)&&C!==I.alpha&&(l(y)||(y=I.clone()),y.alpha=C),l(y)&&(s=new jt(y))}let u=new Bh;u.outline=new li(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=an.RHUMB;let f=[];for(let g=1,A=i.length;g<A;g++)f.push(new Cc(IJ(i[g],n)));let h=i[0];u.hierarchy=new li(new Cc(IJ(h,n),f)),h[0].length>2?u.perPositionHeight=new li(!0):o.clampToGround||(u.height=0);let m=tH(t,e._entityCollection,o.describe);m.polygon=u}function kCe(e,t,n,i,o){QCe(e,t,i,n.coordinates,o)}function UCe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)QCe(e,t,i,r[s],o)}function GCe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=xCe.feature(n,n.objects[r]),a=wCe[s.type];a(e,s,s,i,o)}}function hy(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Da(this),this._promises=[],this._pinBuilder=new $g,this._entityCluster=new _f,this._credit=void 0,this._resourceCredits=[]}hy.load=function(e,t){return new hy().load(e,t)};Object.defineProperties(hy,{markerSize:{get:function(){return mJ},set:function(e){mJ=e}},markerSymbol:{get:function(){return pJ},set:function(e){pJ=e}},markerColor:{get:function(){return gJ},set:function(e){gJ=e}},stroke:{get:function(){return _J},set:function(e){_J=e}},strokeWidth:{get:function(){return CJ},set:function(e){CJ=e}},fill:{get:function(){return yJ},set:function(e){yJ=e}},clampToGround:{get:function(){return EJ},set:function(e){EJ=e}},crsNames:{get:function(){return AJ}},crsLinkHrefs:{get:function(){return TCe}},crsLinkTypes:{get:function(){return SCe}}});Object.defineProperties(hy.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}}});hy.prototype.load=function(e,t){return zCe(this,e,t,!0)};hy.prototype.process=function(e,t){return zCe(this,e,t,!1)};function zCe(e,t,n,i){gs.setLoading(e,!0),n=n??V.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new pt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Be){t=Be.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:n.describe??vlt,markerSize:n.markerSize??mJ,markerSymbol:n.markerSymbol??pJ,markerColor:n.markerColor??gJ,strokeWidthProperty:new li(n.strokeWidth??CJ),strokeMaterialProperty:new jt(n.stroke??_J),fillMaterialProperty:new jt(n.fill??yJ),clampToGround:n.clampToGround??EJ},Promise.resolve(r).then(function(a){return Rlt(e,a,n,s,i)}).catch(function(a){throw gs.setLoading(e,!1),e._error.raiseEvent(e,a),a})}hy.prototype.update=function(e){return!0};function Rlt(e,t,n,i,o){let r;l(i)&&(r=Ug(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=wCe[t.type];if(!l(s))throw new ue(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?eH:null;if(l(a)){if(!l(a.properties))throw new ue("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=AJ[u.name],!l(c))throw new ue(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=TCe[u.href];if(l(f)||(f=SCe[u.type]),!l(f))throw new ue(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=AJ[`EPSG:${u.code}`],!l(c))throw new ue(`Unknown crs EPSG code: ${u.code}`)}else throw new ue(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,gs.setLoading(e,!1),e})})}var Ay=hy;var Yye=mr(KJ(),1);var Wye;typeof DOMParser<"u"&&(Wye=new DOMParser);var Ydt=new Yye.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),EH=32,Fye=2414016,Qye=1,kye=16093e3,Uye=.1,Wdt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Xo={gpx:Wdt};function jdt(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 JJ(e,t){let n=fQ(e,"id");return n=l(n)?n:jn(),t.getOrCreateEntity(n)}function XJ(e){let t=Gye(e,"lon"),n=Gye(e,"lat"),i=lQ(e,"ele",Xo.gpx);return d.fromDegrees(t,n,i)}function Gye(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 fQ(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function gy(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 ZJ(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 lQ(e,t,n){let i=gy(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function vu(e,t,n){let i=gy(e,t,n);if(l(i))return i.textContent.trim()}function jye(e){let t=new Qc;return t.width=EH,t.height=EH,t.scaleByDistance=new Ht(Fye,Qye,kye,Uye),t.pixelOffsetScaleByDistance=new Ht(Fye,Qye,kye,Uye),t.verticalOrigin=new li(Gn.BOTTOM),t.image=e,t}function qdt(){let e=new Sh;return e.translucencyByDistance=new Ht(3e6,1,5e6,0),e.pixelOffset=new F(17,0),e.horizontalOrigin=Mi.LEFT,e.font="16px sans-serif",e.style=cr.FILL_AND_OUTLINE,e}function qye(e){let t=new Uc;return t.width=4,t.material=new ty,t.material.color=l(e)?e:G.RED,t.material.outlineWidth=2,t.material.outlineColor=G.BLACK,t}var zye={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"}},uQ;typeof document<"u"&&(uQ=document.createElement("div"));function $J(e,t){let n,i="",o=Object.keys(zye),r=o.length;for(n=0;n<r;n++){let f=o[n],h=zye[f];h.value=vu(e,h.tag,Xo.gpx)??"",l(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!l(i)||i==="")return;i=Ydt.link(i),uQ.innerHTML=i;let s=uQ.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=G.WHITE,c=G.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${uQ.innerHTML}</div>`,uQ.innerHTML="",u}function Kye(e,t,n,i){let o=XJ(t),r=JJ(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,EH);r.billboard=jye(s);let a=vu(t,"name",Xo.gpx);r.name=a,r.label=qdt(),r.label.text=a,r.description=$J(t,r),i.clampToGround&&(r.billboard.heightReference=$e.CLAMP_TO_GROUND,r.label.heightReference=$e.CLAMP_TO_GROUND)}function Kdt(e,t,n,i){let o=JJ(t,n);o.description=$J(t,o);let r=ZJ(t,"rtept",Xo.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)Kye(e,r[a],n,i),s[a]=XJ(r[a]);o.polyline=qye(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Jdt(e,t,n,i){let o=JJ(t,n);o.description=$J(t,o);let r=ZJ(t,"trkseg",Xo.gpx),s=[],a=[],c,u=!0,f=new nc;for(let h=0;h<r.length;h++)c=Xdt(r[h]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,EH);o.billboard=jye(h),o.position=f,i.clampToGround&&(o.billboard.heightReference=$e.CLAMP_TO_GROUND),o.availability=new ps,o.availability.addInterval(new wn({start:a[0],stop:a[a.length-1]}))}o.polyline=qye(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Xdt(e){let t={positions:[],times:[]},n=ZJ(e,"trkpt",Xo.gpx),i;for(let o=0;o<n.length;o++){let r=XJ(n[o]);t.positions.push(r),i=vu(n[o],"time",Xo.gpx),l(i)&&t.times.push(J.fromIso8601(i))}return t}function Zdt(e){let t=gy(e,"metadata",Xo.gpx);if(l(t)){let n={name:vu(t,"name",Xo.gpx),desc:vu(t,"desc",Xo.gpx),author:$dt(t),copyright:tht(t),link:Jye(t),time:vu(t,"time",Xo.gpx),keywords:vu(t,"keywords",Xo.gpx),bounds:nht(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 $dt(e){let t=gy(e,"author",Xo.gpx);if(l(t)){let n={name:vu(t,"name",Xo.gpx),email:eht(t),link:Jye(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function eht(e){let t=gy(e,"email",Xo.gpx);if(l(t)){let n=vu(t,"id",Xo.gpx),i=vu(t,"domain",Xo.gpx);return`${n}@${i}`}}function Jye(e){let t=gy(e,"link",Xo.gpx);if(l(t)){let n={href:fQ(t,"href"),text:vu(t,"text",Xo.gpx),mimeType:vu(t,"type",Xo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function tht(e){let t=gy(e,"copyright",Xo.gpx);if(l(t)){let n={author:fQ(t,"author"),year:vu(t,"year",Xo.gpx),license:vu(t,"license",Xo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function nht(e){let t=gy(e,"bounds",Xo.gpx);if(l(t)){let n={minLat:lQ(t,"minlat",Xo.gpx),maxLat:lQ(t,"maxlat",Xo.gpx),minLon:lQ(t,"minlon",Xo.gpx),maxLon:lQ(t,"maxlon",Xo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var Vye={wpt:Kye,rte:Kdt,trk:Jdt};function iht(e,t,n,i){let o=Object.keys(Vye),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Vye[a],u=t.childNodes,f=u.length;for(let h=0;h<f;h++){let m=u[h];m.localName===a&&Xo.gpx.indexOf(m.namespaceURI)!==-1&&c(e,m,n,i)}}}function Hye(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=fQ(o,"version"),s=fQ(o,"creator"),a,c=Zdt(o);l(c)&&(a=c.name),o.localName==="gpx"?iht(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),h=f.start,m=f.stop,g=J.equals(h,Ke.MINIMUM_VALUE),A=J.equals(m,Ke.MAXIMUM_VALUE);if(!g||!A){let C;g&&(C=new Date,C.setHours(0,0,0,0),h=J.fromDate(C)),A&&(C=new Date,C.setHours(24,0,0,0),m=J.fromDate(C)),u=new uA,u.startTime=h,u.stopTime=m,u.currentTime=J.clone(h),u.clockRange=_s.LOOP_STOP,u.clockStep=No.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(J.secondsDifference(m,h)/60,1),31556900))}let _=!1;return e._name!==a&&(e._name=a,_=!0),e._creator!==s&&(e._creator=s,_=!0),oht(e._metadata,c)&&(e._metadata=c,_=!0),e._version!==r&&(e._version=r,_=!0),u!==e._clock&&(_=!0,e._clock=u),_&&e._changed.raiseEvent(e),gs.setLoading(e,!1),e}function oht(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 rht(e,t,n,i){i=i??V.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof Be){n=Be.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?jdt(r).then(function(s){let a,c;try{a=Wye.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new ue(u)}return Hye(e,a,i)}):Hye(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function tB(){this._changed=new _e,this._error=new _e,this._loading=new _e,this._clock=void 0,this._entityCollection=new Da(this),this._entityCluster=new _f,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new $g}tB.load=function(e,t){return new tB().load(e,t)};Object.defineProperties(tB.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}}});tB.prototype.update=function(e){return!0};tB.prototype.load=function(e,t){if(!l(e))throw new Ae("data is required.");t=t??V.EMPTY_OBJECT,gs.setLoading(this,!0);let n=this._name,i=this;return rht(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),u=J.equals(a,Ke.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=J.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=J.fromDate(h)),o=new uA,o.startTime=s,o.stopTime=a,o.currentTime=J.clone(s),o.clockRange=_s.LOOP_STOP,o.clockStep=No.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(J.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),gs.setLoading(i,!1),i}).catch(function(o){return gs.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var dQ=tB;function sht(e,t){this.position=e,this.headingPitchRoll=t}var hQ=sht;var XIe=mr(KJ(),1),ZQ=mr(Yu(),1);var eX=new Date(2107,11,31),tX=new Date(1980,0,1),en=void 0,wf="undefined",Hd="function",Xye="object";var aht=64,Zye=2;try{typeof navigator!=wf&&navigator.hardwareConcurrency&&(Zye=navigator.hardwareConcurrency)}catch{}var cht={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:Zye,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=wf&&CompressionStream,DecompressionStream:typeof DecompressionStream!=wf&&DecompressionStream},$ye=Object.assign({},cht);function AQ(){return $ye}function IH(e){return Math.max(e.chunkSize,aht)}function Qm(e){let{baseURI:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,CompressionStream:a,DecompressionStream:c,CompressionStreamZlib:u,DecompressionStreamZlib:f,workerURI:h,wasmURI:m}=e;Yd("baseURI",t),Yd("wasmURI",m),Yd("workerURI",h),Yd("chunkSize",n),Yd("maxWorkers",i),Yd("terminateWorkerTimeout",o),Yd("useCompressionStream",r),Yd("useWebWorkers",s),Yd("CompressionStream",a),Yd("DecompressionStream",c),Yd("CompressionStreamZlib",u),Yd("DecompressionStreamZlib",f)}function Yd(e,t){t!==en&&($ye[e]=t)}var eEe=[];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;eEe[e]=t}var n_=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^eEe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var mQ=class extends null{constructor(){let t,n=new n_;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}};function nB(e){if(typeof TextEncoder==wf){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 jl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=jl.getPartial(n);return i===32?e.concat(t):jl._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+jl.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]=jl.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=jl.getPartial(o);return i.push(jl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},pQ={bytes:{fromBits(e){let n=jl.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(jl.partial(8*(n&3),i)),t}}},tEe={};tEe.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=pQ.utf8String.toBits(e));let n=t._buffer=jl.concat(t._buffer,e),i=t._length,o=t._length=i+jl.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=jl.concat(t,[jl.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 u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=f}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 nX={};nX.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 u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&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,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[f]=h,i[h]=f,u=o[c=o[a=o[f]]];let m=u*16843009^c*65537^a*257^f*16843008,g=o[h]*257^h*16843008;for(let A=0;A<4;A++)e[A][f]=g=g<<24^g>>>8,t[A][h]=m=m<<24^m>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].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],u=r[3],f=r[4],h=e[0]^n[0],m=e[t?3:1]^n[1],g=e[2]^n[2],A=e[t?1:3]^n[3],_=4,C,y,E;for(let I=0;I<i;I++)C=s[h>>>24]^a[m>>16&255]^c[g>>8&255]^u[A&255]^n[_],y=s[m>>>24]^a[g>>16&255]^c[A>>8&255]^u[h&255]^n[_+1],E=s[g>>>24]^a[A>>16&255]^c[h>>8&255]^u[m&255]^n[_+2],A=s[A>>>24]^a[h>>16&255]^c[m>>8&255]^u[g&255]^n[_+3],_+=4,h=C,m=y,g=E;for(let I=0;I<4;I++)o[t?3&-I:I]=f[h>>>24]<<24^f[m>>16&255]<<16^f[g>>8&255]<<8^f[A&255]^n[_++],C=h,h=m,m=g,g=A,A=C;return o}};var nEe={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}},iX={};iX.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=jl.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 jl.clamp(t,o)}};var _y={importKey(e){return new _y.hmacSha1(pQ.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,u,f=new ArrayBuffer(o),h=new DataView(f),m=0,g=jl;for(t=pQ.bytes.toBits(t),u=1;m<(o||1);u++){for(r=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;m<(o||1)&&a<r.length;a++)h.setInt32(m,r[a]),m+=4}return f.slice(0,i/8)}};_y.hmacSha1=class{constructor(e){let t=this,n=t._hash=tEe.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 lht=typeof crypto!=wf&&typeof crypto.getRandomValues==Hd,i_="Invalid password",Cy="Invalid signature",o_="zipjs-abort-check-password";function bH(e){return lht?crypto.getRandomValues(e):nEe.getRandomValues(e)}var iB=16,uht="raw",rEe={name:"PBKDF2"},fht={name:"HMAC"},dht="SHA-1",hht=Object.assign({hash:fht},rEe),oX=Object.assign({iterations:1e3,hash:{name:dht}},rEe),Aht=["deriveBits"],_Q=[8,12,16],gQ=[16,24,32],yy=10,mht=[0,0,0,0],SH=typeof crypto!=wf,EQ=SH&&crypto.subtle,sEe=SH&&typeof EQ!=wf,km=pQ.bytes,pht=nX.aes,ght=iX.ctrGladman,_ht=_y.hmacSha1,iEe=SH&&sEe&&typeof EQ.importKey==Hd,oEe=SH&&sEe&&typeof EQ.deriveBits==Hd,xH=class extends null{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:lEe(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:h,ready:m}=c;u?(await Cht(c,f,u,Wd(s,0,_Q[f]+2)),s=Wd(s,_Q[f]+2),r?a.error(new Error(o_)):h()):await m;let g=new Uint8Array(s.length-yy-(s.length-yy)%iB);a.enqueue(aEe(c,s,g,0,yy,!0))},async flush(s){let{signed:a,ctr:c,hmac:u,pending:f,ready:h}=this;if(u&&c){await h;let m=Wd(f,0,f.length-yy),g=Wd(f,f.length-yy),A=new Uint8Array;if(m.length){let _=yQ(km,m);u.update(_);let C=c.update(_);A=CQ(km,C)}if(a){let _=Wd(CQ(km,u.digest()),0,yy);for(let C=0;C<yy;C++)if(_[C]!=g[C])throw new Error(Cy)}s.enqueue(A)}}})}},TH=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:lEe(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:u,resolveReady:f,ready:h}=a,m=new Uint8Array;c?(m=await yht(a,u,c),f()):await h;let g=new Uint8Array(m.length+r.length-r.length%iB);g.set(m,0),s.enqueue(aEe(a,r,g,m.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(c.length){let h=s.update(yQ(km,c));a.update(h),f=CQ(km,h)}o.signature=CQ(km,a.digest()).slice(0,yy),r.enqueue(rX(f,o.signature))}}}),o=this}};function aEe(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,u=t.length-o;c.length&&(t=rX(c,t),n=bht(n,u-u%iB));let f;for(f=0;f<=u-iB;f+=iB){let h=yQ(km,Wd(t,f,f+iB));r&&a.update(h);let m=s.update(h);r||a.update(m),n.set(CQ(km,m),f+i)}return e.pending=Wd(t,f),n}async function Cht(e,t,n,i){let o=await cEe(e,t,n,Wd(i,0,_Q[t])),r=Wd(i,_Q[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(i_)}async function yht(e,t,n){let i=bH(new Uint8Array(_Q[t])),o=await cEe(e,t,n,i);return rX(i,o)}async function cEe(e,t,n,i){e.password=null;let o=await Eht(uht,n,hht,!1,Aht),r=await Iht(Object.assign({salt:i},oX),o,8*(gQ[t]*2+2)),s=new Uint8Array(r),a=yQ(km,Wd(s,0,gQ[t])),c=yQ(km,Wd(s,gQ[t],gQ[t]*2)),u=Wd(s,gQ[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new ght(new pht(a),Array.from(mht)),hmac:new _ht(c)}),u}async function Eht(e,t,n,i,o){if(iEe)try{return await EQ.importKey(e,t,n,i,o)}catch{return iEe=!1,_y.importKey(t)}else return _y.importKey(t)}async function Iht(e,t,n){if(oEe)try{return await EQ.deriveBits(e,t,n)}catch{return oEe=!1,_y.pbkdf2(t,e.salt,oX.iterations,n)}else return _y.pbkdf2(t,e.salt,oX.iterations,n)}function lEe(e,t){return t===en?nB(e):t}function rX(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 bht(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Wd(e,t,n){return e.subarray(t,n)}function CQ(e,t){return e.fromBits(t)}function yQ(e,t){return e.toBits(t)}var IQ=12,BH=class extends null{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),hEe(this,t)},transform(o,r){let s=this;if(s.password){let a=uEe(s,o.subarray(0,IQ));if(s.password=null,a.at(-1)!=s.passwordVerification)throw new Error(i_);o=o.subarray(IQ)}i?r.error(new Error(o_)):r.enqueue(uEe(s,o))}})}},wH=class extends null{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),hEe(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=bH(new Uint8Array(IQ));c[IQ-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(fEe(r,c),0),a=IQ}else s=new Uint8Array(i.length),a=0;s.set(fEe(r,i),a),o.enqueue(s)}})}};function uEe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=AEe(e)^t[i],sX(e,n[i]);return n}function fEe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=AEe(e)^t[i],sX(e,t[i]);return n}function hEe(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new n_(n[0]),crcKey2:new n_(n[2])});for(let i=0;i<t.length;i++)sX(e,t.charCodeAt(i))}function sX(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=dEe(Math.imul(dEe(i+mEe(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function AEe(e){let t=e.keys[2]|2;return mEe(Math.imul(t,t^1)>>>8)}function mEe(e){return e&255}function dEe(e){return e&4294967295}var oB="Invalid uncompressed size",xht="deflate-raw",Tht="deflate64-raw",DH=class extends null{constructor(t,{chunkSize:n,CompressionStreamZlib:i,CompressionStream:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:u,level:f}=t,h=this,m,g,A=super.readable;(!s||c)&&u&&(m=new mQ,A=Um(A,m)),r&&(A=gEe(A,a,{level:f,chunkSize:n},o,i,o)),s&&(c?A=Um(A,new wH(t)):(g=new TH(t),A=Um(A,g))),pEe(h,A,()=>{let _;s&&!c&&(_=g.signature),(!s||c)&&u&&(_=new DataView(m.value.buffer).getUint32(0)),h.signature=_})}},vH=class extends null{constructor(t,{chunkSize:n,DecompressionStreamZlib:i,DecompressionStream:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:u,useCompressionStream:f,deflate64:h}=t,m,g,A=super.readable;s&&(r?A=Um(A,new BH(t)):(g=new xH(t),A=Um(A,g))),u&&(A=gEe(A,f,{chunkSize:n,deflate64:h},o,i,o)),(!s||r)&&a&&(m=new mQ,A=Um(A,m)),pEe(this,A,()=>{if((!s||r)&&a){let _=new DataView(m.value.buffer);if(c!=_.getUint32(0,!1))throw new Error(Cy)}})}};function pEe(e,t,n){t=Um(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function gEe(e,t,n,i,o,r){let s=t&&i?i:o||r,a=n.deflate64?Tht:xht;try{e=Um(e,new s(a,n))}catch(c){if(t)if(o)e=Um(e,new o(a,n));else if(r)e=Um(e,new r(a,n));else throw c;else throw c}return e}function Um(e,t){return e.pipeThrough(t)}var _Ee="message",CEe="start",yEe="pull",aX="data",EEe="ack",cX="close",MH="deflate",NH="inflate";var PH=class extends null{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(MH)?r=DH:o.startsWith(NH)&&(r=vH),i.outputSize=0;let s=0,a=new r(t,n),c=super.readable,u=new null({transform(h,m){h&&h.length&&(s+=h.length,m.enqueue(h))},flush(){Object.assign(i,{inputSize:s})}}),f=new null({transform(h,m){if(h&&h.length&&(m.enqueue(h),i.outputSize+=h.length,t.outputSize!==en&&i.outputSize>t.outputSize))throw new Error(oB)},flush(){let{signature:h}=a;Object.assign(i,{signature:h,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(a).pipeThrough(f)}})}},RH=class extends null{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 bEe=typeof Worker!=wf,xEe=()=>{};function TEe({initModule:e}){xEe=e}var rB=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:u},f){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new RH(r.chunkSize)).pipeThrough(new uX(s),{signal:h}),writable:i,options:Object.assign({},o),workerURI:u,transferStreams:c,terminate(){return new Promise(m=>{let{worker:g,busy:A}=t;g?(A?t.resolveTerminated=m:(g.terminate(),m()),t.interface=null):m()})},onTaskFinished(){let{resolveTerminated:m}=t;m&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),m()),t.busy=!1,f(t)}}),(a&&bEe?Sht:SEe)(t,r)}},uX=class extends null{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await lX(t,i)},async transform(s,a){r+=s.length,n&&await lX(n,r,i),a.enqueue(s)},async flush(){o&&await lX(o,r)}})}};async function lX(e,...t){try{await e(...t)}catch{}}function SEe(e,t){return{run:()=>Bht(e,t)}}function Sht(e,t){let{baseURI:n,chunkSize:i}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Hd&&(o=o());let r;try{r=vht(e.workerURI,n,e)}catch{return bEe=!1,SEe(e,t)}Object.assign(e,{worker:r,interface:{run:()=>wht(e,{chunkSize:i,wasmURI:o,baseURI:n})}})}return e.interface}async function Bht({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(!e.useCompressionStream)try{await xEe(o)}catch{e.useCompressionStream=!0}r=new PH(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 wht(e,t){let n,i,o=new Promise((h,m)=>{n=h,i=m});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s}=e,{writable:a,closed:c}=Dht(e.writable),u=LH({type:CEe,options:s,config:t,readable:r,writable:a},e);u||Object.assign(e,{reader:r.getReader(),writer:a.getWriter()});let f=await o;return u||await a.getWriter().close(),await c,f}function Dht(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 IEe=!0;function vht(e,t,n){let i={type:"module"},o,r;if(typeof e==Hd&&(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(_Ee,s=>Pht(s,n)),r}function LH(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&&IEe?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{IEe=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function Pht({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:h}=t;try{if(s){let{message:g,stack:A,code:_,name:C,outputSize:y}=s,E=new Error(g);Object.assign(E,{stack:A,code:_,name:C,outputSize:y}),m(E)}else{if(n==yEe){let{value:g,done:A}=await a.read();LH({type:aX,value:g,done:A,messageId:o},t)}n==aX&&(await c.ready,await c.write(new Uint8Array(i)),LH({type:EEe,messageId:o},t)),n==cX&&m(null,r)}}catch(g){LH({type:cX,messageId:o},t),m(g)}function m(g,A){g?f(g):u(A),c&&c.releaseLock(),h()}}var R0=[],fX=[];var BEe=0;async function OH(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,compressed:a,signed:c,encrypted:u}=n,{workerURI:f,maxWorkers:h}=i;t.transferStreams=o||o===en;let m=!a&&!c&&!u&&!t.transferStreams;return t.useWebWorkers=!m&&(r||r===en&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&f?f:en,n.useCompressionStream=s||s===en&&i.useCompressionStream,(await g()).run();async function g(){let _=R0.find(C=>!C.busy);if(_)return wEe(_),new rB(_,e,t,A);if(R0.length<h){let C={indexWorker:BEe};return BEe++,R0.push(C),new rB(C,e,t,A)}else return new Promise(C=>fX.push({resolve:C,stream:e,workerOptions:t}))}function A(_){if(fX.length){let[{resolve:C,stream:y,workerOptions:E}]=fX.splice(0,1);C(new rB(_,y,E,A))}else _.worker?(wEe(_),Rht(_,t)):R0=R0.filter(C=>C!=_)}}function Rht(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{R0=R0.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function wEe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Mht="Writer iterator completed too soon",Nht="Writer not initialized",Lht="text/plain";var Oht="Content-Type";var Fht=64*1024,egi=256*1024,dX="writable",sB=class{constructor(){this.size=0}init(){this.initialized=!0}},bQ=class extends sB{get readable(){let t=this,{chunkSize:n=Fht}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this,u=s===en?n:Math.min(n,s-c),f=await oc(t,r+c,u,a);o.enqueue(f),c+n>s||s===en&&!f.length&&u?o.close():this.chunkOffset+=n}});return i}},FH=class extends sB{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(Nht);return t.writeUint8Array(i)}});Object.defineProperty(t,dX,{get(){return n}})}writeUint8Array(){}};var xQ=class extends FH{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)}},Gm=class extends bQ{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)}},aB=class extends sB{constructor(t){super();let n=this,i=new null,o=[];t&&o.push([Oht,t]),Object.defineProperty(n,dX,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},TQ=class extends Gm{constructor(t){super(new Blob([t],{type:Lht}))}},SQ=class extends aB{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 QH=class extends bQ{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 u=r[a];if(u){let f=u.size;if(c+n<=f)s=await oc(u,c,n);else{let h=f-c;s=new Uint8Array(n);let m=await oc(u,c,h);s.set(m,0);let g=await o.readUint8Array(t+h,n-h,i);s.set(g,h),m.length+g.length<n&&(s=s.subarray(0,m.length+g.length))}}else s=new Uint8Array;return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},BQ=class extends sB{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(f){let{availableSize:h}=i;if(s)f.length>=h?(await c(f.subarray(0,h)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.subarray(h))):await c(f);else{let{value:m,done:g}=await t.next();if(g&&!m)throw new Error(Mht);o=m,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Vm(o),r=m.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,dX,{get(){return a}});async function c(f){let h=f.length;h&&(await s.ready,await s.write(f),o.size+=h,i.size+=h,i.availableSize-=h)}async function u(){await s.close()}}},M0=class{constructor(t){return Array.isArray(t)&&(t=new QH(t)),t instanceof ReadableStream&&(t={readable:t}),t}},cB=class{constructor(t){return t.writable===en&&typeof t.next==Hd&&(t=new BQ(t)),t instanceof WritableStream&&(t={writable:t}),t.size===en&&(t.size=0),t instanceof BQ||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}};async function Vm(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function oc(e,t,n,i){return e.readUint8Array(t,n,i)}var DEe="\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(""),Qht=DEe.length==256;function vEe(e){if(Qht){let t="";for(let n=0;n<e.length;n++)t+=DEe[e[n]];return t}else return new TextDecoder().decode(e)}function wQ(e,t){return t&&t.trim().toLowerCase()=="cp437"?vEe(e):new TextDecoder(t).decode(e)}var hX="filename",AX="rawFilename",DQ="comment",mX="rawComment",vQ="uncompressedSize",pX="compressedSize",gX="offset",_X="diskNumberStart",lB="lastModDate",kH="rawLastModDate",PQ="lastAccessDate",PEe="rawLastAccessDate",RQ="creationDate",CX="rawCreationDate",yX="internalFileAttributes",EX="externalFileAttributes",IX="msdosAttributesRaw",bX="msdosAttributes",xX="msDosCompatible",UH="zip64",TX="encrypted",SX="version",BX="versionMadeBy",wX="zipCrypto",MQ="directory",DX="executable",vX="compressionMethod",PX="signature",RX="extraField",kht="extraFieldInfoZip",Uht="extraFieldUnix";var MX="unixMode",NX="setuid",LX="setgid",OX="sticky",Ght="bitFlag",zht="filenameUTF8",Vht="commentUTF8",Hht="rawExtraField",Yht="extraFieldZip64",Wht="extraFieldUnicodePath",jht="extraFieldUnicodeComment",qht="extraFieldAES",Kht="extraFieldNTFS",Jht="extraFieldExtendedTimestamp",Xht=[hX,AX,vQ,pX,lB,kH,DQ,mX,PQ,RQ,CX,gX,_X,yX,EX,IX,bX,xX,UH,TX,SX,BX,wX,MQ,DX,vX,PX,RX,Uht,kht,"uid","gid",MX,NX,LX,OX,Ght,zht,Vht,Hht,Yht,Wht,jht,qht,Kht,Jht],Ey=class{constructor(t){Xht.forEach(n=>this[n]=t[n])}};var REe="filenameEncoding",MEe="commentEncoding",NEe="decodeText",LEe="extractPrependedData",OEe="extractAppendedData",GH="password",zH="rawPassword",VH="passThrough",HH="signal",FEe="checkPasswordOnly",QEe="checkOverlappingEntryOnly",kEe="checkOverlappingEntry",UEe="checkSignature",YH="useWebWorkers",WH="useCompressionStream",GEe="transferStreams",jH="preventClose",zEe="encryptionStrength",VEe="extendedTimestamp",HEe="keepOrder",YEe="level",WEe="bufferedWrite",jEe="dataDescriptorSignature",qEe="useUnicodeFileNames",KEe="dataDescriptor",FX="supportZip64SplitFile",JEe="encodeText",QX="offset",kX="usdz",XEe="unixExtraFieldType";var qH="File format is not recognized",oIe="End of central directory not found",rIe="End of Zip64 central directory locator not found",sIe="Central directory header not found",aIe="Local file header not found",cIe="Zip64 extra field not found",lIe="File contains encrypted entry",uIe="Encryption method not supported",GX="Compression method not supported",zX="Split zip file",fIe="Overlapping entry found",$Ee="utf-8",tAt="UTF8",eIe="cp437",nAt=[[vQ,4294967295],[pX,4294967295],[gX,4294967295],[_X,65535]],iAt={65535:{getValue:Gr,bytes:4},4294967295:{getValue:dB,bytes:8}},N0=class{constructor(t,n={}){Object.assign(this,{reader:new M0(t),options:n,config:AQ(),readRanges:[]})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Vm(i),(i.size===en||!i.readUint8Array)&&(i=new Gm(await new Response(i.readable).blob()),await Vm(i)),i.size<22)throw new Error(qH);i.chunkSize=IH(o);let r=await lAt(i,101010256,i.size,22,65535*16);if(!r){let L=await oc(i,0,4),p=zr(L);throw Gr(p)==134695760?new Error(zX):new Error(oIe)}let s=zr(r),a=Gr(s,12),c=Gr(s,16),u=r.offset,f=rc(s,20),h=u+22+f,m=rc(s,4),g=i.lastDiskNumber||0,A=rc(s,6),_=rc(s,8),C=0,y=0;if(c==4294967295||a==4294967295||_==65535||A==65535){let L=await oc(i,r.offset-20,20),p=zr(L);if(Gr(p,0)==117853008){c=dB(p,8);let b=await oc(i,c,56,-1),T=zr(b),B=r.offset-20-56;if(Gr(T,0)!=101075792&&c!=B){let R=c;c=B,c>R&&(C=c-R),b=await oc(i,c,56,-1),T=zr(b)}if(Gr(T,0)!=101075792)throw new Error(rIe);m==65535&&(m=Gr(T,16)),A==65535&&(A=Gr(T,20)),_==65535&&(_=dB(T,32)),a==4294967295&&(a=dB(T,40)),c-=a}}if(c>=i.size&&(C=i.size-c-a-22,c=i.size-a-22),g!=m)throw new Error(zX);if(c<0)throw new Error(qH);let E=0,I=await oc(i,c,a,A),x=zr(I);if(a){let L=r.offset-a;if(Gr(x,E)!=33639248&&c!=L){let p=c;c=L,c>p&&(C+=c-p),I=await oc(i,c,a,A),x=zr(I)}}let S=r.offset-c-(i.lastDiskOffset||0);if(a!=S&&S>=0&&(a=S,I=await oc(i,c,a,A),x=zr(I)),c<0||c>=i.size)throw new Error(qH);let w=xc(n,t,REe),v=xc(n,t,MEe);for(let L=0;L<_;L++){let p=new VX(i,o,n.options);if(Gr(x,E)!=33639248)throw new Error(sIe);dIe(p,x,E+6);let b=!!p.bitFlag.languageEncodingFlag,T=E+46,B=T+p.filenameLength,R=B+p.extraFieldLength,O=rc(x,E+4),U=O>>8==0,k=O>>8==3,z=I.subarray(T,B),Q=rc(x,E+32),H=R+Q,W=I.subarray(R,H),Z=b,Y=b,$=Gr(x,E+38),K=$&255,fe={readOnly:!!(K&1),hidden:!!(K&2),system:!!(K&4),directory:!!(K&16),archive:!!(K&32)},ge=Gr(x,E+42)+C,ne=xc(n,t,NEe)||wQ,Ce=Z?$Ee:w||eIe,ye=Y?$Ee:v||eIe,De=ne(z,Ce);De===en&&(De=wQ(z,Ce));let be=ne(W,ye);be===en&&(be=wQ(W,ye)),Object.assign(p,{versionMadeBy:O,msDosCompatible:U,compressedSize:0,uncompressedSize:0,commentLength:Q,offset:ge,diskNumberStart:rc(x,E+34),internalFileAttributes:rc(x,E+36),externalFileAttributes:$,msdosAttributesRaw:K,msdosAttributes:fe,rawFilename:z,filenameUTF8:Z,commentUTF8:Y,rawExtraField:I.subarray(B,R),rawComment:W,filename:De,comment:be}),y=Math.max(ge,y),hIe(p,p,x,E+6);let Ne=p.externalFileAttributes>>16&65535;p.unixMode===en&&(Ne&16877)!=0&&(p.unixMode=Ne);let ke=!!(p.unixMode&2048),Ue=!!(p.unixMode&1024),He=!!(p.unixMode&512),Et=p.unixMode!==en?(p.unixMode&73)!=0:k&&(Ne&73)!=0,Ye=p.unixMode!==en&&(p.unixMode&61440)==16384,nt=(Ne&61440)==16384;Object.assign(p,{setuid:ke,setgid:Ue,sticky:He,unixExternalUpper:Ne,internalFileAttribute:p.internalFileAttributes,externalFileAttribute:p.externalFileAttributes,executable:Et,directory:Ye||nt||U&&fe.directory||De.endsWith("/")&&!p.uncompressedSize,zipCrypto:p.encrypted&&!p.extraFieldAES});let Ct=new Ey(p);Ct.getData=(Qn,on)=>p.getData(Qn,Ct,n.readRanges,on),Ct.arrayBuffer=async Qn=>{let on=new null,[lt]=await Promise.all([new Response(on.readable).arrayBuffer(),p.getData(on,Ct,n.readRanges,Qn)]);return lt},E=H;let{onprogress:Wt}=t;if(Wt)try{await Wt(L+1,_,new Ey(p))}catch{}yield Ct}let P=xc(n,t,LEe),N=xc(n,t,OEe);return P&&(n.prependedData=y>0?await oc(i,0,y):new Uint8Array),n.comment=f?await oc(i,u+22,f):new Uint8Array,N&&(n.appendedData=h<i.size?await oc(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 VX=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:u,extraFieldZip64:f,compressionMethod:h,config:m,bitFlag:g,signature:A,rawLastModDate:_,uncompressedSize:C,compressedSize:y}=r,{dataDescriptor:E}=g,I=n.localDirectory={},x=await oc(s,a,30,c),S=zr(x),w=xc(r,o,GH),v=xc(r,o,zH),P=xc(r,o,VH);if(w=w&&w.length&&w,v=v&&v.length&&v,u&&u.originalCompressionMethod!=99)throw new Error(GX);if(h!=0&&h!=8&&h!=9&&!P)throw new Error(GX);if(Gr(S,0)!=67324752)throw new Error(aIe);dIe(I,S,4);let{extraFieldLength:N,filenameLength:L,lastAccessDate:p,creationDate:b}=I;I.rawExtraField=N?await oc(s,a+30+L,N,c):new Uint8Array,hIe(r,I,S,4,!0),Object.assign(n,{lastAccessDate:p,creationDate:b});let T=r.encrypted&&I.encrypted&&!P,B=T&&!u;if(P||(n.zipCrypto=B),T){if(!B&&u.strength===en)throw new Error(uIe);if(!w&&!v)throw new Error(lIe)}let R=a+30+L+N,O=y,U=s.readable;Object.assign(U,{diskNumberStart:c,offset:R,size:O});let k=xc(r,o,HH),z=xc(r,o,FEe),Q=xc(r,o,kEe),H=xc(r,o,QEe);H&&(Q=!0);let{onstart:W,onprogress:Z,onend:Y}=o,$=h==9,K=xc(r,o,WH);$&&(K=!1);let fe={options:{codecType:NH,password:w,rawPassword:v,zipCrypto:B,encryptionStrength:u&&u.strength,signed:xc(r,o,UEe)&&!P,passwordVerification:B&&(E?_>>>8&255:A>>>24&255),outputSize:P?y:C,signature:A,compressed:h!=0&&!P,encrypted:r.encrypted&&!P,useWebWorkers:xc(r,o,YH),useCompressionStream:K,transferStreams:xc(r,o,GEe),deflate64:$,checkPasswordOnly:z},config:m,streamOptions:{signal:k,size:O,onstart:W,onprogress:Z,onend:Y}};Q&&await cAt({reader:s,fileEntry:n,offset:a,diskNumberStart:c,signature:A,compressedSize:y,uncompressedSize:C,dataOffset:R,dataDescriptor:E||I.bitFlag.dataDescriptor,extraFieldZip64:f||I.extraFieldZip64,readRanges:i});let ge;try{if(!H){z&&(t=new WritableStream),t=new cB(t),await Vm(t,P?y:C),{writable:ge}=t;let{outputSize:ne}=await OH({readable:U,writable:ge},fe);if(t.size+=ne,ne!=(P?y:C))throw new Error(oB)}}catch(ne){if(ne.outputSize!==en&&(t.size+=ne.outputSize),!z||ne.message!=o_)throw ne}finally{!xc(r,o,jH)&&ge&&!ge.locked&&await ge.getWriter().close()}return z||H?en:t.getData?t.getData():ge}};function dIe(e,t,n){let i=e.rawBitFlag=rc(t,n+2),o=(i&1)==1,r=Gr(t,n+6);Object.assign(e,{encrypted:o,version:rc(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:uAt(r),filenameLength:rc(t,n+22),extraFieldLength:rc(t,n+24)})}function hIe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=zr(new Uint8Array(r)),c=0;try{for(;c<r.length;){let E=rc(a,c),I=rc(a,c+2);s.set(E,{type:E,data:r.slice(c+4,c+4+I)}),c+=4+I}}catch{}let u=rc(n,i+4);Object.assign(t,{signature:Gr(n,i+10),compressedSize:Gr(n,i+14),uncompressedSize:Gr(n,i+18)});let f=s.get(1);f&&(oAt(f,t),t.extraFieldZip64=f);let h=s.get(28789);h&&(tIe(h,hX,AX,t,e),t.extraFieldUnicodePath=h);let m=s.get(25461);m&&(tIe(m,DQ,mX,t,e),t.extraFieldUnicodeComment=m);let g=s.get(39169);g?(rAt(g,t,u),t.extraFieldAES=g):t.compressionMethod=u;let A=s.get(10);A&&(sAt(A,t),t.extraFieldNTFS=A);let _=s.get(30805);if(_)nIe(_,t,!1),t.extraFieldUnix=_;else{let E=s.get(30837);E&&(nIe(E,t,!0),t.extraFieldInfoZip=E)}let C=s.get(21589);C&&(aAt(C,t,o),t.extraFieldExtendedTimestamp=C);let y=s.get(6534);y&&(t.extraFieldUSDZ=y)}function oAt(e,t){t.zip64=!0;let n=zr(e.data),i=nAt.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=iAt[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(cIe)}}function tIe(e,t,n,i,o){let r=zr(e.data),s=new n_;s.append(o[n]);let a=zr(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Gr(r,1);Object.assign(e,{version:by(r,0),[t]:wQ(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==Gr(a,0)}),e.valid&&(i[t]=e[t],i[t+tAt]=!0)}function rAt(e,t,n){let i=zr(e.data),o=by(i,4);Object.assign(e,{vendorVersion:by(i,0),vendorId:by(i,2),strength:o,originalCompressionMethod:n,compressionMethod:rc(i,5)}),t.compressionMethod=e.compressionMethod}function sAt(e,t){let n=zr(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=rc(n,i),s=rc(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=zr(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 u=UX(s),f=UX(a),h=UX(c),m={lastModDate:u,lastAccessDate:f,creationDate:h};Object.assign(e,m),Object.assign(t,m)}}catch{}}function nIe(e,t,n){try{let i=zr(new Uint8Array(e.data)),o=0,r=by(i,o++),s=by(i,o++),a=e.data.subarray(o,o+s);o+=s;let c=iIe(a),u=by(i,o++),f=e.data.subarray(o,o+u);o+=u;let h=iIe(f),m=en;if(!n&&o+2<=e.data.length){let g=e.data;m=new DataView(g.buffer,g.byteOffset+o,2).getUint16(0,!0)}Object.assign(e,{version:r,uid:c,gid:h,unixMode:m}),c!==en&&(t.uid=c),h!==en&&(t.gid=h),m!==en&&(t.unixMode=m)}catch{}}function iIe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function aAt(e,t,n){let i=zr(e.data),o=by(i,0),r=[],s=[];n?((o&1)==1&&(r.push(lB),s.push(kH)),(o&2)==2&&(r.push(PQ),s.push(PEe)),(o&4)==4&&(r.push(RQ),s.push(CX))):e.data.length>=5&&(r.push(lB),s.push(kH));let a=1;r.forEach((c,u)=>{if(e.data.length>=a+4){let f=Gr(i,a);t[c]=e[c]=new Date(f*1e3);let h=s[u];e[h]=f}a+=4})}async function cAt({reader:e,fileEntry:t,offset:n,diskNumberStart:i,signature:o,compressedSize:r,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let h=0;if(i)for(let A=0;A<i;A++){let _=e.readers[A];h+=_.size}let m=0;if(c&&(u?m=20:m=12),m){let A=await oc(e,a+r,m+4,i);if(Gr(zr(A),0)==134695760){let C=Gr(zr(A),4),y,E;u?(y=dB(zr(A),8),E=dB(zr(A),16)):(y=Gr(zr(A),8),E=Gr(zr(A),12)),(t.encrypted&&!t.zipCrypto||C==o)&&y==r&&E==s&&(m+=4)}}let g={start:h+n,end:h+a+r+m,fileEntry:t};for(let A of f)if(A.fileEntry!=t&&g.start>=A.start&&g.start<A.end){let _=new Error(fIe);throw _.overlappingEntry=A.fileEntry,_}f.push(g)}async function lAt(e,t,n,i,o){let r=new Uint8Array(4),s=zr(r);fAt(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,h=await oc(e,f,u);for(let m=h.length-i;m>=0;m--)if(h[m]==r[0]&&h[m+1]==r[1]&&h[m+2]==r[2]&&h[m+3]==r[3])return{offset:f+m,buffer:h.slice(m,m+i).buffer}}}function xc(e,t,n){return t[n]===en?e.options[n]:t[n]}function uAt(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 UX(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function by(e,t){return e.getUint8(t)}function rc(e,t){return e.getUint16(t,!0)}function Gr(e,t){return e.getUint32(t,!0)}function dB(e,t){return Number(e.getBigUint64(t,!0))}function fAt(e,t,n){e.setUint32(t,n,!0)}function zr(e){return new DataView(e.buffer)}var EIe="File already exists",IIe="Zip file comment exceeds 64KB",bIe="File entry comment exceeds 64KB",xIe="File entry name exceeds 64KB",c7="Version exceeds 65535",TIe="The strength must equal 1, 2, or 3",SIe="Extra field type exceeds 65535",BIe="Extra field data exceeds 64KB",c8="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",wIe="Undefined uncompressed size",DIe="Zip file not empty",CAt="Invalid uid (must be integer 0..2^32-1)",yAt="Invalid gid (must be integer 0..2^32-1)",EAt="Invalid UNIX mode (must be integer 0..65535)",IAt="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",bAt="Invalid msdosAttributesRaw (must be integer 0..255)",xAt="Invalid msdosAttributes (must be an object with boolean flags)",pIe=new Uint8Array([7,0,2,0,65,69,3,0,0]),vIe="infozip",PIe="unix",s7=0,gIe=[],VQ=class{constructor(t,n={}){t=new cB(t);let i=t.availableSize!==en&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==en&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:AQ(),files:new Map,filenames:new Set,offset:n[QX]===en?t.size||t.writable.size||0:n[QX],pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async prependZip(t){if(this.filenames.size)throw new Error(DIe);t=new M0(t);let n=new N0(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:u,rawFilename:f,bitFlag:h,encrypted:m,uncompressedSize:g,compressedSize:A,diskOffset:_,diskNumber:C,zip64:y}=o,{rawExtraFieldZip64:E,rawExtraFieldAES:I,rawExtraFieldExtendedTimestamp:x,rawExtraFieldNTFS:S,rawExtraFieldUnix:w,rawExtraField:v}=o,{level:P,languageEncodingFlag:N,dataDescriptor:L}=h;E=E||new Uint8Array,I=I||new Uint8Array,x=x||new Uint8Array,S=S||new Uint8Array,w=o.rawExtraFieldUnix||new Uint8Array,v=v||new Uint8Array;let p=vi(E,I,x,S,w,v),b=y&&g>4294967295,T=y&&A>4294967295,{headerArray:B,headerView:R}=RIe({version:r,bitFlag:MIe(P,N,L,m,s),compressionMethod:s,uncompressedSize:g,compressedSize:A,lastModDate:a,rawFilename:f,zip64CompressedSize:T,zip64UncompressedSize:b,extraFieldLength:p});return Object.assign(o,{zip64UncompressedSize:b,zip64CompressedSize:T,zip64Offset:y&&this.offset-_>4294967295,zip64DiskNumberStart:y&&C>65535,rawExtraFieldZip64:E,rawExtraFieldAES:I,rawExtraFieldExtendedTimestamp:x,rawExtraFieldNTFS:S,rawExtraFieldUnix:w,rawExtraField:v,extendedTimestamp:x.length>0||S.length>0,extraFieldExtendedTimestampFlag:1+(c?2:0)+(u?4:0),headerArray:B,headerView:R}),[o.filename,o]}))}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;s7<s.maxWorkers?s7++:await new Promise(c=>gIe.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(EIe);return o.filenames.add(t),a=TAt(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=gIe.shift();c?c():s7--}}remove(t){let{filenames:n,files:i}=this;if(typeof t=="string"&&(t=i.get(t)),t&&t.filename!==en){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 NAt(i,t,n),xi(i,n,jH)||await s.getWriter().close(),r.getData?r.getData():s}};async function TAt(e,t,n,i){t=t.trim();let o=xi(e,i,xX),r=xi(e,i,BX,o?20:768),s=xi(e,i,DX),a=xi(e,i,"uid"),c=xi(e,i,"gid"),u=xi(e,i,MX),f=xi(e,i,XEe),h=xi(e,i,NX),m=xi(e,i,LX),g=xi(e,i,OX);if(a!==en&&(a<0||a>4294967295))throw new Error(CAt);if(c!==en&&(c<0||c>4294967295))throw new Error(yAt);if(u!==en&&(u<0||u>65535))throw new Error(EAt);if(f!==en&&f!==vIe&&f!==PIe)throw new Error(IAt);let A=xi(e,i,IX),_=xi(e,i,bX),C=a!==en||c!==en||u!==en||f,y=A!==en||_!==en;if(C?(o=!1,r=r&65535|768):y&&(o=!0,r=r&255),A!==en&&(A<0||A>255))throw new Error(bAt);if(_&&typeof _!==Xye)throw new Error(xAt);if(r>65535)throw new Error(c7);let E=xi(e,i,EX,0);!i[MQ]&&t.endsWith("/")&&(i[MQ]=!0);let I=xi(e,i,MQ);I?(t.endsWith("/")||(t+="/"),E===0&&(E=16,o||(E|=16877<<16))):!o&&E===0&&(s?E=493<<16:E=420<<16);let x;o||(x=E>>16&65535,u=u===en?x:u&65535,h?u|=2048:h=!!(u&2048),m?u|=1024:m=!!(u&1024),g?u|=512:g=!!(u&512),I&&(u|=16384),E=(u&65535)<<16|E&255),{msdosAttributesRaw:A,msdosAttributes:_}=vAt(A,_),y&&(E=E&4294967295|A&255);let S=xi(e,i,JEe,nB),w=S(t);if(w===en&&(w=nB(t)),vi(w)>65535)throw new Error(xIe);let v=i[DQ]||"",P=S(v);if(P===en&&(P=nB(v)),vi(P)>65535)throw new Error(bIe);let N=xi(e,i,SX,20);if(N>65535)throw new Error(c7);let L=xi(e,i,lB,new Date),p=xi(e,i,PQ),b=xi(e,i,RQ),T=xi(e,i,yX,0),B=xi(e,i,VH),R,O;B||(R=xi(e,i,GH),O=xi(e,i,zH));let U=xi(e,i,zEe,3),k=xi(e,i,wX),z=xi(e,i,VEe,!0),Q=xi(e,i,HEe,!0),H=xi(e,i,YH),W=xi(e,i,WEe),Z=xi(e,i,jEe,!1),Y=xi(e,i,HH),$=xi(e,i,qEe,!0),K=xi(e,i,vX),fe=xi(e,i,YEe),ge=xi(e,i,WH),ne=xi(e,i,KEe);W&&ne===en&&(ne=!1),(ne===en||k)&&(ne=!0),fe!==en&&fe!=6&&(ge=!1),!ge&&e.config.CompressionStream===en&&e.config.CompressionStreamZlib===en&&(fe=0);let Ce=xi(e,i,UH);if(!k&&(R!==en||O!==en)&&!(U>=1&&U<=3))throw new Error(TIe);let ye=new Uint8Array,De=i[RX];if(De){let ro=0,Ao=0;De.forEach(ii=>ro+=4+vi(ii)),ye=new Uint8Array(ro),De.forEach((ii,so)=>{if(so>65535)throw new Error(SIe);if(vi(ii)>65535)throw new Error(BIe);wr(ye,new Uint16Array([so]),Ao),wr(ye,new Uint16Array([vi(ii)]),Ao+2),wr(ye,ii,Ao+4),Ao+=4+vi(ii)})}let be=0,Ne=0,ke=0;if(B&&(ke=i[vQ],ke===en))throw new Error(wIe);let Ue=Ce===!0;n&&(n=new M0(n),await Vm(n),B?(i.uncompressedSize=ke,be=yIe(ke)):n.size===en?(ne=!0,(Ce||Ce===en)&&(Ce=!0,ke=be=4294967296)):(i.uncompressedSize=ke=n.size,be=yIe(ke)));let{diskOffset:He,diskNumber:Et,maxSize:Ye}=e.writer,nt=Ue||ke>4294967295,Ct=Ue||be>4294967295,Wt=Ue||e.offset+e.pendingEntriesSize-He>4294967295,on=xi(e,i,FX,!0)&&Ue||Et+Math.ceil(e.pendingEntriesSize/Ye)>65535;if(Wt||nt||Ct||on){if(Ce===!1||!Q)throw new Error(c8);Ce=!0}Ce=Ce||!1;let lt=xi(e,i,TX);i=Object.assign({},i,{rawFilename:w,rawComment:P,version:N,versionMadeBy:r,lastModDate:L,lastAccessDate:p,creationDate:b,rawExtraField:ye,zip64:Ce,zip64UncompressedSize:nt,zip64CompressedSize:Ct,zip64Offset:Wt,zip64DiskNumberStart:on,password:R,rawPassword:O,level:fe,useWebWorkers:H,encryptionStrength:U,extendedTimestamp:z,zipCrypto:k,bufferedWrite:W,keepOrder:Q,useUnicodeFileNames:$,dataDescriptor:ne,dataDescriptorSignature:Z,signal:Y,msDosCompatible:o,internalFileAttribute:T,internalFileAttributes:T,externalFileAttribute:E,externalFileAttributes:E,useCompressionStream:ge,passThrough:B,encrypted:!!(R&&vi(R)||O&&vi(O))||B&&lt,signature:i[PX],compressionMethod:K,uncompressedSize:ke,offset:e.offset-He,diskNumberStart:Et,uid:a,gid:c,setuid:h,setgid:m,sticky:g,unixMode:u,msdosAttributesRaw:A,msdosAttributes:_,unixExternalUpper:x});let Nt=wAt(i),Mn=PAt(i),at=vi(Nt.localHeaderArray,Mn.dataDescriptorArray);Ne=at+be,e.options[kX]&&(Ne+=Ne+64),e.pendingEntriesSize+=Ne;let fi;try{fi=await SAt(e,t,n,{headerInfo:Nt,dataDescriptorInfo:Mn,metadataSize:at},i)}finally{e.pendingEntriesSize-=Ne}return Object.assign(fi,{name:t,comment:v,extraField:De}),new Ey(fi)}async function SAt(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,h=e.options[kX],m=Array.from(r.values()).pop(),g={},A,_,C,y,E,I,x;r.set(t,g);try{let P;a&&(P=m&&m.lock,S()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!h?(I=new null,I.size=0,A=!0,e.bufferedWrites++,await Vm(s)):(I=s,await w()),await Vm(I);let{writable:N,diskOffset:L}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let R=new Uint8Array(4),O=Ra(R);qi(O,0,134695760),await r_(s,R),e.offset+=4}h&&DAt(i,e.offset-L);let{localHeaderView:p,localHeaderArray:b}=f;A||(await P,await v(N));let{diskNumber:T}=s;E=!0,g.diskNumberStart=T,A?x=new Response(I.readable).blob():await r_(I,b),g=await BAt(n,I,g,i,e.config,o);let{zip64:B}=g;if(E=!1,r.set(t,g),g.filename=t,A){let[R]=await Promise.all([x,I.writable.getWriter().close(),P]);await w(),y=!0,g.diskNumberStart=s.diskNumber,g.offset=e.offset-s.diskOffset,B&&CIe(g),MAt(g,p,o),await v(N),await r_(s,b),await R.stream().pipeTo(N,{preventClose:!0,preventAbort:!0,signal:u}),s.size+=I.size,y=!1}else g.offset=e.offset-L,B&&CIe(g);if(g.offset>4294967295&&!B)throw new Error(c8);return e.offset+=g.size,g}catch(P){if(A&&y||!A&&E){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}A?e.offset+=I.size:e.offset=I.size}throw r.delete(t),P}finally{A&&e.bufferedWrites--,C&&C(),_&&_()}function S(){g.lock=new Promise(P=>C=P)}async function w(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(N=>_=()=>{e.writerLocked=!1,N()}),await P}async function v(P){vi(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await r_(P,new Uint8Array))}}async function BAt(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=o,{headerArray:f,headerView:h,lastModDate:m,rawLastModDate:g,encrypted:A,compressed:_,version:C,compressionMethod:y,rawExtraFieldZip64:E,localExtraFieldZip64Length:I,rawExtraFieldExtendedTimestamp:x,extraFieldExtendedTimestampFlag:S,rawExtraFieldNTFS:w,rawExtraFieldUnix:v,rawExtraFieldAES:P}=a,{dataDescriptorArray:N}=c,{rawFilename:L,lastAccessDate:p,creationDate:b,password:T,rawPassword:B,level:R,zip64:O,zip64UncompressedSize:U,zip64CompressedSize:k,zip64Offset:z,zip64DiskNumberStart:Q,zipCrypto:H,dataDescriptor:W,directory:Z,executable:Y,versionMadeBy:$,rawComment:K,rawExtraField:fe,useWebWorkers:ge,onstart:ne,onprogress:Ce,onend:ye,signal:De,encryptionStrength:be,extendedTimestamp:Ne,msDosCompatible:ke,internalFileAttributes:Ue,externalFileAttributes:He,uid:Et,gid:Ye,unixMode:nt,setuid:Ct,setgid:Wt,sticky:Qn,unixExternalUpper:on,msdosAttributesRaw:lt,msdosAttributes:Nt,useCompressionStream:Mn,passThrough:at}=s,fi={lock:i,versionMadeBy:$,zip64:O,directory:!!Z,executable:!!Y,filenameUTF8:!0,rawFilename:L,commentUTF8:!0,rawComment:K,rawExtraFieldZip64:E,localExtraFieldZip64Length:I,rawExtraFieldExtendedTimestamp:x,rawExtraFieldNTFS:w,rawExtraFieldUnix:v,rawExtraFieldAES:P,rawExtraField:fe,extendedTimestamp:Ne,msDosCompatible:ke,internalFileAttributes:Ue,externalFileAttributes:He,diskNumberStart:n,uid:Et,gid:Ye,unixMode:nt,setuid:Ct,setgid:Wt,sticky:Qn,unixExternalUpper:on,msdosAttributesRaw:lt,msdosAttributes:Nt},{signature:ro,uncompressedSize:Ao}=s,ii=0;at||(Ao=0);let{writable:so}=t;if(e){e.chunkSize=IH(r);let ao=e.readable,Ui=e.size,Pi={options:{codecType:MH,level:R,rawPassword:B,password:T,encryptionStrength:be,zipCrypto:A&&H,passwordVerification:A&&H&&g>>8&255,signed:!at,compressed:_&&!at,encrypted:A&&!at,useWebWorkers:ge,useCompressionStream:Mn,transferStreams:!1},config:r,streamOptions:{signal:De,size:Ui,onstart:ne,onprogress:Ce,onend:ye}};try{let Vn=await OH({readable:ao,writable:so},Pi);ii=Vn.outputSize,t.size+=ii,at||(Ao=Vn.inputSize,ro=Vn.signature)}catch(Vn){throw Vn.outputSize!==en&&(t.size+=Vn.outputSize),Vn}}return RAt({signature:ro,compressedSize:ii,uncompressedSize:Ao,headerInfo:a,dataDescriptorInfo:c},s),W&&await r_(t,N),Object.assign(fi,{uncompressedSize:Ao,compressedSize:ii,lastModDate:m,rawLastModDate:g,creationDate:b,lastAccessDate:p,encrypted:A,zipCrypto:H,size:u+ii,compressionMethod:y,version:C,headerArray:f,headerView:h,signature:ro,extraFieldExtendedTimestampFlag:S,zip64UncompressedSize:U,zip64CompressedSize:k,zip64Offset:z,zip64DiskNumberStart:Q}),fi}function wAt(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:h,encryptionStrength:m,extendedTimestamp:g,passThrough:A,encrypted:_,zip64UncompressedSize:C,zip64CompressedSize:y,zip64Offset:E,zip64DiskNumberStart:I,uncompressedSize:x,offset:S,diskNumberStart:w}=e,{version:v,compressionMethod:P}=e,N=!f&&(r>0||r===en&&P!==0),L,p=A||!N,b=s&&(e.bufferedWrite||!C&&!y||p);if(s){let K=4;C&&(K+=8),y&&(K+=8),E&&(K+=8),I&&(K+=4),L=new Uint8Array(K);let fe=Ra(L);if(fo(fe,0,1),fo(fe,2,vi(L)-4),b){let ge=Ra(L),ne=4;C&&(la(ge,ne,BigInt(x)),ne+=8),y&&p&&(la(ge,ne,BigInt(x)),ne+=8),E&&(la(ge,ne,BigInt(S)),ne+=8),I&&(qi(ge,ne,w),ne+=4)}}else L=new Uint8Array;let T;if(_&&!a){T=new Uint8Array(vi(pIe)+2);let K=Ra(T);fo(K,0,39169),wr(T,pIe,2),hB(K,8,m)}else T=new Uint8Array;let B,R,O;if(g){R=new Uint8Array(9+(i?4:0)+(o?4:0));let K=Ra(R);fo(K,0,21589),fo(K,2,vi(R)-4),O=1+(i?2:0)+(o?4:0),hB(K,4,O);let fe=5;qi(K,fe,Math.floor(n.getTime()/1e3)),fe+=4,i&&(qi(K,fe,Math.floor(i.getTime()/1e3)),fe+=4),o&&qi(K,fe,Math.floor(o.getTime()/1e3));try{B=new Uint8Array(36);let ge=Ra(B),ne=a7(n);fo(ge,0,10),fo(ge,2,32),fo(ge,8,1),fo(ge,10,24),la(ge,12,ne),la(ge,20,a7(i)||ne),la(ge,28,a7(o)||ne)}catch{B=new Uint8Array}}else B=R=new Uint8Array;let U;try{let{uid:K,gid:fe,unixMode:ge,setuid:ne,setgid:Ce,sticky:ye,unixExtraFieldType:De}=e;if(De&&(K!==en||fe!==en||ge!==en)){let be=_Ie(K),Ne=_Ie(fe),ke=new Uint8Array;if(De==PIe&&ge!==en){let Ye=ge&65535;ne&&(Ye|=2048),Ce&&(Ye|=1024),ye&&(Ye|=512),ke=new Uint8Array(2),new DataView(ke.buffer).setUint16(0,Ye,!0)}let Ue=3+be.length+Ne.length+ke.length;U=new Uint8Array(4+Ue);let He=Ra(U);fo(He,0,De==vIe?30837:30805),fo(He,2,Ue),hB(He,4,1),hB(He,5,be.length);let Et=6;wr(U,be,Et),Et+=be.length,hB(He,Et,Ne.length),Et++,wr(U,Ne,Et),Et+=Ne.length,wr(U,ke,Et)}else U=new Uint8Array}catch{U=new Uint8Array}P===en&&(P=N?8:0),s&&(v=v>45?v:45),_&&!a&&(v=v>51?v:51,T[9]=P,P=99);let k=b?vi(L):0,z=k+vi(T,R,B,U,h),{headerArray:Q,headerView:H,rawLastModDate:W}=RIe({version:v,bitFlag:MIe(r,c,u,_,P),compressionMethod:P,uncompressedSize:x,lastModDate:n<tX?tX:n>eX?eX:n,rawFilename:t,zip64CompressedSize:y,zip64UncompressedSize:C,extraFieldLength:z}),Z=30,Y=new Uint8Array(Z+vi(t)+z),$=Ra(Y);return qi($,0,67324752),wr(Y,Q,4),wr(Y,t,Z),Z+=vi(t),b&&wr(Y,L,Z),Z+=k,wr(Y,T,Z),Z+=vi(T),wr(Y,R,Z),Z+=vi(R),wr(Y,B,Z),Z+=vi(B),wr(Y,U,Z),Z+=vi(U),wr(Y,h,Z),u&&(qi($,18,0),qi($,22,0)),{localHeaderArray:Y,localHeaderView:$,headerArray:Q,headerView:H,lastModDate:n,rawLastModDate:W,encrypted:_,compressed:N,version:v,compressionMethod:P,extraFieldExtendedTimestampFlag:O,rawExtraFieldZip64:L,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:R,rawExtraFieldNTFS:B,rawExtraFieldUnix:U,rawExtraFieldAES:T,extraFieldLength:z}}function DAt(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ra(i),s=64-(t+vi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Ra(a);fo(c,0,6534),fo(c,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array(vi(u)+s),wr(i,u),wr(i,a,vi(u)),r=Ra(i),fo(r,28,o+s),e.metadataSize+=s}function _Ie(e){if(e===en)return new Uint8Array;{let t=new Uint8Array(4);Ra(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}}function vAt(e,t){if(e!==en)e=e&255;else if(t!==en){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===en&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function PAt({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=Ra(i),n&&(r=4,qi(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function RAt({signature:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:o},{zip64:r,zipCrypto:s,dataDescriptor:a}){let{headerView:c,encrypted:u}=i,{dataDescriptorView:f,dataDescriptorOffset:h}=o;(!u||s)&&e!==en&&(qi(c,10,e),a&&qi(f,h,e)),r?a&&(la(f,h+4,BigInt(t)),la(f,h+12,BigInt(n))):(qi(c,14,t),qi(c,18,n),a&&(qi(f,h+4,t),qi(f,h+8,n)))}function MAt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,signature:o,compressedSize:r,uncompressedSize:s,offset:a,diskNumberStart:c,zip64UncompressedSize:u,zip64CompressedSize:f,zip64Offset:h,zip64DiskNumberStart:m},g,{dataDescriptor:A}){if(A||(t||qi(g,14,o),n||(qi(g,18,r),qi(g,22,s))),n&&i){let _=30+vi(e)+4;u&&(la(g,_,BigInt(s)),_+=8),f&&(la(g,_,BigInt(r)),_+=8),h&&(la(g,_,BigInt(a)),_+=8),m&&qi(g,_,c)}}function CIe({compressedSize:e,uncompressedSize:t,offset:n,diskNumberStart:i,zip64UncompressedSize:o,zip64CompressedSize:r,zip64Offset:s,zip64DiskNumberStart:a,rawExtraFieldZip64:c}){let u=Ra(c),f=4;o&&(la(u,f,BigInt(t)),f+=8),r&&(la(u,f,BigInt(e)),f+=8),s&&(la(u,f,BigInt(n)),f+=8),a&&qi(u,f,i)}async function NAt(e,t,n){let{files:i,writer:o}=e,{diskOffset:r}=o,{diskNumber:s}=o,a=0,c=0,u=e.offset-r,f=i.size;for(let[,x]of i){let{rawFilename:S,rawExtraFieldZip64:w,rawExtraFieldAES:v,rawComment:P,rawExtraFieldNTFS:N,rawExtraFieldUnix:L,rawExtraField:p,extendedTimestamp:b,extraFieldExtendedTimestampFlag:T,lastModDate:B}=x,R;if(b){R=new Uint8Array(9);let O=Ra(R);fo(O,0,21589),fo(O,2,5),hB(O,4,T),qi(O,5,Math.floor(B.getTime()/1e3))}else R=new Uint8Array;x.rawExtraFieldExtendedTimestamp=R,c+=46+vi(S,P,w,v,N,L,R,p)}let h=new Uint8Array(c),m=Ra(h);await Vm(o);let g=0;for(let[x,S]of Array.from(i.values()).entries()){let{offset:w,rawFilename:v,rawExtraFieldZip64:P,rawExtraFieldAES:N,rawExtraFieldExtendedTimestamp:L,rawExtraFieldNTFS:p,rawExtraFieldUnix:b,rawExtraField:T,rawComment:B,versionMadeBy:R,headerArray:O,headerView:U,zip64:k,zip64UncompressedSize:z,zip64CompressedSize:Q,zip64DiskNumberStart:H,zip64Offset:W,internalFileAttributes:Z,externalFileAttributes:Y,diskNumberStart:$,uncompressedSize:K,compressedSize:fe}=S,ge=vi(P,N,L,p,b,T);qi(m,a,33639248),fo(m,a+4,R),z||qi(U,18,K),Q||qi(U,14,fe),wr(h,O,a+6);let ne=a+30;if(fo(m,ne,ge),ne+=2,fo(m,ne,vi(B)),ne+=2,fo(m,ne,k&&H?65535:$),ne+=2,fo(m,ne,Z),ne+=2,Y&&qi(m,ne,Y),ne+=4,qi(m,ne,k&&W?4294967295:w),ne+=4,wr(h,v,ne),ne+=vi(v),wr(h,P,ne),ne+=vi(P),wr(h,N,ne),ne+=vi(N),wr(h,L,ne),ne+=vi(L),wr(h,p,ne),ne+=vi(p),wr(h,b,ne),ne+=vi(b),wr(h,T,ne),ne+=vi(T),wr(h,B,ne),ne+=vi(B),a-g>o.availableSize&&(o.availableSize=0,await r_(o,h.slice(g,a)),g=a),a=ne,n.onprogress)try{await n.onprogress(x+1,i.size,new Ey(S))}catch{}}await r_(o,g?h.slice(g):h);let A=o.diskNumber,{availableSize:_}=o;_<22&&A++;let C=xi(e,n,UH);if(u>4294967295||c>4294967295||f>65535||A>65535){if(C===!1)throw new Error(c8);C=!0}let y=new Uint8Array(C?98:22),E=Ra(y);a=0,C&&(qi(E,0,101075792),la(E,4,BigInt(44)),fo(E,12,45),fo(E,14,45),qi(E,16,A),qi(E,20,s),la(E,24,BigInt(f)),la(E,32,BigInt(f)),la(E,40,BigInt(c)),la(E,48,BigInt(u)),qi(E,56,117853008),la(E,64,BigInt(u)+BigInt(c)),qi(E,72,A+1),xi(e,n,FX,!0)&&(A=65535,s=65535),f=65535,u=4294967295,c=4294967295,a+=76),qi(E,a,101010256),fo(E,a+4,A),fo(E,a+6,s),fo(E,a+8,f),fo(E,a+10,f),qi(E,a+12,c),qi(E,a+16,u);let I=vi(t);if(I)if(I<=65535)fo(E,a+20,I);else throw new Error(IIe);await r_(o,y),I&&await r_(o,t)}async function r_(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=vi(t),await i.write(t)}finally{i.releaseLock()}}function a7(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function xi(e,t,n,i){let o=t[n]===en?e.options[n]:t[n];return o===en?i:o}function yIe(e){return e+5*(Math.floor(e/16383)+1)}function hB(e,t,n){e.setUint8(t,n)}function fo(e,t,n){e.setUint16(t,n,!0)}function qi(e,t,n){e.setUint32(t,n,!0)}function la(e,t,n){e.setBigUint64(t,n,!0)}function wr(e,t,n){e.set(t,n)}function Ra(e){return new DataView(e.buffer)}function vi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function RIe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawFilename:s,zip64CompressedSize:a,zip64UncompressedSize:c,extraFieldLength:u}){let f=new Uint8Array(26),h=Ra(f);fo(h,0,e),fo(h,2,t),fo(h,4,n);let m=new Uint32Array(1),g=Ra(m);fo(g,0,(r.getHours()<<6|r.getMinutes())<<5|r.getSeconds()/2),fo(g,2,(r.getFullYear()-1980<<4|r.getMonth()+1)<<5|r.getDate());let A=m[0];return qi(h,6,A),(a||o!==en)&&qi(h,14,a?4294967295:o),(c||i!==en)&&qi(h,18,c?4294967295:i),fo(h,22,vi(s)),fo(h,24,u),{headerArray:f,headerView:h,rawLastModDate:A}}function MIe(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 LAt={};try{Qm({baseURI:LAt.url})}catch{}var Df="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function NIe(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 u=0;a>u;u+=4){let f=Df.indexOf(s[u])<<18|Df.indexOf(s[u+1])<<12|(63&Df.indexOf(s[u+2]))<<6|63&Df.indexOf(s[u+3]);c.push(f>>16&255),s[u+2]!=="="&&c.push(f>>8&255),s[u+3]!=="="&&c.push(255&f)}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),u=n[s++]<<8|n[s++],f=o-u;r(o+c);for(let h=0;c>h;h++)i[o++]=i[f+h]}else{let c=a;r(o+c);for(let u=0;c>u&&s<n.length;u++)i[o++]=n[s++]}}return(s=>{let a="",c=s.length,u=0;for(;c>u+2;u+=3){let h=s[u]<<16|s[u+1]<<8|s[u+2];a+=Df[h>>18&63]+Df[h>>12&63]+Df[h>>6&63]+Df[63&h]}let f=c-u;if(f===1){let h=s[u]<<16;a+=Df[h>>18&63]+Df[h>>12&63]+"=="}else if(f===2){let h=s[u]<<16|s[u+1]<<8;a+=Df[h>>18&63]+Df[h>>12&63]+Df[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}}})("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BAGZgAAEAVmAAAQB2YAABAE5gAAEAbmAAAQBeYAABAH5gAAEAQWAAAQBhYAABAFFgAAEAcWAAAQBJYAABAGlgAAEAWWAAAQB5YAABAEVgAAEAZWAAAQBVYAABAHVgAAEATWAAAQBtYAABAF1gAAEAfWAAAQBDYAABAGNgAAEAU2AAAQBzYAABIARMwIArYAABAFtgAAEAe2AAAQBHYAABAGdgAAEAV2AAAQB3YAABAE9gAAEAb2AAAQBfYAABAH9gAAEAROAAMIFEwEJAJOAAAgBk4AACAFTgAAIAVOAAAgB04AACAHTgAAIATOAAAgBM4AACAGzgAAIAbOAAAgBc4AACAFzgAAIAfOAAAgB84AACAELgAAIgBDagAQCgAAEgAAIAUuAAAgBS4AACAHLgAAIAcuAAAgBK4AACAErgAAIAauAAAgBq4AACAFrgAAIAWuAAAgB64AACAHrgAAIARuAAAgBG4AACAGbgAAIAZuAAAgBW4AACAFbgAAIAduAAAgB24AACAE7gAAIATuAAAgBu4AACAG7gAAIAXuAAAgBe4AACAH7gAAIAfuAAAiBA7YBB4AACAGHgAAIAYeAAAgBR4AACAFHgAAIAceAAAgBx4AACAEngAAIASeAAAgBp4AACAGngAAIAWeAAAgBZ4AACAHngAAIAeeAAAgBF4AACAEXgAAIAZeAAAgBl4AACAFXgAAIAVeAAAgB14AACAHXgAAIATeAAAgBN4AACAG3gAAIAbeAAAgBd4AACAF3gAAIAfeAAAgB94AACAEPgAAIAQ+AAAgBj4AACAGPgAAIAU+AAAgBT4AACAHPgAAIAc+AAAgBL4AACAEvgAAIAa+AAAgBr4AACAFvgAAIAW+AAAgB74AACAHvgAAIAR+AAAgBH4AACAGfgAAIAZ+AAAgBX4AACAFfgAAIAd+AAAgB34AACAE/gAAIAT+AAAgBv4AACAG/gAAIAX+AAAgBf4AACAH/gAAIAf+AAAiBBAoBQIAABAEggAAEAWCAAAQBEIAABAFQgAAEATCAAAQBcIIFVgMHAEiAAAQBKIAABAFogAAEARiAAAQBWIAABAE4gAAEAXiAAAQBBIAABAFEgAAEASSAAAQBZIAABAEUgAAEAVSAAAQBNIAABAF0gAAEAQOAAEIBg4AABAFDgAAEAcOAAAQBI4AABAGjgAAEAWOAAAQB44AABIC+K4AAdIECxgEFgABcAQWCBUoBFIAABAEMgAAEARyAAASAvlaABEQBBYIGBAEaggXqAQWAA9QBBYADuAEFgAOcgE92gAAEARGAAAQBCYAABAEZgAAEgQACARWAAAQBDYAABAEdgAAEgL59gAKkgQZAAQWAAiyBBaYBBYABtAEFgD3fAxsLTYMfuYcABIC+rooABIEHUYkABAEEjAAEAQWKAAQEQbAcC4C9CosAS40AO4UALwEGhAAEgQWIgQAEgQEKgQAEgQGSgQAEgIS2ggAEAQuEAAQBDIQABIAF24FHeQTgHQsjhQBfhQXLAhARgAVtBgcJBgoFC4A6uAQNAg4BgAclBJQeC2mFAJCFAIiFAICFAHiBAGiBAFyBBh8BEIAABAEUgAAEARiAAAQBHIAABAEggAAEASiAAAQBMIAABAE4gAAEAUCAAAQBUIAABIEGvQFwgAAEAYCAAAQBoIAABAHAgAAEAeCAAG8DHwtyjQBvgQBrgQBngQBjgQBfgQBbgQBXgQBTgQBPgQBLgQBHgQBDgQE8AYCvAEGAUc0CC22BAMcBBIAAAgEIgAAEgQEzgQJLARCAAA6DAAyBnqyAqmuEACSBB3OBAE8BCIAACIEAGIUADIEIt4MADAEggQCUgDKEgQBrAYCBCC8BBIMADIA/SAoBABAMAEGRIQv/gCUfgMDAgIKxBQgJCQoKgEk3gAABAQ2AAAEBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),t)})}var Ls,AB,vf,HQ;function l7(e){if(Ls=e,{malloc:AB,free:vf,memory:HQ}=Ls,typeof AB!="function"||typeof vf!="function"||!HQ)throw Ls=AB=vf=HQ=null,new Error("Invalid WASM module")}function LIe(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 null({start(){let s;if(this.out=AB(o),this.in=AB(r),this.inBufferSize=r,this._scratch=new Uint8Array(o),e?(this._process=Ls.deflate_process,this._last_consumed=Ls.deflate_last_consumed,this._end=Ls.deflate_end,this.streamHandle=Ls.deflate_new(),t==="gzip"?s=Ls.deflate_init_gzip(this.streamHandle,i):t==="deflate-raw"?s=Ls.deflate_init_raw(this.streamHandle,i):s=Ls.deflate_init(this.streamHandle,i)):t==="deflate64-raw"?(this._process=Ls.inflate9_process,this._last_consumed=Ls.inflate9_last_consumed,this._end=Ls.inflate9_end,this.streamHandle=Ls.inflate9_new(),s=Ls.inflate9_init_raw(this.streamHandle)):(this._process=Ls.inflate_process,this._last_consumed=Ls.inflate_last_consumed,this._end=Ls.inflate_end,this.streamHandle=Ls.inflate_new(),t==="deflate-raw"?s=Ls.inflate_init_raw(this.streamHandle):t==="gzip"?s=Ls.inflate_init_gzip(this.streamHandle):s=Ls.inflate_init(this.streamHandle)),s!==0)throw new Error("init failed:"+s)},transform(s,a){try{let c=s,u=new Uint8Array(HQ.buffer),f=this._process,h=this._last_consumed,m=this.out,g=this._scratch,A=0;for(;A<c.length;){let _=Math.min(c.length-A,32768);(!this.in||this.inBufferSize<_)&&(this.in&&vf&&vf(this.in),this.in=AB(_),this.inBufferSize=_),u.set(c.subarray(A,A+_),this.in);let C=f(this.streamHandle,this.in,_,m,o,0),y=C&16777215;if(y&&(g.set(u.subarray(m,m+y),0),a.enqueue(g.slice(0,y))),!e){let I=C>>24&255,x=I&128?I-256:I;if(x<0)throw new Error("process error:"+x)}let E=h(this.streamHandle);if(E===0)break;A+=E}}catch(c){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&vf&&vf(this.in),this.out&&vf&&vf(this.out),a.error(c)}},flush(s){try{let a=new Uint8Array(HQ.buffer),c=this._process,u=this.out,f=this._scratch;for(;;){let h=c(this.streamHandle,0,0,u,o,4),m=h&16777215,g=h>>24&255;if(!e){let A=g&128?g-256:g;if(A<0)throw new Error("process error:"+A)}if(m&&(f.set(a.subarray(u,u+m),0),s.enqueue(f.slice(0,m))),g===1||m===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&&vf&&vf(this.in),this.out&&vf&&vf(this.out)}}})}var YQ=class{constructor(t="deflate",n){return LIe(!0,t,n)}},WQ=class{constructor(t="deflate",n){return LIe(!1,t,n)}};var OIe=!1;async function FIe(e,{baseURI:t}){if(!OIe){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=OAt(e);else throw r}let o=await WebAssembly.instantiate(n);l7(o.instance.exports),OIe=!0}}function OAt(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 u7;NIe(Qm);TEe({initModule:e=>{if(!u7){let{wasmURI:t}=e;typeof t==Hd&&(t=t()),u7=FIe(t,e)}return u7}});Qm({CompressionStreamZlib:YQ,DecompressionStreamZlib:WQ});function FAt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var On=FAt;function QAt(e,t){this.position=e,this.headingPitchRange=t}var jQ=QAt;function l8(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new _e,this.tourEnd=new _e,this.entryStart=new _e,this.entryEnd=new _e,this._activeEntries=[]}l8.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};l8.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;kIe.call(this,e,t,function(i){n.playlistIndex=0,i||QIe(n._activeEntries),n.tourEnd.raiseEvent(i)})};l8.prototype.stop=function(){QIe(this._activeEntries)};function QIe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function kIe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=kAt.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 kAt(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++,kIe.call(this,e,t,n)}}var qQ=l8;var Ki=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-Ki.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?Ki.Bounce.In(e*2)*.5:Ki.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}}}}),KQ=function(){return performance.now()},UAt=(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=KQ()),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})(),mB={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=mB.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=mB.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=mB.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=mB.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}}},UIe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),f7=new UAt,GIe=(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=Ki.Linear.None,this._interpolationFunction=mB.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=UIe.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=f7,f7.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=KQ()),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),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var m=[a],g=0,A=h.length;g<A;g+=1){var _=this._handleRelativeValue(a,h[g]);if(isNaN(_)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}m.push(_)}f&&(i[s]=m)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var C=a;for(var y in C)n[s][y]=C[y];o[s]=c?[]:{};var h=i[s];if(!this._isDynamic){var E={};for(var y in h)E[y]=h[y];i[s]=h=E}this._setupProperties(C,n[s],h,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),f?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=KQ()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=KQ()),!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=Ki.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=mB.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=KQ()),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,u=function(){if(i._duration===0||s>c)return 1;var _=Math.trunc(s/a),C=s-_*a,y=Math.min(C/i._duration,1);return y===0&&s===i._duration?1:y},f=u(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var m=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=m);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*m,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,A=this._chainedTweens.length;g<A;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]),u=Array.isArray(a),f=!c&&u;f?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 A_i=UIe.nextId,Hm=f7,m_i=Hm.getAll.bind(Hm),p_i=Hm.removeAll.bind(Hm),g_i=Hm.add.bind(Hm),__i=Hm.remove.bind(Hm),C_i=Hm.update.bind(Hm);var GAt={LINEAR_NONE:Ki.Linear.None,QUADRATIC_IN:Ki.Quadratic.In,QUADRATIC_OUT:Ki.Quadratic.Out,QUADRATIC_IN_OUT:Ki.Quadratic.InOut,CUBIC_IN:Ki.Cubic.In,CUBIC_OUT:Ki.Cubic.Out,CUBIC_IN_OUT:Ki.Cubic.InOut,QUARTIC_IN:Ki.Quartic.In,QUARTIC_OUT:Ki.Quartic.Out,QUARTIC_IN_OUT:Ki.Quartic.InOut,QUINTIC_IN:Ki.Quintic.In,QUINTIC_OUT:Ki.Quintic.Out,QUINTIC_IN_OUT:Ki.Quintic.InOut,SINUSOIDAL_IN:Ki.Sinusoidal.In,SINUSOIDAL_OUT:Ki.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Ki.Sinusoidal.InOut,EXPONENTIAL_IN:Ki.Exponential.In,EXPONENTIAL_OUT:Ki.Exponential.Out,EXPONENTIAL_IN_OUT:Ki.Exponential.InOut,CIRCULAR_IN:Ki.Circular.In,CIRCULAR_OUT:Ki.Circular.Out,CIRCULAR_IN_OUT:Ki.Circular.InOut,ELASTIC_IN:Ki.Elastic.In,ELASTIC_OUT:Ki.Elastic.Out,ELASTIC_IN_OUT:Ki.Elastic.InOut,BACK_IN:Ki.Back.In,BACK_OUT:Ki.Back.Out,BACK_IN_OUT:Ki.Back.InOut,BOUNCE_IN:Ki.Bounce.In,BOUNCE_OUT:Ki.Bounce.Out,BOUNCE_IN_OUT:Ki.Bounce.InOut},ys=Object.freeze(GAt);function u8(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}u8.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 le(this.view.position);t.flyToBoundingSphere(o,i)}};u8.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};u8.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=ys.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=St(t,e)),t};var JQ=u8;function d7(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}d7.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};d7.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var XQ=d7;var ZIe={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=mp(t),ZIe[t]}},C7;typeof DOMParser<"u"&&(C7=new DOMParser);var zAt=new XIe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),xy=32,zIe=2414016,VIe=1,HIe=16093e3,YIe=.1,WIe=[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"],jIe=["http://www.google.com/kml/ext/2.2"],VAt=["http://www.w3.org/2005/Atom"],Le={kml:WIe,gx:jIe,atom:VAt,kmlgx:WIe.concat(jIe)},y7={Document:c0e,Folder:cmt,Placemark:lmt,NetworkLink:_mt,GroundOverlay:mmt,PhotoOverlay:f0e,ScreenOverlay:Amt,Tour:fmt};function Ym(e){this._dataSource=e,this._deferred=ou(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Ym.prototype,{dataSource:{get:function(){return this._dataSource}}});Ym.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Ym.prototype.addPromise=function(e){this._promises.push(e)};Ym.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Ym.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Mf._getTimestamp()),this._process(e)};Ym.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Mf._getTimestamp(),e._process(!0)},0)};Ym.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]};Ym.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Ym.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=y7[i.localName];if(l(o)&&(Le.kml.indexOf(i.namespaceURI)!==-1||Le.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Mf._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function HAt(e){let t=e.slice(0,Math.min(4,e.size)),n=ou(),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 YAt(e){let t=ou(),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 $Ie(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 e0e(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 WAt(e,t){let n=await e.getData(new SQ);n=$Ie(n),n=e0e(n),t.kml=C7.parseFromString(n,"application/xml")}async function h7(e,t){let n=ZIe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new xQ(n));t[e.filename]=i}function Pf(e,t,n,i){let o=i.keys,r=new ZQ.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let h=new ZQ.default(u).absoluteTo(r).toString(),m=o.indexOf(h);if(m!==-1){let g=o[m];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Rf(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=E7(a,i);l(c)&&s.setAttribute(n,c.url)}}function t0e(e,t,n){let i=ua(e,"id");i=l(i)&&i.length!==0?i:jn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=jn(),l(n)&&(i=n+i)),o=t.add(new Er({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new Imt),o}function $Q(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function A8(e,t){if(!l(e))return d.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return d.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,d.fromDegrees(i,o,r,t)}function f8(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++]=A8(n[s],t);return o}function Ty(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 qIe(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 bA(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 gi(e,t,n){let i=Ji(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Fn(e,t,n){let i=Ji(e,t,n);if(l(i))return i.textContent.trim()}function xA(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 E7(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 Be({url:o});else{let r=new ZQ.default(t.getUrlComponent()),s=new ZQ.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Be({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Pu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function g7(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?(Pu.maximumRed=r,Pu.red=void 0):(Pu.maximumRed=void 0,Pu.red=0),o>0?(Pu.maximumGreen=o,Pu.green=void 0):(Pu.maximumGreen=void 0,Pu.green=0),i>0?(Pu.maximumBlue=i,Pu.blue=void 0):(Pu.maximumBlue=void 0,Pu.blue=0),Pu.alpha=n,G.fromRandom(Pu)):new G(r,o,i,n)}function F0(e,t,n){let i=Fn(e,t,n);if(l(i))return g7(i,Fn(e,"colorMode",n)==="random")}function jAt(e){let t=Ji(e,"TimeStamp",Le.kmlgx),n=Fn(t,"when",Le.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=J.fromIso8601(n),o=new ps;return o.addInterval(new wn({start:i,stop:Ke.MAXIMUM_VALUE})),o}function qAt(e){let t=Ji(e,"TimeSpan",Le.kmlgx);if(!l(t))return;let n,i=Ji(t,"begin",Le.kmlgx),o=l(i)?J.fromIso8601(i.textContent):void 0,r=Ji(t,"end",Le.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 ps,n.addInterval(new wn({start:o,stop:s}))}else l(o)?(n=new ps,n.addInterval(new wn({start:o,stop:Ke.MAXIMUM_VALUE}))):l(s)&&(n=new ps,n.addInterval(new wn({start:Ke.MINIMUM_VALUE,stop:s})));return n}function n0e(){let e=new Qc;return e.width=xy,e.height=xy,e.scaleByDistance=new Ht(zIe,VIe,HIe,YIe),e.pixelOffsetScaleByDistance=new Ht(zIe,VIe,HIe,YIe),e}function I7(){let e=new Bh;return e.outline=!0,e.outlineColor=G.WHITE,e}function i0e(){let e=new Sh;return e.translucencyByDistance=new Ht(3e6,1,5e6,0),e.pixelOffset=new F(17,0),e.horizontalOrigin=Mi.LEFT,e.font="16px sans-serif",e.style=cr.FILL_AND_OUTLINE,e}function b7(e,t,n,i,o){let r=Fn(e,"href",Le.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=gi(e,"x",Le.gx)??0,u=gi(e,"y",Le.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=E7(r,n,i);if(o){let a=Fn(e,"refreshMode",Le.kml),c=Fn(e,"viewRefreshMode",Le.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 u=Fn(e,"viewBoundScale",Le.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=Fn(e,"viewFormat",Le.kml)??f,m=Fn(e,"httpQuery",Le.kml);l(h)&&s.setQueryParameters(Wu(h8(h))),l(m)&&s.setQueryParameters(Wu(h8(m)));let g=t._ellipsoid;return T7(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function KAt(e,t,n,i,o){let r=gi(t,"scale",Le.kml),s=gi(t,"heading",Le.kml),a=F0(t,"color",Le.kml),c=Ji(t,"Icon",Le.kml),u=b7(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=gi(c,"x",Le.gx),h=gi(c,"y",Le.gx),m=gi(c,"w",Le.gx),g=gi(c,"h",Le.gx),A=Ji(t,"hotSpot",Le.kml),_=Ty(A,"x"),C=Ty(A,"y"),y=ua(A,"xunits"),E=ua(A,"yunits"),I=n.billboard;l(I)||(I=n0e(),n.billboard=I),I.image=u,I.scale=r,I.color=a,(l(f)||l(h)||l(m)||l(g))&&(I.imageSubRegion=new Xe(f,h,m,g)),l(s)&&s!==0&&(I.rotation=D.toRadians(-s),I.alignedAxis=d.UNIT_Z),r=r??1;let x,S;l(_)&&(y==="pixels"?x=-_*r:y==="insetPixels"?x=(_-xy)*r:y==="fraction"&&(x=-_*xy*r),x+=xy*.5*r),l(C)&&(E==="pixels"?S=C*r:E==="insetPixels"?S=(-C+xy)*r:E==="fraction"&&(S=C*xy*r),S-=xy*.5*r),(l(x)||l(S))&&(I.pixelOffset=new F(x,S))}function d8(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")KAt(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=i0e(),n.label=c),c.scale=gi(a,"scale",Le.kml)??c.scale,c.fillColor=F0(a,"color",Le.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Uc,n.polyline=c),c.width=gi(a,"width",Le.kml),c.material=F0(a,"color",Le.kml),l(F0(a,"outerColor",Le.gx))&&At("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(gi(a,"outerWidth",Le.gx))&&At("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(gi(a,"physicalWidth",Le.gx))&&At("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(xA(a,"labelVisibility",Le.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=I7(),n.polygon=c),c.material=F0(a,"color",Le.kml)??c.material,c.fill=xA(a,"fill",Le.kml)??c.fill,c.outline=xA(a,"outline",Le.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=g7(Fn(a,"bgColor",Le.kml))??G.WHITE,u=g7(Fn(a,"textColor",Le.kml))??G.BLACK,f=Fn(a,"text",Le.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Fn(a,"listItemType",Le.kml);(c==="radioFolder"||c==="checkOffOnly")&&At(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function JAt(e,t,n,i,o){let r=new Er,s,a=-1,c=t.childNodes,u=c.length;for(let h=0;h<u;h++){let m=c[h];(m.localName==="Style"||m.localName==="StyleMap")&&(a=h)}if(a!==-1){let h=c[a];if(h.localName==="Style")d8(e,h,r,i,o);else{let m=bA(h,"Pair",Le.kml);for(let g=0;g<m.length;g++){let A=m[g],_=Fn(A,"key",Le.kml);if(_==="normal"){let C=Fn(A,"styleUrl",Le.kml);if(l(C))s=n.getById(C),l(s)||(s=n.getById(`#${C}`)),l(s)&&r.merge(s);else{let y=Ji(A,"Style",Le.kml);d8(e,y,r,i,o)}}else At(`kml-styleMap-${_}`,`KML - Unsupported StyleMap key: ${_}`)}}}let f=Fn(t,"styleUrl",Le.kml);if(l(f)){let h=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let m=f.split("#"),g=m[0];h=`${i.getDerivedResource({url:g}).getUrlComponent()}#${m[1]}`}s=n.getById(h),l(s)||(s=n.getById(`#${h}`)),l(s)&&r.merge(s)}return r}function XAt(e,t,n){return t.fetchXML().then(function(i){return o0e(e,i,n,t,!0)})}function o0e(e,t,n,i,o,r){let s,a,c,u,f=qIe(t,"Style",Le.kml);if(l(f)){let _=f.length;for(s=0;s<_;s++)u=f[s],a=ua(u,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new Er({id:a}),n.add(c),d8(e,u,c,i,r)))}let h=qIe(t,"StyleMap",Le.kml);if(l(h)){let _=h.length;for(s=0;s<_;s++){let C=h[s];if(a=ua(C,"id"),l(a)){let y=bA(C,"Pair",Le.kml);for(let E=0;E<y.length;E++){let I=y[E],x=Fn(I,"key",Le.kml);if(x==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let S=Fn(I,"styleUrl",Le.kml);if(l(S)){S[0]!=="#"&&(S=`#${S}`),o&&l(i)&&(S=i.getUrlComponent()+S);let w=n.getById(S);l(w)&&c.merge(w)}else u=Ji(I,"Style",Le.kml),d8(e,u,c,i,r)}}else At(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}}let m=[],g=t.getElementsByTagName("styleUrl"),A=g.length;for(s=0;s<A;s++){let _=g[s].textContent;if(_[0]!=="#"){let C=_.split("#");if(C.length===2){let y=C[0],E=i.getDerivedResource({url:y});m.push(XAt(e,E,n))}}}return m}function x7(e,t,n){let i=new Vg(e,t.id,["position"]),o=new Rm(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Uc,t.polyline.positions=new zg([i,o])}function r0e(e,t){return!l(e)&&!l(t)||e==="clampToGround"?$e.CLAMP_TO_GROUND:e==="relativeToGround"?$e.RELATIVE_TO_GROUND:e==="absolute"?$e.NONE:t==="clampToSeaFloor"?(At("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),$e.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(At("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),$e.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.`),$e.CLAMP_TO_GROUND)}function ZAt(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 Rm(e))}function $At(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 m8(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():i0e(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():n0e(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(G.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new F(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function s0e(e,t){let n=e.path;l(n)||(n=new Op,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function emt(e,t,n,i,o){let r=Fn(n,"coordinates",Le.kml),s=Fn(n,"altitudeMode",Le.kml),a=Fn(n,"altitudeMode",Le.gx),c=xA(n,"extrude",Le.kml),u=e._ellipsoid,f=A8(r,u);return i.position=f,m8(e,i,o,r0e(s,a)),c&&$Q(s,a)&&x7(t,i,o),!0}function KIe(e,t,n,i,o){let r=Ji(n,"coordinates",Le.kml),s=Fn(n,"altitudeMode",Le.kml),a=Fn(n,"altitudeMode",Le.gx),c=xA(n,"extrude",Le.kml),u=xA(n,"tessellate",Le.kml),f=$Q(s,a),h=gi(n,"drawOrder",Le.gx),m=e._ellipsoid,g=f8(r,m),A=o.polyline;if(f&&c){let _=new Fp;i.wall=_,_.positions=g;let C=o.polygon;l(C)&&(_.fill=C.fill,_.material=C.material),_.outline=!0,l(A)?(_.outlineColor=l(A.material)?A.material.color:G.WHITE,_.outlineWidth=A.width):l(C)&&(_.outlineColor=l(C.material)?C.material.color:G.WHITE)}else if(e._clampToGround&&!f&&u){let _=new Uc;_.clampToGround=!0,i.polyline=_,_.positions=g,l(A)?(_.material=l(A.material)?A.material.color.getValue(Ke.MINIMUM_VALUE):G.WHITE,_.width=A.width??1):(_.material=G.WHITE,_.width=1),_.zIndex=h}else l(h)&&At("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&At("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),A=l(A)?A.clone():new Uc,i.polyline=A,A.positions=$At(g,s,a,m),(!u||f)&&(A.arcType=an.NONE);return!0}function tmt(e,t,n,i,o){let r=Ji(n,"outerBoundaryIs",Le.kml),s=Ji(r,"LinearRing",Le.kml),a=Ji(s,"coordinates",Le.kml),c=e._ellipsoid,u=f8(a,c),f=xA(n,"extrude",Le.kml),h=Fn(n,"altitudeMode",Le.kml),m=Fn(n,"altitudeMode",Le.gx),g=$Q(h,m),A=l(o.polygon)?o.polygon.clone():I7(),_=o.polyline;if(l(_)&&(A.outlineColor=l(_.material)?_.material.color:G.WHITE,A.outlineWidth=_.width),i.polygon=A,g?(A.perPositionHeight=!0,A.extrudedHeight=f?0:void 0):e._clampToGround||(A.height=0),l(u)){let C=new Cc(u),y=bA(n,"innerBoundaryIs",Le.kml);for(let E=0;E<y.length;E++){s=bA(y[E],"LinearRing",Le.kml);for(let I=0;I<s.length;I++)a=Ji(s[I],"coordinates",Le.kml),u=f8(a,c),l(u)&&C.holes.push(new Cc(u))}A.hierarchy=C}return!0}function nmt(e,t,n,i,o){let r=Fn(n,"altitudeMode",Le.kml),s=Fn(n,"altitudeMode",Le.gx),a=bA(n,"coord",Le.gx),c=bA(n,"angles",Le.gx),u=bA(n,"when",Le.kml),f=xA(n,"extrude",Le.kml),h=$Q(r,s),m=e._ellipsoid;c.length>0&&At("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),A=[],_=[];for(let y=0;y<g;y++){let E=A8(a[y].textContent,m);A.push(E),_.push(J.fromIso8601(u[y].textContent))}let C=new nc;return C.addSamples(_,A),i.position=C,m8(e,i,o,r0e(r,s)),s0e(i,o),i.availability=new ps,u.length>0&&i.availability.addInterval(new wn({start:_[0],stop:_[_.length-1]})),h&&f&&x7(t,i,o),!0}function JIe(e,t,n,i,o,r,s,a,c){let u=e[0],f=e[e.length-1],h=new nc;h.addSamples(e,t),n.intervals.addInterval(new wn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:ZAt(h,s,a)})),i.addInterval(new wn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new wn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function imt(e,t,n,i,o){let r=xA(n,"interpolate",Le.gx),s=bA(n,"Track",Le.gx),a,c,u,f=!1,h=new Yg,m=new ps,g=new ec,A=e._ellipsoid;for(let _=0,C=s.length;_<C;_++){let y=s[_],E=bA(y,"when",Le.kml),I=bA(y,"coord",Le.gx),x=Fn(y,"altitudeMode",Le.kml),S=Fn(y,"altitudeMode",Le.gx),w=$Q(x,S),v=xA(y,"extrude",Le.kml),P=Math.min(I.length,E.length),N=[];a=[];for(let L=0;L<P;L++){let p=A8(I[L].textContent,A);N.push(p),a.push(J.fromIso8601(E[L].textContent))}r&&(l(c)&&JIe([c,a[0]],[u,N[0]],g,m,h,!1,"absolute",void 0,!1),c=a[P-1],u=N[N.length-1]),JIe(a,N,g,m,h,w&&v,x,S,!0),f=f||w&&v}return i.availability=m,i.position=g,m8(e,i,o),s0e(i,o),f&&(x7(t,i,o),i.polyline.show=h),!0}var a0e={Point:emt,LineString:KIe,LinearRing:KIe,Polygon:tmt,Track:nmt,MultiTrack:imt,MultiGeometry:omt,Model:rmt};function omt(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),h=a0e[f.localName];if(l(h)){let m=t0e(f,t,r);m.parent=i,m.name=i.name,m.availability=i.availability,m.description=i.description,m.kml=i.kml,h(e,t,f,m,o)&&(a=!0)}}return a}function rmt(e,t,n,i,o){return At("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function smt(e,t){let n=Ji(e,"ExtendedData",Le.kml);if(!l(n))return;l(Ji(n,"SchemaData",Le.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=bA(n,"Data",Le.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:Fn(a,"displayName",Le.kml),value:Fn(a,"value",Le.kml)})}}t.kml.extendedData=i}var Lo;typeof document<"u"&&(Lo=document.createElement("div"));function amt(e,t,n,i,o){let r,s,a,c=t.kml,u=c.extendedData,f=Fn(e,"description",Le.kml),h=t.balloonStyle??n.balloonStyle,m=G.WHITE,g=G.BLACK,A=f;l(h)&&(m=h.bgColor??G.WHITE,g=h.textColor??G.BLACK,A=h.text??f);let _;if(l(A)){if(A=A.replace("$[name]",t.name??""),A=A.replace("$[description]",f??""),A=A.replace("$[address]",c.address??""),A=A.replace("$[Snippet]",c.snippet??""),A=A.replace("$[id]",t.id),A=A.replace("$[geDirections]",""),l(u)){let E=A.match(/\$\[.+?\]/g);if(E!==null)for(r=0;r<E.length;r++){let I=E[r],x=I.substr(2,I.length-3),S=/\/displayName$/.test(x);x=x.replace(/\/displayName$/,""),_=u[x],l(_)&&(_=S?_.displayName:_.value),l(_)&&(A=A.replace(I,_??""))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(A='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],_=u[s],A+=`<tr><th>${_.displayName??s}</th><td>${_.value??""}</td></tr>`;A+="</tbody></table>"}if(!l(A))return;A=zAt.link(A),Lo.innerHTML=A;let C=Lo.querySelectorAll("a");for(r=0;r<C.length;r++)C[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Pf(Lo,"a","href",i),Pf(Lo,"link","href",i),Pf(Lo,"area","href",i),Pf(Lo,"img","src",i),Pf(Lo,"iframe","src",i),Pf(Lo,"video","src",i),Pf(Lo,"audio","src",i),Pf(Lo,"source","src",i),Pf(Lo,"track","src",i),Pf(Lo,"input","src",i),Pf(Lo,"embed","src",i),Pf(Lo,"script","src",i),Pf(Lo,"video","poster",i)),Rf(Lo,"a","href",o),Rf(Lo,"link","href",o),Rf(Lo,"area","href",o),Rf(Lo,"img","src",o),Rf(Lo,"iframe","src",o),Rf(Lo,"video","src",o),Rf(Lo,"audio","src",o),Rf(Lo,"source","src",o),Rf(Lo,"track","src",o),Rf(Lo,"input","src",o),Rf(Lo,"embed","src",o),Rf(Lo,"script","src",o),Rf(Lo,"video","poster",o);let y='<div class="cesium-infoBox-description-lighter" style="';y+="overflow:auto;",y+="word-wrap:break-word;",y+=`background-color:${m.toCssColorString()};`,y+=`color:${g.toCssColorString()};`,y+='">',y+=`${Lo.innerHTML}</div>`,Lo.innerHTML="",t.description=y}function p8(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=t0e(t,i,n.context),c=a.kml,u=JAt(e,t,n.styleCollection,r,s),f=Fn(t,"name",Le.kml);a.name=f,a.parent=o;let h=qAt(t);l(h)||(h=jAt(t)),a.availability=h,B7(a);function m(I){return I?I.show&&m(I.parent):!0}let g=xA(t,"visibility",Le.kml);a.show=m(o)&&(g??!0);let A=Ji(t,"author",Le.atom),_=c.author;_.name=Fn(A,"name",Le.atom),_.uri=Fn(A,"uri",Le.atom),_.email=Fn(A,"email",Le.atom);let C=Ji(t,"link",Le.atom),y=c.link;y.href=ua(C,"href"),y.hreflang=ua(C,"hreflang"),y.rel=ua(C,"rel"),y.type=ua(C,"type"),y.title=ua(C,"title"),y.length=ua(C,"length"),c.address=Fn(t,"address",Le.kml),c.phoneNumber=Fn(t,"phoneNumber",Le.kml),c.snippet=Fn(t,"Snippet",Le.kml),smt(t,a),amt(t,a,u,s,r);let E=e._ellipsoid;return u0e(t,a,E),l0e(t,a,E),l(Ji(t,"Region",Le.kml))&&At("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function c0e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function cmt(e,t,n,i){let o=p8(e,t,n),r=Ve(n);r.parentEntity=o.entity,c0e(e,t,r,i)}function lmt(e,t,n,i){let o=p8(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let h=c.item(u),m=a0e[h.localName];l(m)&&(m(e,n.entityCollection,h,r,s,r.id),a=!0)}a||(r.merge(s),m8(e,r,s))}var umt={FlyTo:hmt,Wait:dmt,SoundCue:A7,AnimatedUpdate:A7,TourControl:A7};function fmt(e,t,n,i){let o=Fn(t,"name",Le.kml),r=ua(t,"id"),s=new qQ(o,r),a=Ji(t,"Playlist",Le.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let h=u[f];if(h.localName){let m=umt[h.localName];m?m(s,h,c):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(s)}function A7(e,t){At(`KML Tour unsupported node ${t.localName}`)}function dmt(e,t){let n=gi(t,"duration",Le.gx);e.addPlaylistEntry(new XQ(n))}function hmt(e,t,n){let i=gi(t,"duration",Le.gx),o=Fn(t,"flyToMode",Le.gx),r={kml:{}};u0e(t,r,n),l0e(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new JQ(i,o,s);e.addPlaylistEntry(a)}function l0e(e,t,n){let i=Ji(e,"Camera",Le.kml);if(l(i)){let o=gi(i,"longitude",Le.kml)??0,r=gi(i,"latitude",Le.kml)??0,s=gi(i,"altitude",Le.kml)??0,a=gi(i,"heading",Le.kml)??0,c=gi(i,"tilt",Le.kml)??0,u=gi(i,"roll",Le.kml)??0,f=d.fromDegrees(o,r,s,n),h=hc.fromDegrees(a,c-90,u);t.kml.camera=new hQ(f,h)}}function u0e(e,t,n){let i=Ji(e,"LookAt",Le.kml);if(l(i)){let o=gi(i,"longitude",Le.kml)??0,r=gi(i,"latitude",Le.kml)??0,s=gi(i,"altitude",Le.kml)??0,a=gi(i,"heading",Le.kml),c=gi(i,"tilt",Le.kml),u=gi(i,"range",Le.kml)??0;c=D.toRadians(c??0),a=D.toRadians(a??0);let f=new zd(a,c-D.PI_OVER_TWO,u),h=d.fromDegrees(o,r,s,n);t.kml.lookAt=new jQ(h,f)}}function Amt(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Ji(t,"Icon",Le.kml),c=b7(a,e,r,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],h=Ji(t,"screenXY",Le.kml),m=Ji(t,"overlayXY",Le.kml),g=Ji(t,"size",Le.kml),A,_,C,y,E,I;l(g)&&(A=Ty(g,"x"),_=Ty(g,"y"),C=ua(g,"xunits"),y=ua(g,"yunits"),l(A)&&A!==-1&&A!==0&&(C==="fraction"?E=`width: ${Math.floor(A*100)}%`:C==="pixels"&&(E=`width: ${A}px`),f.push(E)),l(_)&&_!==-1&&_!==0&&(y==="fraction"?I=`height: ${Math.floor(_*100)}%`:y==="pixels"&&(I=`height: ${_}px`),f.push(I))),u.style=f.join(";");let x=0,S=u.height;l(m)&&(A=Ty(m,"x"),_=Ty(m,"y"),C=ua(m,"xunits"),y=ua(m,"yunits"),l(A)&&(C==="fraction"?x=A*u.width:(C==="pixels"||C==="insetPixels")&&(x=A)),l(_)&&(y==="fraction"?S=_*u.height:(y==="pixels"||y==="insetPixels")&&(S=_))),l(h)&&(A=Ty(h,"x"),_=Ty(h,"y"),C=ua(h,"xunits"),y=ua(h,"yunits"),l(A)&&(C==="fraction"?E=`left: calc(${Math.floor(A*100)}% - ${x}px)`:C==="pixels"?E=`left: ${A-x}px`:C==="insetPixels"&&(E=`right: ${A-x}px`),f.push(E)),l(_)&&(y==="fraction"?I=`bottom: calc(${Math.floor(_*100)}% - ${S}px)`:y==="pixels"?I=`bottom: ${_-S}px`:y==="insetPixels"&&(I=`top: ${_-S}px`),f.push(I))),u.style=f.join(";")},o.appendChild(u)}function mmt(e,t,n,i){let r=p8(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=f8(Ji(t,"LatLonQuad",Le.gx),c),f=gi(t,"drawOrder",Le.kml);if(l(u))s=I7(),s.hierarchy=new Cc(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new wh,s.zIndex=f,r.rectangle=s;let A=Ji(t,"LatLonBox",Le.kml);if(l(A)){let _=gi(A,"west",Le.kml),C=gi(A,"south",Le.kml),y=gi(A,"east",Le.kml),E=gi(A,"north",Le.kml);l(_)&&(_=D.negativePiToPi(D.toRadians(_))),l(C)&&(C=D.clampToLatitudeRange(D.toRadians(C))),l(y)&&(y=D.negativePiToPi(D.toRadians(y))),l(E)&&(E=D.clampToLatitudeRange(D.toRadians(E))),s.coordinates=new ce(_,C,y,E);let I=gi(A,"rotation",Le.kml);if(l(I)){let x=D.toRadians(I);s.rotation=x,s.stRotation=x}}}let h=Ji(t,"Icon",Le.kml),m=b7(h,e,n.sourceResource,n.uriResolver,!0);if(l(m)){a&&At("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let A=gi(h,"x",Le.gx),_=gi(h,"y",Le.gx),C=gi(h,"w",Le.gx),y=gi(h,"h",Le.gx);(l(A)||l(_)||l(C)||l(y))&&At("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=m,s.material.color=F0(t,"color",Le.kml),s.material.transparent=!0}else s.material=F0(t,"color",Le.kml);let g=Fn(t,"altitudeMode",Le.kml);l(g)?g==="absolute"?(s.height=gi(t,"altitude",Le.kml),s.zIndex=void 0):g!=="clampToGround"&&At("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Fn(t,"altitudeMode",Le.gx),g==="relativeToSeaFloor"?(At("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=gi(t,"altitude",Le.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 f0e(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 Sy={INTERVAL:0,EXPIRE:1,STOP:2};function h8(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var pmt=new ce,pB=new he,m7=new F,gmt=new d;function T7(e,t,n,i,o,r){function s(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function a(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=sE(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let u,f;if(o=o??pmt,l(n)&&(m7.x=n.clientWidth*.5,m7.y=n.clientHeight*.5,u=t.pickEllipsoid(m7,r,gmt)),l(u)?f=r.cartesianToCartographic(u,pB):(f=ce.center(o,pB),u=r.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.EPSILON9)){let y=o.width*i*.5,E=o.height*i*.5;o=new ce(a(f.longitude-y),s(f.latitude-E),a(f.longitude+y),s(f.latitude+E))}c=c.replace("[bboxWest]",D.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(o.north).toString());let h=D.toDegrees(f.longitude).toString(),m=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",m),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",d.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",m),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,pB),c=c.replace("[cameraLon]",D.toDegrees(pB.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(pB.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(pB.height).toString());let g=t.frustum,A=g.aspectRatio,_="",C="";if(l(A)){let y=D.toDegrees(g.fov);A>1?(_=y,C=y/A):(C=y,_=y*A)}c=c.replace("[horizFov]",_.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(Wu(c))}function _mt(e,t,n,i){let r=p8(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Ji(t,"Link",Le.kml);if(l(c)||(c=Ji(t,"Url",Le.kml)),l(c)){let u=Fn(c,"href",Le.kml),f,h;if(l(u)){let m=u;if(u=E7(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(m=s.getDerivedResource({url:m}));else{if(m=u.clone(),f=Fn(c,"viewRefreshMode",Le.kml),f==="onRegion"){At("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=Fn(c,"viewBoundScale",Le.kml)??1;let C=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",y=Fn(c,"viewFormat",Le.kml)??C,E=Fn(c,"httpQuery",Le.kml);l(y)&&u.setQueryParameters(Wu(h8(y))),l(E)&&u.setQueryParameters(Wu(h8(E)));let I=e._ellipsoid;T7(u,e.camera,e.canvas,h,e._lastCameraView.bbox,I)}let g={sourceUri:m,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},A=new Da,_=S7(e,A,u,g).then(function(C){let y=e._entityCollection,E=A.values;y.suspendEvents();for(let S=0;S<E.length;S++){let w=E[S];l(w.parent)||(w.parent=r,B7(w)),y.add(w)}y.resumeEvents();let I=Fn(c,"refreshMode",Le.kml),x=gi(c,"refreshInterval",Le.kml)??0;if(I==="onInterval"&&x>0||I==="onExpire"||f==="onStop"){let S=Ji(C,"NetworkLinkControl",Le.kml),w=l(S),v=J.now(),P={id:jn(),href:u,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:v},N=0;if(w&&(P.cookie=Wu(Fn(S,"cookie",Le.kml)??""),N=gi(S,"minRefreshPeriod",Le.kml)??0),I==="onInterval")w&&(x=Math.max(N,x)),P.refreshMode=Sy.INTERVAL,P.time=x;else if(I==="onExpire"){let L;if(w&&(L=Fn(S,"expires",Le.kml)),l(L))try{let p=J.fromIso8601(L),b=J.secondsDifference(p,v);b>0&&b<N&&J.addSeconds(v,N,p),P.refreshMode=Sy.EXPIRE,P.time=p}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)?(P.refreshMode=Sy.STOP,P.time=gi(c,"viewRefreshTime",Le.kml)??0):At("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(P.refreshMode)&&e._networkLinks.set(P.id,P)}}).catch(function(C){At(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,C)});i.addPromise(_)}}}function Cmt(e,t,n,i){let o=y7[t.localName];return l(o)?o(e,t,n,i):f0e(e,t,n,i)}function _7(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Ji(a,"Document",Le.kml),u=Fn(c,"name",Le.kml);l(u)||(u=Ug(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Mf._DeferredLoading(e),h=new Da(e);return Promise.all(o0e(e,n,h,i,!1,o)).then(function(){let m=n.documentElement;if(m.localName==="kml"){let A=m.childNodes;for(let _=0;_<A.length;_++){let C=A[_];if(l(y7[C.localName])){m=C;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Cmt(e,m,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function ymt(e,t,n,i,o){let r=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");Qm({workerURI:r,wasmURI:s});let a=new N0(new Gm(n)),c=await a.getEntries(),u=[],f={},h;for(let m=0;m<c.length;m++){let g=c[m];g.directory||(/\.kml$/i.test(g.filename)&&(!l(h)||!/\//i.test(g.filename))?(l(h)&&u.push(h7(h,f)),h=g):u.push(h7(g,f)))}if(l(h)&&u.push(WAt(h,f)),await Promise.all(u),a.close(),!l(f.kml))throw new ue("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),_7(e,t,f.kml,i,f,o)}function S7(e,t,n,i){i=i??V.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Be){n=Be.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let h=f.length;for(let m=0;m<h;m++)u.push(f[m])}}else o=o??Be.DEFAULT.clone();return o=Be.createIfNeeded(o),l(a)&&(a=On(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?HAt(u).then(function(f){return f?ymt(e,t,u,o,a):YAt(u).then(function(h){h=$Ie(h),h=e0e(h);let m,g;try{m=C7.parseFromString(h,"application/xml")}catch(A){g=A.toString()}if(l(g)||m.body||m.documentElement.tagName==="parsererror"){let A=l(g)?g:m.documentElement.firstChild.nodeValue;throw A||(A=m.body.innerText),new ue(A)}return _7(e,t,m,o,r,a,s)})}):_7(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function Mf(e){e=e??V.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new _e,this._error=new _e,this._loading=new _e,this._refresh=new _e,this._unsupportedNode=new _e,this._clock=void 0,this._entityCollection=new Da(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new $g,this._networkLinks=new Pt,this._entityCluster=new _f,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?d.clone(t.positionWC):void 0,direction:l(t)?d.clone(t.directionWC):void 0,up:l(t)?d.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=e.ellipsoid??te.default;let i=e.credit;typeof i=="string"&&(i=new pt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Mf.load=function(e,t){return t=t??V.EMPTY_OBJECT,new Mf(t).load(e,t)};Object.defineProperties(Mf.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}}});Mf.prototype.load=function(e,t){t=t??V.EMPTY_OBJECT,gs.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return S7(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),u=J.equals(a,Ke.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=J.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=J.fromDate(h)),o=new uA,o.startTime=s,o.stopTime=a,o.currentTime=J.clone(s),o.clockRange=_s.LOOP_STOP,o.clockStep=No.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(J.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),gs.setLoading(i,!1),i}).catch(function(o){return gs.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Mf.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 Emt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Ji(r,"NetworkLinkControl",Le.kml),c=l(a),u=0;if(c){if(l(Ji(a,"Update",Le.kml))){At("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Wu(Fn(a,"cookie",Le.kml)??""),u=gi(a,"minRefreshPeriod",Le.kml)??0}let f=J.now(),h=t.refreshMode;if(h===Sy.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(h===Sy.EXPIRE){let v;if(l(a)&&(v=Fn(a,"expires",Le.kml)),l(v))try{let P=J.fromIso8601(v),N=J.secondsDifference(P,f);N>0&&N<u&&J.addSeconds(f,u,P),t.time=P}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 m=t.entity,g=e._entityCollection,A=n.values;function _(v){g.remove(v);let P=v._children,N=P.length;for(let L=0;L<N;++L)_(P[L])}g.suspendEvents();let C=g.values.slice(),y;for(y=0;y<C.length;++y){let v=C[y];v.parent===m&&(v.parent=void 0,_(v))}for(g.resumeEvents(),g.suspendEvents(),y=0;y<A.length;y++){let v=A[y];l(v.parent)||(v.parent=m,B7(v)),g.add(v)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let E=g.computeAvailability(),I=E.start,x=E.stop,S=J.equals(I,Ke.MINIMUM_VALUE),w=J.equals(x,Ke.MAXIMUM_VALUE);if(!S||!w){let v=e._clock;(v.startTime!==I||v.stopTime!==x)&&(v.startTime=I,v.stopTime=x,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var p7=new Pt;Mf.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=J.now(),i=this;p7.removeAll();function o(f){let h=f._children,m=h.length;for(let g=0;g<m;++g){let A=h[g];p7.set(A.id,A),o(A)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,D.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,D.EPSILON7)&&a.upWC.equalsEpsilon(s.up,D.EPSILON7))&&(s.position=d.clone(a.positionWC),s.direction=d.clone(a.directionWC),s.up=d.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new Pt,u=!1;return t.values.forEach(function(f){let h=f.entity;if(!p7.contains(h.id)){if(!f.updating){let m=!1;if(f.refreshMode===Sy.INTERVAL?J.secondsDifference(n,f.lastUpdated)>f.time&&(m=!0):f.refreshMode===Sy.EXPIRE?J.greaterThan(n,f.time)&&(m=!0):f.refreshMode===Sy.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&J.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(m=!0)),m){o(h),f.updating=!0;let g=new Da,A=f.href.clone();A.setQueryParameters(f.cookie);let _=i._ellipsoid??te.default;T7(A,i.camera,i.canvas,f.viewBoundScale,s.bbox,_),S7(i,g,A,{context:h.id}).then(Emt(i,f,g,c,A)).catch(function(C){let y=`NetworkLink ${f.href} refresh failed: ${C}`;console.log(y),i._error.raiseEvent(i,y)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function Imt(){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}Mf._DeferredLoading=Ym;Mf._getTimestamp=Oi;var Q0=Mf;function e2(){Ae.throwInstantiationError()}e2.prototype.update=Ae.throwInstantiationError;e2.prototype.getBoundingSphere=Ae.throwInstantiationError;e2.prototype.isDestroyed=Ae.throwInstantiationError;e2.prototype.destroy=Ae.throwInstantiationError;var w7=e2;var D7=32,bmt="http://www.opengis.net/kml/2.2",SA="http://www.google.com/kml/ext/2.2",xmt="http://www.w3.org/2000/xmlns/";function g8(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Tmt=/^data:image\/([^,;]+)/;g8.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Be){if(e=Be.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Tmt);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 Smt(e,t){return function(n){e._files[t]=n}}g8.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ue("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(Smt(this,r))}return o};Object.defineProperties(g8.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function _8(e){this._time=e}_8.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};_8.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return U0(n)};_8.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function v7(){this._ids={},this._styles={},this._count=0}v7.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};v7.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 A0e(){this._ids={}}A0e.prototype.get=function(e){if(!l(e))return this.get(jn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function P7(e){e=e??V.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=P7._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(xmt,"xmlns:gx",SA);let a=r.createElement("Document");s.appendChild(a),p0e(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?Bmt(f,c.files):{kml:f,externalFiles:c.files}})}async function Bmt(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");Qm({workerURI:n,wasmURI:i});let o=new aB("application/vnd.google-earth.kmz"),r=new VQ(o);await r.add("doc.kml",new TQ(e));let s=Object.keys(t);return await m0e(r,s,t,0),await r.close(),{kmz:await o.getData()}}async function m0e(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new Gm(n[o])),m0e(e,t,n,i+1)}P7._createState=function(e){let t=e.entities,n=new v7,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 g8(e.modelCallback);return{kmlDoc:document.implementation.createDocument(bmt,"kml"),ellipsoid:e.ellipsoid??te.default,idManager:new A0e,styleCache:n,externalFileHandler:a,time:o,valueGetter:new _8(o),sampleDuration:s,defaultAvailability:new ps([r])}};function p0e(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let h=0;h<a;++h){let m=n[h];c=[],u=[],f=[],wmt(e,m,u,f),Dmt(e,m.polyline,u,f),h0e(e,m.rectangle,u,f,c),h0e(e,m.polygon,u,f,c),Mmt(e,m,m.model,u,f);let g,A=m.availability;l(A)&&(g=i.createElement("TimeSpan"),J.equals(A.start,Ke.MINIMUM_VALUE)||g.appendChild(_n(i,"begin",J.toIso8601(A.start))),J.equals(A.stop,Ke.MAXIMUM_VALUE)||g.appendChild(_n(i,"end",J.toIso8601(A.stop))));for(let y=0;y<c.length;++y){let E=c[y];E.setAttribute("id",s.get(m.id)),E.appendChild(_n(i,"name",m.name)),E.appendChild(_n(i,"visibility",m.show)),E.appendChild(_n(i,"description",m.description)),l(g)&&E.appendChild(g),t.appendChild(E)}let _=u.length;if(_>0){let y=i.createElement("Placemark");y.setAttribute("id",s.get(m.id));let E=m.name,I=m.label;if(l(I)){let S=i.createElement("LabelStyle"),w=r.get(I.text);E=l(w)&&w.length>0?w:E;let v=r.getColor(I.fillColor);l(v)&&(S.appendChild(_n(i,"color",v)),S.appendChild(_n(i,"colorMode","normal")));let P=r.get(I.scale);l(P)&&S.appendChild(_n(i,"scale",P)),f.push(S)}y.appendChild(_n(i,"name",E)),y.appendChild(_n(i,"visibility",m.show)),y.appendChild(_n(i,"description",m.description)),l(g)&&y.appendChild(g),t.appendChild(y);let x=f.length;if(x>0){let S=i.createElement("Style");for(let w=0;w<x;++w)S.appendChild(f[w]);y.appendChild(_n(i,"styleUrl",o.get(S)))}if(u.length===1)y.appendChild(u[0]);else if(u.length>1){let S=i.createElement("MultiGeometry");for(let w=0;w<_;++w)S.appendChild(u[w]);y.appendChild(S)}}let C=m._children;if(C.length>0){let y=i.createElement("Folder");y.setAttribute("id",s.get(m.id)),y.appendChild(_n(i,"name",m.name)),y.appendChild(_n(i,"visibility",m.show)),y.appendChild(_n(i,"description",m.description)),t.appendChild(y),p0e(e,y,C)}}}var Ru=new d,ql=new he,TA=new J;function wmt(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){g0e(e,t,a,n,i);return}s.get(c,void 0,Ru);let u=_n(o,"coordinates",k0(Ru,r)),f=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(G0(e,a.heightReference)),f.appendChild(h),f.appendChild(u),n.push(f);let m=a instanceof Qc?C0e(e,a):_0e(e,a);i.push(m)}function g0e(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof ec?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let h=n instanceof Lp,m,g,A,_=[];for(m=0;m<c.length;++m){let y=c.get(m),E=f?u:y.data,I=r.createElement("altitudeMode");E instanceof Rm?(E=E._value,I.appendChild(G0(e,$e.CLAMP_TO_GROUND))):l(n)?I.appendChild(G0(e,n.heightReference)):I.appendChild(G0(e,$e.NONE));let x=[],S=[];if(E.isConstant){a.get(E,void 0,Ru);let v=_n(r,"coordinates",k0(Ru,s));x.push(J.toIso8601(y.start)),S.push(v),x.push(J.toIso8601(y.stop)),S.push(v)}else if(E instanceof nc)for(A=E._property._times,g=0;g<A.length;++g)x.push(J.toIso8601(A[g])),E.getValueInReferenceFrame(A[g],$i.FIXED,Ru),S.push(k0(Ru,s));else if(E instanceof If){A=E._times;let v=E._values;for(g=0;g<A.length;++g)x.push(J.toIso8601(A[g])),d.fromArray(v,g*3,Ru),S.push(k0(Ru,s))}else{let v=e.sampleDuration;y.start.clone(TA),y.isStartIncluded||J.addSeconds(TA,v,TA);let P=y.stop;for(;J.lessThan(TA,P);)E.getValue(TA,Ru),x.push(J.toIso8601(TA)),S.push(k0(Ru,s)),J.addSeconds(TA,v,TA);y.isStopIncluded&&J.equals(TA,P)&&(E.getValue(TA,Ru),x.push(J.toIso8601(TA)),S.push(k0(Ru,s)))}let w=r.createElementNS(SA,"Track");w.appendChild(I);for(let v=0;v<x.length;++v){let P=_n(r,"when",x[v]),N=_n(r,"coord",S[v],SA);w.appendChild(P),w.appendChild(N)}h&&w.appendChild(y0e(e,n)),_.push(w)}if(_.length===1)i.push(_[0]);else if(_.length>1){let y=r.createElementNS(SA,"MultiTrack");for(m=0;m<_.length;++m)y.appendChild(_[m]);i.push(y)}if(l(n)&&!h){let y=n instanceof Qc?C0e(e,n):_0e(e,n);o.push(y)}let C=t.path;if(l(C)){let y=a.get(C.width),E=C.material;if(l(E)||l(y)){let I=r.createElement("LineStyle");l(y)&&I.appendChild(_n(r,"width",y)),R7(e,E,I),o.push(I)}}}function _0e(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(_n(n,"color",r)),o.appendChild(_n(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(_n(n,"scale",s/D7)),o}function C0e(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 m=n.createElement("Icon");m.appendChild(_n(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(m.appendChild(_n(n,"x",g.x,SA)),m.appendChild(_n(n,"y",g.y,SA)),m.appendChild(_n(n,"w",g.width,SA)),m.appendChild(_n(n,"h",g.height,SA))),r.appendChild(m)}let a=i.getColor(t.color);l(a)&&(r.appendChild(_n(n,"color",a)),r.appendChild(_n(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(_n(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,F.divideByScalar(u,c,u);let m=i.get(t.width,D7),g=i.get(t.height,D7),A=i.get(t.horizontalOrigin,Mi.CENTER);A===Mi.CENTER?u.x-=m*.5:A===Mi.RIGHT&&(u.x-=m);let _=i.get(t.verticalOrigin,Gn.CENTER);_===Gn.TOP?u.y+=g:_===Gn.CENTER&&(u.y+=g*.5);let C=n.createElement("hotSpot");C.setAttribute("x",-u.x),C.setAttribute("y",u.y),C.setAttribute("xunits","pixels"),C.setAttribute("yunits","pixels"),r.appendChild(C)}let f=i.get(t.rotation),h=i.get(t.alignedAxis);return l(f)&&d.equals(d.UNIT_Z,h)&&(f=D.toDegrees(-f),f===0&&(f=360),r.appendChild(_n(n,"heading",f))),r}function Dmt(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"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(_n(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let h=t.positions,m=s.get(h),g=_n(o,"coordinates",k0(m,r));a.appendChild(g);let A=s.get(t.zIndex);u&&l(A)&&a.appendChild(_n(o,"drawOrder",A,SA)),n.push(a);let _=o.createElement("LineStyle"),C=s.get(t.width);l(C)&&_.appendChild(_n(o,"width",C)),R7(e,t.material,_),i.push(_)}function vmt(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=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,ql),c.push(`${D.toDegrees(ql.longitude)},${D.toDegrees(ql.latitude)},${r}`);let f=_n(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),m=i.createElement("LinearRing");return m.appendChild(f),h.appendChild(m),[h]}function d0e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],r,ql),s.push(`${D.toDegrees(ql.longitude)},${D.toDegrees(ql.latitude)},${i?ql.height:n}`);let c=_n(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function Pmt(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,u=o.get(c),f=Array.isArray(u)?u:u.positions,h=i.createElement("outerBoundaryIs");h.appendChild(d0e(e,f,r,s)),a.push(h);let m=u.holes;if(l(m)){let g=m.length;for(let A=0;A<g;++A){let _=i.createElement("innerBoundaryIs");_.appendChild(d0e(e,m[A].positions,r,s)),a.push(_)}}return a}function h0e(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof wh;if(a&&s.getMaterialType(t.material)==="Image"){Rmt(e,t,o);return}let c=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(_n(r,"extrude",!0));let f=a?vmt(e,t,u):Pmt(e,t,u),h=f.length;for(let C=0;C<h;++C)c.appendChild(f[C]);let m=r.createElement("altitudeMode");m.appendChild(G0(e,t.heightReference)),c.appendChild(m),n.push(c);let g=r.createElement("PolyStyle"),A=s.get(t.fill,!1);A&&g.appendChild(_n(r,"fill",A)),R7(e,t.material,g);let _=s.get(t.outline,!1);if(_){g.appendChild(_n(r,"outline",_));let C=r.createElement("LineStyle"),y=s.get(t.outlineWidth,1);C.appendChild(_n(r,"width",y));let E=s.getColor(t.outlineColor,G.BLACK);C.appendChild(_n(r,"color",E)),C.appendChild(_n(r,"colorMode","normal")),i.push(C)}i.push(g)}function Rmt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(G0(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(_n(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(_n(i,"north",D.toDegrees(u.north))),f.appendChild(_n(i,"south",D.toDegrees(u.south))),f.appendChild(_n(i,"east",D.toDegrees(u.east))),f.appendChild(_n(i,"west",D.toDegrees(u.west))),s.appendChild(f);let h=o.get(t.material),m=r.texture(h.image),g=i.createElement("Icon");g.appendChild(_n(i,"href",m)),s.appendChild(g);let A=h.color;l(A)&&s.appendChild(_n(i,"color",U0(h.color))),n.push(s)}function y0e(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 u=n.createElement("scale");u.appendChild(_n(n,"x",s)),u.appendChild(_n(n,"y",s)),u.appendChild(_n(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(_n(n,"href",c)),r.appendChild(a),r}function Mmt(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){g0e(e,t,n,i,o);return}let u=y0e(e,n),f=r.createElement("altitudeMode");f.appendChild(G0(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,Ru),he.fromCartesian(Ru,s,ql);let h=r.createElement("Location");h.appendChild(_n(r,"longitude",D.toDegrees(ql.longitude))),h.appendChild(_n(r,"latitude",D.toDegrees(ql.latitude))),h.appendChild(_n(r,"altitude",ql.height)),u.appendChild(h),i.push(u)}function R7(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,u;switch(a){case"Image":s=U0(G.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=U0(r.color);break;case"PolylineOutline":s=U0(r.color),c=U0(r.outlineColor),u=r.outlineWidth,n.appendChild(_n(i,"outerColor",c,SA)),n.appendChild(_n(i,"outerWidth",u,SA));break;case"Stripe":s=U0(r.oddColor);break}l(s)&&(n.appendChild(_n(i,"color",s)),n.appendChild(_n(i,"colorMode","normal")))}function G0(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,$e.NONE),r;switch(o){case $e.NONE:r=n.createTextNode("absolute");break;case $e.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case $e.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function k0(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,ql),i.push(`${D.toDegrees(ql.longitude)},${D.toDegrees(ql.latitude)},${ql.height}`);return i.join(" ")}function _n(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 U0(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=P7;var Nmt={NONE:0,LERC:1},jd=Object.freeze(Nmt);var Lmt={NONE:0,BITS12:1},Ma=Object.freeze(Lmt);var t2=new d,Omt=new d,qd=new F,Fmt=new M,Qmt=new M,kmt=Math.pow(2,12);function Tc(e,t,n,i,o,r,s,a,c,u){let f=Ma.NONE,h,m;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,A=t.maximum,_=d.subtract(A,g,Omt),C=i-n;Math.max(d.maximumComponent(_),C)<kmt-1?f=Ma.BITS12:f=Ma.NONE;let E=M.fromScale(_,Fmt);E=M.setTranslation(E,g,E);let I=M.fromScale(d.fromElements(1/_.x,1/_.y,1/_.z,t2),Qmt);I=M.multiplyByTranslation(I,d.negate(g,t2),I),m=M.clone(o,new M);let x=M.getTranslation(o,t2);x=d.subtract(x,e,t2),m=M.setTranslation(m,x,m),m=M.multiply(m,E,m),h=M.inverseTransformation(o,new M),h=M.multiply(I,h,h),o=M.multiply(o,E,new M)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=d.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=m,this.hasVertexNormals=r??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??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,u=i.y;if(this.quantization===Ma.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,t2),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,h=D.clamp((o-this.minimumHeight)/f,0,1);F.fromElements(n.x,n.y,qd);let m=bn.compressTextureCoordinates(qd);F.fromElements(n.z,h,qd);let g=bn.compressTextureCoordinates(qd);F.fromElements(c,u,qd);let A=bn.compressTextureCoordinates(qd);if(e[t++]=m,e[t++]=g,e[t++]=A,this.hasWebMercatorT){F.fromElements(s,0,qd);let _=bn.compressTextureCoordinates(qd);e[t++]=_}}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++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=bn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Umt=new d,E0e=new d;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 f=0;f<i;f++){let h=s*i+f,m=s*r+f;t[m]=e[h]}let a=this.decodePosition(t,s,Umt),c=n.geodeticSurfaceNormal(a,E0e),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+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 d),t*=this.stride,this.quantization===Ma.BITS12){let i=bn.decompressTextureCoordinates(e[t],qd);n.x=i.x,n.y=i.y;let o=bn.decompressTextureCoordinates(e[t+1],qd);return n.z=o.x,M.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],d.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,E0e),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 F),t*=this.stride,this.quantization===Ma.BITS12?bn.decompressTextureCoordinates(e[t+2],n):F.fromElements(e[t+4],e[t+5],n)};Tc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ma.BITS12?bn.decompressTextureCoordinates(e[t+1],qd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Tc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ma.BITS12?bn.decompressTextureCoordinates(e[t+3],qd).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 F.fromElements(o,r,n)};Tc.prototype.decodeNormal=function(e,t,n){let i=t=t*this.stride+this._offsetVertexNormal;return bn.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;switch(this.quantization){case Ma.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var C8={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},y8={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Tc.prototype.getAttributes=function(e){let t=q.FLOAT,n=q.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===Ma.NONE){s(C8.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(C8.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(C8.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(y8.compressed0,a?4:3),c&&s(y8.compressed1,1),this.hasGeodeticSurfaceNormals&&s(y8.geodeticSurfaceNormal,3)}return r};Tc.prototype.getAttributeLocations=function(){return this.quantization===Ma.NONE?C8:y8};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=d.clone(e.center),t.toScaledENU=M.clone(e.toScaledENU),t.fromScaledENU=M.clone(e.fromScaledENU),t.matrix=M.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 fr=Tc;var Wm={};Wm.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var N7=new d,Gmt=new M,zmt=new d,Vmt=new d;Wm.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=D.PI_OVER_TWO,a=D.toRadians,c=e.heightmap,u=e.width,f=e.height,h=e.skirtHeight,m=h>0,g=e.isGeographic??!0,A=e.ellipsoid??te.default,_=1/A.maximumRadius,C=ce.clone(e.nativeRectangle),y=ce.clone(e.rectangle),E,I,x,S;l(y)?(E=y.west,I=y.south,x=y.east,S=y.north):g?(E=a(C.west),I=a(C.south),x=a(C.east),S=a(C.north)):(E=C.west*_,I=s-2*o(r(-C.south*_)),x=C.east*_,S=s-2*o(r(-C.north*_)));let w=e.relativeToCenter,v=l(w);w=v?w:d.ZERO;let P=e.includeWebMercatorT??!1,N=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,b=N!==1,T=e.structure??Wm.DEFAULT_STRUCTURE,B=T.heightScale??Wm.DEFAULT_STRUCTURE.heightScale,R=T.heightOffset??Wm.DEFAULT_STRUCTURE.heightOffset,O=T.elementsPerHeight??Wm.DEFAULT_STRUCTURE.elementsPerHeight,U=T.stride??Wm.DEFAULT_STRUCTURE.stride,k=T.elementMultiplier??Wm.DEFAULT_STRUCTURE.elementMultiplier,z=T.isBigEndian??Wm.DEFAULT_STRUCTURE.isBigEndian,Q=ce.computeWidth(C),H=ce.computeHeight(C),W=Q/(u-1),Z=H/(f-1);g||(Q*=_,H*=_);let Y=A.radiiSquared,$=Y.x,K=Y.y,fe=Y.z,ge=65536,ne=-65536,Ce=It.eastNorthUpToFixedFrame(w,A),ye=M.inverseTransformation(Ce,Gmt),De,be;P&&(De=ui.geodeticLatitudeToMercatorAngle(I),be=1/(ui.geodeticLatitudeToMercatorAngle(S)-De));let Ne=zmt;Ne.x=Number.POSITIVE_INFINITY,Ne.y=Number.POSITIVE_INFINITY,Ne.z=Number.POSITIVE_INFINITY;let ke=Vmt;ke.x=Number.NEGATIVE_INFINITY,ke.y=Number.NEGATIVE_INFINITY,ke.z=Number.NEGATIVE_INFINITY;let Ue=Number.POSITIVE_INFINITY,He=u*f,Et=h>0?u*2+f*2:0,Ye=He+Et,nt=new Array(Ye),Ct=new Array(Ye),Wt=new Array(Ye),Qn=P?new Array(Ye):[],on=b?new Array(Ye):[],lt=0,Nt=f,Mn=0,at=u;m&&(--lt,++Nt,--Mn,++at);let fi=1e-5;for(let Vn=lt;Vn<Nt;++Vn){let co=Vn;co<0&&(co=0),co>=f&&(co=f-1);let Vo=C.north-Z*co;g?Vo=a(Vo):Vo=s-2*o(r(-Vo*_));let hr=(Vo-I)/(S-I);hr=D.clamp(hr,0,1);let Rr=Vn===lt,Js=Vn===Nt-1;h>0&&(Rr?Vo+=fi*H:Js&&(Vo-=fi*H));let Is=t(Vo),ka=n(Vo),mo=fe*ka,vn;P&&(vn=(ui.geodeticLatitudeToMercatorAngle(Vo)-De)*be);for(let Ho=Mn;Ho<at;++Ho){let Yo=Ho;Yo<0&&(Yo=0),Yo>=u&&(Yo=u-1);let Xs=co*(u*U)+Yo*U,Ri;if(O===1)Ri=c[Xs];else{Ri=0;let Mo;if(z)for(Mo=0;Mo<O;++Mo)Ri=Ri*k+c[Xs+Mo];else for(Mo=O-1;Mo>=0;--Mo)Ri=Ri*k+c[Xs+Mo]}Ri=Ri*B+R,ne=Math.max(ne,Ri),ge=Math.min(ge,Ri);let Po=C.west+W*Yo;g?Po=a(Po):Po=Po*_;let dc=(Po-E)/(x-E);dc=D.clamp(dc,0,1);let Zs=co*u+Yo;if(h>0){let Mo=Ho===Mn,nu=Ho===at-1,An=Rr||Js||Mo||nu;if((Rr||Js)&&(Mo||nu))continue;An&&(Ri-=h,Mo?(Zs=He+(f-co-1),Po-=fi*Q):Js?Zs=He+f+(u-Yo-1):nu?(Zs=He+f+u+co,Po+=fi*Q):Rr&&(Zs=He+f+u+f+Yo))}let Mr=Is*t(Po),Nr=Is*n(Po),uh=$*Mr,Fs=K*Nr,zA=1/i(uh*Mr+Fs*Nr+mo*ka),Ro=uh*zA,eu=Fs*zA,tu=mo*zA,Aa=new d;Aa.x=Ro+Mr*Ri,Aa.y=eu+Nr*Ri,Aa.z=tu+ka*Ri,M.multiplyByPoint(ye,Aa,N7),d.minimumByComponent(N7,Ne,Ne),d.maximumByComponent(N7,ke,ke),Ue=Math.min(Ue,Ri),nt[Zs]=Aa,Wt[Zs]=new F(dc,hr),Ct[Zs]=Ri,P&&(Qn[Zs]=vn),b&&(on[Zs]=A.geodeticSurfaceNormal(Aa))}}let ro=le.fromPoints(nt),Ao;l(y)&&(Ao=$t.fromRectangle(y,ge,ne,A));let ii;v&&(ii=new aA(A).computeHorizonCullingPointPossiblyUnderEllipsoid(w,nt,ge));let so=new Xu(Ne,ke,w),ao=new fr(w,so,Ue,ne,Ce,!1,P,b,N,L),Ui=new Float32Array(Ye*ao.stride),Pi=0;for(let Vn=0;Vn<Ye;++Vn)Pi=ao.encode(Ui,Pi,nt[Vn],Wt[Vn],Ct[Vn],void 0,Qn[Vn],on[Vn]);return{vertices:Ui,maximumHeight:ne,minimumHeight:ge,encoding:ao,boundingSphere3D:ro,orientedBoundingBox:Ao,occludeePointInScaledSpace:ii}};var gB=Wm;function By(){Ae.throwInstantiationError()}Object.defineProperties(By.prototype,{credits:{get:Ae.throwInstantiationError},waterMask:{get:Ae.throwInstantiationError}});By.prototype.interpolateHeight=Ae.throwInstantiationError;By.prototype.isChildAvailable=Ae.throwInstantiationError;By.prototype.createMesh=Ae.throwInstantiationError;By.prototype.upsample=Ae.throwInstantiationError;By.prototype.wasCreatedByUpsampling=Ae.throwInstantiationError;By.maximumAsynchronousTasks=5;var Mu=By;var Hmt=3;function F7(e,t,n){this._vertices=e,this._indices=t,this._encoding=n,this._inverseTransform=new M,this._needsRebuild=!0,this._rootNode=new O7}var Ymt=new qn("incrementallyBuildTerrainPicker");Object.defineProperties(F7.prototype,{needsRebuild:{get:function(){return this._needsRebuild},set:function(e){this._needsRebuild=e}}});function O7(){this.x=0,this.y=0,this.level=0,this.aabb=I0e(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}O7.prototype.addChild=function(e){let t=new O7;t.x=this.x*2+(e&1),t.y=this.y*2+(e>>1&1),t.level=this.level+1,t.aabb=I0e(t.x,t.y,t.level),this.children[e]=t};var Wmt=new gn,E8=[new d,new d,new d];F7.prototype.rayIntersect=function(e,t,n,i,o){this._needsRebuild&&jmt(this,t);let r=this._inverseTransform,s=Wmt;s.origin=M.multiplyByPoint(r,e.origin,s.origin),s.direction=M.multiplyByPointAsVector(r,e.direction,s.direction);let a=[];return b0e(this._rootNode,s,a),Zmt(this,a,e,n,i,o)};function jmt(e,t){M.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 qmt=new d,Kmt=new d;function I0e(e,t,n){let i=1/Math.pow(2,n),o=d.fromElements(e*i-.5,t*i-.5,-.5,qmt),r=d.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,Kmt);return Xu.fromCorners(o,r)}function Jmt(e,t,n,i,o){d.pack(n[0],e,9*o),d.pack(n[1],e,9*o+3),d.pack(n[2],e,9*o+6),t[o]=i}var Xmt=new qr;function b0e(e,t,n){let i=ci.rayAxisAlignedBoundingBox(t,e.aabb,Xmt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new qr(i.start,i.stop)});return}for(let r=0;r<e.children.length;r++)b0e(e.children[r],t,n)}function Zmt(e,t,n,i,o,r){let s=t.sort(function(c,u){return c.interval.start-u.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let u=s[c],f=$mt(e,n,u.node,i,o,r);if(a=Math.min(f,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return gn.getPoint(n,a)}function $mt(e,t,n,i,o,r){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,m=!(n.level>=Hmt)&&!n.buildingChildren,g,A;m&&(g=new Float32Array(f*9),A=new Uint32Array(f));for(let _=0;_<f;_++){let C=n.intersectingTriangles[_],y=L7(a,o,r,u,c[3*C],E8[0]),E=L7(a,o,r,u,c[3*C+1],E8[1]),I=L7(a,o,r,u,c[3*C+2],E8[2]),x=ci.rayTriangleParametric(t,y,E,I,i);l(x)&&x<s&&x>=0&&(s=x),m&&Jmt(g,A,E8,C,_)}if(m){for(let _=0;_<4;_++)n.addChild(_);tpt(e._inverseTransform,n,A,g)}return s}var ept=new he;function L7(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(t===oe.SCENE3D)return s;let c=n.ellipsoid.cartesianToCartographic(s,ept);return s=n.project(c,r),s=d.fromElements(s.z,s.x,s.y,r),s}async function tpt(e,t,n,i){t.buildingChildren=!0;let o=new Float64Array(16);M.pack(e,o,0);let r=new Float64Array(24);for(let f=0;f<4;f++)d.pack(t.children[f].aabb.minimum,r,f*6),d.pack(t.children[f].aabb.maximum,r,f*6+3);let s={aabbs:r,inverseTransform:o,triangleIndices:n,trianglePositions:i},a=[r.buffer,o.buffer,n.buffer,i.buffer],c=Ymt.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,h)=>{t.children[h].intersectingTriangles=new Uint32Array(f)}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var n2=F7;function i2(e,t,n,i,o,r,s,a,c,u,f,h,m,g,A,_,C){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=h,this.encoding=m,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=A,this.eastIndicesNorthToSouth=_,this.northIndicesWestToEast=C,this._transform=new M,this._recomputeTransform=!0,this._terrainPicker=new n2(t,n,m)}i2.prototype.getTransform=function(e,t){return this._recomputeTransform?(this._recomputeTransform=!1,!l(e)||e===oe.SCENE3D?npt(this,this._transform):lpt(this,t,this._transform)):this._transform};function npt(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=$t.fromRectangle(e.rectangle,o,r,te.default,e.orientedBoundingBox);return $t.computeTransformation(s,t)}var ipt=new d,opt=new d,rpt=new he,spt=new he,apt=new d,cpt=new d;function lpt(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(he.fromRadians(e.rectangle.west,e.rectangle.south,0,rpt),ipt),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,spt),opt),u=s-r,f=d.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,apt),h=d.fromElements(a.x+f.x*.5,a.y+f.y*.5,r+f.z*.5,cpt);return M.fromTranslation(h,n),M.setScale(n,f,n),M.multiply(It.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}i2.prototype.pick=function(e,t,n,i){return this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i)};i2.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._recomputeTransform=!0};i2.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._recomputeTransform=!0};var sc=i2;function s_(e){e=e??V.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??jd.NONE;let t=gB.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===jd.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(s_.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var x0e="createVerticesFromHeightmap",upt=new qn(x0e),fpt=new qn(x0e,Mu.maximumAsynchronousTasks);s_.prototype.createMesh=function(e){e=e??V.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,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),h=c.cartographicToCartesian(ce.center(f)),m=this._structure,A=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(A*4,1e3);let C=(a?fpt:upt).scheduleTask({heightmap:this._buffer,structure:m,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:h,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Gi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(C))return;let y=this;return Promise.resolve(C).then(function(E){let I;y._skirtHeight>0?I=zo.getRegularGridAndSkirtIndicesAndEdgeIndices(E.gridWidth,E.gridHeight):I=zo.getRegularGridIndicesAndEdgeIndices(E.gridWidth,E.gridHeight);let x=E.gridWidth*E.gridHeight;return y._mesh=new sc(h,new Float32Array(E.vertices),I.indices,I.indexCountWithoutSkirts,x,E.minimumHeight,E.maximumHeight,f,le.clone(E.boundingSphere3D),d.clone(E.occludeePointInScaledSpace),E.numberOfAttributes,$t.clone(E.orientedBoundingBox),fr.clone(E.encoding),I.westIndicesSouthToNorth,I.southIndicesEastToWest,I.eastIndicesNorthToSouth,I.northIndicesWestToEast),y._buffer=void 0,y._mesh})};s_.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),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(ce.center(u)),h=this._structure,g=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let A=gB.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Gi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let _;this._skirtHeight>0?_=zo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):_=zo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let C=A.gridWidth*A.gridHeight;return this._mesh=new sc(f,A.vertices,_.indices,_.indexCountWithoutSkirts,C,A.minimumHeight,A.maximumHeight,u,A.boundingSphere3D,A.occludeePointInScaledSpace,A.encoding.stride,A.orientedBoundingBox,A.encoding,_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),this._mesh};s_.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,u=r.isBigEndian,f=r.heightOffset,h=r.heightScale,m=l(this._mesh),g=this._encoding===jd.LERC;if(!m&&g)return;let _;if(m){let C=this._mesh.vertices,y=this._mesh.encoding;_=T0e(C,y,f,h,e,i,o,t,n)}else _=dpt(this._buffer,a,c,s,u,e,i,o,t,n),_=_*h+f;return _};s_.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,h=f.stride,m=new this._bufferType(c*u*h),g=a.vertices,A=a.encoding,_=e.tileXYToRectangle(t,n,i),C=e.tileXYToRectangle(o,r,s),y=f.heightOffset,E=f.heightScale,I=f.elementsPerHeight,x=f.elementMultiplier,S=f.isBigEndian,w=Math.pow(x,I-1);for(let v=0;v<u;++v){let P=D.lerp(C.north,C.south,v/(u-1));for(let N=0;N<c;++N){let L=D.lerp(C.west,C.east,N/(c-1)),p=T0e(g,A,y,E,_,c,u,L,P);p=p<f.lowestEncodedHeight?f.lowestEncodedHeight:p,p=p>f.highestEncodedHeight?f.highestEncodedHeight:p,hpt(m,I,x,w,h,S,v*c+N,p)}}return Promise.resolve(new s_({buffer:m,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};s_.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};s_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function dpt(e,t,n,i,o,r,s,a,c,u){let f=(c-r.west)*(s-1)/(r.east-r.west),h=(u-r.south)*(a-1)/(r.north-r.south),m=f|0,g=m+1;g>=s&&(g=s-1,m=s-2);let A=h|0,_=A+1;_>=a&&(_=a-1,A=a-2);let C=f-m,y=h-A;A=a-1-A,_=a-1-_;let E=I8(e,t,n,i,o,A*s+m),I=I8(e,t,n,i,o,A*s+g),x=I8(e,t,n,i,o,_*s+m),S=I8(e,t,n,i,o,_*s+g);return S0e(C,y,E,I,x,S)}function T0e(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(s-1)/(o.north-o.south),h=u|0,m=h+1;m>=r&&(m=r-1,h=r-2);let g=f|0,A=g+1;A>=s&&(A=s-1,g=s-2);let _=u-h,C=f-g;g=s-1-g,A=s-1-A;let y=(t.decodeHeight(e,g*r+h)-n)/i,E=(t.decodeHeight(e,g*r+m)-n)/i,I=(t.decodeHeight(e,A*r+h)-n)/i,x=(t.decodeHeight(e,A*r+m)-n)/i;return S0e(_,C,y,E,I,x)}function S0e(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function I8(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 hpt(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=s_;function yB(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var z0=new ce;function Apt(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}yB.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let m=n;m<=o;++m)for(let g=t;g<=i;++g)Apt(e,g,m,s)||s.push(new _B(r,void 0,0,g,m));r.tileXYToRectangle(t,n,e,z0);let a=z0.west,c=z0.north;r.tileXYToRectangle(i,o,e,z0);let u=z0.east,f=z0.south,h=new Cpt(e,a,f,u,c);for(let m=0;m<s.length;++m){let g=s[m];Q7(g.extent,h)&&ypt(this._maximumLevel,g,h)}};yB.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(CB(i.extent,e)){t=i;break}}return l(t)?o2(void 0,t,e):-1};var mpt=[],ppt=[],gpt=new ce,_pt=new ce;yB.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=mpt;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,gpt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,_pt))):t.push(e);let n=ppt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)r2(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 B0e=new he;yB.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,z0);return ce.center(i,B0e),this.computeMaximumLevelAtPosition(B0e)>=e};yB.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 _B(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(_B.prototype,{nw:{get:function(){return this._nw||(this._nw=new _B(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new _B(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new _B(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new _B(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Cpt(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 ypt(e,t,n){for(;t.level<e;)if(b8(t.nw.extent,n))t=t.nw;else if(b8(t.ne.extent,n))t=t.ne;else if(b8(t.sw.extent,n))t=t.sw;else if(b8(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=go(t.rectangles,n.level,Ept);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Ept(e,t){return e.level-t}function b8(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function CB(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function o2(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&CB(t._nw.extent,n),s=t._ne&&CB(t._ne.extent,n),a=t._sw&&CB(t._sw.extent,n),c=t._se&&CB(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,o2(t,t._nw,n))),s&&(i=Math.max(i,o2(t,t._ne,n))),a&&(i=Math.max(i,o2(t,t._sw,n))),c&&(i=Math.max(i,o2(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];CB(a,n)&&(i=a.level)}t=t.parent}return i}function r2(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]=Ipt(e[s.level],s)}r2(e,t._nw,n),r2(e,t._ne,n),r2(e,t._sw,n),r2(e,t._se,n)}function Ipt(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 ce(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ce(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ce(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ce(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var BA=yB;var bpt=15;function w0e(e){this.ellipsoid=e.ellipsoid??te.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}w0e.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 xpt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new pt(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Vi(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new F(r.xmin,r.ymin),s.rectangleNortheastInMeters=new F(r.xmax,r.ymax),e.tilingScheme=new Rs(s)}else throw new ue("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new ue("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?jd.LERC:jd.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new BA(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new BA(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=zo.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 Tpt(e,t,n){try{let i=await t.fetchJson();xpt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw qo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function wy(e){e=e??V.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 _e}Object.defineProperties(wy.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}}});wy.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Be.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new w0e(t);await Tpt(o,i);let r=new wy(t);return o.build(r),r._resource=n,r};wy.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(k7(this,n+1,e*2,t*2))){let h=D0e(this,n+1,e*2,t*2);s=h.promise,a=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(h){return new Sc({buffer:h[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):bpt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(h){if(l(a)&&a.state===hi.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=hi.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function k7(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}wy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};wy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=k7(this,n,e,t);if(l(i))return i;D0e(this,n,e,t)};wy.prototype.loadTileDataAvailability=function(e,t,n){};function Spt(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},u=new F(e.x+1,e.y+1),f=!1,h=!1;for(;!(f&&h);){let m=u.x,g=h?u.y+1:u.y;if(!f){for(let A=e.y;A<g;++A)if(i[A*t+u.x]!==s){f=!0;break}f?(a.push(new F(u.x,e.y)),--u.x,--m,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!h){let A=u.y*t;for(let _=e.x;_<=m;++_)if(i[A+_]!==s){h=!0;break}h?(a.push(new F(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,h=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function Bpt(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 F(0,0)];for(;a.length>0;){let c=a.pop(),u=Spt(c,n,i,o);if(u.value===1){let h=u.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function D0e(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 u=new pr({throttle:!1,throttleByServer:!0,type:Qs.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(h)?(h=h.then(function(m){let g=Bpt(o,r,s,s,m.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let A=e._tilesAvailable;for(let _=0;_<g.length;++_){let C=g[_];A.addAvailableTileRange(t,C.startX,C.startY,C.endX,C.endY)}return k7(e,t,n,i)}),c[a]={promise:h,request:u},h=h.finally(function(m){return delete c[a],m}),{promise:h,request:u}):{}}var U7=wy;var v0e="https://dev.virtualearth.net/REST/v1/Locations";function G7(e){e=e??V.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Be({url:v0e,queryParameters:n}),this._credit=new pt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(G7.prototype,{url:{get:function(){return v0e}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});G7.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],u=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,u,c)}})})};var z7=G7;function V7(){}Object.defineProperties(V7.prototype,{credit:{get:function(){}}});V7.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:d.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var H7=V7;var wpt=new se,P0e=new d,EB=new d;function Dpt(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 d);let u=(a-i)*o;return d.lerp(r,s,u,c)}}return function(i,o){l(o)||(o=new d);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=wpt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,h,m;return r===0?(c=t[0],u=t[1],f=e.firstTangent,h=d.subtract(t[2],c,P0e),d.multiplyByScalar(h,.5,h),m=M.multiplyByVector(wC.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],u=t[r+1],h=e.lastTangent,f=d.subtract(u,t[r-1],P0e),d.multiplyByScalar(f,.5,f),m=M.multiplyByVector(wC.hermiteCoefficientMatrix,a,a)):(c=t[r-1],u=t[r],f=t[r+1],h=t[r+2],m=M.multiplyByVector(Dy.catmullRomCoefficientMatrix,a,a)),o=d.multiplyByScalar(c,m.x,o),d.multiplyByScalar(u,m.y,EB),d.add(o,EB,o),d.multiplyByScalar(f,m.z,EB),d.add(o,EB,o),d.multiplyByScalar(h,m.w,EB),d.add(o,EB,o)}}var vpt=new d,Ppt=new d;function Dy(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=vpt,d.multiplyByScalar(t[1],2,i),d.subtract(i,t[2],i),d.subtract(i,t[0],i),d.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=Ppt,d.multiplyByScalar(t[r-1],2,o),d.subtract(t[r],o,o),d.add(o,t[r-2],o),d.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=d.clone(i),this._lastTangent=d.clone(o),this._evaluateFunction=Dpt(this),this._lastTimeIndex=0}Object.defineProperties(Dy.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}}});Dy.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Dy.prototype.findTimeInterval=Io.prototype.findTimeInterval;Dy.prototype.wrapTime=Io.prototype.wrapTime;Dy.prototype.clampTime=Io.prototype.clampTime;Dy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Y7=Dy;var IB=mr(Rj(),1);var W7={},Rpt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},Mpt=new he,Npt=new d,Lpt=new M,Opt=new M,Fpt=new M,Qpt=new d,kpt=new d,Upt=new d,Gpt=new d,zpt=new he,Vpt=new F,s2=new d,Hpt=new F,Ypt=new d,Wpt=new d,x8=function(e,t){return e-t};W7.createMesh=async function(e){e=e??V.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:o,gltf:r,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,f=t!==1,h=le.clone(e.boundingSphere,new le),m=$t.clone(e.orientedBoundingBox,new $t),g=d.clone(e.horizonOcclusionPoint,new d),A=te.clone(e.ellipsoid,new te),_=ce.clone(e.rectangle,new ce);await(r.extensionsRequired!==void 0&&r.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?IB.MeshoptDecoder.ready:Promise.resolve(void 0));let E=_.west,I=_.south,x=_.north,S=_.width,w=_.height,v=ce.center(_,Mpt);v.height=.5*(s+a);let P=he.toCartesian(v,A,Npt),N=It.eastNorthUpToFixedFrame(P,A,Lpt),L=M.inverseTransformation(N,Opt),p=M.unpack(r.nodes[0].matrix,0,Fpt);p=M.multiply(eo.Y_UP_TO_Z_UP,p,p);let b=Tgt(r,i,Rpt),T=zo.getSkirtVertexCount(b.edgeIndicesWest,b.edgeIndicesSouth,b.edgeIndicesEast,b.edgeIndicesNorth),B=b.positions,R=b.normals,O=b.indices,U=B.length/3,k=U+T,z=O.length,Q=zo.getSkirtIndexCountWithFilledCorners(T),H=k<=65535?Uint16Array:Uint32Array,W=new H(z+Q);W.set(O);let Z=new H(b.edgeIndicesWest),Y=new H(b.edgeIndicesSouth),$=new H(b.edgeIndicesEast),K=new H(b.edgeIndicesNorth),fe=new H(Z).sort(),ge=new H(Y).sort(),ne=new H($).sort(),Ce=new H(K).sort(),ye=ui.geodeticLatitudeToMercatorAngle(I),be=1/(ui.geodeticLatitudeToMercatorAngle(x)-ye),Ne=d.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Qpt),ke=d.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,kpt),Ue=new fr(h.center,void 0,void 0,void 0,void 0,i,o,f,t,n),He=Ue.stride,Et=new Float32Array(k*He),Ye=0;for(let Ct=0;Ct<U;Ct++){let Wt=d.unpack(B,Ct*3,Upt),Qn=M.multiplyByPoint(p,Wt,Gpt),on=he.fromCartesian(Qn,A,zpt),{longitude:lt,latitude:Nt,height:Mn}=on,at=(lt-E)/S,fi=(Nt-I)/w;at=D.clamp(at,0,1),fi=D.clamp(fi,0,1),go(fe,Ct,x8)>=0?at=0:go(ne,Ct,x8)>=0&&(at=1),go(ge,Ct,x8)>=0?fi=0:go(Ce,Ct,x8)>=0&&(fi=1);let ro=F.fromElements(at,fi,Vpt),Ao;if(i){let Ui=d.unpack(R,Ct*3,s2);Ui=M.multiplyByPointAsVector(p,Ui,s2),Ui=d.normalize(Ui,s2),Ao=bn.octEncode(Ui,Hpt)}let ii;o&&(ii=(ui.geodeticLatitudeToMercatorAngle(Nt)-ye)*be);let so;f&&(so=A.geodeticSurfaceNormal(Qn,Ypt)),Ye=Ue.encode(Et,Ye,Qn,ro,Mn,Ao,ii,so);let ao=M.multiplyByPoint(L,Qn,Wpt);Ne=d.minimumByComponent(ao,Ne,Ne),ke=d.maximumByComponent(ao,ke,ke)}let nt=new sc(d.clone(Ue.center,new d),Et,W,z,U,s,a,_,le.clone(h,new le),d.clone(g,new d),He,$t.clone(m,new $t),Ue,Z,Y,$,K);return Q0e(nt,_,A,Ne,ke,N,L,c),Promise.resolve(nt)};var jpt=new F,qpt=new F,Kpt=new Array(6),Jpt=new F,Xpt=new F,Zpt=new F,$pt=new d,egt=new d,tgt=new d,ngt=new he,igt=new d,ogt=new he,rgt=new he,R0e=new d,sgt=new d,agt=new d,cgt=new d,lgt=new d,ugt=new d,fgt=new d,dgt=new d,hgt=new M,Agt=new M,M0e=new F,mgt=new F,pgt=new d,ggt=new le,_gt=new $t,Cgt=new Xu,N0e=new d,L0e=new F,ygt=new F,O0e=new d,Egt=new d;function Igt(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,u=c===4?Uint8Array:Uint16Array,f=new u(o*4);IB.MeshoptDecoder.decodeVertexBuffer(new Uint8Array(f.buffer),o,c,a);let h=(1<<f.BYTES_PER_ELEMENT*8)-1,m=new Float32Array(o*3);for(let g=0;g<o;g++)m[g*3+0]=f[g*4+0]/h,m[g*3+1]=f[g*4+1]/h,m[g*3+2]=f[g*4+2]/h;return m}function bgt(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,u=new Int8Array(o*c);IB.MeshoptDecoder.decodeVertexBuffer(new Uint8Array(u.buffer),o,c,a);let f=new Float32Array(o*3);for(let h=0;h<o;h++){let m=Math.max(u[h*4+0]/127,-1),g=Math.max(u[h*4+1]/127,-1),A=1-(Math.abs(m)+Math.abs(g));if(A<0){let C=m,y=g;m=(1-Math.abs(y))*D.signNotZero(C),g=(1-Math.abs(C))*D.signNotZero(y)}let _=s2;_.x=m,_.y=g,_.z=A,_=d.normalize(_,s2),f[h*3+0]=_.x,f[h*3+1]=_.y,f[h*3+2]=_.z}return f}function xgt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],o=n.count,r=n.componentType===q.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new r(f.buffer,f.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),u=new r(o);return IB.MeshoptDecoder.decodeIndexBuffer(new Uint8Array(u.buffer),o,s.byteStride,c),u}function T8(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===q.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let m=e.buffers[o.buffer].extras._pipeline.source;return new s(m.buffer,m.byteOffset+(o.byteOffset??0)+(i.byteOffset??0),r)}let c=e.buffers[a.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),f=new s(r),h=a.byteStride;return IB.MeshoptDecoder.decodeIndexSequence(new Uint8Array(f.buffer),r,h,u),f}function Tgt(e,t,n){return n.positions=Igt(e),n.normals=t?bgt(e):void 0,n.indices=xgt(e),n.edgeIndicesWest=T8(e,"left"),n.edgeIndicesSouth=T8(e,"bottom"),n.edgeIndicesEast=T8(e,"right"),n.edgeIndicesNorth=T8(e,"top"),n}W7.upsampleMesh=function(e){e=e??V.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:o,skirtHeight:r}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=fr.clone(e.parentEncoding,new fr),h=f.hasVertexNormals,m=f.hasWebMercatorT,g=f.exaggeration,A=f.exaggerationRelativeHeight,C=g!==1,y=ce.clone(e.rectangle,new ce),E=te.clone(e.ellipsoid),I=[],x=[],S=[],w=[],v=[],P=[],N=[],L=[];Qgt(t,n,s,a,c,u,f,w,v,P,N,L,I,S,x);let p=ce.center(y,ngt);p.height=.5*(i+o);let b=he.toCartesian(p,E,igt),T=I.length,B=new fr(b,void 0,void 0,void 0,void 0,h,m,C,g,A),R=B.stride,O=zo.getSkirtVertexCount(v,P,N,L),U=T+O,k=w.length,z=zo.getSkirtIndexCountWithFilledCorners(O),Q=k+z,H=U<=65535?Uint16Array:Uint32Array,W=new H(Q);W.set(w);let Z=new H(v),Y=new H(P),$=new H(N),K=new H(L),fe=new Float32Array(U*R),ge=0,ne=It.eastNorthUpToFixedFrame(b,E,hgt),Ce=M.inverseTransformation(ne,Agt),ye=y.west,De=y.east,be=y.south,Ne=y.north,ke=ui.geodeticLatitudeToMercatorAngle(be),He=1/(ui.geodeticLatitudeToMercatorAngle(Ne)-ke),Et=Number.POSITIVE_INFINITY,Ye=Number.NEGATIVE_INFINITY,nt=d.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,fgt),Ct=d.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,dgt);for(let Mn=0;Mn<T;Mn++){let at=I[Mn],fi=a[at*3+0],ro=a[at*3+1],Ao=a[at*3+2],ii=mgt;ii.x=x[Mn*2+0],ii.y=x[Mn*2+1];let so=ii.x,ao=ii.y,Ui=S[Mn*2+0],Pi=S[Mn*2+1],Vn=1-Ui-Pi,co=f.decodeHeight(u,fi),Vo=f.decodeHeight(u,ro),hr=f.decodeHeight(u,Ao),Rr=co*Ui+Vo*Pi+hr*Vn;Et=Math.min(Rr,Et),Ye=Math.max(Rr,Ye);let Js=D.lerp(ye,De,so),Is=D.lerp(be,Ne,ao),ka=he.fromRadians(Js,Is,Rr,rgt),mo=he.toCartesian(ka,E,sgt),vn=M.multiplyByPoint(Ce,mo,cgt);nt=d.minimumByComponent(vn,nt,nt),Ct=d.maximumByComponent(vn,Ct,Ct);let Ho;if(h){let Ri=f.decodeNormal(u,fi,$pt),Po=f.decodeNormal(u,ro,egt),dc=f.decodeNormal(u,Ao,tgt),Zs=d.fromElements(Ri.x*Ui+Po.x*Pi+dc.x*Vn,Ri.y*Ui+Po.y*Pi+dc.y*Vn,Ri.z*Ui+Po.z*Pi+dc.z*Vn,N0e);Zs=d.normalize(Zs,N0e),Ho=bn.octEncode(Zs,ygt)}let Yo;m&&(Yo=(ui.geodeticLatitudeToMercatorAngle(Is)-ke)*He);let Xs;C&&(Xs=E.geodeticSurfaceNormal(mo,Egt)),ge=B.encode(fe,ge,mo,ii,Rr,Ho,Yo,Xs)}let Wt=$t.fromRectangle(y,Et,Ye,E,_gt),Qn=le.fromVertices(fe,B.center,R,ggt),lt=new aA(E).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(B.center,fe,R,B.center,Et,pgt),Nt=new sc(d.clone(B.center,new d),fe,W,k,T,Et,Ye,y,le.clone(Qn),d.clone(lt),R,$t.clone(Wt),B,Z,Y,$,K);return Q0e(Nt,y,E,nt,Ct,ne,Ce,r),Nt};function Q0e(e,t,n,i,o,r,s,a){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:h,hasWebMercatorT:m,exaggeration:g,exaggerationRelativeHeight:A}=c,C=g!==1,y=e.vertexCountWithoutSkirts,E=y*u,I=f.length/u,x=I-y,S=e.indices,w=e.indexCountWithoutSkirts,v=e.westIndicesSouthToNorth,P=e.southIndicesEastToWest,N=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;zo.addSkirtIndicesWithFilledCorners(v,P,N,L,y,S,w);let p=0,b=p+v.length,T=b+P.length,B=T+N.length,R=[v,P,N,L],O=[p,b,T,B],U=[-1,0,1,0],k=[0,-1,0,1],z=d.clone(i,lgt),Q=d.clone(o,ugt),H=e.maximumHeight,W=e.minimumHeight-a;for(let $=0;$<x;$++){let K=0;for(K=0;K<3&&!($<O[K+1]);K++);let fe=R[K][$-O[K]],ge=c.decodeTextureCoordinates(f,fe,M0e),ne=1e-4,Ce=ge.x+U[K]*ne,ye=ge.y+k[K]*ne,De=D.lerp(t.west,t.east,Ce),be=D.clamp(D.lerp(t.south,t.north,ye),-D.PI_OVER_TWO,+D.PI_OVER_TWO),ke=c.decodeHeight(f,fe)-a,Ue=he.fromRadians(De,be,ke,ogt),He=he.toCartesian(Ue,n,R0e),Et;h&&(Et=c.getOctEncodedNormal(f,fe,L0e));let Ye;m&&(Ye=c.decodeWebMercatorT(f,fe));let nt;C&&(nt=n.geodeticSurfaceNormal(He,O0e)),E=c.encode(f,E,He,ge,ke,Et,Ye,nt);let Ct=M.multiplyByPoint(s,He,agt);d.minimumByComponent(Ct,z,z),d.maximumByComponent(Ct,Q,Q)}let Z=Xu.fromCorners(z,Q,Cgt),Y=new fr(c.center,Z,W,H,r,c.hasVertexNormals,c.hasWebMercatorT,C,g,A);if(c.quantization!==Y.quantization){let $=Y,K=$.stride,fe=new Float32Array(I*K),ge=0;for(let ne=0;ne<I;ne++)ge=$.encode(fe,ge,c.decodePosition(f,ne,R0e),c.decodeTextureCoordinates(f,ne,M0e),c.decodeHeight(f,ne),c.hasVertexNormals?c.getOctEncodedNormal(f,ne,L0e):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,ne):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,ne,O0e):void 0);e.vertices=fe,e.stride=K,e.encoding=$}return e}var j7=0,Sgt=1,q7=2,K7=3,Bgt=4,wgt=new d,Dgt=[new d,new d,new d,new d,new d,new d],vgt=[new F,new F,new F,new F,new F,new F],Pgt=[new d,new d,new d,new d,new d,new d],Rgt=[new F,new F,new F,new F,new F,new F];function F0e(e,t,n,i){switch(n){case j7:return D.sign(i.x-e.x);case q7:return D.sign(t.x-i.x);case K7:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function Mgt(e,t,n,i,o,r){let s,a,c;switch(n){case j7:s=(e.x-i.x)/(o.x-i.x),a=e.x,c=i.y+(o.y-i.y)*s;break;case q7:s=(t.x-i.x)/(o.x-i.x),a=t.x,c=i.y+(o.y-i.y)*s;break;case K7: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 d.fromElements(a,c,s,r)}var Ngt={length:0,coordinates:[new F,new F,new F,new F,new F,new F],barycentricCoordinates:[new d,new d,new d,new d,new d,new d]};function Lgt(e,t,n,i,o,r,s,a){let c=0,u=vgt,f=Dgt,h=3,m=Rgt;F.clone(o,m[0]),F.clone(r,m[1]),F.clone(s,m[2]);let g=Pgt;d.fromElements(1,0,0,g[0]),d.fromElements(0,1,0,g[1]),d.fromElements(0,0,1,g[2]);for(let A=0;A<t;A++){let _=(e+A)%Bgt,C=u,y=f;u=m,f=g,c=h,m=C,g=y,h=0;let E=c-1,I=u[E],x=f[E],S=F0e(n,i,_,I);for(let w=0;w<c;w++){let v=u[w],P=f[w],N=F0e(n,i,_,v);if(S*N===-1){let L=Mgt(n,i,_,I,v,wgt),{x:p,y:b,z:T}=L,B=1-T,R=x.x*B+P.x*T,O=x.y*B+P.y*T,U=x.z*B+P.z*T;F.fromElements(p,b,m[h]),d.fromElements(R,O,U,g[h]),h++}N>=0&&(F.clone(v,m[h]),d.clone(P,g[h]),h++),E=w,I=v,x=P,S=N}if(h===0)break}a.length=h;for(let A=0;A<h;A++)F.clone(m[A],a.coordinates[A]),d.clone(g[A],a.barycentricCoordinates[A]);return a}function Ogt(e,t,n,i,o,r,s,a){return Lgt(e?t?K7:j7:t?q7:Sgt,2,n,i,o,r,s,a)}var Fgt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function Qgt(e,t,n,i,o,r,s,a,c,u,f,h,m,g,A){let _={},C=e?.5:0,y=e?1:.5,E=t?.5:0,I=t?1:.5,x=jpt;x.x=C,x.y=E;let S=qpt;S.x=y,S.y=I;let w=0;for(let v=0;v<n;v+=3){let P=i[v+0],N=i[v+1],L=i[v+2],p=s.decodeTextureCoordinates(r,P,Jpt),b=s.decodeTextureCoordinates(r,N,Xpt),T=s.decodeTextureCoordinates(r,L,Zpt),B=Ogt(e,t,x,S,p,b,T,Ngt),R=B.length;if(R<3)continue;let O=Kpt;for(let Q=0;Q<R;Q++){let H=B.barycentricCoordinates[Q],W=H.x,Z=H.y,Y=H.z,$=Math.ceil(W)|Math.ceil(Z)<<1|Math.ceil(Y)<<2,K=Fgt[$],fe,ge=!1;if(K.length===1){let ne=K[0],ye=i[v+ne];fe=_[ye],fe===void 0&&(ge=!0,fe=w++,_[ye]=fe)}else if(K.length===2){let ne=K[0],Ce=K[1],ye=i[v+ne],De=i[v+Ce],be=B.barycentricCoordinates[(Q+R-1)%R],Ne=Math.ceil(be.x)|Math.ceil(be.y)<<1|Math.ceil(be.z)<<2,ke=$===Ne,Ue=Math.min(ye,De),He=Math.max(ye,De),Et=o+2*(Ue*o+He),Ye=Et+0,nt=Et+1,Ct=_[Ye],Wt=_[nt],Qn=!ke==(Ct===void 0||Wt===void 0);if(fe=Qn?Ct:Wt,fe===void 0){ge=!0,fe=w++;let on=Qn?Ye:nt;_[on]=fe}}else ge=!0,fe=w++;if(O[Q]=fe,ge){let ne=v/3;m.push(ne);let Ce=B.coordinates[Q],ye=(Ce.x-C)/(y-C),De=(Ce.y-E)/(I-E);A.push(ye,De),g.push(W,Z),ye===0?c.push(fe):ye===1&&f.push(fe),De===0?u.push(fe):De===1&&h.push(fe)}}let U=O[0],k=O[1],z=O[2];a.push(U,k,z);for(let Q=3;Q<R;Q++)k=z,z=O[Q],a.push(U,k,z)}c.sort(function(v,P){return A[v*2+1]-A[P*2+1]}),u.sort(function(v,P){return A[P*2+0]-A[v*2+0]}),f.sort(function(v,P){return A[P*2+1]-A[v*2+1]}),h.sort(function(v,P){return A[v*2+0]-A[P*2+0]})}var bB=W7;var S8={};S8.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 u=s+a+c,f,h,m,g,A,_;return u===1?s?(f=(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)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(m=(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)),m!==1&&(r.push(-1),r.push(1),r.push(2),r.push(m))):c&&(A=(e-o)/(n-o),_=(e-o)/(i-o),r.push(0),r.push(1),_!==1&&(r.push(-1),r.push(2),r.push(1),r.push(_)),A!==1&&(r.push(-1),r.push(2),r.push(0),r.push(A))):u===2?!s&&n!==e?(g=(e-i)/(n-i),A=(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(A)):!a&&i!==e?(_=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(_),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(h=(e-n)/(o-n),m=(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(m)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};S8.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,f=s-o,h=r-a,m=i-a,g=1/(h*u+f*m),A=t-a,_=e-s,C=(h*_+f*A)*g,y=(-m*_+u*A)*g,E=1-C-y;return l(c)?(c.x=C,c.y=y,c.z=E,c):new d(C,y,E)};S8.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let m=u/h,g=f/h;if(m>=0&&m<=1&&g>=0&&g<=1)return l(c)||(c=new F),c.x=e+m*(n-e),c.y=t+m*(i-t),c};var wA=S8;function c_(e){e=e??V.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=le.clone(e.boundingSphere,new le),this._orientedBoundingBox=$t.clone(e.orientedBoundingBox,new $t),this._horizonOcclusionPoint=d.clone(e.horizonOcclusionPoint,new d),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(c_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});c_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:U0e(i,e,t,n)};c_.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 k0e="createVerticesFromCesium3DTilesTerrain",kgt=new qn(k0e),Ugt=new qn(k0e,Mu.maximumAsynchronousTasks);c_.prototype.createMesh=function(e){e=e??V.EMPTY_OBJECT;let n=e.throttle??!0?Ugt:kgt,i=e.tilingScheme,o=i.ellipsoid,r=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(r,s,a,new ce),u=this._gltf,f=n.scheduleTask({ellipsoid:o,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,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(f))return;let h=this;return Promise.resolve(f).then(function(m){let g=m,A=fr.clone(g.encoding,new fr),_=new Float32Array(g.verticesBuffer),C=_.length/A.stride,y=g.vertexCountWithoutSkirts,E=C<=65535?Uint16Array:Uint32Array,I=new E(g.indicesBuffer),x=new E(g.westIndicesBuffer),S=new E(g.eastIndicesBuffer),w=new E(g.southIndicesBuffer),v=new E(g.northIndicesBuffer),P=g.indexCountWithoutSkirts,N=h._minimumHeight,L=h._maximumHeight,p=d.clone(A.center,new d),b=le.clone(h._boundingSphere,new le),T=d.clone(h._horizonOcclusionPoint,new d),B=$t.clone(h._orientedBoundingBox,new $t),R=new sc(p,_,I,P,y,N,L,c,b,T,A.stride,B,A,x,w,S,v);return h._mesh=R,Promise.resolve(R)})};c_.prototype._createMeshSync=function(e){e=e??V.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 ce),a=bB.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(u){return c._mesh=u,Promise.resolve(u)})};c_.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:B8(!1,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};c_.prototype._upsampleSync=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:B8(!0,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};c_.prototype.wasCreatedByUpsampling=function(){return!1};function a_(e){e=e??V.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}a_.prototype.createMesh=function(e){return e=e??V.EMPTY_OBJECT,Promise.resolve(this._mesh)};a_.prototype.upsample=function(e,t,n,i,o,r,s){return B8(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};a_.prototype._upsampleSync=function(e,t,n,i,o,r,s){return B8(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};a_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return U0e(i,e,t,n)};a_.prototype.wasCreatedByUpsampling=function(){return!0};a_.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(a_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Ggt=new qn("upsampleVerticesFromCesium3DTilesTerrain",Mu.maximumAsynchronousTasks);function B8(e,t,n,i,o,r,s,a,c,u,f){if(f-a>1)throw new Ae("Upsampling through more than one level at a time is not currently supported.");let m=n*.5,g=r*2!==c,A=s*2===u,_=o.tileXYToRectangle(c,u,f,new ce),C=o.ellipsoid,y={isEastChild:g,isNorthChild:A,rectangle:_,ellipsoid:C,skirtHeight:m,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let I=bB.upsampleMesh(y),x=new a_({terrainMesh:I,skirtHeight:m,credits:i});return Promise.resolve(x)}let E=Ggt.scheduleTask(y);if(E!==void 0)return E.then(function(I){let x=fr.clone(I.encoding,new fr),S=x.stride,w=new Float32Array(I.verticesBuffer),v=w.length/S,P=I.vertexCountWithoutSkirts,N=v<=65535?Uint16Array:Uint32Array,L=new N(I.indicesBuffer),p=new N(I.westIndicesBuffer),b=new N(I.eastIndicesBuffer),T=new N(I.southIndicesBuffer),B=new N(I.northIndicesBuffer),R=I.indexCountWithoutSkirts,O=I.minimumHeight,U=I.maximumHeight,k=d.clone(x.center,new d),z=le.clone(I.boundingSphere,new le),Q=d.clone(I.horizonOcclusionPoint,new d),H=$t.clone(I.orientedBoundingBox,new $t),W=new sc(k,w,L,R,P,O,U,_,z,Q,S,H,x,p,T,b,B),Z=new a_({terrainMesh:W,skirtHeight:m,credits:i});return Promise.resolve(Z)})}var zgt=new F,Vgt=new F,Hgt=new F,Ygt=new d;function U0e(e,t,n,i){let o=D.clamp((n-t.west)/t.width,0,1),r=D.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],h=c[u+1],m=c[u+2],g=a.decodeTextureCoordinates(s,f,zgt),A=a.decodeTextureCoordinates(s,h,Vgt),_=a.decodeTextureCoordinates(s,m,Hgt),C=Math.min(g.x,A.x,_.x),y=Math.max(g.x,A.x,_.x),E=Math.min(g.y,A.y,_.y),I=Math.max(g.y,A.y,_.y);if(o>=C&&o<=y&&r>=E&&r<=I){let x=wA.computeBarycentricCoordinates(o,r,g.x,g.y,A.x,A.y,_.x,_.y,Ygt);if(x.x>=0&&x.y>=0&&x.z>=0){let S=a.decodeHeight(s,f),w=a.decodeHeight(s,h),v=a.decodeHeight(s,m);return x.x*S+x.y*w+x.z*v}}}return 0}var a2=c_;function DA(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(DA.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}}});DA.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new DA({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};DA.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};DA.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)G0e(this,t)};DA.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++,G0e(this,i),t};DA.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],z0e(this,0)),this._array[e-1]=void 0,t};DA.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=J7(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&z0e(this,n)}return this._array[e-1]=void 0,t};DA.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};DA.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[J7(this,1,2)?1:2]};function w8(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function c2(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function J7(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function G0e(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=c2(e,t,i);for(o!==n&&(w8(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(c2(e,t,r)!==o)break;w8(e,t,r),t=r}}function z0e(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){c2(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;c2(e,f,r)===i&&(r=f)}}if(c2(e,r,t)===i&&(w8(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);J7(e,r,a)===i&&w8(e,r,a)}t=r}}var l_=DA;function jm(e){e=e??V.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new pt(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new _e,this._ellipsoid=e.ellipsoid??te.WGS84,this._tilingScheme=new Vi({ellipsoid:this._ellipsoid}),this._subtreeCache=new V0({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}jm.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Be.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new ue("Could not load tileset JSON",f)}let o=new jm(t);o._tileCredits=n.credits,o._resource=n;let r=i.root.children,s=r[0],a=r[1],c=i.schema,u=Pl.fromJson(c);return o._tileset0=new bm(n,s,u),o._tileset1=new bm(n,a,u),o};jm.fromIonAssetId=async function(e,t){let n=await ss.fromAssetId(e);return jm.fromUrl(n,t)};var Wgt=new Array(3);jm.prototype.requestTileGeometry=async function(e,t,n,i){let o=H0e(n,e),r=o===0?this._tileset0:this._tileset1,s=Y0e(r,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(o,a),f=this._requestWaterMask,h=this,m;if(u===void 0){let E=r.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});m=r.baseResource.getDerivedResource({url:E.url}).fetchArrayBuffer().then(async function(x){if(u=c.find(o,a),u===void 0){let S=new Uint8Array(x);u=await Zp.fromSubtreeJson(h._resource,void 0,S,r,a),c.addSubtree(o,u)}return u})}else m=Promise.resolve(u);let g=r.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),A=r.baseResource.getDerivedResource({url:g.url}),_=A.fetchArrayBuffer();if(_===void 0)return;let C=_.then(E=>dI(new Uint8Array(E))),y=Wgt;y[0]=m,y[1]=C,y[2]=f?C.then(E=>jgt(E,A)):void 0;try{let E=await Promise.all(y),I=E[0],x=E[1],S=E[2],w=I.getTileMetadataView(s),v=w.getPropertyBySemantic(md.TILE_MINIMUM_HEIGHT),P=w.getPropertyBySemantic(md.TILE_MAXIMUM_HEIGHT),N=w.getPropertyBySemantic(md.TILE_BOUNDING_SPHERE),L=le.unpack(N,0,new le),p=w.getPropertyBySemantic(md.TILE_HORIZON_OCCLUSION_POINT),T=h._tilingScheme.tileXYToRectangle(e,t,n,new ce),B=h._ellipsoid,R=$t.fromRectangle(T,v,P,B,new $t),O=h.getLevelMaximumGeometricError(n)*5,U=D8(r,I,s,0,0),k=D8(r,I,s,1,0),z=D8(r,I,s,0,1),Q=D8(r,I,s,1,1),H=(U?1:0)|(k?2:0)|(z?4:0)|(Q?8:0),W=new a2({gltf:x,minimumHeight:v,maximumHeight:P,boundingSphere:L,orientedBoundingBox:R,horizonOcclusionPoint:p,skirtHeight:O,requestVertexNormals:h._requestVertexNormals,childTileMask:H,credits:h._tileCredits,waterMask:S});return Promise.resolve(W)}catch(E){console.log(`Could not load subtree: ${o} ${a.level} ${a.x} ${a.y}: ${E}`),console.log(`Could not load tile: ${o} ${s.level} ${s.x} ${s.y}: ${E}`);return}};jm.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,o=H0e(n,e),r=o===0?this._tileset0:this._tileset1,s=Y0e(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 u=a.getParentSubtreeCoordinates(),f=i.find(o,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function H0e(e,t){let n=1<<e;return t/n|0}function Y0e(e,t,n,i){let o=1<<t,r=t,s=n%o,a=o-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new xm({subdivisionScheme:c,subtreeLevels:u,level:r,x:s,y:a})}async function jgt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new mC({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],u=e.textures[c.index],f=e.images[u.source]?.bufferView,h=Di.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await h.load(),await Kp({uint8Array:new Uint8Array(h.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function D8(e,t,n,i,o){let r=n.isBottomOfSubtree(),a=X7(e,1,i,o),c=n.getDescendantCoordinates(a);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function X7(e,t,n,i){let{subdivisionScheme:o,subtreeLevels:r}=e;return new xm({subdivisionScheme:o,subtreeLevels:r,level:t,x:n,y:i})}jm.prototype.loadTileDataAvailability=function(e,t,n){};jm.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(jm.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 qgt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function V0(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new l_({comparator:V0.comparator}),this._provider=e.provider}V0.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};V0.prototype.addSubtree=function(e,t){let n=new qgt(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()};V0.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],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===o&&f.x===r&&f.y===s)return c.subtree}};V0.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=X7(r,0,0,0),c=this.find(o,a);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,h=u.y,m=u.level,g=-D.PI,A=+D.PI,_=D.lerp(g,A,o/2),C=D.lerp(g,A,(o+1)/2),y=-D.PI*.5,E=+D.PI*.5,I=0,x=0,S=!0;for(;S;){let v=1/(1<<m),P=(C-_)*v,N=_+f*P,L=(E-y)*v,p=y+h*L;I=(t-N)/P,x=(n-p)/L;let b=V0e(r,u,I,x,s);if(c.childSubtreeIsAvailableAtCoordinates(b)){let T=this.find(o,b);if(T!==void 0)c=T,u=c.implicitCoordinates,f=u.x,h=u.y,m=u.level;else return b}else S=!1}let w;for(let v=0;v<s;v++){let P=V0e(r,u,I,x,v);if(c.tileIsAvailableAtCoordinates(P))w=P;else break}return w};function V0e(e,t,n,i,o){let r=1<<o,s=D.clamp(n*r|0,0,r-1),a=D.clamp(i*r|0,0,r-1),c=X7(e,o,s,a);return t.getDescendantCoordinates(c)}V0.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var Z7=jm;function vy(e){e=e??V.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=P8(e.westIndices,o,t),this._southIndices=P8(e.southIndices,r,t),this._eastIndices=P8(e.eastIndices,o,t),this._northIndices=P8(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(vy.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 v8=[];function P8(e,t,n){v8.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)v8[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(v8.sort(t),Fe.createTypedArray(n,v8)):e}var W0e="createVerticesFromQuantizedTerrainMesh",Kgt=new qn(W0e),Jgt=new qn(W0e,Mu.maximumAsynchronousTasks);vy.prototype.createMesh=function(e){e=e??V.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,u=t.tileXYToRectangle(n,i,o),h=(a?Jgt:Kgt).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:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(h))return;let m=this;return Promise.resolve(h).then(function(g){let A=m._quantizedVertices.length/3,_=A+m._westIndices.length+m._southIndices.length+m._eastIndices.length+m._northIndices.length,C=Fe.createTypedArray(_,g.indices),y=new Float32Array(g.vertices),E=g.center,I=g.minimumHeight,x=g.maximumHeight,S=m._boundingSphere,w=m._orientedBoundingBox,v=d.clone(g.occludeePointInScaledSpace)??m._horizonOcclusionPoint,P=g.vertexStride,N=fr.clone(g.encoding);return m._mesh=new sc(E,y,C,g.indexCountWithoutSkirts,A,I,x,u,S,v,P,w,N,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),m._quantizedVertices=void 0,m._encodedNormals=void 0,m._indices=void 0,m._uValues=void 0,m._vValues=void 0,m._heightValues=void 0,m._westIndices=void 0,m._southIndices=void 0,m._eastIndices=void 0,m._northIndices=void 0,m._mesh})};var Xgt=new qn("upsampleQuantizedTerrainMesh",Mu.maximumAsynchronousTasks);vy.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),m=Xgt.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:u,childRectangle:h,ellipsoid:f});if(!l(m))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let A=c?g*.5:this._westSkirtHeight,_=u?g*.5:this._southSkirtHeight,C=c?this._eastSkirtHeight:g*.5,y=u?this._northSkirtHeight:g*.5,E=this._credits;return Promise.resolve(m).then(function(I){let x=new Uint16Array(I.vertices),S=Fe.createTypedArray(x.length/3,I.indices),w;return l(I.encodedNormals)&&(w=new Uint8Array(I.encodedNormals)),new vy({quantizedVertices:x,indices:S,encodedNormals:w,minimumHeight:I.minimumHeight,maximumHeight:I.maximumHeight,boundingSphere:le.clone(I.boundingSphere),orientedBoundingBox:$t.clone(I.orientedBoundingBox),horizonOcclusionPoint:d.clone(I.horizonOcclusionPoint),westIndices:I.westIndices,southIndices:I.southIndices,eastIndices:I.eastIndices,northIndices:I.northIndices,westSkirtHeight:A,southSkirtHeight:_,eastSkirtHeight:C,northSkirtHeight:y,childTileMask:0,credits:E,createdByUpsampling:!0})})};var $7=32767,j0e=new d;vy.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=$7;let o=D.clamp((n-e.south)/e.height,0,1);return o*=$7,l(this._mesh)?t_t(this,i,o):n_t(this,i,o)};function q0e(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),h=Math.max(i,r,a);return e>=c&&e<=u&&t>=f&&t<=h}var Zgt=new F,$gt=new F,e_t=new F;function t_t(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 u=s[a],f=s[a+1],h=s[a+2],m=r.decodeTextureCoordinates(o,u,Zgt),g=r.decodeTextureCoordinates(o,f,$gt),A=r.decodeTextureCoordinates(o,h,e_t);if(q0e(t,n,m.x,m.y,g.x,g.y,A.x,A.y)){let _=wA.computeBarycentricCoordinates(t,n,m.x,m.y,g.x,g.y,A.x,A.y,j0e);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){let C=r.decodeHeight(o,u),y=r.decodeHeight(o,f),E=r.decodeHeight(o,h);return _.x*C+_.y*y+_.z*E}}}}function n_t(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 u=s[a],f=s[a+1],h=s[a+2],m=i[u],g=i[f],A=i[h],_=o[u],C=o[f],y=o[h];if(q0e(t,n,m,_,g,C,A,y)){let E=wA.computeBarycentricCoordinates(t,n,m,_,g,C,A,y,j0e);if(E.x>=-1e-15&&E.y>=-1e-15&&E.z>=-1e-15){let I=E.x*r[u]+E.y*r[f]+E.z*r[h];return D.lerp(e._minimumHeight,e._maximumHeight,I/$7)}}}}vy.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};vy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var H0=vy;function i_t(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function J0e(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??te.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=[]}J0e.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 X0e(e,t,n){if(!t.format){let _="The tile format is not specified in the layer.json file.";throw e.previousError=qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}if(!t.tiles||t.tiles.length===0){let _="The layer.json file does not specify any tile URL templates.";throw e.previousError=qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}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 _=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Vi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Rs({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let _=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}if(e.levelZeroMaximumGeometricError=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let _=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}let f;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,m=t.available,g;if(l(m)&&!l(h)){g=new BA(e.tilingScheme,m.length);for(let _=0;_<m.length;++_){let C=m[_],y=e.tilingScheme.getNumberOfYTilesAtLevel(_);l(e.overallAvailability[_])||(e.overallAvailability[_]=[]);for(let E=0;E<C.length;++E){let I=C[E],x=y-I.endY-1,S=y-I.startY-1;e.overallAvailability[_].push([I.startX,x,I.endX,S]),g.addAvailableTileRange(_,I.startX,x,I.endX,S)}}}else l(h)&&(f=new BA(e.tilingScheme,u),g=new BA(e.tilingScheme,u),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 i_t({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let A=t.parentUrl;return l(A)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:A}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await nZ(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function o_t(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
${t.message}`),e.previousError=qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return nZ(e,n);throw new ue(i)}async function r_t(e,t,n){await X0e(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new BA(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 pt(e.attribution);e.tileCredits.push(o)}return!0}async function nZ(e,t){try{let n=await e.layerJsonResource.fetchJson();return r_t(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await X0e(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):o_t(e,n,t)}}function vA(e){e=e??V.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 _e;let t=e.credit;typeof t=="string"&&(t=new pt(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 eZ={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function K0e(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 s_t(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 a_t(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,A=3,_=Uint16Array.BYTES_PER_ELEMENT,C=_*A,y=new DataView(t),E=new d(y.getFloat64(a,!0),y.getFloat64(a+8,!0),y.getFloat64(a+16,!0));a+=f;let I=y.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let x=y.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=new le(new d(y.getFloat64(a,!0),y.getFloat64(a+8,!0),y.getFloat64(a+16,!0)),y.getFloat64(a+f,!0));a+=h;let w=new d(y.getFloat64(a,!0),y.getFloat64(a+8,!0),y.getFloat64(a+16,!0));a+=f;let v=y.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,v*3);a+=v*g,v>64*1024&&(_=Uint32Array.BYTES_PER_ELEMENT,C=_*A);let N=P.subarray(0,v),L=P.subarray(v,2*v),p=P.subarray(v*2,3*v);bn.zigZagDeltaDecode(N,L,p),a%_!==0&&(a+=_-a%_);let b=y.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let T=Fe.createTypedArrayFromArrayBuffer(v,t,a,b*A);a+=b*C;let B=0,R=T.length;for(let ne=0;ne<R;++ne){let Ce=T[ne];T[ne]=B-Ce,Ce===0&&++B}let O=y.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let U=Fe.createTypedArrayFromArrayBuffer(v,t,a,O);a+=O*_;let k=y.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=Fe.createTypedArrayFromArrayBuffer(v,t,a,k);a+=k*_;let Q=y.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Fe.createTypedArrayFromArrayBuffer(v,t,a,Q);a+=Q*_;let W=y.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Z=Fe.createTypedArrayFromArrayBuffer(v,t,a,W);a+=W*_;let Y,$;for(;a<y.byteLength;){let ne=y.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let Ce=y.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ne===eZ.OCT_VERTEX_NORMALS&&e._requestVertexNormals)Y=new Uint8Array(t,a,v*2);else if(ne===eZ.WATER_MASK&&e._requestWaterMask)$=new Uint8Array(t,a,Ce);else if(ne===eZ.METADATA&&e._requestMetadata){let ye=y.getUint32(a,!0);if(ye>0){let be=Ir(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ye).available;if(l(be))for(let Ne=0;Ne<be.length;++Ne){let ke=n+Ne+1,Ue=be[Ne],He=e._tilingScheme.getNumberOfYTilesAtLevel(ke);for(let Et=0;Et<Ue.length;++Et){let Ye=Ue[Et],nt=He-Ye.endY-1,Ct=He-Ye.startY-1;e.availability.addAvailableTileRange(ke,Ye.startX,nt,Ye.endX,Ct),r.availability.addAvailableTileRange(ke,Ye.startX,nt,Ye.endX,Ct)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=Ce}let K=e.getLevelMaximumGeometricError(n)*5,fe=e._tilingScheme.tileXYToRectangle(i,o,n),ge=$t.fromRectangle(fe,I,x,e._tilingScheme.ellipsoid);return new H0({center:E,minimumHeight:I,maximumHeight:x,boundingSphere:S,orientedBoundingBox:ge,horizonOcclusionPoint:w,quantizedVertices:P,encodedNormals:Y,indices:T,westIndices:U,southIndices:z,eastIndices:H,northIndices:Z,westSkirtHeight:K,southSkirtHeight:K,eastSkirtHeight:K,northSkirtHeight:K,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:$,credits:e._tileCredits})}vA.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 u=0;u<s;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let h=iZ(this,e,t,n,f,u===0);h.result&&(a=!0,c=c.then(()=>h.promise))}return!l(r)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):Z0e(this,e,t,n,r,i)};function Z0e(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ue("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 u,f,h=s[(t+a+i)%s.length],m=o.resource;l(m._ionEndpoint)&&!l(m._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=K0e(void 0)):u=K0e(c);let g=m.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(A){return l(A)?l(e._heightmapStructure)?s_t(e,A,i,t,n):a_t(e,A,i,t,n,o):Promise.reject(new ue("Mesh buffer doesn't exist."))})}Object.defineProperties(vA.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}}});vA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};vA.fromIonAssetId=async function(e,t){let n=await ss.fromAssetId(e);return vA.fromUrl(n,t)};vA.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Be.createIfNeeded(e);n.appendForwardSlash();let i=new J0e(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await nZ(i);let o=new vA(t);return i.build(o),o};vA.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(iZ(this,e,t,n,i[r],r===0).result)return;return!1};vA.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=iZ(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function tZ(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 iZ(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,u=o.availability,f=tZ(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let h;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,h=o.availabilityPromiseCache[s],!l(h))){let m=new pr({throttle:!1,throttleByServer:!0,type:Qs.TERRAIN});h=Z0e(e,f.x,f.y,f.level,o,m),l(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}f=tZ(o,f.x,f.y,f.level)}return{result:!1}}vA._getAvailabilityTile=tZ;var Y0=vA;function u_(e){e=e??V.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 Yl(n),this._workerName="createCircleGeometry"}u_.packedLength=Yl.packedLength;u_.pack=function(e,t,n){return Yl.pack(e._ellipseGeometry,t,n)};var $0e=new Yl({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Bc={center:new d,radius:void 0,ellipsoid:te.clone(te.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Re,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};u_.unpack=function(e,t,n){let i=Yl.unpack(e,t,$0e);return Bc.center=d.clone(i._center,Bc.center),Bc.ellipsoid=te.clone(i._ellipsoid,Bc.ellipsoid),Bc.ellipsoid=te.clone(i._ellipsoid,$0e._ellipsoid),Bc.height=i._height,Bc.extrudedHeight=i._extrudedHeight,Bc.granularity=i._granularity,Bc.vertexFormat=Re.clone(i._vertexFormat,Bc.vertexFormat),Bc.stRotation=i._stRotation,Bc.shadowVolume=i._shadowVolume,l(n)?(Bc.semiMajorAxis=i._semiMajorAxis,Bc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Yl(Bc),n):(Bc.radius=i._semiMajorAxis,new u_(Bc))};u_.createGeometry=function(e){return Yl.createGeometry(e._ellipseGeometry)};u_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new u_({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Re.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(u_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var oZ=u_;function xB(e){e=e??V.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 xf(n),this._workerName="createCircleOutlineGeometry"}xB.packedLength=xf.packedLength;xB.pack=function(e,t,n){return xf.pack(e._ellipseGeometry,t,n)};var c_t=new xf({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Nf={center:new d,radius:void 0,ellipsoid:te.clone(te.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};xB.unpack=function(e,t,n){let i=xf.unpack(e,t,c_t);return Nf.center=d.clone(i._center,Nf.center),Nf.ellipsoid=te.clone(i._ellipsoid,Nf.ellipsoid),Nf.height=i._height,Nf.extrudedHeight=i._extrudedHeight,Nf.granularity=i._granularity,Nf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Nf.semiMajorAxis=i._semiMajorAxis,Nf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new xf(Nf),n):(Nf.radius=i._semiMajorAxis,new xB(Nf))};xB.createGeometry=function(e){return xf.createGeometry(e._ellipseGeometry)};var rZ=xB;function TB(e){e=e??V.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Vi({ellipsoid:e.ellipsoid??te.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e;let n=e.credit;typeof n=="string"&&(n=new pt(n)),this._credit=n}Object.defineProperties(TB.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}}});TB.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})})};TB.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};TB.prototype.getTileDataAvailable=function(e,t,n){};TB.prototype.loadTileDataAvailability=function(e,t,n){};var sZ=TB;function ebe(e){this.proxy=e}ebe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var aZ=ebe;function SB(e){e=e??V.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Vi({ellipsoid:e.ellipsoid??te.default})),this._levelZeroMaximumGeometricError=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e}Object.defineProperties(SB.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(){}}});SB.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Sc({buffer:new Uint8Array(256),width:16,height:16}))};SB.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};SB.prototype.getTileDataAvailable=function(e,t,n){};SB.prototype.loadTileDataAvailability=function(e,t,n){};var qm=SB;function Km(e){e=e??V.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 Gs,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function cZ(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=M.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Km.prototype,{projectionMatrix:{get:function(){return cZ(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return cZ(this),this._infinitePerspective}}});var l_t=new d,u_t=new d,f_t=new d,d_t=new d;Km.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,u=this.far,f=d.cross(t,n,l_t),h=u_t;d.multiplyByScalar(t,c,h),d.add(e,h,h);let m=f_t;d.multiplyByScalar(t,u,m),d.add(e,m,m);let g=d_t;d.multiplyByScalar(f,a,g),d.add(h,g,g),d.subtract(g,e,g),d.normalize(g,g),d.cross(g,n,g),d.normalize(g,g);let A=i[0];return l(A)||(A=i[0]=new se),A.x=g.x,A.y=g.y,A.z=g.z,A.w=-d.dot(g,e),d.multiplyByScalar(f,s,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(n,g,g),d.normalize(g,g),A=i[1],l(A)||(A=i[1]=new se),A.x=g.x,A.y=g.y,A.z=g.z,A.w=-d.dot(g,e),d.multiplyByScalar(n,r,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(f,g,g),d.normalize(g,g),A=i[2],l(A)||(A=i[2]=new se),A.x=g.x,A.y=g.y,A.z=g.z,A.w=-d.dot(g,e),d.multiplyByScalar(n,o,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(g,f,g),d.normalize(g,g),A=i[3],l(A)||(A=i[3]=new se),A.x=g.x,A.y=g.y,A.z=g.z,A.w=-d.dot(g,e),A=i[4],l(A)||(A=i[4]=new se),A.x=t.x,A.y=t.y,A.z=t.z,A.w=-d.dot(t,h),d.negate(t,g),A=i[5],l(A)||(A=i[5]=new se),A.x=g.x,A.y=g.y,A.z=g.z,A.w=-d.dot(g,m),this._cullingVolume};Km.prototype.getPixelDimensions=function(e,t,n,i,o){cZ(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};Km.prototype.clone=function(e){return l(e)||(e=new Km),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};Km.prototype.equals=function(e){return l(e)&&e instanceof Km&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Km.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Km&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var Kl=Km;function Nu(e){e=e??V.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}Nu.packedLength=6;Nu.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};Nu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Nu),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 PA(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(Nu.prototype,{projectionMatrix:{get:function(){return PA(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return PA(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return PA(this),this._fovy}},sseDenominator:{get:function(){return PA(this),this._sseDenominator}},offCenterFrustum:{get:function(){return PA(this),this._offCenterFrustum}}});Nu.prototype.computeCullingVolume=function(e,t,n){return PA(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Nu.prototype.getPixelDimensions=function(e,t,n,i,o){return PA(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Nu.prototype.clone=function(e){return l(e)||(e=new Nu),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};Nu.prototype.equals=function(e){return!l(e)||!(e instanceof Nu)?!1:(PA(this),PA(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Nu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Nu)?!1:(PA(this),PA(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var ki=Nu;var R8=0,h_t=1;function W0(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Re.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof ki?(s=R8,a=ki.packedLength):t instanceof fn&&(s=h_t,a=fn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Qe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+d.packedLength+Qe.packedLength+Re.packedLength}W0.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===R8?(ki.pack(o,t,n),n+=ki.packedLength):(fn.pack(o,t,n),n+=fn.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Qe.pack(e._orientation,t,n),n+=Qe.packedLength,Re.pack(e._vertexFormat,t,n),n+=Re.packedLength,t[n]=e._drawNearPlane?1:0,t};var A_t=new ki,m_t=new fn,p_t=new Qe,g_t=new d,__t=new Re;W0.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===R8?(o=ki.unpack(e,t,A_t),t+=ki.packedLength):(o=fn.unpack(e,t,m_t),t+=fn.packedLength);let r=d.unpack(e,t,g_t);t+=d.packedLength;let s=Qe.unpack(e,t,p_t);t+=Qe.packedLength;let a=Re.unpack(e,t,__t);t+=Re.packedLength;let c=e[t]===1;if(!l(n))return new W0({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Qe.clone(s,n._orientation),n._vertexFormat=Re.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function BB(e,t,n,i,o,r,s,a){let c=e/3*2;for(let u=0;u<4;++u)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 C_t=new X,y_t=new M,lZ=new M,tbe=new d,nbe=new d,ibe=new d,E_t=new d,I_t=new d,b_t=new d,Py=new Array(3),l2=new Array(4);l2[0]=new se(-1,-1,1,1);l2[1]=new se(1,-1,1,1);l2[2]=new se(1,1,1,1);l2[3]=new se(-1,1,1,1);var obe=new Array(4);for(let e=0;e<4;++e)obe[e]=new se;W0._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=X.fromQuaternion(t,C_t),u=r??tbe,f=s??nbe,h=a??ibe;u=X.getColumn(c,0,u),f=X.getColumn(c,1,f),h=X.getColumn(c,2,h),d.normalize(u,u),d.normalize(f,f),d.normalize(h,h),d.negate(u,u);let m=M.computeView(e,h,f,u,y_t),g,A,_=i.projectionMatrix;if(n===R8){let C=M.multiply(_,m,lZ);A=M.inverse(C,lZ)}else g=M.inverseTransformation(m,lZ);l(A)?(Py[0]=i.near,Py[1]=i.far):(Py[0]=0,Py[1]=i.near,Py[2]=i.far);for(let C=0;C<2;++C)for(let y=0;y<4;++y){let E=se.clone(l2[y],obe[y]);if(l(A)){E=M.multiplyByVector(A,E,E);let I=1/E.w;d.multiplyByScalar(E,I,E),d.subtract(E,e,E),d.normalize(E,E);let x=d.dot(h,E);d.multiplyByScalar(E,Py[C]/x,E),d.add(E,e,E)}else{let I=i.offCenterFrustum;l(I)&&(i=I);let x=Py[C],S=Py[C+1];E.x=(E.x*(i.right-i.left)+i.left+i.right)*.5,E.y=(E.y*(i.top-i.bottom)+i.bottom+i.top)*.5,E.z=(E.z*(x-S)-x-S)*.5,E.w=1,M.multiplyByVector(g,E,E)}o[12*C+y*3]=E.x,o[12*C+y*3+1]=E.y,o[12*C+y*3+2]=E.z}};W0.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);W0._computeNearFarPlanes(i,o,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],r||(c=c.subarray(12));let f=new pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let m=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(12*a):void 0,A=l(s.bitangent)?new Float32Array(12*a):void 0,_=l(s.st)?new Float32Array(8*a):void 0,C=tbe,y=nbe,E=ibe,I=d.negate(C,E_t),x=d.negate(y,I_t),S=d.negate(E,b_t);u=0,r&&(BB(u,m,g,A,_,S,C,y),u+=12),BB(u,m,g,A,_,E,I,y),u+=12,BB(u,m,g,A,_,I,S,y),u+=12,BB(u,m,g,A,_,x,S,I),u+=12,BB(u,m,g,A,_,C,E,y),u+=12,BB(u,m,g,A,_,y,E,I),l(m)&&(f.normal=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:m})),l(g)&&(f.tangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),l(A)&&(f.bitangent=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:A})),l(_)&&(f.st=new ve({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:_}))}let h=new Uint16Array(6*a);for(let m=0;m<a;++m){let g=m*6,A=m*4;h[g]=A,h[g+1]=A+1,h[g+2]=A+2,h[g+3]=A,h[g+4]=A+2,h[g+5]=A+3}return new ht({attributes:f,indices:h,primitiveType:Pe.TRIANGLES,boundingSphere:le.fromVertices(c)})};var j0=W0;var uZ=0,x_t=1;function u2(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof ki?(r=uZ,s=ki.packedLength):t instanceof fn&&(r=x_t,s=fn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Qe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+d.packedLength+Qe.packedLength}u2.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===uZ?(ki.pack(o,t,n),n+=ki.packedLength):(fn.pack(o,t,n),n+=fn.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Qe.pack(e._orientation,t,n),n+=Qe.packedLength,t[n]=e._drawNearPlane?1:0,t};var T_t=new ki,S_t=new fn,B_t=new Qe,w_t=new d;u2.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===uZ?(o=ki.unpack(e,t,T_t),t+=ki.packedLength):(o=fn.unpack(e,t,S_t),t+=fn.packedLength);let r=d.unpack(e,t,w_t);t+=d.packedLength;let s=Qe.unpack(e,t,B_t);t+=Qe.packedLength;let a=e[t]===1;if(!l(n))return new u2({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=d.clone(r,n._origin),n._orientation=Qe.clone(s,n._orientation),n._drawNearPlane=a,n};u2.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(24);j0._computeNearFarPlanes(i,o,t,n,s);let a=new pn({position:new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=r?2:1,h=new Uint16Array(8*(f+1)),m=r?0:1;for(;m<2;++m)c=r?m*8:0,u=m*4,h[c]=u,h[c+1]=u+1,h[c+2]=u+1,h[c+3]=u+2,h[c+4]=u+2,h[c+5]=u+3,h[c+6]=u+3,h[c+7]=u;for(m=0;m<2;++m)c=(f+m)*8,u=m*4,h[c]=u,h[c+1]=u+4,h[c+2]=u+1,h[c+3]=u+5,h[c+4]=u+2,h[c+5]=u+6,h[c+6]=u+3,h[c+7]=u+7;return new ht({attributes:a,indices:h,primitiveType:Pe.LINES,boundingSphere:le.fromVertices(s)})};var f2=u2;var D_t={SEARCH:0,AUTOCOMPLETE:1},Ry=Object.freeze(D_t);function M8(){Ae.throwInstantiationError()}Object.defineProperties(M8.prototype,{credit:{get:Ae.throwInstantiationError}});M8.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(pt.getIonCredit)};M8.prototype.geocode=Ae.throwInstantiationError;var wB=M8;function rbe(){Ae.throwInstantiationError()}rbe.createGeometry=function(e){Ae.throwInstantiationError()};var fZ=rbe;var L_t=mr(dZ(),1);function v_t(e,t){return(e&t)!==0}var il=v_t;var P_t=[1,2,4,8],sbe=15,R_t=16,M_t=64,N_t=128;function Jm(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}Jm.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 Jm(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Jm.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Jm.prototype.hasSubtree=function(){return il(this._bits,R_t)};Jm.prototype.hasImagery=function(){return il(this._bits,M_t)};Jm.prototype.hasTerrain=function(){return il(this._bits,N_t)};Jm.prototype.hasChildren=function(){return il(this._bits,sbe)};Jm.prototype.hasChild=function(e){return il(this._bits,P_t[e])};Jm.prototype.getChildBitmask=function(){return this._bits&sbe};var d2=Jm;function O_t(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 F_t=O_t(`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 Lf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Lf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Lf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Be)&&(t=e.url);let n=Be.createIfNeeded(t);n.appendForwardSlash();let i=new Lf;i._resource=n;try{await Q_t(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${cbe(i,"",1).url}: ${o}`;throw new ue(r)}return i};Lf.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;il(t,r)?il(e,r)&&(s|=1):(s|=2,il(e,r)||(s|=1)),i+=s}return i};Lf.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];il(s,2)?il(s,1)||(t|=r):(n|=r,il(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Lf.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 abe=new qn("decodeGoogleEarthEnterprisePacket");Lf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=cbe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return abe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,h=-1;if(e!==""){h=e.length+1;let A=u[e];f=r[e],f._bits|=A._bits,delete u[e]}let m=Object.keys(u);m.sort(function(A,_){return A.length-_.length});let g=m.length;for(let A=0;A<g;++A){let _=m[A];if(u[_]!==null){let y=d2.clone(u[_]),E=_.length;if(E===h)y.setParent(f);else if(E>1){let I=r[_.substring(0,_.length-1)];y.setParent(I)}r[_]=y}else r[_]=null}})})};Lf.prototype.populateSubtree=function(e,t,n,i){let o=Lf.tileXYToQuadKey(e,t,n);return mZ(this,o,i)};function mZ(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}),mZ(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ue(`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}),mZ(e,t,s)}).finally(function(){delete a[o]})}Lf.prototype.getTileInformation=function(e,t,n){let i=Lf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Lf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function cbe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var hZ,AZ;function Q_t(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(AZ)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;AZ=rE(n).then(function(){hZ=window.cesiumGoogleEarthDbRootParser(L_t),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return AZ.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=hZ.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 abe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=hZ.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],u=c.copyrightString;l(u)&&(o[c.providerId]=new pt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=F_t})}var f_=Lf;function q0(e){e=e??V.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(q0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var fbe="createVerticesFromGoogleEarthEnterpriseBuffer",k_t=new qn(fbe),U_t=new qn(fbe,Mu.maximumAsynchronousTasks),lbe=new ce,N8=new ce;q0.prototype.createMesh=function(e){e=e??V.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,lbe),t.tileXYToRectangle(n,i,o,N8);let u=c.cartographicToCartesian(ce.center(N8)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?U_t:k_t).scheduleTask({buffer:this._buffer,nativeRectangle:lbe,rectangle:N8,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let A=this;return g.then(function(_){return A._mesh=new sc(u,new Float32Array(_.vertices),new Uint16Array(_.indices),_.indexCountWithoutSkirts,_.vertexCountWithoutSkirts,_.minimumHeight,_.maximumHeight,N8,le.clone(_.boundingSphere3D),d.clone(_.occludeePointInScaledSpace),_.numberOfAttributes,$t.clone(_.orientedBoundingBox),fr.clone(_.encoding),_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),A._minimumHeight=_.minimumHeight,A._maximumHeight=_.maximumHeight,A._buffer=void 0,A._mesh})};q0.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),o=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?Y_t(this,i,o):q_t(this,i,o,e)};var G_t=new qn("upsampleQuantizedTerrainMesh",Mu.maximumAsynchronousTasks);q0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),m=G_t.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:u,childRectangle:h,ellipsoid:f});if(!l(m))return;let g=this;return m.then(function(A){let _=new Uint16Array(A.vertices),C=Fe.createTypedArray(_.length/3,A.indices),y=g._skirtHeight;return new H0({quantizedVertices:_,indices:C,minimumHeight:A.minimumHeight,maximumHeight:A.maximumHeight,boundingSphere:le.clone(A.boundingSphere),orientedBoundingBox:$t.clone(A.orientedBoundingBox),horizonOcclusionPoint:d.clone(A.horizonOcclusionPoint),westIndices:A.westIndices,southIndices:A.southIndices,eastIndices:A.eastIndices,northIndices:A.northIndices,westSkirtHeight:y,southSkirtHeight:y,eastSkirtHeight:y,northSkirtHeight:y,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};q0.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};q0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var z_t=new F,V_t=new F,H_t=new F,dbe=new d;function Y_t(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 u=s[a],f=s[a+1],h=s[a+2],m=r.decodeTextureCoordinates(o,u,z_t),g=r.decodeTextureCoordinates(o,f,V_t),A=r.decodeTextureCoordinates(o,h,H_t),_=wA.computeBarycentricCoordinates(t,n,m.x,m.y,g.x,g.y,A.x,A.y,dbe);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){let C=r.decodeHeight(o,u),y=r.decodeHeight(o,f),E=r.decodeHeight(o,h);return _.x*C+_.y*y+_.z*E}}}var W_t=Uint16Array.BYTES_PER_ELEMENT,ube=Uint32Array.BYTES_PER_ELEMENT,pZ=Int32Array.BYTES_PER_ELEMENT,j_t=Float32Array.BYTES_PER_ELEMENT,gZ=Float64Array.BYTES_PER_ELEMENT;function q_t(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),u=0;for(let S=0;S<r;++S)u+=c.getUint32(u,!0),u+=ube;u+=ube,u+=2*gZ;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=gZ;let h=D.toRadians(c.getFloat64(u,!0)*180);u+=gZ;let m=i.width/f/2,g=i.height/h/2,A=c.getInt32(u,!0);u+=pZ;let _=c.getInt32(u,!0)*3;u+=pZ,u+=pZ;let C=new Array(A),y=new Array(A),E=new Array(A),I;for(I=0;I<A;++I)C[I]=s+c.getUint8(u++)*m,y[I]=a+c.getUint8(u++)*g,E[I]=c.getFloat32(u,!0)*6371010,u+=j_t;let x=new Array(_);for(I=0;I<_;++I)x[I]=c.getUint16(u,!0),u+=W_t;for(I=0;I<_;I+=3){let S=x[I],w=x[I+1],v=x[I+2],P=C[S],N=C[w],L=C[v],p=y[S],b=y[w],T=y[v],B=wA.computeBarycentricCoordinates(t,n,P,p,N,b,L,T,dbe);if(B.x>=-1e-15&&B.y>=-1e-15&&B.z>=-1e-15)return B.x*E[S]+B.y*E[w]+B.z*E[v]}}var DB=q0;var Kd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},L8=new J;function O8(){this._terrainCache={},this._lastTidy=J.now()}O8.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:J.now()}};O8.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};O8.prototype.tidy=function(){if(J.now(L8),J.secondsDifference(L8,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(L8,r.timestamp)>10&&delete e[o]}J.clone(L8,this._lastTidy)}};function My(e){e=e??V.EMPTY_OBJECT,this._tilingScheme=new Vi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new pt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new O8,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new _e}Object.defineProperties(My.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(){}}});My.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ue(`The server ${e.url} doesn't have terrain`);let n=new My(t);return n._metadata=e,n};var K_t=new qn("decodeGoogleEarthEnterprisePacket");function hbe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Kd.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}My.prototype.requestTileGeometry=function(e,t,n,i){let o=f_.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new ue("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Kd.UNKNOWN);let u=r.get(o);if(l(u)){let y=s.providers[a.terrainProvider];return Promise.resolve(new DB({buffer:u,childTileMask:hbe(o,a,s),credits:l(y)?[y]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Kd.NONE)return Promise.reject(new ue("Terrain tile doesn't exist"))}else return Promise.resolve(new Sc({buffer:new Uint8Array(256),width:16,height:16}));let f,h=o,m=-1;switch(c){case Kd.SELF:m=a.terrainVersion;break;case Kd.PARENT:h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),m=f.terrainVersion;break;case Kd.UNKNOWN:a.hasTerrain()?m=a.terrainVersion:(h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),l(f)&&f.hasTerrain()&&(m=f.terrainVersion));break}if(m<0)return Promise.reject(new ue("Terrain tile doesn't exist"));let g=this._terrainPromises,A=this._terrainRequests,_,C;if(l(g[h]))_=g[h],C=A[h];else{C=i;let y=J_t(this,h,m,C).fetchArrayBuffer();if(!l(y))return;_=y.then(function(E){return l(E)?K_t.scheduleTask({buffer:E,type:"Terrain",key:s.key},[E]).then(function(I){let x=s.getTileInformationFromQuadKey(h);x.terrainState=Kd.SELF,r.add(h,I[0]);let S=x.terrainProvider,w=I.length-1;for(let v=0;v<w;++v){let P=h+v.toString(),N=s.getTileInformationFromQuadKey(P);l(N)&&(r.add(P,I[v+1]),N.terrainState=Kd.PARENT,N.terrainProvider===0&&(N.terrainProvider=S))}}):Promise.reject(new ue("Failed to load terrain."))}),g[h]=_,A[h]=C,_=_.finally(function(){delete g[h],delete A[h]})}return _.then(function(){let y=r.get(o);if(l(y)){let E=s.providers[a.terrainProvider];return new DB({buffer:y,childTileMask:hbe(o,a,s),credits:l(E)?[E]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ue("Failed to load terrain."))}).catch(function(y){return C.state===hi.CANCELLED?(i.state=C.state,Promise.reject(y)):(a.terrainState=Kd.NONE,Promise.reject(y))})};My.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};My.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=f_.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===Kd.NONE)return!1;if((!l(s)||s===Kd.UNKNOWN)&&(r.terrainState=Kd.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:Qs.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};My.prototype.loadTileDataAvailability=function(e,t,n){};function J_t(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 _Z=My;var X_t="https://maps.googleapis.com/maps/api/geocode/json",Abe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function CZ(e){e=e??V.EMPTY_OBJECT;let t=e.key;this._resource=new Be({url:X_t,queryParameters:{key:t}}),this._credit=new pt(Abe,!0)}Object.defineProperties(CZ.prototype,{credit:{get:function(){return this._credit}}});CZ.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 ue(`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:ce.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:Abe,collapsible:!1}}})};var yZ=CZ;var qs={};qs.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});qs.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});qs.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});qs.defaultAccessToken=void 0;qs.defaultShareKey=void 0;qs._getAuthorizationHeader=function(){return l(qs.defaultShareKey)?`Basic ${qs.defaultShareKey}`:`Bearer ${qs.defaultAccessToken}`};qs.apiEndpoint=new Be({url:"https://api.bentley.com"});qs.getExports=async function(e,t){let n=new Be({url:`${qs.apiEndpoint}mesh-export`,headers:{Authorization:qs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:qs.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 ue(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ue("Not allowed, forbidden");if(i.statusCode===422)throw new ue(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ue("Too many requests")}throw new ue(`Unknown request failure ${i.statusCode}`)}};qs.getRealityDataMetadata=async function(e,t){let n=new Be({url:`${qs.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:qs._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 ue(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ue("Not allowed, forbidden");if(i.statusCode===404)throw new ue(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ue(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ue("Too many requests")}throw new ue(`Unknown request failure ${i.statusCode}`)}};qs.getRealityDataURL=async function(e,t,n){let i=new Be({url:`${qs.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:qs._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 ue(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ue("Not allowed, forbidden");if(o.statusCode===404)throw new ue(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ue(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ue("Too many requests")}throw new ue(`Unknown request failure ${o.statusCode}`)}};var fa=qs;function Z_t(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var h2=Z_t;var wbe={},$_t=32.184,eCt=2451545,mbe=-.0529921,pbe=-.1059842,gbe=13.0120009,_be=13.3407154,Cbe=.9856003,ybe=26.4057084,Ebe=13.064993,Ibe=.3287146,bbe=1.7484877,xbe=-.1589763,Tbe=.0036096,Sbe=.1643573,Bbe=12.9590088,EZ=new J;wbe.ComputeMoon=function(e,t){l(e)||(e=J.now()),EZ=J.addSeconds(e,$_t,EZ);let n=J.totalDays(EZ)-eCt,i=n/ri.DAYS_PER_JULIAN_CENTURY,o=(125.045+mbe*n)*D.RADIANS_PER_DEGREE,r=(250.089+pbe*n)*D.RADIANS_PER_DEGREE,s=(260.008+gbe*n)*D.RADIANS_PER_DEGREE,a=(176.625+_be*n)*D.RADIANS_PER_DEGREE,c=(357.529+Cbe*n)*D.RADIANS_PER_DEGREE,u=(311.589+ybe*n)*D.RADIANS_PER_DEGREE,f=(134.963+Ebe*n)*D.RADIANS_PER_DEGREE,h=(276.617+Ibe*n)*D.RADIANS_PER_DEGREE,m=(34.226+bbe*n)*D.RADIANS_PER_DEGREE,g=(15.134+xbe*n)*D.RADIANS_PER_DEGREE,A=(119.743+Tbe*n)*D.RADIANS_PER_DEGREE,_=(239.961+Sbe*n)*D.RADIANS_PER_DEGREE,C=(25.053+Bbe*n)*D.RADIANS_PER_DEGREE,y=Math.sin(o),E=Math.sin(r),I=Math.sin(s),x=Math.sin(a),S=Math.sin(c),w=Math.sin(u),v=Math.sin(f),P=Math.sin(h),N=Math.sin(m),L=Math.sin(g),p=Math.sin(A),b=Math.sin(_),T=Math.sin(C),B=Math.cos(o),R=Math.cos(r),O=Math.cos(s),U=Math.cos(a),k=Math.cos(c),z=Math.cos(u),Q=Math.cos(f),H=Math.cos(h),W=Math.cos(m),Z=Math.cos(g),Y=Math.cos(A),$=Math.cos(_),K=Math.cos(C),fe=(269.9949+.0031*i-3.8787*y-.1204*E+.07*I-.0172*x+.0072*w-.0052*L+.0043*T)*D.RADIANS_PER_DEGREE,ge=(66.5392+.013*i+1.5419*B+.0239*R-.0278*O+.0068*U-.0029*z+9e-4*Q+8e-4*Z-9e-4*K)*D.RADIANS_PER_DEGREE,ne=(38.3213+13.17635815*n-14e-13*n*n+3.561*y+.1208*E-.0642*I+.0158*x+.0252*S-.0066*w-.0047*v-.0046*P+.0028*N+.0052*L+.004*p+.0019*b-.0044*T)*D.RADIANS_PER_DEGREE,Ce=(13.17635815-14e-13*(2*n)+3.561*B*mbe+.1208*R*pbe-.0642*O*gbe+.0158*U*_be+.0252*k*Cbe-.0066*z*ybe-.0047*Q*Ebe-.0046*H*Ibe+.0028*W*bbe+.0052*Z*xbe+.004*Y*Tbe+.0019*$*Sbe-.0044*K*Bbe)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new h2),t.rightAscension=fe,t.declination=ge,t.rotation=ne,t.rotationRate=Ce,t};var A2=wbe;function Dbe(e){(!l(e)||typeof e!="function")&&(e=A2.ComputeMoon),this._computeFunction=e}var tCt=new d,nCt=new d,iCt=new d;function oCt(e,t,n){let i=tCt;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=iCt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=d.cross(r,i,nCt);return l(n)||(n=new X),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 rCt=new X,sCt=new Qe;Dbe.prototype.evaluate=function(e,t){l(e)||(e=J.now());let n=this._computeFunction(e),i=oCt(n.rightAscension,n.declination,t),o=D.zeroToTwoPi(n.rotation),r=Qe.fromAxisAngle(d.UNIT_Z,o,sCt),s=X.fromQuaternion(Qe.conjugate(r,r),rCt);return X.multiply(s,i,i)};var m2=Dbe;var p2={};p2.type=void 0;p2.getRequiredDataPoints=Ae.throwInstantiationError;p2.interpolateOrderZero=Ae.throwInstantiationError;p2.interpolate=Ae.throwInstantiationError;var IZ=p2;var aCt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},d_=Object.freeze(aCt);function bZ(e){this._url=Be.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(bZ.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});bZ.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Ry.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=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=d.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var g2=bZ;function cCt(e){if(!Object.values(d_).some(t=>t===e))throw new Ae(`Invalid geocodeProviderType: "${e}"`)}var vbe=Object.freeze({[d_.GOOGLE]:"google",[d_.BING]:"bing",[d_.DEFAULT]:void 0});function lCt(e){return vbe[e]}function uCt(e){return Object.entries(vbe).find(t=>t[1]===e)[0]}function xZ(e){e=e??V.EMPTY_OBJECT;let t=e.geocodeProviderType??d_.DEFAULT,n=e.accessToken??Rh.defaultAccessToken,i=Be.createIfNeeded(e.server??Rh.defaultServer);i.appendForwardSlash();let o=Rh.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(pt.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 g2(r),this.geocodeProviderType=t}Object.defineProperties(xZ.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return uCt(this._pelias.url.queryParameters.geocoder)},set:function(e){cCt(e);let t={...this._pelias.url.queryParameters,geocoder:lCt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});xZ.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var K0=xZ;var fCt={SHIFT:0,CTRL:1,ALT:2},Na=Object.freeze(fCt);function F8(){Ae.throwInstantiationError()}Object.defineProperties(F8.prototype,{ellipsoid:{get:Ae.throwInstantiationError}});F8.prototype.project=Ae.throwInstantiationError;F8.prototype.unproject=Ae.throwInstantiationError;var TZ=F8;function vB(e){e=e??V.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(vB.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});vB.prototype.findTimeInterval=Io.prototype.findTimeInterval;vB.prototype.wrapTime=Io.prototype.wrapTime;vB.prototype.clampTime=Io.prototype.clampTime;vB.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 SZ=vB;var dCt={NONE:-1,PARTIAL:0,FULL:1},Vr=Object.freeze(dCt);function ol(e,t){this._occluderPosition=d.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 Q8=new d;Object.defineProperties(ol.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=d.clone(e,this._cameraPosition);let t=d.subtract(this._occluderPosition,e,Q8),n=d.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=d.multiplyByScalar(t,n,Q8);let a=o*o*n;s=d.add(e,d.multiplyByScalar(r,a,Q8),Q8)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});ol.fromBoundingSphere=function(e,t,n){return l(n)?(d.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new ol(e,t)};var Rbe=new d;ol.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=d.subtract(e,this._occluderPosition,Rbe),n=this._occluderRadius;if(n=d.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=d.subtract(e,this._cameraPosition,t),n*n>d.magnitudeSquared(t)}return!1};var hCt=new d;ol.prototype.isBoundingSphereVisible=function(e){let t=d.clone(e.center,hCt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,Rbe),o=this._occluderRadius-n;if(o=d.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i),o*o+n*n>d.magnitudeSquared(i)):!1;if(o>0){i=d.subtract(t,this._cameraPosition,i);let r=d.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 ACt=new d;ol.prototype.computeVisibility=function(e){let t=d.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Vr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,ACt),o=this._occluderRadius-n,r=d.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i);let s=d.magnitudeSquared(i);return o*o+n*n<s?Vr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Vr.FULL:Vr.PARTIAL):(i=d.subtract(t,this._horizonPlanePosition,i),d.dot(i,this._horizonPlaneNormal)>-n?Vr.PARTIAL:Vr.FULL))}}return Vr.NONE};var k8=new d;ol.computeOccludeePoint=function(e,t,n){let i=d.clone(t),o=d.clone(e.center),r=e.radius,s=n.length,a=d.normalize(d.subtract(i,o,k8),k8),c=-d.dot(a,o),u=ol._anyRotationVector(o,a,c),f=ol._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let h;for(let g=1;g<s;++g){if(h=ol._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!h)return;h<f&&(f=h)}if(f<.0017453283658983088)return;let m=r/f;return d.add(o,d.multiplyByScalar(a,m,k8),k8)};var mCt=[];ol.computeOccludeePointFromRectangle=function(e,t){t=t??te.default;let n=ce.subsample(e,t,0,mCt),i=le.fromPoints(n),o=d.ZERO;if(!d.equals(o,i.center))return ol.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var pCt=new d;ol._anyRotationVector=function(e,t,n){let i=d.abs(t,pCt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new d,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=d.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=d.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=d.UNIT_Z);let a=(d.dot(t,i)+n)/-d.dot(t,s);return d.normalize(d.subtract(d.add(i,d.multiplyByScalar(s,a,r),i),e,i),i)};var gCt=new d;ol._rotationVector=function(e,t,n,i,o){let r=d.subtract(i,e,gCt);if(r=d.normalize(r,r),d.dot(t,r)<.9999999847691291){let s=d.cross(t,r,r);if(d.magnitude(s)>D.EPSILON13)return d.normalize(s,new d)}return o};var BZ=new d,_Ct=new d,U8=new d,Pbe=new d;ol._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=d.clone(o,BZ),s=d.clone(e.center,_Ct),a=e.radius,c=d.subtract(s,r,U8),u=d.magnitudeSquared(c),f=a*a;if(u<f)return!1;let h=u-f,m=Math.sqrt(h),A=1/Math.sqrt(u),C=m*A*m;c=d.normalize(c,c);let y=d.add(r,d.multiplyByScalar(c,C,Pbe),Pbe),E=Math.sqrt(h-C*C),I=this._rotationVector(s,t,n,r,i),x=d.fromElements(I.x*I.x*c.x+(I.x*I.y-I.z)*c.y+(I.x*I.z+I.y)*c.z,(I.x*I.y+I.z)*c.x+I.y*I.y*c.y+(I.y*I.z-I.x)*c.z,(I.x*I.z-I.y)*c.x+(I.y*I.z+I.x)*c.y+I.z*I.z*c.z,BZ);x=d.normalize(x,x);let S=d.multiplyByScalar(x,E,BZ);I=d.normalize(d.subtract(d.add(y,S,U8),s,U8),U8);let w=d.dot(t,I);I=d.normalize(d.subtract(d.subtract(y,S,I),s,I),I);let v=d.dot(t,I);return w<v?w:v};var _2=ol;function wZ(e,t,n){e=Be.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new pt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(wZ.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});wZ.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:St(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=d.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var DZ=wZ;var CCt={packedLength:void 0,pack:Ae.throwInstantiationError,unpack:Ae.throwInstantiationError},vZ=CCt;var yCt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:Ae.throwInstantiationError,unpackInterpolationResult:Ae.throwInstantiationError},PZ=yCt;function Mbe(){Ae.throwInstantiationError()}Mbe.prototype.getURL=Ae.throwInstantiationError;var RZ=Mbe;var ECt={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},Sn=Object.freeze(ECt);function Ny(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 QZ(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function J0(e){if(e.shiftKey)return Na.SHIFT;if(e.ctrlKey)return Na.CTRL;if(e.altKey)return Na.ALT}var Es={LEFT:0,MIDDLE:1,RIGHT:2};function Of(e,t,n,i){function o(r){i(e,r)}zt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function ICt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;zt.supportsPointerEvents()?(Of(e,"pointerdown",t,wCt),Of(e,"pointerup",t,Vbe),Of(e,"pointermove",t,DCt),Of(e,"pointercancel",t,Vbe)):(Of(e,"mousedown",t,Hbe),Of(e,"mouseup",n,Ybe),Of(e,"mousemove",n,Wbe),Of(e,"touchstart",t,SCt),Of(e,"touchend",n,Qbe),Of(e,"touchmove",n,BCt),Of(e,"touchcancel",n,Qbe)),Of(e,"dblclick",t,xCt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Of(e,i,t,TCt)}function bCt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var Nbe={position:new F};function kZ(e){e._lastSeenTouchEvent=Oi()}function UZ(e){return Oi()-e._lastSeenTouchEvent>RA.mouseEmulationIgnoreMilliseconds}function FZ(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function Hbe(e,t){if(!UZ(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Es.LEFT)i=Sn.LEFT_DOWN;else if(n===Es.MIDDLE)i=Sn.MIDDLE_DOWN;else if(n===Es.RIGHT)i=Sn.RIGHT_DOWN;else return;let o=Ny(e,t,e._primaryPosition);F.clone(o,e._primaryStartPosition),F.clone(o,e._primaryPreviousPosition);let r=J0(t),s=e.getInputAction(i,r);l(s)&&(F.clone(o,Nbe.position),s(Nbe),t.preventDefault())}var Lbe={position:new F},Obe={position:new F};function MZ(e,t,n,i){let o=J0(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=Ny(e,i,e._primaryPosition);if(l(r)&&(F.clone(a,Lbe.position),r(Lbe)),l(s)){let c=e._primaryStartPosition;FZ(c,a,e._clickPixelTolerance)&&(F.clone(a,Obe.position),s(Obe))}}}function Ybe(e,t){if(!UZ(e))return;let n=t.button;n!==Es.LEFT&&n!==Es.MIDDLE&&n!==Es.RIGHT||(e._buttonDown[Es.LEFT]&&(MZ(e,Sn.LEFT_UP,Sn.LEFT_CLICK,t),e._buttonDown[Es.LEFT]=!1),e._buttonDown[Es.MIDDLE]&&(MZ(e,Sn.MIDDLE_UP,Sn.MIDDLE_CLICK,t),e._buttonDown[Es.MIDDLE]=!1),e._buttonDown[Es.RIGHT]&&(MZ(e,Sn.RIGHT_UP,Sn.RIGHT_CLICK,t),e._buttonDown[Es.RIGHT]=!1))}var NZ={startPosition:new F,endPosition:new F};function Wbe(e,t){if(!UZ(e))return;let n=J0(t),i=Ny(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Sn.MOUSE_MOVE,n);l(r)&&(F.clone(o,NZ.startPosition),F.clone(i,NZ.endPosition),r(NZ)),F.clone(i,o),(e._buttonDown[Es.LEFT]||e._buttonDown[Es.MIDDLE]||e._buttonDown[Es.RIGHT])&&t.preventDefault()}var Fbe={position:new F};function xCt(e,t){let n=t.button,i;if(n===Es.LEFT)i=Sn.LEFT_DOUBLE_CLICK;else return;let o=J0(t),r=e.getInputAction(i,o);l(r)&&(Ny(e,t,Fbe.position),r(Fbe))}function TCt(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=J0(t),o=e.getInputAction(Sn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function SCt(e,t){kZ(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,Ny(e,r,new F));G8(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,F.clone(a.get(s)))}function Qbe(e,t){kZ(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);G8(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var kbe={position:new F},LZ={position1:new F,position2:new F},Ube={position:new F},Gbe={position:new F},zbe={position:new F};function G8(e,t){let n=J0(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Es.LEFT]){if(e._buttonDown[Es.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Sn.LEFT_UP,n),l(r)&&(F.clone(e._primaryPosition,Ube.position),r(Ube)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Sn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];FZ(c,u,e._clickPixelTolerance)&&(F.clone(e._primaryPosition,Gbe.position),s(Gbe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Sn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];F.clone(c,e._primaryPosition),F.clone(c,e._primaryStartPosition),F.clone(c,e._primaryPreviousPosition),e._buttonDown[Es.LEFT]=!0,r=e.getInputAction(Sn.LEFT_DOWN,n),l(r)&&(F.clone(c,kbe.position),r(kbe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Sn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];FZ(u,f,e._holdPixelTolerance)&&(F.clone(e._primaryPosition,zbe.position),s(zbe))}},RA.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Sn.PINCH_START,n),l(r)&&(F.clone(i.values[0],LZ.position1),F.clone(i.values[1],LZ.position2),r(LZ),t.preventDefault()))}function BCt(e,t){kZ(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 u=a.get(s);l(u)&&Ny(e,r,u)}jbe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,F.clone(a.get(s),c.get(s))}var OZ={startPosition:new F,endPosition:new F},C2={distance:{startPosition:new F,endPosition:new F},angleAndHeight:{startPosition:new F,endPosition:new F}};function jbe(e,t){let n=J0(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Es.LEFT]){let a=i.values[0];F.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Sn.MOUSE_MOVE,n),l(s)&&(F.clone(c,OZ.startPosition),F.clone(a,OZ.endPosition),s(OZ)),F.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Sn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],h=c.x-a.x,m=c.y-a.y,g=Math.sqrt(h*h+m*m)*.25,A=f.x-u.x,_=f.y-u.y,C=Math.sqrt(A*A+_*_)*.25,y=(c.y+a.y)*.125,E=(f.y+u.y)*.125,I=Math.atan2(m,h),x=Math.atan2(_,A);F.fromElements(0,C,C2.distance.startPosition),F.fromElements(0,g,C2.distance.endPosition),F.fromElements(x,E,C2.angleAndHeight.startPosition),F.fromElements(I,y,C2.angleAndHeight.endPosition),s(C2)}}function wCt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Ny(e,t,new F)),G8(e,t),e._previousPositions.set(i,F.clone(n.get(i)))}else Hbe(e,t)}function Vbe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),G8(e,t),e._previousPositions.remove(i)}else Ybe(e,t)}function DCt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;Ny(e,t,o),jbe(e,t);let r=e._previousPositions;F.clone(n.get(i),r.get(i))}else Wbe(e,t)}function RA(e){this._inputEvents={},this._buttonDown={[Es.LEFT]:!1,[Es.MIDDLE]:!1,[Es.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-RA.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new F,this._primaryPosition=new F,this._primaryPreviousPosition=new F,this._positions=new Pt,this._previousPositions=new Pt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,ICt(this)}RA.prototype.setInputAction=function(e,t,n){let i=QZ(t,n);this._inputEvents[i]=e};RA.prototype.getInputAction=function(e,t){let n=QZ(e,t);return this._inputEvents[n]};RA.prototype.removeInputAction=function(e,t){let n=QZ(e,t);delete this._inputEvents[n]};RA.prototype.isDestroyed=function(){return!1};RA.prototype.destroy=function(){return bCt(this),de(this)};RA.mouseEmulationIgnoreMilliseconds=800;RA.touchHoldDelayMilliseconds=1500;var Ff=RA;function vCt(e,t,n,i,o,r,s){let a=Wi.numberOfPoints(e,t,o),c,u=n.red,f=n.green,h=n.blue,m=n.alpha,g=i.red,A=i.green,_=i.blue,C=i.alpha;if(G.equals(n,i)){for(c=0;c<a;c++)r[s++]=G.floatToByte(u),r[s++]=G.floatToByte(f),r[s++]=G.floatToByte(h),r[s++]=G.floatToByte(m);return s}let y=(g-u)/a,E=(A-f)/a,I=(_-h)/a,x=(C-m)/a,S=s;for(c=0;c<a;c++)r[S++]=G.floatToByte(u+c*y),r[S++]=G.floatToByte(f+c*E),r[S++]=G.floatToByte(h+c*I),r[S++]=G.floatToByte(m+c*x);return S}function y2(e){e=e??V.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??an.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??te.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*d.packedLength;o+=l(n)?1+n.length*G.packedLength:1,this.packedLength=o+te.packedLength+3}y2.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+=d.packedLength)d.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+=G.packedLength)G.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};y2.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=G.packedLength)s[i]=G.unpack(e,t);let a=te.unpack(e,t);t+=te.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new y2({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var z8=new Array(2),V8=new Array(2),PCt={positions:z8,height:V8,ellipsoid:void 0,minDistance:void 0,granularity:void 0};y2.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=D.chordLength(r,s.maximumRadius),c=l(n)&&!i,u,f=t.length,h,m,g,A,_=0;if(o===an.GEODESIC||o===an.RHUMB){let x,S,w;o===an.GEODESIC?(x=D.chordLength(r,s.maximumRadius),S=Wi.numberOfPoints,w=Wi.generateArc):(x=r,S=Wi.numberOfPointsRhumbLine,w=Wi.generateRhumbArc);let v=Wi.extractHeights(t,s),P=PCt;if(o===an.GEODESIC?P.minDistance=a:P.granularity=r,P.ellipsoid=s,c){let N=0;for(u=0;u<f-1;u++)N+=S(t[u],t[u+1],x)+1;h=new Float64Array(N*3),g=new Uint8Array(N*4),P.positions=z8,P.height=V8;let L=0;for(u=0;u<f-1;++u){z8[0]=t[u],z8[1]=t[u+1],V8[0]=v[u],V8[1]=v[u+1];let p=w(P);if(l(n)){let b=p.length/3;A=n[u];for(let T=0;T<b;++T)g[L++]=G.floatToByte(A.red),g[L++]=G.floatToByte(A.green),g[L++]=G.floatToByte(A.blue),g[L++]=G.floatToByte(A.alpha)}h.set(p,_),_+=p.length}}else if(P.positions=t,P.height=v,h=new Float64Array(w(P)),l(n)){for(g=new Uint8Array(h.length/3*4),u=0;u<f-1;++u){let L=t[u],p=t[u+1],b=n[u],T=n[u+1];_=vCt(L,p,b,T,a,g,_)}let N=n[f-1];g[_++]=G.floatToByte(N.red),g[_++]=G.floatToByte(N.green),g[_++]=G.floatToByte(N.blue),g[_++]=G.floatToByte(N.alpha)}}else{m=c?f*2-2:f,h=new Float64Array(m*3),g=l(n)?new Uint8Array(m*4):void 0;let x=0,S=0;for(u=0;u<f;++u){let w=t[u];if(c&&u>0&&(d.pack(w,h,x),x+=3,A=n[u-1],g[S++]=G.floatToByte(A.red),g[S++]=G.floatToByte(A.green),g[S++]=G.floatToByte(A.blue),g[S++]=G.floatToByte(A.alpha)),c&&u===f-1)break;d.pack(w,h,x),x+=3,l(n)&&(A=n[u],g[S++]=G.floatToByte(A.red),g[S++]=G.floatToByte(A.green),g[S++]=G.floatToByte(A.blue),g[S++]=G.floatToByte(A.alpha))}}let C=new pn;C.position=new ve({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(C.color=new ve({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),m=h.length/3;let y=(m-1)*2,E=Fe.createTypedArray(m,y),I=0;for(u=0;u<m-1;++u)E[I++]=u,E[I++]=u+1;return new ht({attributes:C,indices:E,primitiveType:Pe.LINES,boundingSphere:le.fromPoints(t)})};var GZ=y2;function PB(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new va(i),this._workerName="createSphereGeometry"}PB.packedLength=va.packedLength;PB.pack=function(e,t,n){return va.pack(e._ellipsoidGeometry,t,n)};var RCt=new va,Ly={radius:void 0,radii:new d,vertexFormat:new Re,stackPartitions:void 0,slicePartitions:void 0};PB.unpack=function(e,t,n){let i=va.unpack(e,t,RCt);return Ly.vertexFormat=Re.clone(i._vertexFormat,Ly.vertexFormat),Ly.stackPartitions=i._stackPartitions,Ly.slicePartitions=i._slicePartitions,l(n)?(d.clone(i._radii,Ly.radii),n._ellipsoidGeometry=new va(Ly),n):(Ly.radius=i._radii.x,new PB(Ly))};PB.createGeometry=function(e){return va.createGeometry(e._ellipsoidGeometry)};var zZ=PB;var MCt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},In=MCt;function Oy(e){}Object.defineProperties(Oy.prototype,{ellipsoid:{get:Ae.throwInstantiationError},rectangle:{get:Ae.throwInstantiationError},projection:{get:Ae.throwInstantiationError}});Oy.prototype.getNumberOfXTilesAtLevel=Ae.throwInstantiationError;Oy.prototype.getNumberOfYTilesAtLevel=Ae.throwInstantiationError;Oy.prototype.rectangleToNativeRectangle=Ae.throwInstantiationError;Oy.prototype.tileXYToNativeRectangle=Ae.throwInstantiationError;Oy.prototype.tileXYToRectangle=Ae.throwInstantiationError;Oy.prototype.positionToTileXY=Ae.throwInstantiationError;var VZ=Oy;function NCt(e,t){this.rectangle=e,this.maxLevel=t}function qbe(e){this.ellipsoid=e.ellipsoid??te.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}qbe.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 LCt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Vi({ellipsoid:e.ellipsoid});else throw new ue(`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=zo.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=D.toRadians(parseFloat(s.getAttribute("minx"))),c=D.toRadians(parseFloat(s.getAttribute("miny"))),u=D.toRadians(parseFloat(s.getAttribute("maxx"))),f=D.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new NCt(new ce(a,c,u,f),h))}}function OCt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),qo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ue(i)}async function FCt(e,t,n){try{let i=await t.fetchXML();LCt(e,i)}catch(i){OCt(t,i,n)}}function Fy(e){e=e??V.EMPTY_OBJECT,this._errorEvent=new _e,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 pt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Fy.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(){}}});Fy.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=new qbe(t),i=Be.createIfNeeded(e);await FCt(n,i);let o=new Fy(t);return n.build(o),o._resource=i,o};Fy.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:hh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:QCt(a,e,t,n),structure:a._terrainDataStructure})})};Fy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var Kbe=new ce;function QCt(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 u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,h=ce.intersection(f,s,Kbe);l(h)&&(H8(o,f,t*2,n*2,i+1)&&(a|=4),H8(o,f,t*2+1,n*2,i+1)&&(a|=8),H8(o,f,t*2,n*2+1,i+1)&&(a|=1),H8(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function H8(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ce.intersection(r,t,Kbe))}Fy.prototype.getTileDataAvailable=function(e,t,n){};Fy.prototype.loadTileDataAvailability=function(e,t,n){};var HZ=Fy;function X0(e){e=e??V.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(X0.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(X0.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=kCt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});X0.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,de(this)};X0.prototype.isDestroyed=function(){return!1};X0.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};X0.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,u=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 f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function kCt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var YZ=X0;var UCt={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},WZ=Object.freeze(UCt);function GCt(e){return e=e??V.EMPTY_OBJECT,Y0.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var E2=GCt;function zCt(e){return e=e??V.EMPTY_OBJECT,Y0.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:te.WGS84})}var Z0=zCt;var VCt=1953029805,HCt=2917034100;function jZ(e,t){if(jZ.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new ue("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===VCt||o===HCt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,h=8;for(;s<c;)for(h=(h+8)%24,f=h;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(h=(h+8)%24,f=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}jZ.passThroughDataForTesting=!1;var I2=jZ;function YCt(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 b2=YCt;var qZ=[],KZ=[];function WCt(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=qZ,u=KZ,f,h;for(f=0;f<s;++f)c[f]=e[i+f];for(h=0;h<a;++h)u[h]=e[o+h+1];f=0,h=0;for(let m=i;m<=r;++m){let g=c[f],A=u[h];f<s&&(h>=a||t(g,A,n)<=0)?(e[m]=g,++f):h<a&&(e[m]=A,++h)}}function JZ(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);JZ(e,t,n,i,r),JZ(e,t,n,r+1,o),WCt(e,t,n,i,r,o)}function jCt(e,t,n){let i=e.length,o=Math.ceil(i*.5);qZ.length=o,KZ.length=o,JZ(e,t,n,0,i-1),qZ.length=0,KZ.length=0}var Xm=jCt;var qCt=new d;function KCt(e,t,n,i){let o=AE(e,t,n,i,qCt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var XZ=KCt;async function JCt(e,t,n,i){return l(i)||(i=!1),$Ct(e,t,n,i)}function XCt(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(Xbe(i)):r=o.then(Xbe(i)).catch(eyt(i)),e.shift(),t.push(r),!0}function ZCt(e){return new Promise(function(t){setTimeout(t,e)})}function ZZ(e,t,n){return e.length?XCt(e,t,n)?ZZ(e,t,n):ZCt(100).then(()=>ZZ(e,t,n)):Promise.resolve()}function $Ct(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let h={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=h,s.push(h)}a[f].positions.push(n[r])}let c=[];return ZZ(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Jbe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Xbe(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(!Jbe(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];Jbe(s,i,n)}}):Promise.resolve()}}function eyt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var x2=JCt;var $Z=new F;async function Zbe(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,$Z);let m=e.loadTileDataAvailability($Z.x,$Z.y,1);l(m)&&s.push(m)}let h=i[f];l(h)||(i[f]=h=[]),h.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return x2(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&a.push(u)}return a.length>0&&await Zbe(e,a,n),t}var $0=Zbe;function tyt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var eb=tyt;function nyt(e){switch(e){case ee.FLOAT:return"float";case ee.FLOAT_VEC2:return"vec2";case ee.FLOAT_VEC3:return"vec3";case ee.FLOAT_VEC4:return"vec4";case ee.FLOAT_MAT2:return"mat2";case ee.FLOAT_MAT3:return"mat3";case ee.FLOAT_MAT4:return"mat4";case ee.SAMPLER_2D:return"sampler2D";case ee.BOOL:return"bool"}}var e$=nyt;function iyt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var T2=iyt;var RB=`#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 S2=`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);
}
`;var B2=`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 w2=`#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 D2=`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 v2=`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 P2=`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 R2=`/**
* 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;
}
}
`;var M2=`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 N2=`in vec4 position;
out vec4 positionEC;
void main()
{
positionEC = czm_modelView * position;
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
}
`;var MB=`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 NB=`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();
}
`;/**
* @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 L2=`/**
* @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 O2=`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 F2=`#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 LB=`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 OB=`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 Q2=`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 k2=`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;
}
`;var U2=`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 G2=`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;
}
`;var z2=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(u_texture, v_textureCoordinates);
out_FragColor = czm_gammaCorrect(color);
}
`;var V2=`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 H2=`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;
}
`;var Y2=`
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);
}
`;async function t$(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===oe.SCENE2D)return r;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await t$._sampleTerrainMostDetailed(n,c),f=!1,h=u.reduce(function(g,A){return l(A.height)?(f=!0,Math.max(A.height,g)):g},-Number.MAX_VALUE),m=r;return f&&(m.height+=h),m}t$._sampleTerrainMostDetailed=$0;var tb=t$;var oyt=new F;function ryt(e,t){let n=e.unionClippingRegions,i=e.length,o=cs.useFloatTexture(t),r=cs.getTextureResolution(e,t,oyt),s=r.x,a=r.y,c=o?cyt(s,a):lyt(s,a);return c+=`
`,c+=n?syt(i):ayt(i),c}function syt(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 ayt(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 cyt(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 lyt(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 nb=ryt;function uyt(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 n$(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function fyt(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 oe.SCENE3D:o=t;break;case oe.SCENE2D:case oe.COLUMBUS_VIEW:o=n;break;case oe.MORPHING:o=i;break}return o}function dyt(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 hyt(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 Ayt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}n$.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,u=e.applyAlpha,f=e.applyDayNightAlpha,h=e.applySplit,m=e.hasWaterMask,g=e.showReflectiveOcean,A=e.showOceanWaves,_=e.enableLighting,C=e.dynamicAtmosphereLighting,y=e.dynamicAtmosphereLightingFromSun,E=e.showGroundAtmosphere,I=e.perFragmentGroundAtmosphere,x=e.hasVertexNormals,S=e.useWebMercatorProjection,w=e.enableFog,v=e.enableClippingPlanes,P=e.clippingPlanes,N=e.enableClippingPolygons,L=e.clippingPolygons,p=e.clippedByBoundaries,b=e.hasImageryLayerCutout,T=e.colorCorrect,B=e.highlightFillTile,R=e.colorToAlpha,O=e.hasGeodeticSurfaceNormals,U=e.hasExaggeration,k=e.showUndergroundColor,z=e.translucent,Q=0,H="",Z=n.renderedMesh.encoding;Z.quantization===Ma.BITS12&&(Q=1,H="QUANTIZATION_BITS12");let $=0,K="";p&&($=1,K="TILE_LIMIT_RECTANGLE");let fe=0,ge="";b&&(fe=1,ge="APPLY_IMAGERY_CUTOUT");let ne=t.mode,Ce=ne|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|m<<8|g<<9|A<<10|_<<11|C<<12|y<<13|E<<14|I<<15|x<<16|S<<17|w<<18|Q<<19|h<<20|v<<21|N<<22|$<<23|fe<<24|T<<25|B<<26|R<<27|O<<28|U<<29|k<<30|z<<31|f<<32,ye=0;l(P)&&P.length>0&&(ye=v?P.clippingPlanesState:0);let De=0;l(L)&&L.length>0&&(De=N?L.clippingPolygonsState:0);let be=n.surfaceShader;if(l(be)&&be.numberOfDayTextures===i&&be.flags===Ce&&be.material===this.material&&be.clippingShaderState===ye&&be.clippingPolygonShaderState===De)return be.shaderProgram;let Ne=this._shadersByTexturesFlags[i];if(l(Ne)||(Ne=this._shadersByTexturesFlags[i]=[]),be=Ne[Ce],!l(be)||be.material!==this.material||be.clippingShaderState!==ye||be.clippingPolygonShaderState!==De){let ke=this.baseVertexShaderSource.clone(),Ue=this.baseFragmentShaderSource.clone();ye!==0&&Ue.sources.unshift(nb(P,t.context)),De!==0&&(Ue.sources.unshift(dyt(t.context)),ke.sources.unshift(hyt(t.context))),ke.defines.push(H),Ue.defines.push(`TEXTURE_UNITS ${i}`,K,ge),o&&Ue.defines.push("APPLY_BRIGHTNESS"),r&&Ue.defines.push("APPLY_CONTRAST"),s&&Ue.defines.push("APPLY_HUE"),a&&Ue.defines.push("APPLY_SATURATION"),c&&Ue.defines.push("APPLY_GAMMA"),u&&Ue.defines.push("APPLY_ALPHA"),f&&Ue.defines.push("APPLY_DAY_NIGHT_ALPHA"),m&&Ue.defines.push("HAS_WATER_MASK"),g&&(Ue.defines.push("SHOW_REFLECTIVE_OCEAN"),ke.defines.push("SHOW_REFLECTIVE_OCEAN")),A&&Ue.defines.push("SHOW_OCEAN_WAVES"),R&&Ue.defines.push("APPLY_COLOR_TO_ALPHA"),k&&(ke.defines.push("UNDERGROUND_COLOR"),Ue.defines.push("UNDERGROUND_COLOR")),z&&(ke.defines.push("TRANSLUCENT"),Ue.defines.push("TRANSLUCENT")),_&&(x?(ke.defines.push("ENABLE_VERTEX_LIGHTING"),Ue.defines.push("ENABLE_VERTEX_LIGHTING")):(ke.defines.push("ENABLE_DAYNIGHT_SHADING"),Ue.defines.push("ENABLE_DAYNIGHT_SHADING"))),C&&(ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Ue.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),y&&(ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Ue.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),E&&(ke.defines.push("GROUND_ATMOSPHERE"),Ue.defines.push("GROUND_ATMOSPHERE"),I&&(ke.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Ue.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),ke.defines.push("INCLUDE_WEB_MERCATOR_Y"),Ue.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(ke.defines.push("FOG"),Ue.defines.push("FOG")),h&&Ue.defines.push("APPLY_SPLIT"),v&&Ue.defines.push("ENABLE_CLIPPING_PLANES"),N&&(Ue.defines.push("ENABLE_CLIPPING_POLYGONS"),ke.defines.push("ENABLE_CLIPPING_POLYGONS"),L.inverse&&Ue.defines.push("CLIPPING_INVERSE"),Ue.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`),ke.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`)),T&&Ue.defines.push("COLOR_CORRECT"),B&&Ue.defines.push("HIGHLIGHT_FILL_TILE"),O&&ke.defines.push("GEODETIC_SURFACE_NORMALS"),U&&ke.defines.push("EXAGGERATION");let He=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
{
vec4 color = initialColor;
`;b&&(He+=` vec4 cutoutAndColorResult;
bool texelUnclipped;
`);for(let Ye=0;Ye<i;++Ye)b?He+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Ye}];
texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
cutoutAndColorResult = sampleAndBlend(
`:He+=` color = sampleAndBlend(
`,He+=` color,
u_dayTextures[${Ye}],
u_dayTextureUseWebMercatorT[${Ye}] ? textureCoordinates.xz : textureCoordinates.xy,
u_dayTextureTexCoordsRectangle[${Ye}],
u_dayTextureTranslationAndScale[${Ye}],
${u?`u_dayTextureAlpha[${Ye}]`:"1.0"},
${f?`u_dayTextureNightAlpha[${Ye}]`:"1.0"},
${f?`u_dayTextureDayAlpha[${Ye}]`:"1.0"},
${o?`u_dayTextureBrightness[${Ye}]`:"0.0"},
${r?`u_dayTextureContrast[${Ye}]`:"0.0"},
${s?`u_dayTextureHue[${Ye}]`:"0.0"},
${a?`u_dayTextureSaturation[${Ye}]`:"0.0"},
${c?`u_dayTextureOneOverGamma[${Ye}]`:"0.0"},
${h?`u_dayTextureSplit[${Ye}]`:"0.0"},
${R?`u_colorsToAlpha[${Ye}]`:"vec4(0.0)"},
nightBlend);
`,b&&(He+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
`);He+=` return color;
}`,Ue.sources.push(He),ke.sources.push(fyt(ne)),ke.sources.push(Ayt(S));let Et=sn.fromCache({context:t.context,vertexShaderSource:ke,fragmentShaderSource:Ue,attributeLocations:Z.getAttributeLocations()});be=Ne[Ce]=new uyt(i,Ce,this.material,Et,ye,De)}return n.surfaceShader=be,be.shaderProgram};n$.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 de(this)};var W2=n$;var myt={START:0,LOADING:1,DONE:2,FAILED:3},La=Object.freeze(myt);var pyt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},Do=Object.freeze(pyt);function dr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new d,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Do.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new le,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(dr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===Do.RECEIVING||e===Do.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!==Wn.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});dr.prototype.pick=function(e,t,n,i,o){if(!l(this.renderedMesh))return;let r=this.renderedMesh.pick(e,i,t,n);return d.clone(r,o)};dr.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=Do.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()};dr.prototype.freeVertexArray=function(){dr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,dr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};dr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new dr),e.state===La.START&&(gyt(e,t,n),e.state=La.LOADING)};dr.processStateMachine=function(e,t,n,i,o,r,s){dr.initialize(e,n,i);let a=e.data;if(e.state===La.LOADING&&_yt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===Do.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let h=e._loadedCallbacks,m={};for(let g in h)h.hasOwnProperty(g)&&(h[g](e)||(m[g]=h[g]));e._loadedCallbacks=m,e.state=La.DONE}c&&(e.renderable=!0)};dr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let h=c[u];if(!l(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===Wn.PLACEHOLDER){let g=h.loadingImagery.imageryLayer;if(g.ready){h.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let m=h.processStateMachine(e,n,i);a=a&&m,s=s||m||l(h.readyImagery),r=r&&l(h.loadingImagery)&&(h.loadingImagery.state===Wn.FAILED||h.loadingImagery.state===Wn.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function $be(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=fr.clone(s);c.hasGeodeticSurfaceNormals=t,c=fr.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(dr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=dr._createVertexArrayForMesh(i.context,o)):(dr._freeVertexArray(e.vertexArray),e.vertexArray=dr._createVertexArrayForMesh(i.context,o)),dr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}dr.prototype.addGeodeticSurfaceNormals=function(e,t){$be(this,!0,e,t)};dr.prototype.removeGeodeticSurfaceNormals=function(e){$be(this,!1,void 0,e)};dr.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,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let m=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(m,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let m=e.customData;for(let g of m)g.level=-1}o.updateExaggeration(r,s)}};dr.prototype.updateSceneMode=function(e){let n=this.renderedMesh;n!==void 0&&n.updateSceneMode(e)};function gyt(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=Do.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function _yt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===Do.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||dr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===Do.FAILED&&Cyt(s,e,t,n,e.x,e.y,e.level),s.terrainState===Do.UNLOADED&&yyt(s,n,e.x,e.y,e.level),s.terrainState===Do.RECEIVED&&Iyt(s,t,n,e.x,e.y,e.level),s.terrainState===Do.TRANSFORMED&&(byt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=Do.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Tyt(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Cyt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=La.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,h=a.level;if(!l(c))return;let m=c.upsample(i.tilingScheme,u,f,h,o,r,s);l(m)&&(e.terrainState=Do.RECEIVING,Promise.resolve(m).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=Do.RECEIVED)}).catch(function(){e.terrainState=Do.FAILED}))}function yyt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=Do.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=Do.RECEIVED,e.request=void 0}function s(c){if(e.request.state===hi.CANCELLED){e.terrainData=void 0,e.terrainState=Do.UNLOADED,e.request=void 0;return}e.terrainState=Do.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=qo.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new pr({throttle:!1,throttleByServer:!0,type:Qs.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=Do.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=Do.UNLOADED,e.request=void 0)}a()}var Eyt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Iyt(e,t,n,i,o,r){let s=n.tilingScheme,a=Eyt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=Do.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=Do.TRANSFORMED}).catch(function(){e.terrainState=Do.FAILED}))}dr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=ut.createVertexBuffer({context:e,typedArray:n,usage:Oe.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=ut.createIndexBuffer({context:e,typedArray:a,usage:Oe.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new oi({context:e,attributes:o,indexBuffer:s})};dr._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 byt(e,t,n,i,o,r,s){e.vertexArray=dr._createVertexArrayForMesh(t,e.mesh),e.terrainState=Do.READY,e.fill=e.fill&&e.fill.destroy(s)}function xyt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Bt.create({context:e,pixelFormat:qe.LUMINANCE,pixelDatatype:Ge.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:mi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Tyt(e,t){let n=t.terrainData.waterMask,i=xyt(e),o,r=n.length;if(n instanceof ImageBitmap)o=Bt.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=Bt.create({context:e,pixelFormat:qe.LUMINANCE,pixelDatatype:Ge.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}dr.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};dr.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 Jd=dr;var exe={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>=exe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},si=exe;function QB(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 se}QB.prototype.update=function(e,t,n){this.changedThisFrame&&(axe(e,t,this.tile,n),this.changedThisFrame=!1)};QB.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};QB.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Jd._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Syt=new yC;QB.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Syt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),h=c.findTileToEast(r),m=c.findTileToNorth(r);da(e,n,c,u,s,In.EAST,!1,a,i),da(e,n,c,f,s,In.NORTH,!1,a,i),da(e,n,c,h,s,In.WEST,!1,a,i),da(e,n,c,m,s,In.SOUTH,!1,a,i);let g=u.findTileToNorth(r),A=u.findTileToSouth(r),_=h.findTileToNorth(r),C=h.findTileToSouth(r);da(e,n,c,g,s,In.SOUTHEAST,!1,a,i),da(e,n,c,_,s,In.SOUTHWEST,!1,a,i),da(e,n,c,A,s,In.NORTHEAST,!1,a,i),da(e,n,c,C,s,In.NORTHWEST,!1,a,i),c=a.dequeue()}};function da(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||si.wasKicked(u._lastSelectionResult)||si.originalResult(u._lastSelectionResult)===si.CULLED);){if(s)return;let f=u.parent;if(r>=In.NORTHWEST&&f!==void 0)switch(r){case In.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case In.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case In.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case In.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===si.RENDERED){if(l(u.data.vertexArray))return;Byt(e,t,n,u,r,o,a,c);return}if(si.originalResult(i._lastSelectionResult)!==si.CULLED)switch(r){case In.WEST:da(e,t,n,i.northwestChild,o,r,!0,a,c),da(e,t,n,i.southwestChild,o,r,!0,a,c);break;case In.EAST:da(e,t,n,i.southeastChild,o,r,!0,a,c),da(e,t,n,i.northeastChild,o,r,!0,a,c);break;case In.SOUTH:da(e,t,n,i.southwestChild,o,r,!0,a,c),da(e,t,n,i.southeastChild,o,r,!0,a,c);break;case In.NORTH:da(e,t,n,i.northeastChild,o,r,!0,a,c),da(e,t,n,i.northwestChild,o,r,!0,a,c);break;case In.NORTHWEST:da(e,t,n,i.northwestChild,o,r,!0,a,c);break;case In.NORTHEAST:da(e,t,n,i.northeastChild,o,r,!0,a,c);break;case In.SOUTHWEST:da(e,t,n,i.southwestChild,o,r,!0,a,c);break;case In.SOUTHEAST:da(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new Ae("Invalid edge")}}}function Byt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new QB(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),wyt(e,t,n,i,o,a)}function wyt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(axe(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case In.WEST:u=s.westMeshes,f=s.westTiles;break;case In.SOUTH:u=s.southMeshes,f=s.southTiles;break;case In.EAST:u=s.eastMeshes,f=s.eastTiles;break;case In.NORTH:u=s.northMeshes,f=s.northTiles;break;case In.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case In.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case In.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case In.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let h,m,g,A,_=n.rectangle,C,y=i.rectangle;switch(o){case In.WEST:for(C=(y.north-y.south)*D.EPSILON5,h=0;h<f.length&&(g=f[h],A=g.rectangle,!D.greaterThan(_.north,A.south,C));++h);for(m=h;m<f.length&&(g=f[m],A=g.rectangle,!D.greaterThanOrEquals(_.south,A.north,C));++m);break;case In.SOUTH:for(C=(y.east-y.west)*D.EPSILON5,h=0;h<f.length&&(g=f[h],A=g.rectangle,!D.lessThan(_.west,A.east,C));++h);for(m=h;m<f.length&&(g=f[m],A=g.rectangle,!D.lessThanOrEquals(_.east,A.west,C));++m);break;case In.EAST:for(C=(y.north-y.south)*D.EPSILON5,h=0;h<f.length&&(g=f[h],A=g.rectangle,!D.lessThan(_.south,A.north,C));++h);for(m=h;m<f.length&&(g=f[m],A=g.rectangle,!D.lessThanOrEquals(_.north,A.south,C));++m);break;case In.NORTH:for(C=(y.east-y.west)*D.EPSILON5,h=0;h<f.length&&(g=f[h],A=g.rectangle,!D.greaterThan(_.east,A.west,C));++h);for(m=h;m<f.length&&(g=f[m],A=g.rectangle,!D.greaterThanOrEquals(_.west,A.east,C));++m);break}m-h===1?(s.changedThisFrame=s.changedThisFrame||u[h]!==a,u[h]=a,f[h]=n):(s.changedThisFrame=!0,u.splice(h,m-h,a),f.splice(h,m-h,n))}var ib=new he,Dyt=new he,FB=new d,s$=new d,i$=new F,o$=new F,Qf=new F;function X8(){this.height=0,this.encodedNormal=new F}function Y8(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let h=e.tile.data.tileBoundingRegion,m=0,g=0;l(h)&&(m=h.minimumHeight,g=h.maximumHeight),u=(m+g)*.5}return cxe(e,t,n,i,u,c),c}var vyt={minimumHeight:0,maximumHeight:0},Pyt=new d,txe=new X8,nxe=new X8,ixe=new X8,oxe=new X8,Ryt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,Myt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function axe(e,t,n,i){Jd.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,h=j8(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,ixe),m=j8(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,txe),g=j8(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,nxe),A=j8(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,oxe);h=Y8(r,f,0,1,h,m,A,g,ixe),m=Y8(r,f,0,0,m,h,g,A,txe),g=Y8(r,f,1,1,g,m,A,h,nxe),A=Y8(r,f,1,1,A,g,h,m,oxe);let _=m.height,C=g.height,y=h.height,E=A.height,I=Math.min(_,C,y,E),x=Math.max(_,C,y,E),S=(I+x)*.5,w,v,P=e.getLevelMaximumGeometricError(n.level),N=f.maximumRadius-P,L=Math.acos(N/f.maximumRadius)*4;if(L*=1.5,s.width>L&&x-I<=P){let T=new Sc({width:9,height:9,buffer:Ryt,structure:{heightOffset:x}}),B=Myt;B.tilingScheme=n.tilingScheme,B.x=n.x,B.y=n.y,B.level=n.level,B.exaggeration=a,B.exaggerationRelativeHeight=c,r.mesh=T._createMeshSync(B)}else{let T=u,B=ce.center(s,Dyt);B.height=S;let R=f.cartographicToCartesian(B,Pyt),O=new fr(R,void 0,void 0,void 0,void 0,!0,!0,T,a,c),U=5,k;for(k=r.westMeshes,w=0,v=k.length;w<v;++w)U+=k[w].eastIndicesNorthToSouth.length;for(k=r.southMeshes,w=0,v=k.length;w<v;++w)U+=k[w].northIndicesWestToEast.length;for(k=r.eastMeshes,w=0,v=k.length;w<v;++w)U+=k[w].westIndicesSouthToNorth.length;for(k=r.northMeshes,w=0,v=k.length;w<v;++w)U+=k[w].southIndicesEastToWest.length;let z=vyt;z.minimumHeight=I,z.maximumHeight=x;let Q=O.stride,H=new Float32Array(U*Q),W=0,Z=W;W=W8(f,s,O,H,W,0,1,h.height,h.encodedNormal,1,z),W=K8(r,f,O,H,W,r.westTiles,r.westMeshes,In.EAST,z);let Y=W;W=W8(f,s,O,H,W,0,0,m.height,m.encodedNormal,0,z),W=K8(r,f,O,H,W,r.southTiles,r.southMeshes,In.NORTH,z);let $=W;W=W8(f,s,O,H,W,1,0,g.height,g.encodedNormal,0,z),W=K8(r,f,O,H,W,r.eastTiles,r.eastMeshes,In.WEST,z);let K=W;W=W8(f,s,O,H,W,1,1,A.height,A.encodedNormal,1,z),W=K8(r,f,O,H,W,r.northTiles,r.northMeshes,In.SOUTH,z),I=z.minimumHeight,x=z.maximumHeight;let fe=$t.fromRectangle(s,I,x,n.tilingScheme.ellipsoid),ge=ui.geodeticLatitudeToMercatorAngle(s.south),ne=1/(ui.geodeticLatitudeToMercatorAngle(s.north)-ge),Ce=(ui.geodeticLatitudeToMercatorAngle(B.latitude)-ge)*ne,ye=f.geodeticSurfaceNormalCartographic(ib,s$),De=bn.octEncode(ye,i$),be=W;O.encode(H,W*Q,fe.center,F.fromElements(.5,.5,Qf),S,De,Ce,ye),++W;let Ne=W,ke=Ne<256?1:2,Ue=(Ne-1)*3,He=Ue*ke,Et=(H.length-Ne*Q)*Float32Array.BYTES_PER_ELEMENT,Ye;if(Et>=He){let lt=Ne*Q*Float32Array.BYTES_PER_ELEMENT;Ye=Ne<256?new Uint8Array(H.buffer,lt,Ue):new Uint16Array(H.buffer,lt,Ue)}else Ye=Ne<256?new Uint8Array(Ue):new Uint16Array(Ue);H=new Float32Array(H.buffer,0,Ne*Q);let nt=0;for(w=0;w<Ne-2;++w)Ye[nt++]=be,Ye[nt++]=w,Ye[nt++]=w+1;Ye[nt++]=be,Ye[nt++]=w,Ye[nt++]=0;let Ct=[];for(w=Y;w>=Z;--w)Ct.push(w);let Wt=[];for(w=$;w>=Y;--w)Wt.push(w);let Qn=[];for(w=K;w>=$;--w)Qn.push(w);let on=[];for(on.push(0),w=be-1;w>=K;--w)on.push(w);r.mesh=new sc(O.center,H,Ye,Ue,Ne,I,x,s,le.fromOrientedBoundingBox(fe),Uyt(e,fe.center,s,I,x),O.stride,fe,O,Ct,Wt,Qn,on)}let p=t.context;r._destroyVertexArray(i),r.vertexArray=Jd._createVertexArrayForMesh(p,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let b=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let T=o._findAncestorTileWithTerrainData(n);l(T)&&l(T.data.waterMaskTexture)&&(r.waterMaskTexture=T.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,T,r.waterMaskTranslationAndScale))}l(b)&&(--b.referenceCount,b.referenceCount===0&&b.destroy())}function W8(e,t,n,i,o,r,s,a,c,u,f){let h=ib;h.longitude=D.lerp(t.west,t.east,r),h.latitude=D.lerp(t.south,t.north,s),h.height=a;let m=e.cartographicToCartesian(h,FB),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(m,s$));let A=o$;return A.x=r,A.y=s,n.encode(i,o*n.stride,m,A,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var J8=new ce;function j2(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=ce.clone(e.rectangle,J8),o.west-=D.TWO_PI,o.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,J8),o.west+=D.TWO_PI,o.east+=D.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,h=(r.north-o.south)/u,m=(n.x-a)/(c-a),g=(n.y-f)/(h-f);return Math.abs(m)<Math.EPSILON5?m=0:Math.abs(m-1)<Math.EPSILON5&&(m=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=m,i.y=g,i}var Nyt=new F;function r$(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 Lyt=new F,Oyt=new d;function Fyt(e,t,n,i,o,r,s,a,c,u){let f=i.encoding,h=i.vertices,m=j2(t,n,f.decodeTextureCoordinates(h,o,Qf),Qf),g=j2(t,n,f.decodeTextureCoordinates(h,r,o$),o$),A;c?A=(s-m.x)/(g.x-m.x):A=(a-m.y)/(g.y-m.y);let _=f.decodeHeight(h,o),C=f.decodeHeight(h,r),y=n.rectangle;ib.longitude=D.lerp(y.west,y.east,s),ib.latitude=D.lerp(y.south,y.north,a),u.height=ib.height=D.lerp(_,C,A);let E;if(f.hasVertexNormals){let I=f.getOctEncodedNormal(h,o,Nyt),x=f.getOctEncodedNormal(h,r,Lyt),S=bn.octDecode(I.x,I.y,FB),w=bn.octDecode(x.x,x.y,Oyt);E=d.lerp(S,w,A,FB),d.normalize(E,E),bn.octEncode(E,u.encodedNormal)}else E=e.geodeticSurfaceNormalCartographic(ib,FB),bn.octEncode(E,u.encodedNormal)}function cxe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(ib,FB);bn.octEncode(s,r.encodedNormal)}function j8(e,t,n,i,o,r,s,a,c,u,f){if(sxe(e,t,a,s,!1,n,i,f)||sxe(e,t,u,c,!0,n,i,f))return f;let m;if(a$(o,r))return n===0?i===0?m=r.eastIndicesNorthToSouth[0]:m=r.southIndicesEastToWest[0]:i===0?m=r.northIndicesWestToEast[0]:m=r.westIndicesSouthToNorth[0],r$(r,m,n,i,f),f;let g;if(n===0?i===0?g=q8(e.westMeshes,e.westTiles,In.EAST,e.southMeshes,e.southTiles,In.NORTH,n,i):g=q8(e.northMeshes,e.northTiles,In.SOUTH,e.westMeshes,e.westTiles,In.EAST,n,i):i===0?g=q8(e.southMeshes,e.southTiles,In.NORTH,e.eastMeshes,e.eastTiles,In.WEST,n,i):g=q8(e.eastMeshes,e.eastTiles,In.WEST,e.northMeshes,e.northTiles,In.SOUTH,n,i),l(g))return cxe(e,t,n,i,g,f),f}function q8(e,t,n,i,o,r,s,a){let c=rxe(e,t,!1,n,s,a),u=rxe(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function K8(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=Qyt(e,t,n,i,o,r[u],s[u],a,c);return o}function Qyt(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===In.EAST&&e.tile.x===0?(u=ce.clone(r.rectangle,J8),u.west-=D.TWO_PI,u.east-=D.TWO_PI):a===In.WEST&&r.x===0&&(u=ce.clone(r.rectangle,J8),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,h,m;o>0&&(n.decodeTextureCoordinates(i,o-1,Qf),h=Qf.x,m=Qf.y);let g,A;switch(a){case In.WEST:g=s.westIndicesSouthToNorth,A=!1;break;case In.NORTH:g=s.northIndicesWestToEast,A=!0;break;case In.EAST:g=s.eastIndicesNorthToSouth,A=!1;break;case In.SOUTH:g=s.southIndicesEastToWest,A=!0;break}let _=r,C=e.tile,y=s.encoding,E=s.vertices,I=n.stride,x,S;y.hasWebMercatorT&&(x=ui.geodeticLatitudeToMercatorAngle(f.south),S=1/(ui.geodeticLatitudeToMercatorAngle(f.north)-x));for(let w=0;w<g.length;++w){let v=g[w],P=y.decodeTextureCoordinates(E,v,Qf);j2(_,C,P,P);let N=P.x,L=P.y,p=A?N:L;if(p<0||p>1||Math.abs(N-h)<D.EPSILON5&&Math.abs(L-m)<D.EPSILON5)continue;let b=Math.abs(N)<D.EPSILON5||Math.abs(N-1)<D.EPSILON5,T=Math.abs(L)<D.EPSILON5||Math.abs(L-1)<D.EPSILON5;if(b&&T)continue;let B=y.decodePosition(E,v,FB),R=y.decodeHeight(E,v),O;y.hasVertexNormals?O=y.getOctEncodedNormal(E,v,i$):(O=i$,O.x=0,O.y=0);let U=L;if(y.hasWebMercatorT){let z=D.lerp(f.south,f.north,L);U=(ui.geodeticLatitudeToMercatorAngle(z)-x)*S}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(B,s$)),n.encode(i,o*I,B,P,R,O,U,k),c.minimumHeight=Math.min(c.minimumHeight,R),c.maximumHeight=Math.max(c.maximumHeight,R),++o}return o}function rxe(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 u=s;u!==a;u+=c){let f=e[u],h=t[u];if(!a$(h,f))continue;let m;switch(i){case In.WEST:m=f.westIndicesSouthToNorth;break;case In.SOUTH:m=f.southIndicesEastToWest;break;case In.EAST:m=f.eastIndicesNorthToSouth;break;case In.NORTH:m=f.northIndicesWestToEast;break}let g=m[n?0:m.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function a$(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function sxe(e,t,n,i,o,r,s,a){let c,u,f,h,m,g=i[o?0:n.length-1],A=n[o?0:n.length-1];if(a$(g,A)&&(r===0?s===0?(c=o?A.northIndicesWestToEast:A.eastIndicesNorthToSouth,u=o,f=o):(c=o?A.eastIndicesNorthToSouth:A.southIndicesEastToWest,u=!o,f=!1):s===0?(c=o?A.westIndicesSouthToNorth:A.northIndicesWestToEast,u=!o,f=!0):(c=o?A.southIndicesEastToWest:A.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){h=o?0:c.length-1,m=c[h],A.encoding.decodeTextureCoordinates(A.vertices,m,Qf);let _=j2(g,e.tile,Qf,Qf);if(_.x===r&&_.y===s)return r$(A,m,r,s,a),!0;if(h=go(c,u?r:s,function(C,y){A.encoding.decodeTextureCoordinates(A.vertices,C,Qf);let E=j2(g,e.tile,Qf,Qf);return f?u?E.x-r:E.y-s:u?r-E.x:s-E.y}),h<0){if(h=~h,h>0&&h<c.length)return Fyt(t,g,e.tile,A,c[h-1],c[h],r,s,u,a),!0}else return r$(A,c[h],r,s,a),!0}return!1}var kyt=[new d,new d,new d,new d];function Uyt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=kyt;return d.fromRadians(n.west,n.south,o,a,c[0]),d.fromRadians(n.east,n.south,o,a,c[1]),d.fromRadians(n.west,n.north,o,a,c[2]),d.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var kB=QB;function Dr(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=Tn.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 _e,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(Dr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(Dr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(Dr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(Dr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new _e,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 G(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=oe.SCENE3D}Object.defineProperties(Dr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=se.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){cs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Qh.setOwner(e,this,"_clippingPolygons")}}});function Gyt(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}Dr.prototype.update=function(e){this._imageryLayers._update()};function zyt(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)}}Dr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Gyt)})),zyt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)Jd._freeVertexArray(t[i]);t.length=0};Dr.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};Dr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Wa.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},blending:dn.ALPHA_BLEND});let a=Ve(this._renderState,!0);a.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(a),a=Ve(this._blendRenderState,!0),a.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(a)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&kB.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 u=s[a];if(l(u))for(let f=0,h=u.length;f<h;++f){let m=u[f],g=m.data.tileBoundingRegion;dEt(this,m,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,g.minimumHeight)}}};function hxe(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)}Dr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)hxe(t[n],e)};Dr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};Dr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};Dr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===si.CULLED_BUT_NEEDED,o=n.terrainState),Jd.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)!==Vr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,Jd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Vyt=new le,Axe=new ce,Hyt=new ce,Yyt=new he;function $8(e,t){if(t.west<t.east)return t;let n=ce.clone(t,Hyt);return ce.center(e,Yyt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function mxe(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||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}Dr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=mxe(this,t);if(t.fog.enabled&&!o&&D.fog(i,t.fog.density)>=1)return Vr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return Vr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=$8(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,Axe);if(!l(f))return Vr.NONE;if(ce.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=Vyt,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),d.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===oe.MORPHING&&l(r.renderedMesh)&&(c=le.union(s.boundingSphere,c,c))),!l(c))return Vr.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let C=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=C!==qt.INSIDE,C===qt.OUTSIDE)return Vr.NONE}let m=this._clippingPolygons;if(l(m)&&m.enabled){let C=m.computeIntersectionWithBoundingVolume(s);e.isClipped=C!==qt.OUTSIDE}let g,A=a.computeVisibility(c);if(A===qt.OUTSIDE?g=Vr.NONE:A===qt.INTERSECTING?g=Vr.PARTIAL:A===qt.INSIDE&&(g=Vr.FULL),g===Vr.NONE)return g;let _=t.mode===oe.SCENE3D&&t.camera.frustum instanceof fn;if(t.mode===oe.SCENE3D&&!_&&l(n)&&!o){let C=r.occludeePointInScaledSpace;return!l(C)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(C,s.minimumHeight)?g:Vr.NONE}return g};Dr.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 Wyt=[],jyt=[];Dr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Wyt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===Do.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],m=h.loadingImagery,g=!l(m)||m.state===Wn.FAILED||m.state===Wn.INVALID,A=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[A]=g&&i[A]}let u=this.quadtree._lastSelectionFrameNumber,f=jyt;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let h=f.pop(),m=h._lastSelectionResultFrame===u?h._lastSelectionResult:si.NONE;if(m===si.RENDERED){let g=h.data;if(!l(g))continue;if(!o&&h.data.terrainState===Do.READY)return!1;let A=h.data.imagery;for(a=0,c=A.length;a<c;++a){let _=A[a],C=_.loadingImagery,y=!l(C)||C.state===Wn.FAILED||C.state===Wn.INVALID,E=(_.loadingImagery||_.readyImagery).imageryLayer._layerIndex;if(y&&!i[E])return!1}}else m===si.REFINED&&f.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var qyt=new d;Dr.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=d.subtract(i.center,o,qyt),a=d.magnitude(s);return a<D.EPSILON5?0:(d.divideByScalar(s,a,s),(1-d.dot(s,r))*e._distance)};var lxe=new M,Z8=new M,Kyt=new se,Jyt=new se,Xyt=new se,Zyt=new d,uxe=new d,$yt=new d,eEt=new d;Dr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.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 tEt=[new d,new d,new d,new d];function fxe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=tEt;return d.fromRadians(n.west,n.south,o,a,c[0]),d.fromRadians(n.east,n.south,o,a,c[1]),d.fromRadians(n.west,n.north,o,a,c[2]),d.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}Dr.prototype.computeDistanceToTile=function(e,t){nEt(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,u=Math.abs(c-r),f=Math.abs(c-s);u>f?(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 nEt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Jd);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new mf({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,f=i.mesh,h=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.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 m=e.parent;for(;m!==void 0;){let g=m.data;if(g!==void 0){let A=g.mesh,_=g.terrainData;if(A!==void 0&&A.minimumHeight!==void 0&&A.maximumHeight!==void 0){r.minimumHeight=A.minimumHeight,r.maximumHeight=A.maximumHeight;break}else if(_!==void 0&&_._minimumHeight!==void 0&&_._maximumHeight!==void 0){r.minimumHeight=_._minimumHeight,r.maximumHeight=_._maximumHeight;break}}m=m.parent}u=m}if(u!==void 0){let m=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(m!==1&&(c=!1,r.minimumHeight=Eo.getHeight(r.minimumHeight,m,g),r.maximumHeight=Eo.getHeight(r.maximumHeight,m,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=$t.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=d.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=fxe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let _=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||_)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=fxe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}Dr.prototype.isDestroyed=function(){return!1};Dr.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(),de(this)};function iEt(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}Dr.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,u=c.length,f=-1,h=0;for(a=0;a<u;++a){let g=c[a];if((g.readyImagery??g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++h;else if(f!==-1)break}if(f===-1)return;let m=f+h;e._createTileImagerySkeletons(s,n,m)&&(s._loadedCallbacks[e._layerIndex]=iEt(h,e,n),s.state=La.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=La.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==si.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};Dr.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],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.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()};Dr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};Dr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var oEt=new M,rEt=new M;function dxe(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=M.multiplyByPoint(i,this.properties.rtc,uxe);return M.setTranslation(i,o,lxe),lxe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=M.multiplyByPoint(i,this.properties.rtc,uxe);return M.setTranslation(i,r,Z8),M.multiply(o,Z8,Z8),Z8},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)?M.multiply(e.context.uniformState.view,i.modelMatrix,oEt):M.IDENTITY;return M.inverseTranspose(o,rEt)},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 se(0,0,.5,1),fillHighlightColor:new G(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new F(65e5,9e6),nightFadeDistance:new F(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new d(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new d(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new d,center3D:void 0,rtc:new d,modifiedModelView:new M,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new F(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new F,southMercatorYAndOneOverHeight:new F,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new F,scaleAndBias:new M,clippingPlanesEdgeColor:G.clone(G.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:G.clone(G.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?St(n,t.materialUniformMap):n}function sEt(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=aEt(e,r,o),i.wireframeVertexArray.mesh=o}}function aEt(e,t,n){let o={indices:n.indices,primitiveType:Pe.TRIANGLES};Un.toWireframe(o);let r=o.indices,s=ut.createIndexBuffer({context:e,typedArray:r,usage:Oe.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new oi({context:e,attributes:t._attributes,indexBuffer:s})}var pxe,gxe,e5;(function(){let e=new Rt({geometry:bh.fromDimensions({dimensions:new d(2,2,2)})}),t=new Rt({geometry:new vg({radius:1})}),n=new M,i,o;function r(s){return new Ln({geometryInstances:s,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})}pxe=function(s,a){return s===i||(e5(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Xt.fromColor(a),o=r(e)),o},gxe=function(s,a){return s===i||(e5(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Xt.fromColor(a),o=r(t)),o},e5=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var cEt=new se(0,0,0,0),lEt={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},uEt=G.TRANSPARENT,fEt=new Ht;function dEt(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new kB(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let lt=r.credits;for(let Nt=0,Mn=lt.length;Nt<Mn;++Nt)o.addCreditToNextFrame(lt[Nt])}let s=Ft.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,h=f.translucent,m=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,A=f.rectangle,_=e.undergroundColor??uEt,C=e.undergroundColorAlphaByDistance??fEt,y=mxe(e,n)&&n.mode===oe.SCENE3D&&_.alpha>0&&(C.nearValue>0||C.farValue>0),E=e.lambertDiffuseMultiplier,I=e.vertexShadowDarkness,x=e.hasWaterMask&&l(a),S=x&&e.showWaterEffect,w=e.oceanNormalMap,v=S&&l(w),P=e.terrainProvider,N=l(P)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,p=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,b=Tn.castShadows(e.shadows)&&!h,T=Tn.receiveShadows(e.shadows)&&!h,B=e.hueShift,R=e.saturationShift,O=e.brightnessShift,U=!(D.equalsEpsilon(B,0,D.EPSILON7)&&D.equalsEpsilon(R,0,D.EPSILON7)&&D.equalsEpsilon(O,0,D.EPSILON7)),k=!1;if(p){let lt=d.magnitude(n.camera.positionWC),Nt=e.nightFadeOutDistance;k=lt>Nt}x&&--s,v&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let z=i.renderedMesh,Q=z.center,H=z.encoding,W=i.tileBoundingRegion,Z=n.verticalExaggeration,Y=n.verticalExaggerationRelativeHeight,$=Z!==1,K=H.hasGeodeticSurfaceNormals,fe=Kyt,ge=0,ne=0,Ce=0,ye=0,De=!1;if(n.mode!==oe.SCENE3D){let lt=n.mapProjection,Nt=lt.project(ce.southwest(t.rectangle),$yt),Mn=lt.project(ce.northeast(t.rectangle),eEt);if(fe.x=Nt.x,fe.y=Nt.y,fe.z=Mn.x,fe.w=Mn.y,n.mode!==oe.MORPHING&&(Q=Zyt,Q.x=0,Q.y=(fe.z+fe.x)*.5,Q.z=(fe.w+fe.y)*.5,fe.x-=Q.y,fe.y-=Q.z,fe.z-=Q.y,fe.w-=Q.z),n.mode===oe.SCENE2D&&H.quantization===Ma.BITS12){let at=1/(Math.pow(2,12)-1)*.5,fi=(fe.z-fe.x)*at,ro=(fe.w-fe.y)*at;fe.x-=fi,fe.y-=ro,fe.z+=fi,fe.w+=ro}lt instanceof ui&&(ge=t.rectangle.south,ne=t.rectangle.north,Ce=ui.geodeticLatitudeToMercatorAngle(ge),ye=1/(ui.geodeticLatitudeToMercatorAngle(ne)-Ce),De=!0)}let be=lEt;be.frameState=n,be.surfaceTile=i,be.hasWaterMask=x,be.showReflectiveOcean=S,be.showOceanWaves=v,be.enableLighting=e.enableLighting,be.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,be.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,be.showGroundAtmosphere=p,be.atmosphereLightIntensity=e.atmosphereLightIntensity,be.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,be.atmosphereMieCoefficient=e.atmosphereMieCoefficient,be.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,be.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,be.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,be.perFragmentGroundAtmosphere=k,be.hasVertexNormals=N,be.useWebMercatorProjection=De,be.clippedByBoundaries=i.clippedByBoundaries,be.hasGeodeticSurfaceNormals=K,be.hasExaggeration=$;let Ne=i.imagery,ke=0,Ue=Ne.length,He=e.showSkirts&&!u&&!h,Et=e.backFaceCulling&&!u&&!h,Ye=Et?e._renderState:e._disableCullingRenderState,nt=Et?e._blendRenderState:e._disableCullingBlendRenderState,Ct=Ye,Wt=e._firstPassInitialColor,Qn=n.context;if(l(e._debug.boundingSphereTile)||e5(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let lt=e._drawCommands.length;for(let Nt=0;Nt<lt;++Nt)e._uniformMaps[Nt]=dxe(n,e)}do{let lt=0,Nt,Mn;if(e._drawCommands.length<=e._usedDrawCommands?(Nt=new et,Nt.owner=t,Nt.cull=!1,Nt.boundingVolume=new le,Nt.orientedBoundingBox=void 0,Mn=dxe(n,e),e._drawCommands.push(Nt),e._uniformMaps.push(Mn)):(Nt=e._drawCommands[e._usedDrawCommands],Mn=e._uniformMaps[e._usedDrawCommands]),Nt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Fs=W.boundingVolume,Ua=W.boundingSphere;l(Fs)?pxe(Fs,G.RED).update(n):l(Ua)&&gxe(Ua,G.RED).update(n)}let at=Mn.properties;se.clone(Wt,at.initialColor),at.oceanNormalMap=w,at.lightingFadeDistance.x=e.lightingFadeOutDistance,at.lightingFadeDistance.y=e.lightingFadeInDistance,at.nightFadeDistance.x=e.nightFadeOutDistance,at.nightFadeDistance.y=e.nightFadeInDistance,at.atmosphereLightIntensity=e.atmosphereLightIntensity,at.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,at.atmosphereMieCoefficient=e.atmosphereMieCoefficient,at.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,at.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,at.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,at.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let fi=u?g:m,ro=u?m:g;l(fi)&&(se.fromElements(fi.near,fi.nearValue,fi.far,fi.farValue,at.frontFaceAlphaByDistance),se.fromElements(ro.near,ro.nearValue,ro.far,ro.farValue,at.backFaceAlphaByDistance)),se.fromElements(C.near,C.nearValue,C.far,C.farValue,at.undergroundColorAlphaByDistance),G.clone(_,at.undergroundColor),at.lambertDiffuseMultiplier=E,at.vertexShadowDarkness=I;let Ao=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Ao&&G.clone(e.fillHighlightColor,at.fillHighlightColor),at.verticalExaggerationAndRelativeHeight.x=Z,at.verticalExaggerationAndRelativeHeight.y=Y,at.center3D=z.center,d.clone(Q,at.rtc),se.clone(fe,at.tileRectangle),at.southAndNorthLatitude.x=ge,at.southAndNorthLatitude.y=ne,at.southMercatorYAndOneOverHeight.x=Ce,at.southMercatorYAndOneOverHeight.y=ye;let ii=Jyt,so=$8(t.rectangle,e.cartographicLimitRectangle),ao=Xyt,Ui=$8(t.rectangle,A);d.fromElements(B,R,O,at.hsbShift);let Pi=t.rectangle,Vn=1/Pi.width,co=1/Pi.height;ii.x=(so.west-Pi.west)*Vn,ii.y=(so.south-Pi.south)*co,ii.z=(so.east-Pi.west)*Vn,ii.w=(so.north-Pi.south)*co,se.clone(ii,at.localizedCartographicLimitRectangle),ao.x=(Ui.west-Pi.west)*Vn,ao.y=(Ui.south-Pi.south)*co,ao.z=(Ui.east-Pi.west)*Vn,ao.w=(Ui.north-Pi.south)*co,se.clone(ao,at.localizedTranslucencyRectangle);let Vo=L&&D.fog(t._distance,n.fog.density)>D.EPSILON3;U=U&&(Vo||p);let hr=!1,Rr=!1,Js=!1,Is=!1,ka=!1,mo=!1,vn=!1,Ho=!1,Yo=!1,Xs=!1;for(;lt<s&&ke<Ue;){let Fs=Ne[ke],Ua=Fs.readyImagery;if(++ke,!l(Ua)||Ua.imageryLayer.alpha===0)continue;let zA=Fs.useWebMercatorT?Ua.textureWebMercator:Ua.texture,Ro=Ua.imageryLayer;l(Fs.textureTranslationAndScale)||(Fs.textureTranslationAndScale=Ro._calculateTextureTranslationAndScale(t,Fs)),at.dayTextures[lt]=zA,at.dayTextureTranslationAndScale[lt]=Fs.textureTranslationAndScale,at.dayTextureTexCoordsRectangle[lt]=Fs.textureCoordinateRectangle,at.dayTextureUseWebMercatorT[lt]=Fs.useWebMercatorT,at.dayTextureAlpha[lt]=Ro.alpha,mo=mo||at.dayTextureAlpha[lt]!==1,at.dayTextureNightAlpha[lt]=Ro.nightAlpha,vn=vn||at.dayTextureNightAlpha[lt]!==1,at.dayTextureDayAlpha[lt]=Ro.dayAlpha,vn=vn||at.dayTextureDayAlpha[lt]!==1,at.dayTextureBrightness[lt]=Ro.brightness,hr=hr||at.dayTextureBrightness[lt]!==ds.DEFAULT_BRIGHTNESS,at.dayTextureContrast[lt]=Ro.contrast,Rr=Rr||at.dayTextureContrast[lt]!==ds.DEFAULT_CONTRAST,at.dayTextureHue[lt]=Ro.hue,Js=Js||at.dayTextureHue[lt]!==ds.DEFAULT_HUE,at.dayTextureSaturation[lt]=Ro.saturation,Is=Is||at.dayTextureSaturation[lt]!==ds.DEFAULT_SATURATION,at.dayTextureOneOverGamma[lt]=1/Ro.gamma,ka=ka||at.dayTextureOneOverGamma[lt]!==1/ds.DEFAULT_GAMMA,at.dayTextureSplit[lt]=Ro.splitDirection,Ho=Ho||at.dayTextureSplit[lt]!==0;let eu=at.dayTextureCutoutRectangles[lt];if(l(eu)||(eu=at.dayTextureCutoutRectangles[lt]=new se),se.clone(se.ZERO,eu),l(Ro.cutoutRectangle)){let Mo=$8(Pi,Ro.cutoutRectangle),nu=ce.simpleIntersection(Mo,Pi,Axe);Yo=l(nu)||Yo,eu.x=(Mo.west-Pi.west)*Vn,eu.y=(Mo.south-Pi.south)*co,eu.z=(Mo.east-Pi.west)*Vn,eu.w=(Mo.north-Pi.south)*co}let tu=at.colorsToAlpha[lt];l(tu)||(tu=at.colorsToAlpha[lt]=new se);let Aa=l(Ro.colorToAlpha)&&Ro.colorToAlphaThreshold>0;if(Xs=Xs||Aa,Aa){let Mo=Ro.colorToAlpha;tu.x=Mo.red,tu.y=Mo.green,tu.z=Mo.blue,tu.w=Ro.colorToAlphaThreshold}else tu.w=-1;if(l(Ua.credits)){let Mo=Ua.credits;for(let nu=0,An=Mo.length;nu<An;++nu)o.addCreditToNextFrame(Mo[nu])}++lt}at.dayTextures.length=lt,at.waterMask=a,se.clone(c,at.waterMaskTranslationAndScale),at.minMaxHeight.x=H.minimumHeight,at.minMaxHeight.y=H.maximumHeight,M.clone(H.matrix,at.scaleAndBias);let Ri=e._clippingPlanes,Po=l(Ri)&&Ri.enabled&&t.isClipped;Po&&(at.clippingPlanesEdgeColor=G.clone(Ri.edgeColor,at.clippingPlanesEdgeColor),at.clippingPlanesEdgeWidth=Ri.edgeWidth);let dc=e._clippingPolygons,Zs=l(dc)&&dc.enabled&&t.isClipped;be.numberOfDayTextures=lt,be.applyBrightness=hr,be.applyContrast=Rr,be.applyHue=Js,be.applySaturation=Is,be.applyGamma=ka,be.applyAlpha=mo,be.applyDayNightAlpha=vn,be.applySplit=Ho,be.enableFog=Vo,be.enableClippingPlanes=Po,be.clippingPlanes=Ri,be.enableClippingPolygons=Zs,be.clippingPolygons=dc,be.hasImageryLayerCutout=Yo,be.colorCorrect=U,be.highlightFillTile=Ao,be.colorToAlpha=Xs,be.showUndergroundColor=y,be.translucent=h;let Mr=i.renderedMesh.indices.length;He||(Mr=i.renderedMesh.indexCountWithoutSkirts),Nt.shaderProgram=e._surfaceShaderSet.getShaderProgram(be),Nt.castShadows=b,Nt.receiveShadows=T,Nt.renderState=Ct,Nt.primitiveType=Pe.TRIANGLES,Nt.vertexArray=i.vertexArray||i.fill.vertexArray,Nt.count=Mr,Nt.uniformMap=Mn,Nt.pass=we.GLOBE,e._debug.wireframe&&(sEt(Qn,e,t),l(i.wireframeVertexArray)&&(Nt.vertexArray=i.wireframeVertexArray,Nt.primitiveType=Pe.LINES,Nt.count=Mr*2));let Nr=Nt.boundingVolume,uh=Nt.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,W.minimumHeight,W.maximumHeight,Nr),d.fromElements(Nr.center.z,Nr.center.x,Nr.center.y,Nr.center),n.mode===oe.MORPHING&&(Nr=le.union(W.boundingSphere,Nr,Nr))):(Nt.boundingVolume=le.clone(W.boundingSphere,Nr),Nt.orientedBoundingBox=$t.clone(W.boundingVolume,uh)),Nt.dirty=!0,h&&f.updateDerivedCommands(Nt,n),hxe(Nt,n),Ct=nt,Wt=cEt}while(ke<Ue)}var q2=Dr;function _xe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(_xe.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=Ht.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=Ht.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var K2=_xe;function Cxe(e){this._ellipsoid=new aA(e.ellipsoid,d.ZERO)}Object.defineProperties(Cxe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var J2=Cxe;var c$=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()}},hEt=1e3;function Oa(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=si.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new c$(hEt),this.state=La.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Oa.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 Oa({tilingScheme:e,x:s,y:r,level:0});return i};var AEt=256;function mEt(e,t,n,i){let o=n.width/AEt*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}Oa.prototype._getCacheKey=function(e,t){return mEt(e.longitude,e.latitude,this._rectangle,t)};Oa.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};Oa.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};Oa.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};Oa.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),yxe(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),yxe(this,o.positionCartographic)._removedCustomData.push(o)}this._removedCustomData.length=0};var pEt=new he;function yxe(e,t){let n=e.northwestChild.rectangle,i=ce.southeast(n,pEt),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(Oa.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 Oa({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 Oa({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 Oa({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 Oa({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<La.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Oa.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]};Oa.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};Oa.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};Oa.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};Oa.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};Oa.prototype.freeResources=function(){this.clearPositionCache(),this.state=La.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),t5(this._southwestChild),this._southwestChild=void 0,t5(this._southeastChild),this._southeastChild=void 0,t5(this._northwestChild),this._northwestChild=void 0,t5(this._northeastChild),this._northeastChild=void 0};function t5(e){l(e)&&e.freeResources()}var X2=Oa;function n5(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}n5.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};n5.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(),Exe(this,t)),t=i}};function Exe(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}n5.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))&&Exe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var Z2=n5;function Xd(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._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new Z2,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 J2({ellipsoid:n}),this._tileLoadProgressEvent=new _e,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Xd.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Xd.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function gEt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,bxe(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()}Xd.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==La.START&&e(t),t=t.replacementNext};Xd.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};Xd.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};Xd.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function bxe(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}Xd.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(gEt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),bxe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};Xd.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),EEt(this,e),PEt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function _Et(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=_e.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))}Xd.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(BEt(this,e),vEt(this,e),_Et(this,e))};Xd.prototype.isDestroyed=function(){return!1};Xd.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var ek,Ixe=new he;function CEt(e,t){let n=ce.center(e.rectangle,Ixe),i=n.longitude-ek.longitude,o=n.latitude-ek.latitude;n=ce.center(t.rectangle,Ixe);let r=n.longitude-ek.longitude,s=n.latitude-ek.latitude;return i*i+o*o-(r*r+s*s)}var yEt=new d,$2=[];function EEt(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 m=o.tilingScheme;e._levelZeroTiles=X2.createLevelZeroTiles(m);let g=e._levelZeroTiles.length;if($2.length<g){$2=new Array(g);for(let A=0;A<g;++A)$2[A]===void 0&&($2[A]=new tk)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,s=r.length>1?e._occluders:void 0;ek=t.camera.positionCartographic,r.sort(CEt);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(h=>{let m=r.find(g=>ce.contains(g.rectangle,h.positionCartographic));m&&m._addedCustomData.push(h)}),c.forEach(h=>{let m=r.find(g=>ce.contains(g.rectangle,h.positionCartographic));m&&m._removedCustomData.push(h)}),r.forEach(h=>h.updateCustomData()),a.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=M.getTranslation(u.transform,yEt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let h=0;h<r.length;++h){let m=r[h];e._tileReplacementQueue.markTileRendered(m),m.renderable?wc(e,m,o,t,s,!1,$2[h]):(h_(e,e._tileLoadQueueHigh,m,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function h_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function tk(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function xxe(){this.southwest=new tk,this.southeast=new tk,this.northwest=new tk,this.northeast=new tk}xxe.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 u$=new Array(31);for(let e=0;e<u$.length;++e)u$[e]=new xxe;function IEt(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=TEt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,h=e._lastSelectionFrameNumber,m=n._lastSelectionResultFrame===h?n._lastSelectionResult:si.NONE,g=e.tileProvider;if(s||i){let A=si.originalResult(m)===si.RENDERED,_=si.originalResult(m)===si.CULLED||m===si.NONE,C=n.state===La.DONE,y=A||_||C;if(y||l(g.canRenderWithoutLosingDetail)&&(y=g.canRenderWithoutLosingDetail(n)),y){s&&h_(e,e._tileLoadQueueMedium,n,t),i5(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=m===si.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=si.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&h_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){i5(e,n),h_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=m===si.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=si.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=si.REFINED;let _=e._tilesToRender.length,C=e._tileLoadQueueLow.length,y=e._tileLoadQueueMedium.length,E=e._tileLoadQueueHigh.length,I=e._tileToUpdateHeights.length;if(bEt(e,a,c,u,f,t,i,o),_!==e._tilesToRender.length){let x=o.allAreRenderable,S=o.anyWereRenderedLastFrame,w=o.notYetRenderableCount,v=!1;if(!x&&!S){let P=e._tilesToRender;for(let L=_;L<P.length;++L){let p=P[L];for(;p!==void 0&&p._lastSelectionResult!==si.KICKED&&p!==n;)p._lastSelectionResult=si.kick(p._lastSelectionResult),p=p.parent}e._tilesToRender.length=_,e._tileToUpdateHeights.length=I,i5(e,n),n._lastSelectionResult=si.RENDERED;let N=m===si.RENDERED;!N&&w>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=C,e._tileLoadQueueMedium.length=y,e._tileLoadQueueHigh.length=E,h_(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=N,N||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&h_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=si.RENDERED,i5(e,n),h_(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=m===si.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function bEt(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,h=u$[t.level],m=h.southwest,g=h.southeast,A=h.northwest,_=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(wc(e,t,u,r,f,s,m),wc(e,n,u,r,f,s,g),wc(e,i,u,r,f,s,A),wc(e,o,u,r,f,s,_)):(wc(e,i,u,r,f,s,A),wc(e,t,u,r,f,s,m),wc(e,o,u,r,f,s,_),wc(e,n,u,r,f,s,g)):c.latitude<t.rectangle.north?(wc(e,n,u,r,f,s,g),wc(e,t,u,r,f,s,m),wc(e,o,u,r,f,s,_),wc(e,i,u,r,f,s,A)):(wc(e,o,u,r,f,s,_),wc(e,i,u,r,f,s,A),wc(e,n,u,r,f,s,g),wc(e,t,u,r,f,s,m)),h.combine(a)}function xEt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function wc(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Vr.NONE)return IEt(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,xEt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&h_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:si.NONE;c!==si.CULLED_BUT_NEEDED&&c!==si.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=si.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(h_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=si.CULLED):t._lastSelectionResult=si.CULLED;t._lastSelectionResultFrame=i.frameNumber}function TEt(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof fn||t.camera.frustum instanceof rs)return SEt(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-=D.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function SEt(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,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),h=u/f;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=D.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function i5(e,t){e._tilesToRender.push(t)}function BEt(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=Oi()+e._loadQueueTimeSlice,s=e._tileProvider,a=l$(e,t,s,r,n,!1);a=l$(e,t,s,r,i,a),l$(e,t,s,r,o,a)}function wEt(e,t){return e._loadPriority-t._loadPriority}function l$(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(wEt);for(let s=0,a=o.length;s<a&&(Oi()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var UB=new gn,o5=new he,Qy=new d,DEt=[];function vEt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=DEt;n.length=0;let i=e._tileToUpdateHeights,o=Oi(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let C=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:si.NONE;(C===si.RENDERED||C===si.CULLED_BUT_NEEDED)&&n.push(h),h.clearPositionCache(),i.shift();continue}let m=h.customData;l(h._customDataIterator)||(h._customDataIterator=m.values());let g=h._customDataIterator,A=!1,_;for(;!(_=g.next()).done;){let C=_.value,y=h.data.terrainData,E=l(y)&&y.wasCreatedByUpsampling();if(h.level>C.level&&!E){let I,x=h.getPositionCacheEntry(C.positionCartographic,e.maximumScreenSpaceError);if(l(x))I=x;else{if(l(C.positionOnEllipsoidSurface)||(C.positionOnEllipsoidSurface=d.fromRadians(C.positionCartographic.longitude,C.positionCartographic.latitude,0,u)),a===oe.SCENE3D){let S=u.geodeticSurfaceNormal(C.positionOnEllipsoidSurface,UB.direction),w=u.getSurfaceNormalIntersectionWithZAxis(C.positionOnEllipsoidSurface,11500,UB.origin);if(!l(w)){let v=0;l(h.data.tileBoundingRegion)&&(v=h.data.tileBoundingRegion.minimumHeight);let P=Math.min(v,-11500),N=d.multiplyByScalar(S,Math.abs(P)+1,Qy);d.subtract(C.positionOnEllipsoidSurface,N,UB.origin)}}else he.clone(C.positionCartographic,o5),o5.height=-11500,c.project(o5,Qy),d.fromElements(Qy.z,Qy.x,Qy.y,Qy),d.clone(Qy,UB.origin),d.clone(d.UNIT_X,UB.direction);I=h.data.pick(UB,a,c,!1,Qy),l(I)&&h.setPositionCacheEntry(C.positionCartographic,e.maximumScreenSpaceError,I)}if(l(I)){if(l(C.callback)){let S=u.cartesianToCartographic(I,o5);C.callback(S)}C.level=h.level}}if(Oi()>=s){A=!0;break}}if(A){h._customDataIterator=g;break}else h._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function PEt(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 nk=Xd;function MA(e){e=e??te.default;let t=new qm({ellipsoid:e}),n=new t0;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new W2,this._material=void 0,this._surface=new nk({tileProvider:new q2({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new _e,this._undergroundColor=G.clone(G.BLACK),this._undergroundColorAlphaByDistance=new Ht(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new K2,d$(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Be({url:Zt("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=te.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=D.PI*e.minimumRadius,this.nightFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*D.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Tn.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(MA.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=ce.clone(ce.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)&&d$(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,d$(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=G.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Ht.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function d$(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[kh,LB];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(O2),e._surfaceShaderSet.baseVertexShaderSource=new We({sources:[kh,LB,F2],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new We({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function REt(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var MEt=[],NEt={start:0,stop:0};MA.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=MEt;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let m=u.data;if(!l(m))continue;let g=m.pickBoundingSphere;if(o!==oe.SCENE3D)m.pickBoundingSphere=g=le.fromRectangleWithHeights2D(u.rectangle,r,m.tileBoundingRegion.minimumHeight,m.tileBoundingRegion.maximumHeight,g),d.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(m.renderedMesh))le.clone(m.tileBoundingRegion.boundingSphere,g);else continue;let A=ci.raySphere(e,g,NEt);l(A)&&s.push(m)}s.sort(REt(e.origin));let h;for(c=s.length,f=0;f<c&&(h=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(h));++f);return h};var LEt=new he;MA.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=d.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,LEt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var OEt=new d,Txe=new d,FEt=new he,QEt=new gn;function f$(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}MA.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],!ce.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=f$(n._southwestChild,e)||f$(n._southeastChild,e)||f$(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=d.fromRadians(e.longitude,e.latitude,0,a,OEt),u=QEt,f=a.geodeticSurfaceNormal(c,u.direction),h=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(h)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let A=Math.min(g??0,-11500),_=d.multiplyByScalar(f,Math.abs(A)+1,Txe);d.subtract(c,_,u.origin)}let m=n.data.pick(u,oe.SCENE3D,s,!1,Txe);if(l(m))return a.cartesianToCartographic(m,FEt).height};MA.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};MA.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 u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Bt({context:e.context,source:f}))})}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===oe.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))};MA.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};MA.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};MA.prototype.isDestroyed=function(){return!1};MA.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(),de(this)};var ik=MA;var h$={position:0};function r5(e){e=e??V.EMPTY_OBJECT,this.center=d.clone(e.center??d.ZERO),this._center=new d,this.radii=d.clone(e.radii),this._radii=new d,this._oneOverEllipsoidRadiiSquared=new d,this._boundingSphere=new le,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=e.show??!0,this.material=e.material??uo.fromType(uo.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 et({owner:e._owner??this}),this._pickCommand=new et({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 kEt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=mc.createGeometry(mc.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Re.POSITION_ONLY}));return t=oi.fromGeometry({context:e,geometry:n,attributeLocations:h$,bufferUsage:Oe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}r5.prototype.update=function(e){if(!this.show||e.mode!==oe.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=ze.fromCache({cull:{enabled:!0,face:Ni.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?dn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=kEt(t));let o=!1,r=this.radii;if(!d.equals(this._radii,r)){d.clone(r,this._radii);let _=this._oneOverEllipsoidRadiiSquared;_.x=1/(r.x*r.x),_.y=1/(r.y*r.y),_.z=1/(r.z*r.z),o=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!d.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),d.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(d.clone(d.ZERO,this._boundingSphere.center),this._boundingSphere.radius=d.maximumComponent(r),le.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,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,h,m;(s||a||i||u)&&(h=new We({sources:[NB]}),m=new We({sources:[this.material.shaderSource,MB]}),this.onlySunLighting&&m.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&m.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),m.defines.push("LOG_DEPTH")),this._sp=sn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:m,attributeLocations:h$}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=St(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,A=e.passes;if(A.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?we.TRANSLUCENT:we.OPAQUE,g.push(f)),A.pick){let _=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)||u)&&(h=new We({sources:[NB]}),m=new We({sources:[this.material.shaderSource,MB],pickColorQualifier:"uniform"}),this.onlySunLighting&&m.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&m.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),m.defines.push("LOG_DEPTH")),this._pickSP=sn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:m,attributeLocations:h$}),_.vertexArray=this._va,_.renderState=this._rs,_.shaderProgram=this._pickSP,_.uniformMap=St(St(this._uniforms,this._pickUniforms),this.material._uniforms),_.executeInClosestFrustum=n),_.boundingVolume=this._boundingSphere,_.modelMatrix=this._computedModelMatrix,_.pass=n?we.TRANSLUCENT:we.OPAQUE,g.push(_)}};r5.prototype.isDestroyed=function(){return!1};r5.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(),de(this)};var ok=r5;function rk(e){e=e??V.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Zt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??te.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new ok({radii:this.ellipsoid.radii,material:uo.fromType(uo.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new m2}Object.defineProperties(rk.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var s5=new X,UEt=new X,GEt=new d,a5=[];rk.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(It.computeIcrfToFixedMatrix(n,s5))||It.computeTemeToPseudoFixedMatrix(n,s5);let i=this._axes.evaluate(n,UEt);X.transpose(i,i),X.multiply(s5,i,i);let o=V_.computeMoonPositionInEarthInertialFrame(n,GEt);X.multiplyByVector(s5,o,o),M.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=a5,a5.length=0,t.update(e),e.commandList=r,a5.length===1?a5[0]:void 0};rk.prototype.isDestroyed=function(){return!1};rk.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),de(this)};var sk=rk;function ak(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(ak.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function zEt(e,t,n){let i=t.createViewportQuadCommand(S2,{framebuffer:n,renderState:ze.fromCache({viewport:new Xe(0,0,256,256)})});e._drawCommand=i}ak.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Bt({context:t,width:256,height:256,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,sampler:Jt.NEAREST});this._colorTexture=n;let i=new os({context:t,colorTextures:[n],destroyAttachments:!1});zEt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};ak.prototype.isDestroyed=function(){return!1};ak.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),de(this)};var ck=ak;var Dxe={};function VEt(e,t,n){let i,o,r;if(e instanceof ki){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 HEt=new d,Sxe=new d;function vxe(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(u){let f=n(u);if(u<=.5){let m=(f-o)/a;return D.lerp(e,-D.PI_OVER_TWO,m)}let h=(f-r)/c;return D.lerp(-D.PI_OVER_TWO,t,1-h)}}return function(o){return D.lerp(e,t,o)}}function m$(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,f=e.right,h=e.frustum,m=d.subtract(a,c,HEt),g=d.magnitude(d.multiplyByScalar(u,d.dot(m,u),Sxe)),A=d.magnitude(d.multiplyByScalar(f,d.dot(m,f),Sxe));r=Math.min(VEt(h,g,A)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(h){let m=h*(f-u)+u;return-Math.pow(m,8)/1e6+r}}return function(a){return D.lerp(n,i,a)}}function lk(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var Pxe=new d;function YEt(e,t,n,i,o,r,s,a){let c=e.camera,u=d.clone(c.position,Pxe),f=c.pitch,h=lk(c.heading,i),m=lk(c.roll,r),g=m$(c,n,u.z,n.z,s),A=vxe(f,o,g,a);function _(C){let y=C.time/t;c.setView({orientation:{heading:D.lerp(h,i,y),pitch:A(y),roll:D.lerp(m,r,y)}}),F.lerp(u,n,y,c.position),c.position.z=g(y)}return _}function WEt(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function jEt(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var qEt=new he,KEt=new he;function JEt(e,t,n,i,o,r,s,a,c,u){let f=e.camera,m=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,qEt),A=f.pitch,_=lk(f.heading,i),C=lk(f.roll,r),y=m.cartesianToCartographic(n,KEt);g.longitude=D.zeroToTwoPi(g.longitude),y.longitude=D.zeroToTwoPi(y.longitude);let E=!1;if(l(a)){let w=D.zeroToTwoPi(a),v=Math.min(g.longitude,y.longitude),P=Math.max(g.longitude,y.longitude),N=w>=v&&w<=P;if(l(c)){let L=Math.abs(g.longitude-y.longitude),p=D.TWO_PI-L;(N?L:p)<(N?p:L)*c&&!N&&(E=!0)}else N||(E=!0)}E?WEt(g,y):jEt(g,y);let I=m$(f,n,g.height,y.height,s),x=vxe(A,o,I,u);function S(){let w=g.longitude,v=y.longitude,P=g.latitude,N=y.latitude;return function(p){let b=p.time/t,T=d.fromRadians(D.lerp(w,v,b),D.lerp(P,N,b),I(b),m);f.setView({destination:T,orientation:{heading:D.lerp(_,i,b),pitch:x(b),roll:D.lerp(C,r,b)}})}}return S()}function XEt(e,t,n,i,o,r,s){let a=e.camera,c=d.clone(a.position,Pxe),u=lk(a.heading,i),f=a.frustum.right-a.frustum.left,h=m$(a,n,f,n.z,s);function m(g){let A=g.time/t;a.setView({orientation:{heading:D.lerp(u,i,A)}}),F.lerp(c,n,A,a.position);let _=h(A),C=a.frustum,y=C.top/C.right,E=(_-(C.right-C.left))*.5;C.right+=E,C.left-=E,C.top=y*C.right,C.bottom=-C.top}return m}var Bxe=new he,ZEt=new d;function A$(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function wxe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Dxe.createTween=function(e,t){t=t??V.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===oe.MORPHING)return A$();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,Bxe),n=r.project(Bxe,ZEt));let m=e.camera,g=t.endTransform;l(g)&&m._setTransform(g);let A=t.duration;l(A)||(A=Math.ceil(d.distance(m.position,n)/1e6)+2,A=Math.min(A,3));let _=t.heading??0,C=t.pitch??-D.PI_OVER_TWO,y=t.roll??0,E=e.screenSpaceCameraController;E.enableInputs=!1;let I=wxe(E,t.complete),x=wxe(E,t.cancel),S=m.frustum,w=e.mode===oe.SCENE2D;if(w=w&&F.equalsEpsilon(m.position,n,D.EPSILON6),w=w&&D.equalsEpsilon(Math.max(S.right-S.left,S.top-S.bottom),n.z,D.EPSILON6),w=w||e.mode!==oe.SCENE2D&&d.equalsEpsilon(n,m.position,D.EPSILON10),w=w&&D.equalsEpsilon(D.negativePiToPi(_),D.negativePiToPi(m.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(C),D.negativePiToPi(m.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(y),D.negativePiToPi(m.roll),D.EPSILON10),w)return A$(I,x);let v=new Array(4);if(v[oe.SCENE2D]=XEt,v[oe.SCENE3D]=JEt,v[oe.COLUMBUS_VIEW]=YEt,A<=0)return A$(function(){v[i](e,1,n,_,C,y,a,c,u,f)({time:1}),typeof I=="function"&&I()},x);let P=v[i](e,A,n,_,C,y,a,c,u,f);if(!l(h)){let N=m.positionCartographic.height,L=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;N>L&&N>11500?h=ys.CUBIC_OUT:h=ys.QUINTIC_IN_OUT}return{duration:A,easingFunction:h,startObject:{time:0},stopObject:{time:A},update:P,complete:I,cancel:x}};var uk=Dxe;var $Et={ROTATE:0,INFINITE_SCROLL:1},Lu=Object.freeze($Et);function cn(e){this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new d,this._position=new d,this._positionWC=new d,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new d,this._direction=new d,this._directionWC=new d,this.up=new d,this._up=new d,this._upWC=new d,this.right=new d,this._right=new d,this._rightWC=new d,this.frustum=new ki,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.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 _e,this._moveEnd=new _e,this._changed=new _e,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 M,this._invViewMatrix=new M,kxe(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,Xxe(this,cn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=d.magnitude(this.position);n+=n*cn.DEFAULT_VIEW_FACTOR,d.normalize(this.position,this.position),d.multiplyByScalar(this.position,n,this.position)}cn.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);cn.TRANSFORM_2D_INVERSE=M.inverseTransformation(cn.TRANSFORM_2D,new M);cn.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);cn.DEFAULT_VIEW_FACTOR=.5;cn.DEFAULT_OFFSET=new zd(0,-D.PI_OVER_FOUR,0);function kxe(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function eIt(e){if(!l(e._oldPositionWC))e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=d.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=d.magnitude(t),e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Oi()):e.timeSinceMoved=Math.max(Oi()-e._lastMovedTimestamp,0)/1e3}}cn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};cn.prototype._updateCameraChanged=function(){let e=this;if(eIt(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)%D.TWO_PI;i=i>D.PI?D.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)%D.TWO_PI;s=s>D.PI?D.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===oe.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let m=e.position,g=e._changedPosition,A=e.frustum,_=e._changedFrustum,C=m.x+A.left,y=m.x+A.right,E=g.x+_.left,I=g.x+_.right,x=m.y+A.bottom,S=m.y+A.top,w=g.y+_.bottom,v=g.y+_.top,P=Math.max(C,E),N=Math.min(y,I),L=Math.max(x,w),p=Math.min(S,v),b;if(P>=N||L>=S)b=1;else{let T=_;C<E&&y>I&&x<w&&S>v&&(T=A),b=1-(N-P)*(p-L)/((T.right-T.left)*(T.top-T.bottom))}b>t&&(e._changed.raiseEvent(b),e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection);return}let c=D.acosClamped(d.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let h=d.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||h>t)&&(e._changed.raiseEvent(Math.max(u,h)),e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection))};function tIt(e){It.basisTo2D(e._projection,e._transform,e._actualTransform)}var nIt=new he,iIt=new d,c5=new d,oIt=new se,rIt=new se,sIt=new se,aIt=new se,cIt=new se;function lIt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,oIt),o=n.cartesianToCartographic(i,nIt),r=t.project(o,iIt),s=rIt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,cIt),c=se.add(M.getColumn(e._transform,0,c5),i,c5);n.cartesianToCartographic(c,o),t.project(o,r);let u=sIt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,d.subtract(u,s,u),u.x=0;let f=aIt;if(d.magnitudeSquared(u)>D.EPSILON10)d.cross(a,u,f);else{let h=se.add(M.getColumn(e._transform,1,c5),i,c5);n.cartesianToCartographic(h,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,d.subtract(f,s,f),f.x=0,d.magnitudeSquared(f)<D.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}d.cross(f,a,u),d.normalize(u,u),d.cross(a,u,f),d.normalize(f,f),M.setColumn(e._actualTransform,0,u,e._actualTransform),M.setColumn(e._actualTransform,1,f,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var p$=new d;function sl(e){let t=e._mode,n=!1,i=0;t===oe.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!d.equals(o,e.position)||n;r&&(o=d.clone(e.position,e._position));let s=e._direction,a=!d.equals(s,e.direction);a&&(d.normalize(e.direction,e.direction),s=d.clone(e.direction,e._direction));let c=e._up,u=!d.equals(c,e.up);u&&(d.normalize(e.up,e.up),c=d.clone(e.up,e._up));let f=e._right,h=!d.equals(f,e.right);h&&(d.normalize(e.right,e.right),f=d.clone(e.right,e._right));let m=e._transformChanged||e._modeChanged;e._transformChanged=!1,m&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(cn.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?tIt(e):lIt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||m)if(e._positionWC=M.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let A=p$;A.x=e._positionWC.y,A.y=e._positionWC.z,A.z=e._positionWC.x,t===oe.SCENE2D&&(A.z=i),e._projection.unproject(A,e._positionCartographic)}if(a||u||h){let A=d.dot(s,d.cross(c,f,p$));if(Math.abs(1-A)>D.EPSILON2){let _=1/d.magnitudeSquared(c),C=d.dot(c,s)*_,y=d.multiplyByScalar(s,C,p$);c=d.normalize(d.subtract(c,y,e._up),e._up),d.clone(c,e.up),f=d.cross(s,c,e._right),d.clone(f,e.right)}}(a||m)&&(e._directionWC=M.multiplyByPointAsVector(g,s,e._directionWC),d.normalize(e._directionWC,e._directionWC)),(u||m)&&(e._upWC=M.multiplyByPointAsVector(g,c,e._upWC),d.normalize(e._upWC,e._upWC)),(h||m)&&(e._rightWC=M.multiplyByPointAsVector(g,f,e._rightWC),d.normalize(e._rightWC,e._rightWC)),(r||a||u||h||m)&&kxe(e)}function Uxe(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function Gxe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function zxe(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var f5=new M,d5=new M;Object.defineProperties(cn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return sl(this),this._invTransform}},viewMatrix:{get:function(){return sl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return sl(this),this._invViewMatrix}},positionCartographic:{get:function(){return sl(this),this._positionCartographic}},positionWC:{get:function(){return sl(this),this._positionWC}},directionWC:{get:function(){return sl(this),this._directionWC}},upWC:{get:function(){return sl(this),this._upWC}},rightWC:{get:function(){return sl(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,f5),n=It.eastNorthUpToFixedFrame(this.positionWC,e,d5);this._setTransform(n);let i=Uxe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,f5),n=It.eastNorthUpToFixedFrame(this.positionWC,e,d5);this._setTransform(n);let i=Gxe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,f5),n=It.eastNorthUpToFixedFrame(this.positionWC,e,d5);this._setTransform(n);let i=zxe(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}}});cn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==oe.MORPHING,t=this._mode===oe.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===oe.SCENE2D&&Wxe(this,this.position)};var uIt=new d,fIt=new d,dIt=new d;cn.prototype._setTransform=function(e){let t=d.clone(this.positionWC,uIt),n=d.clone(this.upWC,fIt),i=d.clone(this.directionWC,dIt);M.clone(e,this._transform),this._transformChanged=!0,sl(this);let o=this._actualInvTransform;M.multiplyByPoint(o,t,this.position),M.multiplyByPointAsVector(o,i,this.direction),M.multiplyByPointAsVector(o,n,this.up),d.cross(this.direction,this.up,this.right),sl(this)};var hIt=new F,AIt=new gn,mIt=new d,pIt=new d;function Vxe(e){if(!M.equals(M.IDENTITY,e.transform))return d.magnitude(e.position);let t=e._scene,n=t.globe,i=hIt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,AIt);o=n.pickWorldCoordinates(a,t,!0,mIt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,pIt));let s;if(l(o)||l(r)){let a=l(r)?d.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?d.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}cn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof fn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Vxe(this)))};var h5=new d,E$=new M,gIt=new M,I$=new Qe,b$=new X,Hxe=new he;function _It(e,t,n){let i=M.clone(e.transform,E$),o=It.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,gIt);e._setTransform(o),d.clone(d.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let r=Qe.fromHeadingPitchRoll(n,I$),s=X.fromQuaternion(r,b$);X.getColumn(s,0,e.direction),X.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function CIt(e,t,n,i){let o=M.clone(e.transform,E$);if(e._setTransform(M.IDENTITY),!d.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Hxe);t=a.project(c,h5)}d.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let r=Qe.fromHeadingPitchRoll(n,I$),s=X.fromQuaternion(r,b$);X.getColumn(s,0,e.direction),X.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function yIt(e,t,n,i){let o=M.clone(e.transform,E$);if(e._setTransform(M.IDENTITY),!d.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,Hxe);t=c.project(u,h5)}F.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===Lu.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let r=Qe.fromHeadingPitchRoll(n,I$),s=X.fromQuaternion(r,b$);X.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right)}e._setTransform(o)}var EIt=new d,IIt=new d,bIt=new d;function Yxe(e,t,n,i){let o=d.clone(n.direction,EIt),r=d.clone(n.up,IIt);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,c=It.eastNorthUpToFixedFrame(t,a,f5),u=M.inverseTransformation(c,d5);M.multiplyByPointAsVector(u,o,o),M.multiplyByPointAsVector(u,r,r)}let s=d.cross(o,r,bIt);return i.heading=Uxe(o,r),i.pitch=Gxe(o),i.roll=zxe(o,r,s),i}var y$={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},GB=new hc;cn.prototype.setView=function(e){e=e??V.EMPTY_OBJECT;let t=e.orientation??V.EMPTY_OBJECT,n=this._mode;if(n===oe.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??d.clone(this.positionWC,h5);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,h5),i=!1),l(t.direction)&&(t=Yxe(this,o,t,y$.orientation)),GB.heading=t.heading??0,GB.pitch=t.pitch??-D.PI_OVER_TWO,GB.roll=t.roll??0,n===oe.SCENE3D?_It(this,o,GB):n===oe.SCENE2D?yIt(this,o,GB,i):CIt(this,o,GB,i)};var xIt=new d;cn.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:cn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(cn.DEFAULT_VIEW_RECTANGLE),i=d.magnitude(n);i+=i*cn.DEFAULT_VIEW_FACTOR,d.normalize(n,n),d.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new d(0,-1,1);i=d.multiplyByScalar(d.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(d.normalize(i,xIt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};cn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),sl(this),M.multiplyByVector(this._actualInvTransform,e,t)};cn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new d),sl(this),M.multiplyByPoint(this._actualInvTransform,e,t)};cn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new d),sl(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};cn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),sl(this),M.multiplyByVector(this._actualTransform,e,t)};cn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new d),sl(this),M.multiplyByPoint(this._actualTransform,e,t)};cn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new d),sl(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function Wxe(e,t){let n=e._scene.mapMode2D===Lu.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 Rxe=new d;cn.prototype.move=function(e,t){let n=this.position;d.multiplyByScalar(e,t,Rxe),d.add(n,Rxe,n),this._mode===oe.SCENE2D&&Wxe(this,n),this._adjustOrthographicFrustum(!0)};cn.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?A5(this,e):this.move(this.direction,e)};cn.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?A5(this,-e):this.move(this.direction,-e)};cn.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};cn.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};cn.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};cn.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};cn.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,-e)};cn.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,e)};cn.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,-e)};cn.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,e)};var TIt=new Qe,SIt=new X;cn.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Qe.fromAxisAngle(e,-n,TIt),o=X.fromQuaternion(i,SIt),r=this.direction,s=this.up,a=this.right;X.multiplyByVector(o,r,r),X.multiplyByVector(o,s,s),X.multiplyByVector(o,a,a)};cn.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};cn.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var BIt=new Qe,wIt=new X;cn.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Qe.fromAxisAngle(e,-n,BIt),o=X.fromQuaternion(i,wIt);X.multiplyByVector(o,this.position,this.position),X.multiplyByVector(o,this.direction,this.direction),X.multiplyByVector(o,this.up,this.up),d.cross(this.direction,this.up,this.right),d.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};cn.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,jxe(this,e)};cn.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,jxe(this,-e)};var DIt=new d,vIt=new d,PIt=new d,Mxe=new d;function jxe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!d.equalsEpsilon(e.position,d.ZERO,D.EPSILON2)){let i=d.normalize(n,DIt),o=d.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),r=d.equalsEpsilon(i,d.negate(e.constrainedAxis,Mxe),D.EPSILON2);if(!o&&!r){let s=d.normalize(e.constrainedAxis,vIt),a=d.dot(i,s),c=D.acosClamped(a);t>0&&t>c&&(t=c-D.EPSILON4),a=d.dot(i,d.negate(s,Mxe)),c=D.acosClamped(a),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=d.cross(s,i,PIt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}cn.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,qxe(this,-e)};cn.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,qxe(this,e)};function qxe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function A5(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===Lu.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===Lu.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 Kxe(e,t){e.move(e.direction,t)}cn.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?A5(this,e):Kxe(this,e)};cn.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?A5(this,-e):Kxe(this,-e)};cn.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return d.magnitude(this.position);if(this._mode===oe.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===oe.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var RIt=new M;cn.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??te.default,o=It.eastNorthUpToFixedFrame(e,i,RIt);this.lookAtTransform(o,t)};var MIt=new d,NIt=new Qe,LIt=new Qe,OIt=new X;function Jxe(e,t,n){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let i=Qe.fromAxisAngle(d.UNIT_Y,-t,NIt),o=Qe.fromAxisAngle(d.UNIT_Z,-e,LIt),r=Qe.multiply(o,i,o),s=X.fromQuaternion(r,OIt),a=d.clone(d.UNIT_X,MIt);return X.multiplyByVector(s,a,a),d.negate(a,a),d.multiplyByScalar(a,n,a),a}cn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=Jxe(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){F.clone(F.ZERO,this.position),d.negate(n,this.up),this.up.z=0,d.magnitudeSquared(this.up)<D.EPSILON10&&d.clone(d.UNIT_Y,this.up),d.normalize(this.up,this.up),this._setTransform(M.IDENTITY),d.negate(d.UNIT_Z,this.direction),d.cross(this.direction,this.up,this.right),d.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=d.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}d.clone(n,this.position),d.negate(this.position,this.direction),d.normalize(this.direction,this.direction),d.cross(this.direction,d.UNIT_Z,this.right),d.magnitudeSquared(this.right)<D.EPSILON10&&d.clone(d.UNIT_X,this.right),d.normalize(this.right,this.right),d.cross(this.right,this.direction,this.up),d.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var fk=new he,FIt=new he,QIt=new d,kIt=new d,UIt=new d,GIt=new d,zIt=new d,VIt=new d,HIt=new d,g$=new d,YIt={direction:new d,right:new d,up:new d},Nxe;function rl(e,t,n,i){return Math.abs(d.dot(t,n))/i-d.dot(e,n)}function Xxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:YIt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=D.TWO_PI);let f=(c+u)*.5,h;if(a<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&s>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)h=0;else{let N=fk;N.longitude=f,N.latitude=s,N.height=0;let L=FIt;L.longitude=f,L.latitude=a,L.height=0;let p=Nxe;(!l(p)||p.ellipsoid!==o)&&(Nxe=p=new vp(void 0,void 0,o)),p.setEndPoints(N,L),h=p.interpolateUsingFraction(.5,fk).latitude}let m=fk;m.longitude=f,m.latitude=h,m.height=0;let g=o.cartographicToCartesian(m,HIt),A=fk;A.longitude=u,A.latitude=s;let _=o.cartographicToCartesian(A,QIt);A.longitude=c;let C=o.cartographicToCartesian(A,UIt);A.longitude=f;let y=o.cartographicToCartesian(A,zIt);A.latitude=a;let E=o.cartographicToCartesian(A,VIt);A.longitude=u;let I=o.cartographicToCartesian(A,GIt);A.longitude=c;let x=o.cartographicToCartesian(A,kIt);d.subtract(C,g,C),d.subtract(I,g,I),d.subtract(_,g,_),d.subtract(x,g,x),d.subtract(y,g,y),d.subtract(E,g,E);let S=o.geodeticSurfaceNormal(g,r.direction);d.negate(S,S);let w=d.cross(S,d.UNIT_Z,r.right);d.normalize(w,w);let v=d.cross(w,S,r.up),P;if(e.frustum instanceof fn){let N=Math.max(d.distance(_,C),d.distance(I,x)),L=Math.max(d.distance(_,I),d.distance(C,x)),p,b,T=e.frustum._offCenterFrustum,B=T.right/T.top,R=L*B;N>R?(p=N,b=p/B):(b=L,p=R),P=Math.max(p,b)}else{let N=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*N;if(P=Math.max(rl(S,v,C,N),rl(S,v,I,N),rl(S,v,_,N),rl(S,v,x,N),rl(S,v,y,N),rl(S,v,E,N),rl(S,w,C,L),rl(S,w,I,L),rl(S,w,_,L),rl(S,w,x,L),rl(S,w,y,L),rl(S,w,E,L)),a<0&&s>0){let p=fk;p.longitude=c,p.latitude=0,p.height=0;let b=o.cartographicToCartesian(p,g$);d.subtract(b,g,b),P=Math.max(P,rl(S,v,b,N),rl(S,w,b,L)),p.longitude=u,b=o.cartographicToCartesian(p,g$),d.subtract(b,g,b),P=Math.max(P,rl(S,v,b,N),rl(S,w,b,L))}}return d.add(g,d.multiplyByScalar(S,-P,g$),n)}var WIt=new he,jIt=new d,qIt=new d;function KIt(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=WIt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,jIt);M.multiplyByPoint(o,a,a),M.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,qIt);if(M.multiplyByPoint(o,c,c),M.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 u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var JIt=new he,XIt=new d,ZIt=new d;function $It(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Lu.INFINITE_SCROLL?o+=D.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=JIt;r.longitude=o,r.latitude=t.north;let s=i.project(r,XIt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,ZIt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,h,m=e.frustum.right/e.frustum.top,g=u*m;return c>g?(f=c,h=f/m):(h=u,f=g),u=Math.max(2*f,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=u,n=i.project(r,n),n}cn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new d),n===oe.SCENE3D)return Xxe(this,e,t);if(n===oe.COLUMBUS_VIEW)return KIt(this,e,t);if(n===oe.SCENE2D)return $It(this,e,t)};var e0t=new gn;function t0t(e,t,n,i){n=n??te.default;let o=e.getPickRay(t,e0t),r=ci.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return gn.getPoint(o,s,i)}var n0t=new gn;function i0t(e,t,n,i){let r=e.getPickRay(t,n0t).origin;r=d.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var o0t=new gn;function r0t(e,t,n,i){let o=e.getPickRay(t,o0t),r=-o.origin.x/o.direction.x;gn.getPoint(o,r,i);let s=n.unproject(new d(i.y,i.z,0));if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}cn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new d),t=t??te.default,this._mode===oe.SCENE3D)n=t0t(this,e,t,n);else if(this._mode===oe.SCENE2D)n=i0t(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=r0t(this,e,this._projection,n);else return;return n}};var s0t=new d,a0t=new d,c0t=new d;function l0t(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,u=2/o*t.x-1,f=2/r*(r-t.y)-1,h=e.positionWC;d.clone(h,n.origin);let m=d.multiplyByScalar(e.directionWC,c,s0t);d.add(h,m,m);let g=d.multiplyByScalar(e.rightWC,u*c*a,a0t),A=d.multiplyByScalar(e.upWC,f*c*s,c0t),_=d.add(m,g,n.direction);return d.add(_,A,_),d.subtract(_,h,_),d.normalize(_,_),n}var l5=new d;function u0t(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 u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return d.clone(e.positionWC,f),d.multiplyByScalar(e.rightWC,c,l5),d.add(l5,f,f),d.multiplyByScalar(e.upWC,u,l5),d.add(l5,f,f),d.clone(e.directionWC,n.direction),n}cn.prototype.getPickRay=function(e,t){l(t)||(t=new gn);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)?l0t(this,e,t):u0t(this,e,t)};var f0t=new d,d0t=new d;cn.prototype.distanceToBoundingSphere=function(e){let t=d.subtract(this.positionWC,e.center,f0t),n=d.multiplyByScalar(this.directionWC,d.dot(t,this.directionWC),d0t);return Math.max(0,d.magnitude(n)-e.radius)};var h0t=new F;cn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,h0t);return Math.max(o.x,o.y)};function A0t(e,t,n,i,o,r){let s=d.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 u=d.lerp(t,s,c.time,new d);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:ys.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var m0t=new d,Lxe=new d,p0t=new d,g0t=new d;function _0t(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(d.UNIT_X,m0t),r=-d.dot(o,n)/d.dot(o,i),s=d.add(n,d.multiplyByScalar(i,r,Lxe),Lxe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,p0t);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=d.magnitude(d.subtract(n,s,g0t)),f=c*u,h=a*u,m=e._maxCoord.x,g=e._maxCoord.y,A=Math.max(f-m,m),_=Math.max(h-g,g);if(n.z<-A||n.z>A||n.y<-_||n.y>_){let C=s.y<-A||s.y>A,y=s.z<-_||s.z>_;if(C||y)return A0t(e,n,s,A,_,t)}}cn.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return _0t(this,e)};var C0t=new d,Fa={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};cn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};cn.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=Fa.destination,e.orientation.heading=Fa.heading,e.orientation.pitch=Fa.pitch,e.orientation.roll=Fa.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};cn.prototype.flyTo=function(e){e=e??V.EMPTY_OBJECT;let t=e.destination;if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,C0t));let o=e.orientation??V.EMPTY_OBJECT;if(l(o.direction)&&(o=Yxe(this,t,o,y$.orientation)),l(e.duration)&&e.duration<=0){let f=y$;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;Fa.destination=t,Fa.heading=o.heading,Fa.pitch=o.pitch,Fa.roll=o.roll,Fa.duration=e.duration,Fa.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Fa.cancel=e.cancel,Fa.endTransform=e.endTransform,Fa.convert=i?!1:e.convert,Fa.maximumHeight=e.maximumHeight,Fa.pitchAdjustHeight=e.pitchAdjustHeight,Fa.flyOverLongitude=e.flyOverLongitude,Fa.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Fa.easingFunction=e.easingFunction;let a=this._scene,c=uk.createTween(a,Fa);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(l(u)||(u=cn.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function y0t(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function E0t(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 I0t=100;function Zxe(e,t,n){n=zd.clone(l(n)?n:cn.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=I0t:e.frustum instanceof fn||e._mode===oe.SCENE2D?n.range=E0t(e,s):n.range=y0t(e,s),n.range=D.clamp(n.range,i,o)}return n}cn.prototype.viewBoundingSphere=function(e,t){t=Zxe(this,e,t),this.lookAt(e.center,t)};var b0t=new M,x0t=new d,T0t=new d,S0t=new d,B0t=new d,w0t=new se,D0t=new Qe,v0t=new X;cn.prototype.flyToBoundingSphere=function(e,t){t=t??V.EMPTY_OBJECT;let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=Zxe(this,e,t.offset),o;n?o=d.multiplyByScalar(d.UNIT_Z,i.range,x0t):o=Jxe(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??te.default,a=It.eastNorthUpToFixedFrame(e.center,s,b0t);M.multiplyByPoint(a,o,o);let c,u;if(!n){if(c=d.subtract(e.center,o,T0t),d.normalize(c,c),u=M.multiplyByPointAsVector(a,d.UNIT_Z,S0t),1-Math.abs(d.dot(c,u))<D.EPSILON6){let h=Qe.fromAxisAngle(c,i.heading,D0t),m=X.fromQuaternion(h,v0t);d.fromCartesian4(M.getColumn(a,1,w0t),u),X.multiplyByVector(m,u,u)}let f=d.cross(c,u,B0t);d.cross(f,c,u),d.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},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 Oxe=new d,Fxe=new d,_$=new d,Qxe=new d,dk=[new d,new d,new d,new d];function P0t(e,t){let n=t.radii,i=e.positionWC,o=d.multiplyComponents(t.oneOverRadii,i,Oxe),r=d.magnitude(o),s=d.normalize(o,Fxe),a,c;d.equalsEpsilon(s,d.UNIT_Z,D.EPSILON10)?(a=new d(0,1,0),c=new d(0,0,1)):(a=d.normalize(d.cross(d.UNIT_Z,s,_$),_$),c=d.normalize(d.cross(s,a,Qxe),Qxe));let u=Math.sqrt(d.magnitudeSquared(o)-1),f=d.multiplyByScalar(s,1/r,Oxe),h=u/r,m=d.multiplyByScalar(a,h,Fxe),g=d.multiplyByScalar(c,h,_$),A=d.add(f,g,dk[0]);d.subtract(A,m,A),d.multiplyComponents(n,A,A);let _=d.subtract(f,g,dk[1]);d.subtract(_,m,_),d.multiplyComponents(n,_,_);let C=d.subtract(f,g,dk[2]);d.add(C,m,C),d.multiplyComponents(n,C,C);let y=d.add(f,g,dk[3]);return d.add(y,m,y),d.multiplyComponents(n,y,y),dk}var C$=new F,R0t=new d,ky=[new he,new he,new he,new he];function u5(e,t,n,i,o,r){C$.x=e,C$.y=t;let s=i.pickEllipsoid(C$,o,R0t);return l(s)?(ky[n]=o.cartesianToCartographic(s,ky[n]),1):(ky[n]=o.cartesianToCartographic(r[n],ky[n]),0)}cn.prototype.computeViewRectangle=function(e,t){e=e??te.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(d.ZERO,e.maximumRadius);if(n.computeVisibility(i)===qt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=P0t(this,e);if(c+=u5(0,0,0,this,e,u),c+=u5(0,a,1,this,e,u),c+=u5(s,a,2,this,e,u),c+=u5(s,0,3,this,e,u),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(ky,t);let f=0,h=ky[3].longitude;for(let m=0;m<4;++m){let g=ky[m].longitude,A=Math.abs(g-h);A>D.PI?f+=D.TWO_PI-A:f+=A,h=g}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,ky[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};cn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof ki)return;let e=this._scene;this.frustum=new ki,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60)};cn.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof fn)return;let e=Vxe(this),t=this._scene;this.frustum=new fn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};cn.clone=function(e,t){return l(t)||(t=new cn(e._scene)),d.clone(e.position,t.position),d.clone(e.direction,t.direction),d.clone(e.up,t.up),d.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var bo=cn;function M0t(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Zd=M0t;var iTe=mr(Yu(),1),$xe=576,N0t=100,hk="#ffffff",m5="#48b";function oTe(e,t){this.credit=e,this.count=t??1}function L0t(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(pt.equals(o,t))return!0}return!1}function O0t(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;pt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var rTe="cesium-credit-delimiter";function eTe(e){let t=document.createElement("span");return t.textContent=e,t.className=rTe,t}function tTe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function nTe(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 u=r-1;if(o.length<=u)e.appendChild(eTe(n));else{let f=o[u];f.className!==rTe&&e.replaceChild(eTe(n),f)}}let c=a.element;if(o.length<=r)e.appendChild(tTe(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(tTe(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function F0t(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<$xe?(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>=$xe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Q0t(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: ${hk};
position: relative;
min-height: ${N0t}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: ${hk};
}
.cesium-credit-lightbox > ul > li a:hover {
color: ${m5};
}
.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: ${hk};
}
.cesium-credit-lightbox-close:hover {
color: ${m5};
}
.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: ${hk};
}
.cesium-credit-expand-link:hover {
color: ${m5};
}
.cesium-credit-text {
color: ${hk};
}
.cesium-credit-delimiter {
padding: 0 5px;
}
.cesium-credit-textContainer *,
.cesium-credit-logoContainer * {
display: inline;
}
.cesium-credit-textContainer a:hover {
color: ${m5}
}
.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 Hr(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(A){r.contains(A.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 u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let m=document.createElement("a");m.className="cesium-credit-expand-link",m.onclick=this.showLightbox.bind(this),m.textContent="Data attribution",e.appendChild(m),Q0t(e);let g=pt.clone(Hr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=h,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=m,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Pt,lightboxCredits:new Pt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function sTe(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 oTe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Hr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=pt.clone(aTe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,sTe(this,t,e)};Hr.prototype.addStaticCredit=function(e){let t=this._staticCredits;L0t(t,e)||t.push(e)};Hr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Hr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Hr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Hr.prototype.update=function(){this._expanded&&F0t(this)};Hr.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()&&pt.equals(Hr.cesiumCredit,this._cesiumCredit)||sTe(this,s,r,Number.MAX_VALUE)}pt.equals(Hr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=pt.clone(Hr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Hr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;nTe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",nTe(this._creditList,t,void 0,"li"),O0t(this)};Hr.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),de(this)};Hr.prototype.isDestroyed=function(){return!1};Hr._cesiumCredit=void 0;Hr._cesiumCreditInitialized=!1;var p5;function aTe(){if(!l(p5)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new iTe.default(e).path()),p5=new pt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Hr._cesiumCreditInitialized||(Hr._cesiumCredit=p5,Hr._cesiumCreditInitialized=!0),p5}Object.defineProperties(Hr,{cesiumCredit:{get:function(){return aTe(),Hr._cesiumCredit},set:function(e){Hr._cesiumCredit=e,Hr._cesiumCreditInitialized=!0}}});Hr.CreditDisplayElement=oTe;var Ak=Hr;function g5(e){e=e??V.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??G.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var k0t=new d,U0t=new X,G0t=new Qe,z0t=new ki,V0t=new Kl,H0t=new fn,Y0t=new rs,W0t=new G,j0t=[1,1e5];g5.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 ki?a=z0t:s instanceof Kl?a=V0t:s instanceof fn?a=H0t:a=Y0t,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=j0t,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,h=r.directionWC,m=r.upWC,g=r.rightWC;g=d.negate(g,k0t);let A=U0t;X.setColumn(A,0,g,A),X.setColumn(A,1,m,A),X.setColumn(A,2,h,A);let _=Qe.fromRotationMatrix(A,G0t);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Ln({geometryInstances:new Rt({geometry:new j0({origin:f,orientation:_,frustum:a,_drawNearPlane:i===0}),attributes:{color:Xt.fromColor(G.fromAlpha(this._color,.1,W0t))},id:this.id,pickPrimitive:this}),appearance:new hn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Ln({geometryInstances:new Rt({geometry:new f2({origin:f,orientation:_,frustum:a,_drawNearPlane:i===0}),attributes:{color:Xt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};g5.prototype.isDestroyed=function(){return!1};g5.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 de(this)};var Zm=g5;function pk(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 mk=zt.supportsTypedArrays()?new Float32Array(12):[],cTe=new d,lTe=new d,x$=new d,uTe=new d,_5=new d;function q0t(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof fn)o=d.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,m=d.multiplyComponents(e.oneOverRadii,h,cTe),g=d.normalize(m,lTe),A=d.normalize(d.cross(d.UNIT_Z,m,x$),x$),_=d.normalize(d.cross(g,A,uTe),uTe),C=d.magnitude(m),y=Math.sqrt(C*C-1);o=d.multiplyByScalar(g,1/C,cTe);let E=y/C;r=d.multiplyByScalar(A,E,lTe),s=d.multiplyByScalar(_,E,x$)}let a=d.add(o,s,_5);d.subtract(a,r,a),d.multiplyComponents(n,a,a),d.pack(a,mk,0);let c=d.subtract(o,s,_5);d.subtract(c,r,c),d.multiplyComponents(n,c,c),d.pack(c,mk,3);let u=d.add(o,s,_5);d.add(u,r,u),d.multiplyComponents(n,u,u),d.pack(u,mk,6);let f=d.subtract(o,s,_5);return d.add(f,r,f),d.multiplyComponents(n,f,f),d.pack(f,mk,9),mk}pk.prototype.update=function(e){if(this._mode=e.mode,e.mode!==oe.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new te(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new et({renderState:this._rs,boundingVolume:new le(d.ZERO,i.maximumRadius),pass:we.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new We({sources:[N2]}),a=new We({sources:[M2]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=sn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=q0t(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ht({attributes:{position:new ve({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Pe.TRIANGLES});this._va=oi.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Oe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};pk.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};pk.prototype.isDestroyed=function(){return!1};pk.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var gk=pk;function VB(){}var K0t=/\bgl_FragDepth\b/,J0t=/\bdiscard\b/;function X0t(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(K0t.test(r[a])||J0t.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 We({sources:[a]})}else if(!o&&s){let a=`void main()
{
out_FragColor = vec4(1.0);
czm_writeLogDepth();
}
`;i=new We({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function Z0t(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=ze.fromCache(o);return n[t.id]=r,r}VB.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=et.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=X0t(n,t.shaderProgram),i.depthOnlyCommand.renderState=Z0t(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var $0t=/\s+czm_writeLogDepth\(/,ebt=/\s+czm_vertexLogDepth\(/;function tbt(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 f=0;f<c.length;++f)if(ebt.test(c[f])){a=!0;break}if(!a){for(let h=0;h<c.length;++h)c[h]=We.replaceMain(c[h],"czm_log_depth_main");c.push(`
void main()
{
czm_log_depth_main();
czm_vertexLogDepth();
}
`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)$0t.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=We.replaceMain(c[f],"czm_log_depth_main");u=`
void main()
{
czm_log_depth_main();
czm_writeLogDepth();
}
`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}VB.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=et.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=tbt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function nbt(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",u=`void main ()
{
czm_non_pick_main();
if (${c}.a == 0.0) {
discard;
}
${c} = ${n};
} `,f=r.length,h=new Array(f+1);for(let g=0;g<f;++g)h[g]=We.replaceMain(r[g],"czm_non_pick_main");h[f]=u;let m=new We({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:o})}function fTe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=ze.fromCache(o);return n[t.id]=r,r}VB.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=et.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=nbt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=fTe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function zB(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 dTe(e){return e.isArray?e.arrayLength:_t.getComponentCount(e.type)}function ibt(e){let t=dTe(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function hTe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function ATe(e,t){let n=kt.getMaximum(t);return`(${e}) / float(${n})`}function obt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=hTe(n,i,o)}return e.normalized||(n=ATe(n,e.componentType)),n}function rbt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=hTe(o,r,s)}return e.normalized||(o=ATe(o,e.componentType)),o}function sbt(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,u=n.classProperty,f=ibt(u),h=["0.0","0.0","0.0","0.0"],m=dTe(u);if(m===1)h[0]=obt(u,c);else{let C=["x","y","z","w"];for(let y=0;y<m;y++)h[y]=rbt(u,c,C[y])}let g=t.fragmentShaderSource.defines.slice();g.push(lf.METADATA_PICKING_ENABLED),zB(g,lf.METADATA_PICKING_VALUE_TYPE,f),zB(g,lf.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),zB(g,lf.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),zB(g,lf.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),zB(g,lf.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),zB(g,lf.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let A=new We({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:A,attributeLocations:t._attributeLocations})}VB.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=et.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=sbt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=fTe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function abt(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})}VB.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=et.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=abt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var $m=VB;function C5(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=D.toRadians(o),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var cbt=new Qe,mTe=new Qe,lbt=new X;function ubt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Qe.fromAxisAngle(o,n,mTe),c=Qe.fromAxisAngle(r,i,cbt),u=Qe.multiply(c,a,c),f=Qe.fromAxisAngle(s,t,mTe);Qe.multiply(f,u,u);let h=X.fromQuaternion(u,lbt);X.multiplyByVector(h,r,r),X.multiplyByVector(h,s,s),X.multiplyByVector(h,o,o)}C5.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;ubt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};C5.prototype.isDestroyed=function(){return!1};C5.prototype.destroy=function(){return this._removeListener(),de(this)};var _k=C5;function T$(){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(T$.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var fbt=new d;T$.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!==oe.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,D.EPSILON4),-Math.max(this._heightFalloff,0)),s=d.normalize(n.positionWC,fbt),a=Math.abs(d.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 Ck=T$;function dbt(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=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.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 yk=dbt;var ac={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},ob=ac.DERIVED_COMMANDS_MAXIMUM_LENGTH,TTe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function rb(){this._frontFaceAlphaByDistance=new Ht(0,1,0,1),this._backFaceAlphaByDistance=new Ht(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=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(ob),this._derivedBlendCommandTypes=new Array(ob),this._derivedPickCommandTypes=new Array(ob),this._derivedCommandTypesToUpdate=new Array(ob),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(rb.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}}});rb.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=pTe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=pTe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=gTe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=gTe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=pbt(this,e,t),this._sunVisibleThroughGlobe=hbt(this,e),this._environmentVisible=Abt(this,e),this._useDepthPlane=mbt(this,e),this._numberOfTextureUniforms=gbt(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),_bt(this,e)};function pTe(e,t,n,i){return e?l(n)?(Ht.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 gTe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function hbt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Abt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function mbt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function pbt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function gbt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function _bt(e,t){e._derivedCommandsLength=S$(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=S$(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=S$(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<ob;++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=Mbt())}function S$(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?ac.PICK_FRONT_FACE:u?ac.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ac.TRANSLUCENT_FRONT_FACE,h=i?ac.PICK_BACK_FACE:u?ac.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ac.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=ac.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=ac.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=h):(o[r++]=h,o[r++]=f)):c?(n||(o[r++]=ac.DEPTH_ONLY_BACK_FACE),o[r++]=ac.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=ac.DEPTH_ONLY_FRONT_FACE),o[r++]=ac.OPAQUE_BACK_FACE,o[r++]=f),r)}function $d(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function _Te(e,t){return e.indexOf(t)>-1}function Cbt(e,t){$d(e.defines,"TRANSLUCENT"),$d(t.defines,"TRANSLUCENT")}function ybt(e,t){$d(e.defines,"GROUND_ATMOSPHERE"),$d(t.defines,"GROUND_ATMOSPHERE"),$d(e.defines,"FOG"),$d(t.defines,"FOG"),$d(e.defines,"TRANSLUCENT"),$d(t.defines,"TRANSLUCENT")}function B$(e,t){if(_Te(t.defines,"TILE_LIMIT_RECTANGLE")||_Te(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
{
out_FragColor = vec4(1.0);
}
`;t.sources=[n]}function w$(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=We.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 STe(e,t){w$(e,t),$d(e.defines,"GROUND_ATMOSPHERE"),$d(t.defines,"GROUND_ATMOSPHERE"),$d(e.defines,"FOG"),$d(t.defines,"FOG")}function Ebt(e,t){w$(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Ibt(e,t){STe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function CTe(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 bbt(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(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function xbt(e){e.cull.face=Ni.BACK,e.cull.enabled=!0}function Tbt(e){e.cull.face=Ni.FRONT,e.cull.enabled=!0}function Sbt(e){e.cull.face=Ni.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Bbt(e){e.cull.face=Ni.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function wbt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function yTe(e){e.cull.face=Ni.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=dn.ALPHA_BLEND}function ETe(e){e.cull.face=Ni.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=dn.ALPHA_BLEND}function Dbt(e){e.cull.face=Ni.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function vbt(e){e.cull.face=Ni.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Pbt(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=ze.getState(e);i(s),r=ze.fromCache(s),o[e.id]=r}return r}function HB(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Rbt(e,t,n,i,o){return l(o)?!i&&l(n)?n:St(t,o(e),!1):t}function NA(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Mbt(){return[new NA({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:Cbt,getRenderStateFunction:xbt,getUniformMapFunction:void 0}),new NA({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:ybt,getRenderStateFunction:Tbt,getUniformMapFunction:void 0}),new NA({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:B$,getRenderStateFunction:Sbt,getUniformMapFunction:void 0}),new NA({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:B$,getRenderStateFunction:Bbt,getUniformMapFunction:void 0}),new NA({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:B$,getRenderStateFunction:wbt,getUniformMapFunction:void 0}),new NA({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:w$,getRenderStateFunction:yTe,getUniformMapFunction:HB}),new NA({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:STe,getRenderStateFunction:ETe,getUniformMapFunction:HB}),new NA({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Ebt,getRenderStateFunction:yTe,getUniformMapFunction:HB}),new NA({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Ibt,getRenderStateFunction:ETe,getUniformMapFunction:HB}),new NA({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:CTe,getRenderStateFunction:Dbt,getUniformMapFunction:HB}),new NA({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:CTe,getRenderStateFunction:vbt,getUniformMapFunction:HB})]}var ITe=new Array(ob),bTe=new Array(ob);rb.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)bTe[o]=this._derivedCommandPacks[n[o]],ITe[o]=TTe[n[o]];Nbt(this,e,i,n,ITe,bTe,t)}};function Nbt(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 u=s.frameNumber,f=a.uniformMapDirtyFrame??0,h=a.shaderProgramDirtyFrame??0,m=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,A=a.shaderProgramId!==t.shaderProgram.id,_=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),A&&(a.shaderProgramDirtyFrame=u),_&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let C=0;C<n;++C){let y=r[C],E=i[C],I=o[C],x=a[I],S,w,v;l(x)?(S=x.uniformMap,w=x.shaderProgram,v=x.renderState):(S=void 0,w=void 0,v=void 0),x=et.shallowClone(t,x),a[I]=x;let P=x.derivedCommands.uniformMapDirtyFrame??0,N=x.derivedCommands.shaderProgramDirtyFrame??0,L=x.derivedCommands.renderStateDirtyFrame??0,p=g||P<f,b=A||N<h,T=_||L<m;p&&(x.derivedCommands.uniformMapDirtyFrame=u),b&&(x.derivedCommands.shaderProgramDirtyFrame=u),T&&(x.derivedCommands.renderStateDirtyFrame=u),x.derivedCommands.type=E,x.pass=y.pass,x.pickOnly=y.pickOnly,x.uniformMap=Rbt(e,t.uniformMap,S,p,y.getUniformMapFunction),x.shaderProgram=bbt(s.context,t.shaderProgram,w,b,y.getShaderProgramFunction,I),x.renderState=Pbt(t.renderState,v,T,y.getRenderStateFunction,y.renderStateCache)}}}rb.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=TTe[o[a]];n.commandList.push(s[c])}};function BTe(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 xTe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var Lbt=[ac.OPAQUE_FRONT_FACE,ac.OPAQUE_BACK_FACE],Obt=[ac.DEPTH_ONLY_FRONT_FACE,ac.DEPTH_ONLY_BACK_FACE,ac.DEPTH_ONLY_FRONT_AND_BACK_FACE];rb.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[we.GLOBE],a=e.indices[we.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),BTe(s,a,t,i,o,Lbt))};rb.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[we.GLOBE],c=e.indices[we.GLOBE],u=e.commands[we.TERRAIN_CLASSIFICATION],f=e.indices[we.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let h=this._frontFaceTranslucent,m=this._backFaceTranslucent;if((!h||!m)&&xTe(u,f,t,i,o),!h&&!m)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,A=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,BTe(a,c,t,i,o,Obt),r.depthTexture){let _=n.packDepth(r,o);s.globeDepthTexture=_}xTe(u,f,t,i,o),s.globeDepthTexture=g,o.framebuffer=A};var Ek=rb;var Ou=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;function ep(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new Ci({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new Ci({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 ai({color:new G(0,0,0,0),owner:this}),this._clearCommand=new ai({color:new G(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(ep.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});ep.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Fbt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Xn.EQUAL,frontOperation:{fail:yt.KEEP,zFail:yt.KEEP,zPass:yt.KEEP},backFunction:Xn.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:dn.ALPHA_BLEND},Qbt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:yt.KEEP,zFail:yt.KEEP,zPass:yt.KEEP},backFunction:Xn.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:dn.ALPHA_BLEND},kbt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:dn.ALPHA_BLEND},Ubt=`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;
}
`,Gbt=`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
}
`;ep.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 Bt({context:e,width:s,height:a,pixelFormat:qe.DEPTH_STENCIL,pixelDatatype:Ge.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Ku({context:e,width:s,height:a,format:pl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=ze.fromCache(Fbt),this._rsClassified=ze.fromCache(Qbt),this._rsDefault=ze.fromCache(kbt)),!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 u=l(this._previousFramebuffer)?Gbt:Ubt,f=new We({defines:["UNCLASSIFIED"],sources:[u]}),h=new We({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{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(Ou,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};ep.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};ep.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))};ep.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)};ep.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};ep.prototype.isDestroyed=function(){return!1};ep.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()),de(this)};var YB=ep;function y5(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(y5.prototype,{total:{get:function(){return this._total}}});function Uy(e){let t=new Array(Ec.NUMBER_OF_JOB_TYPES);t[Ec.TEXTURE]=new y5(l(e)?e[Ec.TEXTURE]:10),t[Ec.PROGRAM]=new y5(l(e)?e[Ec.PROGRAM]:10),t[Ec.BUFFER]=new y5(l(e)?e[Ec.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}Uy.getTimestamp=Oi;Object.defineProperties(Uy.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Uy.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Uy.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};Uy.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,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Uy.getTimestamp();e.execute();let a=Uy.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var Ik=Uy;function E5(e){e=e??V.EMPTY_OBJECT;let t=On(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=Oi(),this._lastMsSampleTime=Oi(),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(E5.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});E5.prototype.update=function(e){let t=Oi(),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}};E5.prototype.destroy=function(){return de(this)};var A_=E5;var cc={};cc.decodeRawMetadataValue=function(e,t,n){switch(e){case kt.INT8:return t.getInt8(n);case kt.UINT8:return t.getUint8(n);case kt.INT16:return t.getInt16(n,!0);case kt.UINT16:return t.getUint16(n,!0);case kt.INT32:return t.getInt32(n,!0);case kt.UINT32:return t.getUint32(n,!0);case kt.INT64:return t.getBigInt64(n,!0);case kt.UINT64:return t.getBigUint64(n,!0);case kt.FLOAT32:return t.getFloat32(n,!0);case kt.FLOAT64:return t.getFloat64(n,!0)}throw new ue(`Invalid component type: ${e}`)};cc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=cc.decodeRawMetadataValue(i,t,n);return e.normalized?kt.normalize(o,i):o};cc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=kt.getSizeInBytes(i),r=e.type,s=_t.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let h=0;h<s;h++){let m=n*a+h*o,g=cc.decodeRawMetadataValueComponent(e,t,m);f[h]=g}return f}let c=n*a;return cc.decodeRawMetadataValueComponent(e,t,c)};cc.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=cc.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return cc.decodeRawMetadataValueElement(e,n,0)};cc.convertToObjectType=function(e,t){if(!l(t)||e===_t.SCALAR||e===_t.STRING||e===_t.BOOLEAN||e===_t.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case _t.VEC2:return F.unpack(n,0,new F);case _t.VEC3:return d.unpack(n,0,new d);case _t.VEC4:return se.unpack(n,0,new se);case _t.MAT2:return zi.unpack(n,0,new zi);case _t.MAT3:return X.unpack(n,0,new X);case _t.MAT4:return M.unpack(n,0,new M)}throw new ue(`Invalid metadata object type: ${e}`)};cc.convertFromObjectType=function(e,t){if(!l(t)||e===_t.SCALAR||e===_t.STRING||e===_t.BOOLEAN||e===_t.ENUM)return t;switch(e){case _t.VEC2:return F.pack(t,Array(2));case _t.VEC3:return d.pack(t,Array(3));case _t.VEC4:return se.pack(t,Array(4));case _t.MAT2:return zi.pack(t,Array(4));case _t.MAT3:return X.pack(t,Array(9));case _t.MAT4:return M.pack(t,Array(16))}throw new ue(`Invalid metadata object type: ${e}`)};cc.decodeMetadataValues=function(e,t,n){let i=cc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=cc.convertFromObjectType(e.type,t.offset),s=cc.convertFromObjectType(e.type,t.scale);i=sm.valueTransformInPlace(i,r,s,kt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],u=cc.convertToObjectType(e.type,c);s[a]=u}return s}return cc.convertToObjectType(e.type,i)};var bk=Object.freeze(cc);function sb(){this._framebuffer=new Ci,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(sb.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function zbt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function Vbt(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:ze.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}sb.prototype.update=function(e,t){zbt(this,e,t),Vbt(this,e,t)};var Hbt=new se,Ybt=new se(1,1/255,1/65025,1/16581375);sb.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=se.unpack(i,0,Hbt);return se.divideByScalar(o,255,o),se.dot(o,Ybt)};sb.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};sb.prototype.isDestroyed=function(){return!1};sb.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),de(this)};var xk=sb;function Gy(e){e=e||{},this._framebufferManager=new Ci({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 ai({color:new G(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(Gy.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}}});Gy.prototype.update=function(e,t,n,i,o){let r=t.width,s=t.height,a=n?e.halfFloatingPointTexture?Ge.HALF_FLOAT:Ge.FLOAT:Ge.UNSIGNED_BYTE,c=this._framebufferManager.update(e,r,s,1,a,qe.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};Gy.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};Gy.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&G.clone(e,this._clearCommand.color),this._clearCommand};Gy.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};Gy.prototype.isDestroyed=function(){return!1};Gy.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,de(this)};var Tk=Gy;function Wbt(e,t){this.near=e??0,this.far=t??0;let n=we.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 Sk=Wbt;var zy=`uniform highp sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function tp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new Ci({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new Ci({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new Ci,this._tempCopyDepthFramebuffer=new Ci,this._updateDepthFramebuffer=new Ci({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 Xe,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(tp.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 wTe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!Xe.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,Xe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Xe.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!Xe.equals(r,e._rs.viewport)||a)&&(e._rs=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:dn.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Xn.EQUAL,frontOperation:{fail:yt.KEEP,zFail:yt.KEEP,zPass:yt.KEEP},backFunction:Xn.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(zy,{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(Ou,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(zy,{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(Ou,{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 ai({color:new G(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}tp.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?Ge.HALF_FLOAT:Ge.FLOAT:Ge.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),wTe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};tp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};tp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};tp.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),wTe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};tp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};tp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(G.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};tp.prototype.isDestroyed=function(){return!1};tp.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()),de(this)};var Bk=tp;function ab(){this._framebuffer=new Ci({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new Ci,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Xe,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(ab.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 jbt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function qbt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ge.HALF_FLOAT:Ge.FLOAT:Ge.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Kbt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Xe.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Xe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Xe.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Xe.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(zy,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ai({color:new G(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}ab.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;qbt(this,n,o,r,e),Kbt(this,n,o,r,i),this._useHdr=e};ab.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};ab.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};ab.prototype.isDestroyed=function(){return!1};ab.prototype.destroy=function(){return jbt(this),de(this)};var wk=ab;function m_(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 Ci({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new Ci({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new Ci({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new Ci({createColorAttachments:!1}),this._opaqueClearCommand=new ai({color:new G(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ai({color:new G(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ai({color:new G(0,0,0,0),owner:this}),this._alphaClearCommand=new ai({color:new G(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 Xe,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function DTe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function D$(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function vTe(e){DTe(e),D$(e)}function Jbt(e,t,n,i){DTe(e),e._accumulationTexture=new Bt({context:t,width:n,height:i,pixelFormat:qe.RGBA,pixelDatatype:Ge.FLOAT}),e._revealageTexture=new Bt({context:t,pixelFormat:qe.RGBA,pixelDatatype:Ge.FLOAT,width:n,height:i,flipY:!1})}function Xbt(e,t){D$(e);let n=ee.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)&&(D$(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,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(vTe(e),e._translucentMultipassSupport=!1,i=!1)}return i}m_.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,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,Jbt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!Xbt(this,e))return;this._useHDR=i;let f=this,h,m;l(this._compositeCommand)||(h=new We({sources:[R2]}),this._translucentMRTSupport&&h.defines.push("MRT"),m={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:m,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new We({defines:["MRT"],sources:[RB]}),m={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:m,owner:this})):this._translucentMultipassSupport&&(h=new We({sources:[RB]}),m={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:m,owner:this}),m={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:m,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!Xe.equals(this._viewport,t.viewport),A=g!==this._useScissorTest;this._useScissorTest=g,Xe.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Xe.clone(t.viewport,this._scissorRectangle),A=!0),(!l(this._rs)||!Xe.equals(this._viewport,this._rs.viewport)||A)&&(this._rs=ze.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 Zbt={enabled:!0,color:new G(0,0,0,0),equationRgb:gc.ADD,equationAlpha:gc.ADD,functionSourceRgb:Wo.ONE,functionDestinationRgb:Wo.ONE,functionSourceAlpha:Wo.ZERO,functionDestinationAlpha:Wo.ONE_MINUS_SOURCE_ALPHA},$bt={enabled:!0,color:new G(0,0,0,0),equationRgb:gc.ADD,equationAlpha:gc.ADD,functionSourceRgb:Wo.ONE,functionDestinationRgb:Wo.ONE,functionSourceAlpha:Wo.ONE,functionDestinationAlpha:Wo.ONE},ext={enabled:!0,color:new G(0,0,0,0),equationRgb:gc.ADD,equationAlpha:gc.ADD,functionSourceRgb:Wo.ZERO,functionDestinationRgb:Wo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Wo.ZERO,functionDestinationAlpha:Wo.ONE_MINUS_SOURCE_ALPHA};function v$(e,t,n,i){let o=n[i.id];if(!l(o)){let r=ze.getState(i);r.depthMask=!1,r.blending=t,o=ze.fromCache(r),n[i.id]=o}return o}function txt(e,t,n){return v$(t,Zbt,e._translucentRenderStateCache,n)}function nxt(e,t,n){return v$(t,$bt,e._translucentRenderStateCache,n)}function ixt(e,t,n){return v$(t,ext,e._alphaRenderStateCache,n)}var oxt=` 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);
`,rxt=` 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;
`,sxt=` float ai = czm_out_FragColor.a;
out_FragColor = vec4(ai);
`;function P$(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(f){return We.replaceMain(f,"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)],u="";for(let f=0;f<c.length;f++){let h=c[f];u=`layout (location = ${h[1]}) out vec4 ${h[0]};
${u}`}return a.sources.push(u),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 axt(e,t){return P$(e,t,"translucentMRT",oxt)}function cxt(e,t){return P$(e,t,"translucentMultipass",rxt)}function lxt(e,t){return P$(e,t,"alphaMultipass",sxt)}m_.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=et.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=axt(t,e.shaderProgram),n.translucentCommand.renderState=txt(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=et.shallowClone(e,n.translucentCommand),n.alphaCommand=et.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=cxt(t,e.shaderProgram),n.translucentCommand.renderState=nxt(this,t,e.renderState),n.alphaCommand.shaderProgram=lxt(t,e.shaderProgram),n.alphaCommand.renderState=ixt(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 uxt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,h=i.framebuffer,m=u.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 A=0;A<o.length;++A){let _=o[A];_=c?_.derivedCommands.logDepth.command:_,_=f?_.derivedCommands.hdr.command:_;let C=m&&_.receiveShadows?_.derivedCommands.oit.shadows.translucentCommand:_.derivedCommands.oit.translucentCommand;n(C,t,i,g)}if(l(r)){let A=r.unclassifiedCommand,_=m&&A.receiveShadows?A.derivedCommands.oit.shadows.translucentCommand:A.derivedCommands.oit.translucentCommand;n(_,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let A=0;A<o.length;++A){let _=o[A];_=c?_.derivedCommands.logDepth.command:_,_=f?_.derivedCommands.hdr.command:_;let C=m&&_.receiveShadows?_.derivedCommands.oit.shadows.alphaCommand:_.derivedCommands.oit.alphaCommand;n(C,t,i,g)}if(l(r)){let A=r.unclassifiedCommand,_=m&&A.receiveShadows?A.derivedCommands.oit.shadows.alphaCommand:A.derivedCommands.oit.alphaCommand;n(_,t,i,g)}i.framebuffer=h}function fxt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,h=i.framebuffer,m=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let A=0;A<o.length;++A){let _=o[A];_=c?_.derivedCommands.logDepth.command:_,_=f?_.derivedCommands.hdr.command:_;let C=m&&_.receiveShadows?_.derivedCommands.oit.shadows.translucentCommand:_.derivedCommands.oit.translucentCommand;n(C,t,i,g)}if(l(r)){let A=r.unclassifiedCommand,_=m&&A.receiveShadows?A.derivedCommands.oit.shadows.translucentCommand:A.derivedCommands.oit.translucentCommand;n(_,t,i,g)}i.framebuffer=h}m_.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){fxt(this,e,t,n,i,o);return}uxt(this,e,t,n,i,o)};m_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};m_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,G.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};m_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};m_.prototype.isDestroyed=function(){return!1};m_.prototype.destroy=function(){return vTe(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()),de(this)};var Dk=m_;function vk(){this._framebuffer=new Ci({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(vk.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function dxt(e){e._framebuffer.destroy()}function hxt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Fc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Xe},o.viewport=new Xe,e._passState=o}vk.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&hxt(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};vk.prototype.isDestroyed=function(){return!1};vk.prototype.destroy=function(){return dxt(this),de(this)};var Pk=vk;function cb(e){let t=new Fc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Xe},t.viewport=new Xe,this._context=e,this._fb=new Ci({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function PTe(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),u=0,f=0,h=0,m=-1,g=new Set;for(let A=0;A<s;++A){if(-a<=u&&u<=a&&-c<=f&&f<=c){let _=4*((c-f)*n+u+a),C=G.bytesToRgba(t[_],t[_+1],t[_+2],t[_+3]),y=e.getObjectByPickColor(C);if(l(y)&&(g.add(y),g.size>=o))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let _=h;h=-m,m=_}u+=h,f+=m}return[...g]}cb.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Xe.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};cb.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=Ge.UNSIGNED_BYTE,c=qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=r.readPixelsToPBO({x:e.x,y:e.y,width:i,height:o,framebuffer:s}),f=UP.create({context:r});try{await f.waitForSignal(g=>t.afterRender.push(g));let h=qe.createTypedArray(c,a,i,o);return u.getBufferData(h),PTe(r,h,i,o,n)}catch{throw new ue("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};cb.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 PTe(o,r,n,i,t)};cb.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)};cb.prototype.isDestroyed=function(){return!1};cb.prototype.destroy=function(){return this._fb.destroy(),de(this)};var Rk=cb;function p_(){this._numSamples=1,this._colorFramebuffer=new Ci({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new Ci({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new G(0,0,0,0),this._clearCommand=new ai({color:new G(0,0,0,0),depth:1,owner:this})}function Axt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(p_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});p_.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ge.HALF_FLOAT:Ge.FLOAT:Ge.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};p_.prototype.clear=function(e,t,n){G.clone(n,this._clearCommand.color),G.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};p_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};p_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};p_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};p_.prototype.isDestroyed=function(){return!1};p_.prototype.destroy=function(){return Axt(this),de(this)};var lb=p_;function ub(){}ub.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};ub.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=We.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=We.replaceMain(o[u],"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 We({defines:i,sources:o})};ub.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=We.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let f=0;f<c;++f)r[f]=We.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC;
`),u+=`uniform vec4 shadowMap_lightPositionEC;
`),i?u+=`void main()
{
`:u+=`void main()
{
czm_shadow_cast_main();
if (out_FragColor.a == 0.0)
{
discard;
}
`,t?u+=` float distance = length(${s});
if (distance >= shadowMap_lightPositionEC.w)
{
discard;
}
distance /= shadowMap_lightPositionEC.w; // radius
out_FragColor = czm_packDepth(distance);
`:n?u+=` out_FragColor = vec4(1.0);
`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z);
`,u+=`}
`,r.push(u),new We({defines:o,sources:r})};ub.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${u}${f}${t}${n}${i}`};ub.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 We({defines:i,sources:o})};ub.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=We.findNormalVarying(e),s=!i&&l(r)||i&&o,a=We.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,h=t._isPointLight,m=t._isSpotLight,g=t._numberOfCascades>1,A=t.debugCascadeColors,_=t.softShadows,C=h?t._pointBias:i?t._terrainBias:t._primitiveBias,y=e.defines.slice(0),E=e.sources.slice(0),I=E.length;for(let w=0;w<I;++w)E[w]=We.replaceMain(E[w],"czm_shadow_receive_main");h?y.push("USE_CUBE_MAP_SHADOW"):u&&y.push("USE_SHADOW_DEPTH_TEXTURE"),_&&!h&&y.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&C.normalShading&&s&&(y.push("USE_NORMAL_SHADING"),C.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));let x="";h?x+=`uniform samplerCube shadowMap_textureCube;
`:x+=`uniform sampler2D shadowMap_texture;
`;let S;return c?S=` return vec4(${a}, 1.0);
`:S=`#ifndef LOG_DEPTH
return czm_windowToEyeCoordinates(gl_FragCoord);
#else
return vec4(v_logPositionEC, 1.0);
#endif
`,x+=`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()
{
${S}}
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;
`:""}}
`,x+=`void main()
{
czm_shadow_receive_main();
vec4 positionEC = getPositionEC();
vec3 normalEC = getNormalEC();
float depth = -positionEC.z;
`,x+=` czm_shadowParameters shadowParameters;
shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
`,i?x+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
`:f||(x+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
`),h?x+=` 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);
`:m?x+=` 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?x+=` 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);
${A?` // Draw cascade colors for debugging
out_FragColor *= czm_cascadeColor(weights);
`:""}`:x+=` 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);
`,x+=` out_FragColor.rgb *= visibility;
}
`,E.push(x),new We({defines:y,sources:E})};var np=ub;function ip(e){e=e??V.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;(zt.isInternetExplorer()||zt.isEdge()||(zt.isChrome()||zt.isFirefox())&&zt.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 M,this._shadowMapTexture=void 0,this._lightDirectionEC=new d,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new I5,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,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 F,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new rs:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new se;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 mxt(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,M$(this),this._clearCommand=new ai({depth:1,color:new G}),this._clearPassState=new Fc(t),this._size=e.size??2048,this.size=this._size}ip.MAXIMUM_DISTANCE=2e4;function mxt(e){this.camera=new I5,this.passState=new Fc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function R$(e,t){return ze.fromCache({cull:{enabled:!0,face:Ni.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 M$(e){let t=!e._usesDepthTexture;e._primitiveRenderState=R$(t,e._primitiveBias),e._terrainRenderState=R$(t,e._terrainBias),e._pointRenderState=R$(t,e._pointBias)}ip.prototype.debugCreateRenderStates=function(){M$(this)};Object.defineProperties(ip.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){Ext(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 N$(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 pxt(e,t){let n=new Ku({context:t,width:e._textureSize.x,height:e._textureSize.y,format:pl.DEPTH_COMPONENT16}),i=new Bt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,sampler:Jt.NEAREST}),o=new os({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 gxt(e,t){let n=new Bt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:qe.DEPTH_STENCIL,pixelDatatype:Ge.UNSIGNED_INT_24_8,sampler:Jt.NEAREST}),i=new os({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 _xt(e,t){let n=new Ku({context:t,width:e._textureSize.x,height:e._textureSize.y,format:pl.DEPTH_COMPONENT16}),i=new Kr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,sampler:Jt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new os({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 NTe(e,t){e._isPointLight?_xt(e,t):e._usesDepthTexture?gxt(e,t):pxt(e,t)}function Cxt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ee.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,M$(e),N$(e),NTe(e,t))}function yxt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(N$(e),NTe(e,t),Cxt(e,t),LTe(e,t))}function LTe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Ext(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Ft.maximumCubeMapSize>=t?t:Ft.maximumCubeMapSize,o.x=t,o.y=t;let r=new Xe(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=Ft.maximumTextureSize>=t?t:Ft.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Xe(0,0,t,t)):i===4&&(t=Ft.maximumTextureSize>=t*2?t:Ft.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Xe(0,0,t,t),n[1].passState.viewport=new Xe(t,0,t,t),n[2].passState.viewport=new Xe(0,t,t,t),n[3].passState.viewport=new Xe(t,t,t,t));e._clearPassState.viewport=new Xe(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,u=a.y/o.y,f=a.width/o.x,h=a.height/o.y;s.textureOffsets=new M(f,0,0,c,0,h,0,u,0,0,1,0,0,0,0,1)}}var Ixt=new Xe;function bxt(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=we.OVERLAY,i}function xxt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Ixt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=bxt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Xe.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:Xe.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var op=new Array(8);op[0]=new se(-1,-1,-1,1);op[1]=new se(1,-1,-1,1);op[2]=new se(1,1,-1,1);op[3]=new se(-1,1,-1,1);op[4]=new se(-1,-1,1,1);op[5]=new se(1,-1,1,1);op[6]=new se(1,1,1,1);op[7]=new se(-1,1,1,1);var Vy=new M,L$=new Array(8);for(let e=0;e<8;++e)L$[e]=new se;function Txt(e,t){let n=new Rt({geometry:new bh({minimum:new d(-.5,-.5,-.5),maximum:new d(.5,.5,.5)}),attributes:{color:Xt.fromColor(t)}}),i=new Rt({geometry:new vg({radius:.5}),attributes:{color:Xt.fromColor(t)}});return new Ln({geometryInstances:[n,i],appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Sxt=[G.RED,G.GREEN,G.BLUE,G.MAGENTA],Bxt=new d;function wxt(e,t){xxt(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 Zm({camera:e._sceneCamera,color:G.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Zm({camera:e._shadowMapCamera,color:G.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 Zm({camera:e._passes[i].camera,color:Sxt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Qe.IDENTITY,r=e._pointLightRadius*2,s=d.fromElements(r,r,r,Bxt),a=M.fromTranslationQuaternionRotationScale(i,o,s,Vy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Txt(a,G.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Zm({camera:e._shadowMapCamera,color:G.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function I5(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new d,this.directionWC=d.clone(d.UNIT_Z),this.upWC=d.clone(d.UNIT_Y),this.rightWC=d.clone(d.UNIT_X),this.viewProjectionMatrix=new M}I5.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),d.clone(e.positionWC,this.positionWC),d.clone(e.directionWC,this.directionWC),d.clone(e.upWC,this.upWC),d.clone(e.rightWC,this.rightWC)};var Dxt=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);I5.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(Dxt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var vxt=new Array(5),Pxt=new ki,Rxt=new Array(4),OTe=new d,FTe=new d;function Mxt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,f=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,f=.9);let m=Rxt,g=vxt;for(g[0]=o,g[s]=r,a=0;a<s;++a){let L=(a+1)/s,p=o*Math.pow(u,L),b=o+c*L,T=D.lerp(b,p,f);g[a+1]=T,m[a]=T-g[a]}if(h){for(a=0;a<s;++a)m[a]=Math.min(m[a],e._maximumCascadeDistances[a]);let L=g[0];for(a=0;a<s-1;++a)L+=m[a],g[a+1]=L}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(m,0,e._cascadeDistances);let A=n.frustum,_=A.left,C=A.right,y=A.bottom,E=A.top,I=A.near,x=A.far,S=n.positionWC,w=n.directionWC,v=n.upWC,P=i.frustum.clone(Pxt),N=n.getViewProjection();for(a=0;a<s;++a){P.near=g[a],P.far=g[a+1];let L=M.multiply(P.projectionMatrix,i.viewMatrix,Vy),p=M.inverse(L,Vy),b=M.multiply(N,p,Vy),T=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,OTe),B=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,FTe);for(let z=0;z<8;++z){let Q=se.clone(op[z],L$[z]);M.multiplyByVector(b,Q,Q),d.divideByScalar(Q,Q.w,Q),d.minimumByComponent(Q,T,T),d.maximumByComponent(Q,B,B)}T.x=Math.max(T.x,0),T.y=Math.max(T.y,0),T.z=0,B.x=Math.min(B.x,1),B.y=Math.min(B.y,1),B.z=Math.min(B.z,1);let R=e._passes[a],O=R.camera;O.clone(n);let U=O.frustum;U.left=_+T.x*(C-_),U.right=_+B.x*(C-_),U.bottom=y+T.y*(E-y),U.top=y+B.y*(E-y),U.near=I+T.z*(x-I),U.far=I+B.z*(x-I),R.cullingVolume=O.frustum.computeCullingVolume(S,w,v);let k=e._cascadeMatrices[a];M.multiply(O.getViewProjection(),i.inverseViewMatrix,k),M.multiply(R.textureOffsets,k,k)}}var Nxt=new M,Lxt=new d,Oxt=new d,RTe=new d;function Fxt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,Vy),r=M.inverse(o,Vy),s=n.directionWC,a=i.directionWC;d.equalsEpsilon(s,a,D.EPSILON10)&&(a=i.upWC);let c=d.cross(s,a,Lxt);a=d.cross(c,s,Oxt),d.normalize(a,a),d.normalize(c,c);let u=d.fromElements(0,0,0,RTe),f=M.computeView(u,s,a,c,Nxt),h=M.multiply(f,r,Vy),m=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,OTe),g=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,FTe);for(let x=0;x<8;++x){let S=se.clone(op[x],L$[x]);M.multiplyByVector(h,S,S),d.divideByScalar(S,S.w,S),d.minimumByComponent(S,m,m),d.maximumByComponent(S,g,g)}g.z+=1e3,m.z-=10;let A=RTe;A.x=-(.5*(m.x+g.x)),A.y=-(.5*(m.y+g.y)),A.z=-g.z;let _=M.fromTranslation(A,Vy);f=M.multiply(_,f,f);let C=.5*(g.x-m.x),y=.5*(g.y-m.y),E=g.z-m.z,I=n.frustum;I.left=-C,I.right=C,I.bottom=-y,I.top=y,I.near=.01,I.far=E,M.clone(f,n.viewMatrix),M.inverse(f,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),d.clone(s,n.directionWC),d.clone(a,n.upWC),d.clone(c,n.rightWC)}var Qxt=[new d(-1,0,0),new d(0,-1,0),new d(0,0,-1),new d(1,0,0),new d(0,1,0),new d(0,0,1)],kxt=[new d(0,-1,0),new d(0,0,-1),new d(0,-1,0),new d(0,-1,0),new d(0,0,1),new d(0,-1,0)],Uxt=[new d(0,0,1),new d(1,0,0),new d(-1,0,0),new d(0,0,-1),new d(1,0,0),new d(1,0,0)];function Gxt(e,t){let n=new ki;n.fov=D.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=Qxt[i],o.upWC=kxt[i],o.rightWC=Uxt[i],M.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),M.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var zxt=new d,Vxt=new d,QTe=new le,MTe=QTe.center;function Hxt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=QTe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,zxt),s=d.negate(i.directionWC,Vxt),a=d.dot(r,s);if(e.fadingEnabled){let c=D.clamp(a/.1,0,1);e._darkness=D.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)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=d.add(i.positionWC,d.multiplyByScalar(i.directionWC,r,MTe),MTe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function Yxt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?d.clone(i.directionWC,r.directionWC):e._isPointLight?d.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),d.normalize(s,s),d.negate(s,s),M.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=bo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Hxt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}ip.prototype.update=function(e){if(Yxt(this,e),this._needsUpdate)if(yxt(this,e.context),this._isPointLight&&Gxt(this,e),this._cascadesEnabled&&(Fxt(this,e),this._numberOfCascades>1&&Mxt(this,e)),this._isPointLight)this._shadowMapCullingVolume=Gs.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;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&wxt(this,e)};ip.prototype.updatePass=function(e,t){LTe(this,e,t)};var Wxt=new F;function kTe(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=Wxt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,se.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return St(t,o,!1)}function jxt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=et.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===we.GLOBE,h=n.pass!==we.TRANSLUCENT,m=e._isPointLight,g=e._usesDepthTexture,A=np.getShadowCastShaderKeyword(m,f,g,h);if(s=i.shaderCache.getDerivedShaderProgram(u,A),!l(s)){let C=u.vertexShaderSource,y=u.fragmentShaderSource,E=np.createShadowCastVertexShader(C,m,f),I=np.createShadowCastFragmentShader(y,m,g,h);s=i.shaderCache.createDerivedShaderProgram(u,A,{vertexShaderSource:E,fragmentShaderSource:I,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,m?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ve(a,!1),a.cull=Ve(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),c=kTe(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}ip.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===we.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,m;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,m=o.receiveCommand.uniformMap),o.receiveCommand=et.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,A=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||A||n||g){let _=np.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(h=i.shaderCache.getDerivedShaderProgram(s,_),!l(h)){let C=np.createShadowReceiveVertexShader(a,u,f),y=np.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);h=i.shaderCache.createDerivedShaderProgram(s,_,{vertexShaderSource:C,fragmentShaderSource:y,attributeLocations:s._attributeLocations})}m=kTe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=m,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};ip.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]=jxt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};ip.prototype.isDestroyed=function(){return!1};ip.prototype.destroy=function(){N$(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 de(this)};var g_=ip;var fb=`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 qxt=!1;function Hy(e){this._drawClassificationFBO=new Ci({createDepthAttachments:!1}),this._accumulationFBO=new Ci({createDepthAttachments:!1}),this._packFBO=new Ci,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 ai({color:new G(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ai({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Xe,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(Hy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function UTe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function GTe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Kxt(e,t,n,i){UTe(e),e._translucentDepthStencilTexture=new Bt({context:t,width:n,height:i,pixelFormat:qe.DEPTH_STENCIL,pixelDatatype:Ge.UNSIGNED_INT_24_8,sampler:Jt.NEAREST})}function Jxt(e,t,n,i){GTe(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 Xxt(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)&&(Kxt(e,t,o,r),Jxt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new We({sources:[P2]}),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 We({sources:[fb]}),a={colorTexture:function(){return e._textureToComposite}},qxt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,h=f.shaderProgram,m=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new We({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=et.shallowClone(f);g.shaderProgram=m,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new We({sources:[fb]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new We({sources:[fb]}),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=!Xe.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Xe.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Xe.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Xe.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Xe.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Xn.EQUAL,reference:Yt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Xe.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:dn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Hy.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 u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){Xxt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};Hy.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(we.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[we.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[we.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};Hy.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),Zxt(this,e,t)};function Zxt(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}Hy.prototype.isSupported=function(){return this._supported};Hy.prototype.isDestroyed=function(){return!1};Hy.prototype.destroy=function(){return UTe(this),GTe(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()),de(this)};var Mk=Hy;function $xt(){this.command=void 0,this.near=void 0,this.far=void 0}function b5(e,t,n){let i=e.context,o;i.depthTexture&&(o=new Bk);let r;e._useOIT&&i.depthTexture&&(r=new Dk(i));let s=new Fc(i);s.viewport=Xe.clone(n),this.camera=t,this._cameraClone=bo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new Rk(i),this.pickDepthFramebuffer=new Pk,this.sceneFramebuffer=new lb,this.edgeFramebuffer=new Tk,this.globeDepth=o,this.globeTranslucencyFramebuffer=new wk,this.oit=r,this.translucentTileClassification=new Mk(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var O$=new d,F$=new d;function eTt(e,t,n){let i=Math.max(d.maximumComponent(d.abs(e.position,O$)),d.maximumComponent(d.abs(t.position,F$))),o=1/Math.max(1,i);return d.multiplyByScalar(e.position,o,O$),d.multiplyByScalar(t.position,o,F$),d.equalsEpsilon(O$,F$,n)&&d.equalsEpsilon(e.direction,t.direction,n)&&d.equalsEpsilon(e.up,t.up,n)&&d.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}b5.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return eTt(t,n,D.EPSILON15)?(this._cameraStartFired&&Oi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Oi(),bo.clone(t,n),!0)};function tTt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===oe.SCENE2D,u=t.nearToFarDistance2D;i*=1+D.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=f;for(let m=0;m<f;++m){let g,A;c?(g=Math.min(i-u,n+m*u),A=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,m)*n),A=Math.min(i,a*g));let _=h[m];l(_)?(_.near=g,_.far=A):_=h[m]=new Sk(g,A)}}function nTt(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 u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var zTe=new Gs,iTt=new qr;b5.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,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let N=0;N<f.length;++N)for(let L=0;L<we.NUMBER_OF_PASSES;++L)f[N].indices[L]=0;c.length=0,u.length=0;let h=this._commandExtents,m=h.length,g=0,A=+Number.MAX_VALUE,_=-Number.MAX_VALUE,{shadowsEnabled:C}=o,y=+Number.MAX_VALUE,E=-Number.MAX_VALUE,I=Number.MAX_VALUE,x=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:S}=t,w=zTe.planes;for(let N=0;N<5;++N)w[N]=S.planes[N];S=zTe;for(let N=0;N<i.length;++N){let L=i[N],{pass:p,boundingVolume:b}=L;if(p===we.COMPUTE)c.push(L);else if(p===we.OVERLAY)u.push(L);else{let T,B;if(l(b)){if(!e.isVisible(S,L,x))continue;let O=b.computePlaneDistances(r,s,iTt);if(T=O.start,B=O.stop,A=Math.min(A,T),_=Math.max(_,B),C&&L.receiveShadows&&T<g_.MAXIMUM_DISTANCE&&!(p===we.GLOBE&&T<-100&&B>100)){let U=B-T;p!==we.GLOBE&&T<100&&(I=Math.min(I,U)),y=Math.min(y,T),E=Math.max(E,B)}}else L instanceof ai?(T=a.near,B=a.far):(T=a.near,B=a.far,A=Math.min(A,T),_=Math.max(_,B));let R=h[g];l(R)||(R=h[g]=new $xt),R.command=L,R.near=T,R.far=B,g++}}C&&(y=Math.min(Math.max(y,a.near),a.far),E=Math.max(Math.min(E,a.far),y),o.nearPlane=y,o.farPlane=E,o.closestObjectSize=I),tTt(this,e,A,_);for(let N=0;N<g;N++)nTt(this,e,h[N]);if(g<m)for(let N=g;N<m;N++){let L=h[N];if(!l(L.command))break;L.command=void 0}let v=f.length,{frustumSplits:P}=t;P.length=v+1;for(let N=0;N<v;++N)P[N]=f[N].near,N===v-1&&(P[N+1]=f[N].far)};b5.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 db=b5;var HTe=.1,oTt=new Zd({pass:nr.MOST_DETAILED_PRELOAD}),rTt=new Zd({pass:nr.MOST_DETAILED_PICK}),Nk=new Zd({pass:nr.PICK});function ha(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Xe(0,0,1,1),n=new bo(e);n.frustum=new fn({width:HTe,aspectRatio:1,near:.1}),this._pickOffscreenView=new db(e,n,t)}ha.prototype.update=function(){this._pickPositionCacheDirty=!0};ha.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new xk,n[t]=i),i};var sTt=new rs,aTt=new d,x5=new d,cTt=new F,lTt=new M;function uTt(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 u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=M.clone(r.transform,lTt);r._setTransform(M.IDENTITY);let h=d.clone(r.position,aTt);d.multiplyByScalar(r.right,c,x5),d.add(x5,h,h),d.multiplyByScalar(r.up,u,x5),d.add(x5,h,h),r._setTransform(f),e.mode===oe.SCENE2D&&d.fromElements(h.z,h.x,h.y,h);let m=s.getPixelDimensions(o.width,o.height,1,1,cTt),g=sTt;return g.right=m.x*.5,g.left=-g.right,g.top=m.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(h,r.directionWC,r.upWC)}var fTt=new Kl,dTt=new F;function hTt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,m=f*a*u,g=h*a*c,A=s.getPixelDimensions(o.width,o.height,1,1,dTt),_=A.x*n*.5,C=A.y*i*.5,y=fTt;return y.top=g+C,y.bottom=g-C,y.right=m+_,y.left=m-_,y.near=a,y.far=s.far,y.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function T5(e,t,n,i,o){let r=e.camera.frustum;return r instanceof fn||r instanceof rs?uTt(e,t,n,i,o):hTt(e,t,n,i,o)}var Lk=new Xe(0,0,3,3),S5=new F,Ok=new G(0,0,0,0);function Q$(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 YTe(e,t,n,i,o){let{context:r,frameState:s,defaultView:a}=e,{viewport:c,pickFramebuffer:u}=a;e.view=a,c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let f=a.passState;f.viewport=Xe.clone(c,f.viewport);let h=to.transformWindowToDrawingBuffer(e,t,S5);Q$(r.drawingBufferHeight,h,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=T5(e,h,n.width,n.height,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=Nk,r.uniformState.update(s),e.updateEnvironment(),f=u.begin(n,c),e.updateAndExecuteCommands(f,Ok),e.resolveFramebuffers(f)}function WTe(e){let{context:t}=e;t.endFrame()}ha.prototype.pickAsync=async function(e,t,n,i,o=1){let{context:r,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,u=Lk;YTe(e,t,u,n,i);let f;return r.webgl2?f=c.endAsync(u,s,o):(f=c.end(u,o),f=Promise.resolve(f),At("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),WTe(e),f};ha.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:s}=r,a=Lk;YTe(e,t,a,n,i);let c=s.end(a,o);return WTe(e),c};ha.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 u=s.passState;u.viewport=Xe.clone(a,u.viewport);let f=to.transformWindowToDrawingBuffer(e,t,S5),h=Q$(o.drawingBufferHeight,f,n,i,Lk);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=T5(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=Nk,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(h,a),e.updateAndExecuteCommands(u,Ok),e.resolveFramebuffers(u);let m=c.readCenterPixel(h);return o.endFrame(),m};ha.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=Xe.clone(s,c.viewport);let u=to.transformWindowToDrawingBuffer(e,t,S5),f=Q$(i.drawingBufferHeight,u,1,1,Lk);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=T5(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=Nk,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,Ok);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let m=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,bk.decodeMetadataValues(n.classProperty,n.metadataProperty,m)};function ATt(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=Xe.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=T5(e,t,1,1,s),o.tilesetPassState=Nk,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,Ok),e.resolveFramebuffers(c),i.endFrame()}var mTt=new ki,pTt=new Kl,gTt=new fn,_Tt=new rs;ha.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 d.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let u=to.transformWindowToDrawingBuffer(e,t,S5);e.pickTranslucentDepth?ATt(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(mTt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(pTt):l(s.frustum.width)?f=s.frustum.clone(gTt):f=s.frustum.clone(_Tt);let{frustumCommandsList:h}=a,m=h.length;for(let g=0;g<m;++g){let _=this.getPickDepth(e,g).getDepth(o,u.x,u.y);if(l(_)&&_>0&&_<1){let C=h[g],y;return e.mode===oe.SCENE2D?(y=s.position.z,s.position.z=y-C.near+1,f.far=Math.max(1,C.far-C.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=C.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=C.far,c.updateFrustum(f)),n=to.drawingBufferToWorldCoordinates(e,u,_,n),e.mode===oe.SCENE2D&&(s.position.z=y,c.update(r)),this._pickPositionCache[i]=d.clone(n),n}}this._pickPositionCache[i]=void 0};var CTt=new he;ha.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){d.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,CTt);o.cartographicToCartesian(r,n)}return n};function yTt(e,t,n,i,o,r){for(let s of e){let a=s.object,c=s.position,u=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!u&&(n.push(s),n.length>=t))return!0;let f=a.primitive,h=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(a.id)){let m=f.getGeometryInstanceAttributes(a.id);l(m)&&l(m.show)&&(h=!0,m.show=xn.toValue(!1,m.show),o.push(m))}a instanceof Ia&&(h=!0,a.show=!1,r.push(a)),h||(f.show=!1,i.push(f))}}function jTe(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!yTt(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=xn.toValue(!0,c.show)}for(let a=0;a<r.length;++a)r[a].show=!0;return n}ha.prototype.drillPick=function(e,t,n,i,o){return jTe(a=>this.pick(e,t,i,o,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var VTe=new d,ETt=new d;function ITt(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 qTe(e,t,n,i){let o=t.direction,r=d.mostOrthogonalAxis(o,VTe),s=d.cross(o,r,VTe),a=d.cross(o,s,ETt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??HTe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function bTt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=qTe(e,o,r,a),u=oTt;u.camera=a,u.cullingVolume=c;let f=!0,h=s.length;for(let m=0;m<h;++m){let g=s[m];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}ha.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)bTt(this,e,t[n])&&t.splice(n--,1)};function KTe(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 Hl&&KTe(o,t,n))}}function B5(e,t,n,i,o,r){let s=[];if(KTe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new ITt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function xTt(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 TTt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,qTe(e,n,o,f.camera);let h=Xe.clone(f.viewport,Lk),m=f.pickFramebuffer.begin(h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=rTt:c.tilesetPassState=Nk,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(m,Ok),t.resolveFramebuffers(m);let g,A=f.pickFramebuffer.end(h,1)[0];if(t.context.depthTexture){let{frustumCommandsList:_}=f,C=_.length;for(let y=0;y<C;++y){let I=e.getPickDepth(t,y).getDepth(a,0,0);if(l(I)&&I>0&&I<1){let x=_[y],S=x.near*(y!==0?t.opaqueFrustumNearOffset:1),w=x.far,v=S+I*(w-S);g=gn.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),l(A)||l(g))return{object:A,position:g,exclude:!l(g)&&r||xTt(A,i)}}function k$(e,t,n,i,o,r,s,a){return jTe(function(){let u=TTt(e,t,n,o,r,s,a);return u?[u]:void 0},i)}function WB(e,t,n,i,o,r,s){let a=k$(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function w5(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)})})}ha.prototype.pickFromRay=function(e,t,n,i){return WB(this,e,t,n,i,!1,!1)};ha.prototype.drillPickFromRay=function(e,t,n,i,o){return k$(this,e,t,n,i,o,!1,!1)};ha.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=gn.clone(t),n=l(n)?n.slice():n,w5(e,B5(o,e,t,n,i,function(){return WB(o,e,t,n,i,!1,!0)}))};ha.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=gn.clone(t),i=l(i)?i.slice():i,w5(e,B5(r,e,t,i,o,function(){return k$(r,e,t,n,i,o,!1,!0)}))};var STt=new d,BTt=new d,wTt=new gn,JTe=new he;function U$(e,t){let n=e.ellipsoid,i=Si._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,BTt),r=he.toCartesian(t,n,STt),s=wTt;s.origin=r,s.direction=o;let a=new gn;return gn.getPoint(s,i,a.origin),d.negate(o,a.direction),a}function XTe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,JTe);return U$(e,i)}function ZTe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,JTe).height}function DTt(e,t,n,i,o){let r=U$(t,n);return B5(e,t,r,i,o,function(){let s=WB(e,t,r,i,o,!0,!0);if(l(s))return ZTe(t,s.position)})}function vTt(e,t,n,i,o,r){let s=XTe(t,n);return B5(e,t,s,i,o,function(){let a=WB(e,t,s,i,o,!0,!0);if(l(a))return d.clone(a.position,r)})}ha.prototype.sampleHeight=function(e,t,n,i){let o=U$(e,t),r=WB(this,e,o,n,i,!0,!1);if(l(r))return ZTe(e,r.position)};ha.prototype.clampToHeight=function(e,t,n,i,o){let r=XTe(e,t),s=WB(this,e,r,n,i,!0,!1);if(l(s))return d.clone(s.position,o)};ha.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]=DTt(this,e,t[s],n,i);return w5(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}))};ha.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]=vTt(this,e,t[s],n,i,t[s]);return w5(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};ha.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var Fk=ha;var Qk=`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 kk=`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 Uk=`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 Gk=`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 zk=`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 Vk=`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 Hk=`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 Yk=`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 Wk=`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 jk=`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 qk=`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 Kk=`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 Jk=`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 Yy=`#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 Xk=`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 Zk=`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 $k=`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 e3=`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 t3=`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);
}
`;function hb(){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 Ci,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new F,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(hb.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 $Te(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 PTt(e,t){$Te(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ge.HALF_FLOAT:Ge.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 Ci,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 eSe(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 RTt(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 MTt(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 NTt(e,t){eSe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(MTt(r,i),{framebuffer:n[r].framebuffer,uniformMap:RTt(e,r)});e._commands=o}hb.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ai({color:new G(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};hb.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,PTt(this,e),NTt(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};hb.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)};hb.prototype.isDestroyed=function(){return!1};hb.prototype.destroy=function(){return $Te(this),eSe(this),de(this)};var n3=hb;var LTt={NEAREST:0,LINEAR:1},kf=LTt;function Ab(e){e=e??V.EMPTY_OBJECT;let{name:t=jn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=kf.NEAREST,pixelFormat:a=qe.RGBA,pixelDatatype:c=Ge.UNSIGNED_BYTE,clearColor:u=G.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,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 Fc;h.scissorTest={enabled:!0,rectangle:l(f)?Xe.clone(f):new Xe},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(Ab.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 OTt=/uniform\s+sampler2D\s+depthTexture/g;Ab.prototype._isSupported=function(e){return!OTt.test(this._fragmentShader)||e.depthTexture};function FTt(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 Bt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Bt&&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 QTt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function kTt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function UTt(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]=QTt(e,r),n[r]=FTt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Bt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=kTt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=St(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 GTt(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 zTt(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=GTt(n,o)}let i=new We({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function VTt(e){let t=e._sampleMode,n,i;t===kf.LINEAR?(n=Kt.LINEAR,i=mi.LINEAR):(n=Kt.NEAREST,i=mi.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function HTt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function YTt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function WTt(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:u}=i[a];e._actualUniforms[c]=new Bt({context:t,source:u})}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],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=YTt(e,u);else if(typeof u=="string"){let h=new Be({url:u});s.push(h.fetchImage().then(HTt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}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 tSe(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 Bt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function jTt(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 qTt(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 Bt({context:t,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:Jt.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,u=c.length;for(let f=0;f<u;++f){let h=c[f].color;r[o]=G.floatToByte(h.red),r[o+1]=G.floatToByte(h.green),r[o+2]=G.floatToByte(h.blue),r[o+3]=G.floatToByte(h.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=G.floatToByte(c.red),r[o+1]=G.floatToByte(c.green),r[o+2]=G.floatToByte(c.blue),r[o+3]=G.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Bt({context:t,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:Jt.NEAREST})}Ab.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&tSe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=jTt(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,qTt(this,e),UTt(this),WTt(this,e),zTt(this,e),VTt(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=ze.fromCache({viewport:new Xe(0,0,i.width,i.height)}))),this._command.renderState=o};Ab.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,Jt.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)};Ab.prototype.isDestroyed=function(){return!1};Ab.prototype.destroy=function(){return tSe(this),de(this)};var vo=Ab;function mb(e){e=e??V.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=jn()),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(mb.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}}});mb.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};mb.prototype.get=function(e){return this._stages[e]};function KTt(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}mb.prototype.update=function(e,t){this._selectedDirty=KTt(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)}};mb.prototype.isDestroyed=function(){return!1};mb.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var Fu=mb;var ts={};function G$(e){let o=`#define USE_STEP_SIZE
${Yy}`,r=new vo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:kf.LINEAR}),s=new vo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:kf.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Fu({name:e,stages:[r,s],uniforms:a})}ts.createBlurStage=function(){return G$("czm_blur")};ts.createDepthOfFieldStage=function(){let e=G$("czm_depth_of_field_blur"),t=new vo({name:"czm_depth_of_field_composite",fragmentShader:Yk,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 Fu({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ts.isDepthOfFieldSupported=function(e){return e.context.depthTexture};ts.createEdgeDetectionStage=function(){let e=jn();return new vo({name:`czm_edge_detection_${e}`,fragmentShader:jk,uniforms:{length:.25,color:G.clone(G.BLACK)}})};ts.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function JTt(e){if(!l(e))return ts.createEdgeDetectionStage();let t=new Fu({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 vo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Fu({name:"czm_edge_detection_composite",stages:[t,s]})}ts.createSilhouetteStage=function(e){let t=JTt(e),n=new vo({name:"czm_silhouette_color_edges",fragmentShader:t3,uniforms:{silhouetteTexture:t.name}});return new Fu({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};ts.isSilhouetteSupported=function(e){return e.context.depthTexture};ts.createBloomStage=function(){let e=new vo({name:"czm_bloom_contrast_bias",fragmentShader:Hk,uniforms:{contrast:128,brightness:-.3}}),t=G$("czm_bloom_blur"),n=new Fu({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new vo({name:"czm_bloom_generate_composite",fragmentShader:zk,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 Fu({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};ts.createAmbientOcclusionStage=function(){let e=new vo({name:"czm_ambient_occlusion_generate",fragmentShader:kk,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new vo({name:"czm_ambient_occlusion_composite",fragmentShader:Uk,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 Fu({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ts.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var XTt=`#define FXAA_QUALITY_PRESET 39
${L2}
${Jk}`;ts.createFXAAStage=function(){return new vo({name:"czm_FXAA",fragmentShader:XTt,sampleMode:kf.LINEAR})};ts.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=Qk,new vo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ts.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=qk,new vo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ts.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=Kk,new vo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ts.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=e3,new vo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ts.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=Zk,new vo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:G.WHITE,autoExposure:void 0,exposure:1}})};ts.createAutoExposureStage=function(){return new n3};ts.createBlackAndWhiteStage=function(){return new vo({name:"czm_black_and_white",fragmentShader:Gk,uniforms:{gradations:5}})};ts.createBrightnessStage=function(){return new vo({name:"czm_brightness",fragmentShader:Vk,uniforms:{brightness:.5}})};ts.createNightVisionStage=function(){return new vo({name:"czm_night_vision",fragmentShader:$k})};ts.createDepthViewStage=function(){return new vo({name:"czm_depth_view",fragmentShader:Wk})};ts.createLensFlareStage=function(){return new vo({name:"czm_lens_flare",fragmentShader:Xk,uniforms:{dirtTexture:Zt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Zt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:te.WGS84.maximumRadius}})};var Uf=ts;function __(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function o3(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function z$(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[o3(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let h=e.getStageByName(f);l(h)&&(r[o3(h)]=!0)}}}return i.name}function i3(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 m=i.get(h);l(m.length)?a=i3(e,t,n,m,o):a=z$(e,t,n,m,o),s&&(o=a)}let u,f;if(s)for(u=1;u<c;++u)f=o3(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=o3(i.get(u));let h=n[f];for(let m=0;m<u;++m)h[o3(i.get(m))]=!0}return a}function ZTt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=i3(e,t,n,i,void 0);a=i3(e,t,n,o,a),a=z$(e,t,n,r,a),a=i3(e,t,n,e,a),z$(e,t,n,s,a)}else i3(e,t,n,e,void 0);return n}function $Tt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,h,m=e._framebuffers,g=m.length;for(f=0;f<g;++f){if(h=m[f],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||c!==h.pixelDatatype||!G.equals(u,h.clearColor))continue;let A=h.stages,_=A.length,C=!1;for(let y=0;y<_;++y)if(n[A[y]]){C=!0;break}if(!C)break}return l(h)&&f<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new Ci({pixelFormat:a,pixelDatatype:c}),clear:void 0},m.push(h),h)}function eSt(e,t){let n=ZTt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=$Tt(e,i,n[i]))}function V$(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function tSt(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,u=Math.ceil(n*c),f=Math.ceil(i*c),h=Math.min(u,f);a.forcePowerOfTwo&&(D.isPowerOfTwo(h)||(h=D.nextPowerOfTwo(h)),u=h,f=h),a.buffer.update(t,u,f),a.clear=new ai({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}__.prototype.updateDependencies=function(){this._updateDependencies=!0};__.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)&&(V$(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&eSt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,V$(this),tSt(this,e))};__.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};__.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};__.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};__.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};__.prototype.isDestroyed=function(){return!1};__.prototype.destroy=function(){return V$(this),de(this)};var pb=__;var nSt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var C_=Object.freeze(nSt);var H$=[];function Jl(){let e=Uf.createFXAAStage(),t=Uf.createAmbientOcclusionStage(),n=Uf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Uf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=C_.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new pb(this),r={},s=H$;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}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(Jl.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 Y$(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 C_.REINHARD:n=Uf.createReinhardTonemappingStage(t);break;case C_.MODIFIED_REINHARD:n=Uf.createModifiedReinhardTonemappingStage(t);break;case C_.FILMIC:n=Uf.createFilmicTonemappingStage(t);break;case C_.PBR_NEUTRAL:n=Uf.createPbrNeutralTonemappingStage(t);break;default:n=Uf.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 Y$(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}Jl.prototype.add=function(e){let t=this._stageNames,n=H$;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};Jl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=H$;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};Jl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Jl.prototype.get=function(e){return Y$(this),this._stages[e]};Jl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Jl.prototype.getStageByName=function(e){return this._stageNames[e]};Jl.prototype.update=function(e,t,n){Y$(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 y=0;y<r.length;++y){let E=r[y];E.ready&&E.enabled&&E._isSupported(e)&&(o[s++]=E)}o.length=s;let a=s!==i.length;if(!a){for(let y=0;y<s;++y)if(o[y]!==i[y]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,h=this._tonemapping,m=this._fxaa;h.enabled=n;let g=c.enabled&&c._isSupported(e),A=u.enabled&&u._isSupported(e),_=h.enabled&&h._isSupported(e),C=m.enabled&&m._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||A!==this._bloomEnabled||_!==this._tonemappingEnabled||C!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=A,this._tonemappingEnabled=_,this._fxaaEnabled=C,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let E=new Uint8Array(196608);for(let I=0;I<196608;I+=3)E[I]=Math.floor(Math.random()*255);this._randomTexture=new Bt({context:e,pixelFormat:qe.RGB,pixelDatatype:Ge.UNSIGNED_BYTE,source:{arrayBufferView:E,width:256,height:256},sampler:new Jt({wrapS:En.REPEAT,wrapT:En.REPEAT,minificationFilter:Kt.NEAREST,magnificationFilter:mi.NEAREST})})}this._textureCache.update(e),m.update(e,t),c.update(e,t),u.update(e,t),h.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let y=0;y<r.length;++y)r[y].update(e,t);s=0;for(let y=0;y<r.length;++y){let E=r[y];E.ready&&E.enabled&&E._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};Jl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function gb(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Jl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return gb(t)};function rp(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){rp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)rp(e.get(r),t,gb(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)rp(e.get(r),t,n,i,o)}Jl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,h=a.enabled&&a._isSupported(e),m=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,A=f.enabled&&f._isSupported(e),_=s.enabled&&s._isSupported(e);if(!_&&!h&&!m&&!A&&r===0)return;let C=t;h&&a.ready&&(rp(a,e,C,n,i),C=gb(a)),m&&c.ready&&(rp(c,e,C,n,i),C=gb(c)),g&&u.ready&&rp(u,e,C,n,i),A&&f.ready&&(rp(f,e,C,n,i),C=gb(f));let y=C;if(r>0){rp(o[0],e,C,n,i);for(let E=1;E<r;++E)rp(o[E],e,gb(o[E-1]),n,i);y=gb(o[r-1])}_&&s.ready&&rp(s,e,y,n,i)};Jl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Ou,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Jl.prototype.isDestroyed=function(){return!1};Jl.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(),de(this)};var r3=Jl;function _b(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}_b.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};_b.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof fn,!(this._previousMode===oe.SCENE2D||this._previousMode===oe.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE2D,!0),n._mode=oe.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?LSt(this,e):zSt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var iSt=new d,oSt=new d,rSt=new d,sSt=new d,aSt=new d,cSt=new d,lSt=new d,uSt=new he,fSt=new M,dSt=new ki,hSt=new fn,ASt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};_b.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===oe.COLUMBUS_VIEW||this._previousMode===oe.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,oe.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=iSt,o=oSt,r=rSt;if(e>0)i.x=0,i.y=-1,i.z=1,i=d.multiplyByScalar(d.normalize(i,i),5*t.maximumRadius,i),d.negate(d.normalize(i,o),o),d.cross(d.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===oe.SCENE2D)d.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,d.negate(d.UNIT_Z,o),d.clone(d.UNIT_Y,r);else{d.clone(u.positionWC,i),d.clone(u.directionWC,o),d.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,lSt),h=It.eastNorthUpToFixedFrame(f,t,fSt);M.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,uSt),i),M.multiplyByPointAsVector(h,o,o),M.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=hSt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=dSt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=D.toRadians(60));let a=ASt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=HSt(a);s3(this,c),this._previousMode===oe.SCENE2D?VSt(this,e,a,c):(a.position2D=M.multiplyByPoint(bo.TRANSFORM_2D,i,sSt),a.direction2D=M.multiplyByPointAsVector(bo.TRANSFORM_2D,o,aSt),a.up2D=M.multiplyByPointAsVector(bo.TRANSFORM_2D,r,cSt),n._mode=oe.MORPHING,dSe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var q$={position:new d,direction:new d,up:new d,frustum:void 0},iSe=new ki;_b.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===oe.SCENE3D||this._previousMode===oe.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE3D,!0),n._mode=oe.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===oe.SCENE2D)TSt(this,e,t);else{let i;e>0?(i=q$,d.fromDegrees(0,0,5*t.maximumRadius,t,i.position),d.negate(i.position,i.direction),d.normalize(i.direction,i.direction),d.clone(d.UNIT_Z,i.up)):i=oSe(this,t);let o,r=n.camera;r.frustum instanceof fn?o=r.frustum.clone():(o=iSe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=D.toRadians(60)),i.frustum=o;let s=ASe(i);s3(this,s),j$(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};_b.prototype.isDestroyed=function(){return!1};_b.prototype.destroy=function(){return D5(this),de(this)};function s3(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Ff(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Sn.LEFT_DOWN),e._morphHandler.setInputAction(n,Sn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Sn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Sn.WHEEL)}}function D5(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 mSt=new he,pSt=new d,gSt=new M;function oSe(e,t){let n=e._scene,i=n.camera,o=q$,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,mSt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,pSt),f=It.eastNorthUpToFixedFrame(u,t,gSt);return M.multiplyByPointAsVector(f,i.direction,s),M.multiplyByPointAsVector(f,i.up,a),o}var _St=new d,CSt=new d,ySt=new d,ESt=new d,ISt=new d,bSt=new d;function j$(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(r.position,_St),a=d.clone(r.direction,CSt),c=d.clone(r.up,ySt),u=M.multiplyByPoint(bo.TRANSFORM_2D_INVERSE,n.position,ESt),f=M.multiplyByPointAsVector(bo.TRANSFORM_2D_INVERSE,n.direction,ISt),h=M.multiplyByPointAsVector(bo.TRANSFORM_2D_INVERSE,n.up,bSt);function m(A){eh(s,u,A.time,r.position),eh(a,f,A.time,r.direction),eh(c,h,A.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:ys.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:m,complete:function(){hSe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var xSt=new fn,rSe=new d,sSe=new d,aSe=new d,K$=new d,cSe=new d,lSe=new d;function TSt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=q$,d.fromDegrees(0,0,5*n.maximumRadius,n,r.position),d.negate(r.position,r.direction),d.normalize(r.direction,r.direction),d.clone(d.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=oSe(e,n));let s;e._morphToOrthographic?(s=xSt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=iSe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=D.toRadians(60)),r.frustum=s;let a=ASe(r);s3(e,a);let c;e._morphToOrthographic?c=function(){j$(e,t,r,a)}:c=function(){fSe(e,t,r,function(){j$(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:d.fromDegrees(0,0,5*n.maximumRadius,n,K$),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function eh(e,t,n,i){return d.lerp(e,t,n,i)}function uSe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof fn)return;let a=s.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(m){s.frustum.fov=D.lerp(a,c,m.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:ys.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var SSt=new d,BSt=new d,wSt=new d,W$=new d,DSt=new d,vSt=new d,PSt=new rs,RSt=new gn,MSt=new d,NSt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function LSt(e,t){t*=.5;let n=e._scene,i=n.camera,o=d.clone(i.position,SSt),r=d.clone(i.direction,BSt),s=d.clone(i.up,wSt),a=d.negate(d.UNIT_Z,DSt),c=d.clone(d.UNIT_Y,vSt),u=W$;if(t>0)d.clone(d.ZERO,W$),u.z=5*n.ellipsoid.maximumRadius;else{d.clone(o,W$);let C=RSt;M.multiplyByPoint(bo.TRANSFORM_2D,o,C.origin),M.multiplyByPointAsVector(bo.TRANSFORM_2D,r,C.direction);let y=n.globe;if(l(y)){let E=y.pickWorldCoordinates(C,n,!0,MSt);l(E)&&(M.multiplyByPoint(bo.TRANSFORM_2D_INVERSE,E,u),u.z+=d.distance(o,u))}}let f=PSt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let h=NSt;h.position=u,h.direction=a,h.up=c,h.frustum=f;let m=mSe(h);s3(e,m);function g(C){eh(o,u,C.time,i.position),eh(r,a,C.time,i.direction),eh(s,c,C.time,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function A(C,y){C.position.z=y}let _=n.tweens.add({duration:t,easingFunction:ys.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){uSe(e,t,h,A,m)}});e._currentTweens.push(_)}var nSe=new he,OSt={position:new d,direction:new d,up:new d,position2D:new d,direction2D:new d,up2D:new d,frustum:new rs},FSt={position:new d,direction:new d,up:new d,frustum:void 0},QSt=new d,kSt=new gn,USt=new M,GSt=new d;function zSt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=OSt;if(t>0)d.clone(d.ZERO,r.position),r.position.z=5*n.maximumRadius,d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,nSe),i.mapProjection.project(nSe,r.position),d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);let h=kSt;d.clone(r.position2D,h.origin);let m=d.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,GSt),A=It.eastNorthUpToFixedFrame(g,n,USt);M.inverseTransformation(A,A),M.multiplyByPointAsVector(A,m,m),M.multiplyByPointAsVector(bo.TRANSFORM_2D,m,m);let _=i.globe;if(l(_)){let C=_.pickWorldCoordinates(h,i,!0,QSt);if(l(C)){let y=d.distance(r.position2D,C);C.x+=y,d.clone(C,r.position2D)}}}function s(h,m){h.position.x=m}M.multiplyByPoint(bo.TRANSFORM_2D,r.position,r.position2D),M.multiplyByPointAsVector(bo.TRANSFORM_2D,r.direction,r.direction2D),M.multiplyByPointAsVector(bo.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=FSt;M.multiplyByPoint(bo.TRANSFORM_2D_INVERSE,r.position2D,c.position),d.clone(r.direction,c.direction),d.clone(r.up,c.up),c.frustum=a;let u=mSe(c);s3(e,u);function f(){uSe(e,t,r,s,u)}dSe(e,t,r,f)}function fSe(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=D.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(m){r.frustum.fov=D.lerp(c,a,m.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:ys.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(h)}function VSt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(n.position,K$),a=d.clone(n.direction,cSe),c=d.clone(n.up,lSe);o._mode=oe.MORPHING;function u(){r.frustum=n.frustum.clone();let f=d.clone(r.position,rSe),h=d.clone(r.direction,sSe),m=d.clone(r.up,aSe);f.z=s.z;function g(_){eh(f,s,_.time,r.position),eh(h,a,_.time,r.direction),eh(m,c,_.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let A=o.tweens.add({duration:t,easingFunction:ys.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(A)}e._morphToOrthographic?u():fSe(e,0,n,u)}function dSe(e,t,n,i){let o=e._scene,r=o.camera,s=d.clone(r.position,rSe),a=d.clone(r.direction,sSe),c=d.clone(r.up,aSe),u=d.clone(n.position2D,K$),f=d.clone(n.direction2D,cSe),h=d.clone(n.up2D,lSe);function m(A){eh(s,u,A.time,r.position),eh(a,f,A.time,r.direction),eh(c,h,A.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:ys.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:m,complete:function(){hSe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function hSe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:ys.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function ASe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),D5(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.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,oe.SCENE3D,r)}}function mSe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),D5(t);let i=n.camera;d.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.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,oe.SCENE2D,o)}}function HSt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),D5(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.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,oe.COLUMBUS_VIEW,r)}}var a3=_b;var YSt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Xi=Object.freeze(YSt);function Qa(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function WSt(e,t){F.clone(e.distance.startPosition,t.distance.startPosition),F.clone(e.distance.endPosition,t.distance.endPosition),F.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),F.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function pSe(e,t,n){let i=Qa(Xi.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 F;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new F,endPosition:new F},u.angleAndHeight={startPosition:new F,endPosition:new F},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,F.lerp(f.position1,f.position2,.5,s[i])},Sn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Sn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(WSt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(F.clone(f.distance.endPosition,u.distance.endPosition),F.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let h=u.angleAndHeight.endPosition.x,m=u.prevAngle,g=Math.PI*2;for(;h>=m+Math.PI;)h-=g;for(;h<m-Math.PI;)h+=g;u.angleAndHeight.endPosition.x=-h*n.clientWidth/12,u.angleAndHeight.startPosition.x=-m*n.clientWidth/12}},Sn.PINCH_MOVE,t)}function gSe(e,t){let n=Qa(Xi.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 F,endPosition:new F,valid:!1}),s.startPosition=new F,F.clone(F.ZERO,s.startPosition),s.endPosition=new F,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,F.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Sn.WHEEL,t)}function jB(e,t,n){let i=Qa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new F;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new F,endPosition:new F,valid:!1});let c,u;n===Xi.LEFT_DRAG?(c=Sn.LEFT_DOWN,u=Sn.LEFT_UP):n===Xi.RIGHT_DRAG?(c=Sn.RIGHT_DOWN,u=Sn.RIGHT_UP):n===Xi.MIDDLE_DRAG&&(c=Sn.MIDDLE_DOWN,u=Sn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,F.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){J$(Qa(n,void 0),e);for(let f of Object.values(Na)){let h=Qa(n,f);J$(h,e)}},u,t)}function J$(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 _Se(e,t){F.clone(e.startPosition,t.startPosition),F.clone(e.endPosition,t.endPosition)}function jSt(e,t,n){let i=n._isDown,o=!1,r=Qa(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,J$(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new F,endPosition:new F,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function CSe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Xi)if(Xi.hasOwnProperty(s)){let a=Xi[s];if(l(a)){let c=Qa(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new F,endPosition:new F,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new F,endPosition:new F})}}e._eventHandler.setInputAction(function(s){for(let a in Xi)if(Xi.hasOwnProperty(a)){let c=Xi[a];if(l(c)){let u=Qa(c,t);jSt(c,t,e),r[u]&&(n[u]?(_Se(i[u],o[u]),o[u].valid=!0,_Se(s,i[u]),n[u]=!1):F.clone(s.endPosition,i[u].endPosition))}}F.clone(s.endPosition,e._currentMousePosition)},Sn.MOUSE_MOVE,t)}function th(e){this._eventHandler=new Ff(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new F,gSe(this,void 0),pSe(this,void 0,e),jB(this,void 0,Xi.LEFT_DRAG),jB(this,void 0,Xi.RIGHT_DRAG),jB(this,void 0,Xi.MIDDLE_DRAG),CSe(this,void 0);for(let t in Na)if(Na.hasOwnProperty(t)){let n=Na[t];l(n)&&(gSe(this,n),pSe(this,n,e),jB(this,n,Xi.LEFT_DRAG),jB(this,n,Xi.RIGHT_DRAG),jB(this,n,Xi.MIDDLE_DRAG),CSe(this,n))}}Object.defineProperties(th.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Qa(Xi.WHEEL)]||!this._update[Qa(Xi.WHEEL,Na.SHIFT)]||!this._update[Qa(Xi.WHEEL,Na.CTRL)]||!this._update[Qa(Xi.WHEEL,Na.ALT)];return this._buttonsDown>0||e}}});th.prototype.isMoving=function(e,t){let n=Qa(e,t);return!this._update[n]};th.prototype.getMovement=function(e,t){let n=Qa(e,t);return this._movement[n]};th.prototype.getLastMovement=function(e,t){let n=Qa(e,t),i=this._lastMovement[n];if(i.valid)return i};th.prototype.isButtonDown=function(e,t){let n=Qa(e,t);return this._isDown[n]};th.prototype.getStartMousePosition=function(e,t){if(e===Xi.WHEEL)return this._currentMousePosition;let n=Qa(e,t);return this._eventStartPosition[n]};th.prototype.getButtonPressTime=function(e,t){let n=Qa(e,t);return this._pressTime[n]};th.prototype.getButtonReleaseTime=function(e,t){let n=Qa(e,t);return this._releaseTime[n]};th.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};th.prototype.isDestroyed=function(){return!1};th.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),de(this)};var c3=th;function v5(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ve(n),this._stopObject=Ve(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(v5.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}}});v5.prototype.cancelTween=function(){this._tweens.remove(this)};function LA(){this._tweens=[]}Object.defineProperties(LA.prototype,{length:{get:function(){return this._tweens.length}}});LA.prototype.add=function(e){if(e=e??V.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new v5(this);let t=e.duration/ri.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/ri.SECONDS_PER_MILLISECOND,o=e.easingFunction??ys.LINEAR_NONE,r=e.startObject,s=new GIe(r);s.to(Ve(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 v5(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};LA.prototype.addProperty=function(e){e=e??V.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})};LA.prototype.addAlpha=function(e){e=e??V.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})};LA.prototype.addOffsetIncrement=function(e){e=e??V.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})};LA.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};LA.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};LA.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};LA.prototype.get=function(e){return this._tweens[e]};LA.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/ri.SECONDS_PER_MILLISECOND:Oi();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 Cb=LA;function u3(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=Xi.LEFT_DRAG,this.zoomEventTypes=[Xi.RIGHT_DRAG,Xi.WHEEL,Xi.PINCH],this.rotateEventTypes=Xi.LEFT_DRAG,this.tiltEventTypes=[Xi.MIDDLE_DRAG,Xi.PINCH,{eventType:Xi.LEFT_DRAG,modifier:Na.CTRL},{eventType:Xi.RIGHT_DRAG,modifier:Na.CTRL}],this.lookEventTypes={eventType:Xi.LEFT_DRAG,modifier:Na.SHIFT};let t=e.ellipsoid??te.default;this.minimumPickingTerrainHeight=te.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=te.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=te.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=te.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 c3(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 Cb,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new F(-1,-1),this._tiltCenter=new d,this._rotateMousePosition=new F(-1,-1),this._rotateStartPosition=new d,this._strafeStartPosition=new d,this._strafeMousePosition=new F,this._strafeEndMousePosition=new F,this._zoomMouseStart=new F(-1,-1),this._zoomWorldPosition=new d,this._useZoomWorldPosition=!1,this._panLastMousePosition=new F,this._panLastWorldPosition=new d,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 he(Math.PI,D.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 qSt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function KSt(e){return F.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var JSt=.4;function XSt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new F,endPosition:new F,motion:new F,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,m=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<JSt){let g=qSt(m,i),A=e.getLastMovement(t,n);if(!l(A)||KSt(A)||!a.inertiaEnabled||(a.motion.x=(A.endPosition.x-A.startPosition.x)*.5,a.motion.y=(A.endPosition.y-A.startPosition.y)*.5,a.startPosition=F.clone(A.startPosition,a.startPosition),a.endPosition=F.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=F.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||F.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let _=e.getStartMousePosition(t,n);o(r,_,a)}}}function ZSt(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 ySe=[];function Xl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(ySe[0]=n,n=ySe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,h=u.modifier,m=s.isMoving(f,h)&&s.getMovement(f,h),g=s.getStartMousePosition(f,h);e.enableInputs&&t&&(m?(i(e,g,m),ZSt(e,r)):o<1&&XSt(s,f,h,o,i,e,r))}}var P5=new gn,$St=new d,eBt=new F,tBt=new d,nBt=new F,iBt=new d,oBt=new d,rBt=new d,sBt=new d,RSe=new d,aBt=new d,cBt=new d,lBt=new d,uBt=new d,fBt=new d,dBt=new d,hBt=new d,ABt=new d,mBt=new d,pBt=new d,yb=new d,ESe=new d,ISe=new d,X$={orientation:new hc};function ree(e,t,n,i,o,r){let s=1;l(r)&&(s=D.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,h=o-u,m=i*h;m=D.clamp(m,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let A=m*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(A>0&&Math.abs(o-u)<1||A<0&&Math.abs(o-f)<1)return;o-A<u?A=o-u-1:o-A>f&&(A=o-f)}let _=e._scene,C=_.camera,y=_.mode,E=X$.orientation;E.heading=C.heading,E.pitch=C.pitch,E.roll=C.roll;let I=n.inertiaEnabled??F.equals(t,e._zoomMouseStart),x=e._zoomingOnVector,S=e._rotatingZoom,w;if(I||(e._zoomMouseStart=F.clone(t,e._zoomMouseStart),l(e._globe)&&y===oe.SCENE2D?(w=C.getPickRay(t,P5).origin,w=d.fromElements(w.y,w.z,w.x)):l(e._globe)&&(w=y_(e,t,$St)),l(w)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=d.clone(w,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,x=e._zoomingOnVector=!1,S=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){C.zoomIn(A);return}let v=y===oe.COLUMBUS_VIEW;if(C.positionCartographic.height<2e6&&(S=!0),!I||S){if(y===oe.SCENE2D){let P=e._zoomWorldPosition,N=C.position;if(!d.equals(P,N)&&C.positionCartographic.height<e._maxCoord.x*2){let L=C.position.x,p=d.subtract(P,N,tBt);d.normalize(p,p);let b=d.distance(P,N)*A/(C.getMagnitude()*.5);C.move(p,b*.5),(C.position.x<0&&L>0||C.position.x>0&&L<0)&&(w=C.getPickRay(t,P5).origin,w=d.fromElements(w.y,w.z,w.x),e._zoomWorldPosition=d.clone(w,e._zoomWorldPosition))}}else if(y===oe.SCENE3D){let P=d.normalize(C.position,RSe);if(e._cameraUnderground||e._zoomingUnderground||C.positionCartographic.height<3e3&&Math.abs(d.dot(C.direction,P))<.6)v=!0;else{let N=_.canvas,L=nBt;L.x=N.clientWidth/2,L.y=N.clientHeight/2;let p=y_(e,L,iBt);if(!l(p))v=!0;else if(C.positionCartographic.height<1e6)if(d.dot(C.direction,P)>=-.5)v=!0;else{let b=cBt;d.clone(C.position,b);let T=e._zoomWorldPosition,B=aBt;if(B=d.normalize(T,B),d.dot(B,P)<0)return;let R=pBt,O=fBt;d.clone(C.direction,O),d.add(b,d.multiplyByScalar(O,1e3,yb),R);let U=dBt,k=hBt;d.subtract(T,b,U),d.normalize(U,k);let z=d.dot(P,k);if(z>=0){e._zoomMouseStart.x=-1;return}let Q=Math.acos(-z),H=d.magnitude(b),W=d.magnitude(T),Z=H-A,Y=d.magnitude(U),$=Math.asin(D.clamp(Y/W*Math.sin(Q),-1,1)),K=Math.asin(D.clamp(Z/W*Math.sin(Q),-1,1)),fe=$-K+Q,ge=lBt;d.normalize(b,ge);let ne=uBt;ne=d.cross(k,ge,ne),ne=d.normalize(ne,ne),d.normalize(d.cross(ge,ne,yb),O),d.multiplyByScalar(d.normalize(R,yb),d.magnitude(R)-A,R),d.normalize(b,b),d.multiplyByScalar(b,Z,b);let Ce=ABt;d.multiplyByScalar(d.add(d.multiplyByScalar(ge,Math.cos(fe)-1,ESe),d.multiplyByScalar(O,Math.sin(fe),ISe),yb),Z,Ce),d.add(b,Ce,b),d.normalize(R,ge),d.normalize(d.cross(ge,ne,yb),O);let ye=mBt;d.multiplyByScalar(d.add(d.multiplyByScalar(ge,Math.cos(fe)-1,ESe),d.multiplyByScalar(O,Math.sin(fe),ISe),yb),d.magnitude(R),ye),d.add(R,ye,R),d.clone(b,C.position),d.normalize(d.subtract(R,b,yb),C.direction),d.clone(C.direction,C.direction),d.cross(C.direction,C.up,C.right),d.cross(C.right,C.direction,C.up),C.setView(X$);return}else{let b=d.normalize(p,oBt),T=d.normalize(e._zoomWorldPosition,rBt),B=d.dot(T,b);if(B>0&&B<1){let R=D.acosClamped(B),O=d.cross(T,b,sBt),U=Math.abs(R)>D.toRadians(20)?C.positionCartographic.height*.75:C.positionCartographic.height-A,k=A/U;C.rotate(O,R*k)}}}}e._rotatingZoom=!v}if(!I&&v||x){let P,N=to.worldToWindowCoordinates(_,e._zoomWorldPosition,eBt);y!==oe.COLUMBUS_VIEW&&F.equals(t,e._zoomMouseStart)&&l(N)?P=C.getPickRay(N,P5):P=C.getPickRay(t,P5);let L=P.direction;(y===oe.COLUMBUS_VIEW||y===oe.SCENE2D)&&d.fromElements(L.y,L.z,L.x,L),C.move(L,A),e._zoomingOnVector=!0}else C.zoomIn(A);e._cameraUnderground||C.setView(X$)}var gBt=new gn,_Bt=new gn,CBt=new d;function yBt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,gBt).origin,s=o.getPickRay(n.endPosition,_Bt).origin;r=d.fromElements(r.y,r.z,r.x,r),s=d.fromElements(s.y,s.z,s.x,s);let a=d.subtract(r,s,CBt),c=d.magnitude(a);c>0&&(d.normalize(a,a),o.move(a,c))}function bSe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;ree(e,t,n,e.zoomFactor,o.getMagnitude())}var EBt=new F,IBt=new F;function xSe(e,t,n){if(l(n.angleAndHeight)){bBt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=EBt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=F.normalize(c,c);let u=IBt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=F.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let h=D.acosClamped(u.x);u.y<0&&(h=D.TWO_PI-h);let m=h-f;o.twistRight(m)}function bBt(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 xBt(e){let t=e._scene.mapMode2D===Lu.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(Xl(e,e.enableTranslate,e.translateEventTypes,yBt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Xl(e,e.enableZoom,e.zoomEventTypes,bSe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Xl(e,e.enableRotate,e.tiltEventTypes,xSe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Xl(e,e.enableZoom,e.zoomEventTypes,bSe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Xl(e,e.enableRotate,e.translateEventTypes,xSe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var MSe=new gn,TBt=new d,SBt=new d;function y_(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,TBt)),!l(o))return d.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,MSe),u=o.pickWorldCoordinates(c,i,a,SBt),f=l(s)?d.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=l(u)?d.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<h?d.clone(s,n):d.clone(u,n)}var BBt=new he;function Q5(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let c=t.cartesianToCartographic(i.position,BBt);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var wBt=new d;function NSe(e,t){let n=t.origin,i=t.direction,o=Q5(e),r=d.normalize(n,wBt),s=Math.abs(d.dot(r,i));return s=Math.max(s,.5)*2,o*s}function LSe(e,t,n,i){let o=d.distance(t.origin,n),r=Q5(e),s=D.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),gn.getPoint(t,o,i)}function OSe(e,t,n,i){let o;return l(n)?(o=d.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=Q5(e))):o=Q5(e),gn.getPoint(t,o,i)}var DBt=new F;function FSe(e,t){let n=t.endPosition,i=F.subtract(t.endPosition,t.startPosition,DBt),o=e._strafeEndMousePosition;F.add(o,i,o),t.endPosition=o,see(e,t,e._strafeStartPosition),t.endPosition=n}var TSe=new gn,vBt=new gn,Z$=new d,PBt=new d,RBt=new d,MBt=new d,NBt=new rn(d.UNIT_X,0),LBt=new F,OBt=new F;function FBt(e,t,n){if(d.equals(t,e._translateMousePosition)||(e._looking=!1),d.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){zf(e,t,n);return}if(e._strafing){FSe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=F.clone(n.startPosition,LBt),a=F.clone(n.endPosition,OBt),c=o.getPickRay(s,TSe),u=d.clone(d.ZERO,MBt),f=d.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=y_(e,s,Z$),l(h)&&(u.x=h.x)),r||u.x>o.position.z&&l(h)){let I=h;r&&(I=OSe(e,c,h,Z$)),F.clone(t,e._strafeMousePosition),F.clone(t,e._strafeEndMousePosition),d.clone(I,e._strafeStartPosition),e._strafing=!0,see(e,n,e._strafeStartPosition);return}let m=rn.fromPointNormal(u,f,NBt);c=o.getPickRay(s,TSe);let g=ci.rayPlane(c,m,Z$),A=o.getPickRay(a,vBt),_=ci.rayPlane(A,m,PBt);if(!l(g)||!l(_)){e._looking=!0,zf(e,t,n),F.clone(t,e._translateMousePosition);return}let C=d.subtract(g,_,RBt),y=C.x;C.x=C.y,C.y=C.z,C.z=y;let E=d.magnitude(C);E>D.EPSILON6&&(d.normalize(C,C),o.move(C,E))}var QSe=new F,N5=new gn,L5=new d,QBt=new d,kSe=new M,kBt=new M,UBt=new d,GBt=new rn(d.UNIT_X,0),$$=new d,nee=new he,USe=new M,zBt=new Qe,VBt=new X,O5=new d;function HBt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),F.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){zf(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,YBt(e,t,n)):WBt(e,t,n)}function YBt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=QSe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,N5),c=d.UNIT_X,u=a.origin,f=a.direction,h,m=d.dot(c,f);if(Math.abs(m)>D.EPSILON6&&(h=-d.dot(c,u)/m),!l(h)||h<=0){e._looking=!0,zf(e,t,n),F.clone(t,e._tiltCenterMousePosition);return}let g=d.multiplyByScalar(f,h,L5);d.add(u,g,g);let A=i.mapProjection,_=A.ellipsoid;d.fromElements(g.y,g.z,g.x,g);let C=A.unproject(g,nee);_.cartographicToCartesian(C,g);let y=It.eastNorthUpToFixedFrame(g,_,kSe),E=e._globe,I=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=M.clone(o.transform,USe);o._setTransform(y),Gf(e,t,n,d.UNIT_Z),o._setTransform(x),e._globe=E,e._ellipsoid=I;let S=I.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function WBt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=d.UNIT_X;if(F.equals(t,e._tiltCenterMousePosition))s=d.clone(e._tiltCenter,L5);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=y_(e,t,L5)),!l(s)){a=o.getPickRay(t,N5);let p=a.origin,b=a.direction,T,B=d.dot(c,b);if(Math.abs(B)>D.EPSILON6&&(T=-d.dot(c,p)/B),!l(T)||T<=0){e._looking=!0,zf(e,t,n),F.clone(t,e._tiltCenterMousePosition);return}s=d.multiplyByScalar(b,T,L5),d.add(p,s,s)}r&&(l(a)||(a=o.getPickRay(t,N5)),LSe(e,a,s,s)),F.clone(t,e._tiltCenterMousePosition),d.clone(s,e._tiltCenter)}let u=i.canvas,f=QSe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,N5);let h=d.clone(d.ZERO,UBt);h.x=s.x;let m=rn.fromPointNormal(h,c,GBt),g=ci.rayPlane(a,m,QBt),A=o._projection,_=A.ellipsoid;d.fromElements(s.y,s.z,s.x,s);let C=A.unproject(s,nee);_.cartographicToCartesian(C,s);let y=It.eastNorthUpToFixedFrame(s,_,kSe),E;l(g)?(d.fromElements(g.y,g.z,g.x,g),C=A.unproject(g,nee),_.cartographicToCartesian(C,g),E=It.eastNorthUpToFixedFrame(g,_,kBt)):E=y;let I=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=d.UNIT_Z,w=M.clone(o.transform,USe);o._setTransform(y);let v=d.cross(d.UNIT_Z,d.normalize(o.position,$$),$$),P=d.dot(o.right,v);if(Gf(e,t,n,S,!1,!0),o._setTransform(E),P<0){let p=n.startPosition.y-n.endPosition.y;(r&&p<0||!r&&p>0)&&(S=void 0);let b=o.constrainedAxis;o.constrainedAxis=void 0,Gf(e,t,n,S,!0,!1),o.constrainedAxis=b}else Gf(e,t,n,S,!0,!1);if(l(o.constrainedAxis)){let p=d.cross(o.direction,o.constrainedAxis,O5);d.equalsEpsilon(p,d.ZERO,D.EPSILON6)||(d.dot(p,o.right)<0&&d.negate(p,p),d.cross(p,o.direction,o.up),d.cross(o.direction,o.up,o.right),d.normalize(o.up,o.up),d.normalize(o.right,o.right))}o._setTransform(w),e._globe=I,e._ellipsoid=x;let N=x.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let L=d.clone(o.positionWC,$$);if(e.enableCollisionDetection&&lee(e,!0),!d.equals(o.positionWC,L)){o._setTransform(E),o.worldToCameraCoordinatesPoint(L,L);let p=d.magnitudeSquared(L);d.magnitudeSquared(o.position)>p&&(d.normalize(o.position,o.position),d.multiplyByScalar(o.position,Math.sqrt(p),o.position));let b=d.angleBetween(L,o.position),T=d.cross(L,o.position,L);d.normalize(T,T);let B=Qe.fromAxisAngle(T,b,zBt),R=X.fromQuaternion(B,VBt);X.multiplyByVector(R,o.direction,o.direction),X.multiplyByVector(R,o.up,o.up),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up),o._setTransform(w)}}var GSe=new F,zSe=new gn,VSe=new d;function jBt(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=GSe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,zSe),u=c.origin,f=c.direction,h=o.position.z,m;h<e._minimumPickingTerrainHeight&&(m=y_(e,a,VSe));let g;if(l(m)&&(g=d.distance(u,m)),s){let A=NSe(e,c,h);l(g)?g=Math.min(g,A):g=A}if(!l(g)){let A=d.UNIT_X;g=-d.dot(A,u)/d.dot(A,f)}ree(e,t,n,e.zoomFactor,g)}function qBt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))Xl(e,e.enableRotate,e.rotateEventTypes,Gf,e.inertiaSpin,"_lastInertiaSpinMovement"),Xl(e,e.enableZoom,e.zoomEventTypes,YSe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Xl(e,e.enableTilt,e.tiltEventTypes,HBt,e.inertiaSpin,"_lastInertiaTiltMovement"),Xl(e,e.enableTranslate,e.translateEventTypes,FBt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Xl(e,e.enableZoom,e.zoomEventTypes,jBt,e.inertiaZoom,"_lastInertiaZoomMovement"),Xl(e,e.enableLook,e.lookEventTypes,zf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var KBt=new gn,JBt=new rn(d.UNIT_X,0),XBt=new d,ZBt=new d;function see(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,KBt),s=d.clone(o.direction,ZBt);i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.z,s.x,s.y,s);let a=rn.fromPointNormal(n,s,JBt),c=ci.rayPlane(r,a,XBt);l(c)&&(s=d.subtract(n,c,s),i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.y,s.z,s.x,s),d.add(o.position,s,o.position))}var SSe=new d,HSe=new he,iee=new d,oee=new te,$Bt=new d,ewt=new d,twt=new d;function nwt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(o.transform,M.IDENTITY)){Gf(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,$Bt);if(F.equals(t,e._rotateMousePosition)){if(e._looking)zf(e,t,n,u);else if(e._rotating)Gf(e,t,n);else if(e._strafing)FSe(e,n);else{if(d.magnitude(o.position)<d.magnitude(e._rotateStartPosition))return;a=d.magnitude(e._rotateStartPosition),c=iee,c.x=c.y=c.z=a,s=te.fromCartesian3(c,oee),tee(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,HSe).height,h=e._globe;if(l(h)&&f<e._minimumPickingTerrainHeight){let m=y_(e,n.startPosition,twt);if(l(m)){let g=!1,A=o.getPickRay(n.startPosition,MSe);if(r)g=!0,OSe(e,A,m,m);else{let _=s.geodeticSurfaceNormal(m,ewt);Math.abs(d.dot(A.direction,_))<.05?g=!0:g=d.magnitude(o.position)<d.magnitude(m)}g?(F.clone(t,e._strafeEndMousePosition),d.clone(m,e._strafeStartPosition),e._strafing=!0,see(e,n,e._strafeStartPosition)):(a=d.magnitude(m),c=iee,c.x=c.y=c.z=a,s=te.fromCartesian3(c,oee),tee(e,t,n,s),d.clone(m,e._rotateStartPosition))}else e._looking=!0,zf(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,SSe))?(tee(e,t,n,e._ellipsoid),d.clone(SSe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Gf(e,t,n)):(e._looking=!0,zf(e,t,n,u));F.clone(t,e._rotateMousePosition)}function Gf(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=d.magnitude(a.position),h=e._rotateFactor*(f-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let m=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;m=Math.min(m,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let A=h*m*Math.PI*2,_=h*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let C=e.maximumTiltAngle,y=d.dot(a.direction,i),E=Math.PI-Math.acos(y)+_;E>C&&(_-=E-C)}o||a.rotateRight(A),r||a.rotateUp(_),a.constrainedAxis=u}var eee=se.clone(se.UNIT_W),BSe=se.clone(se.UNIT_W),R5=new d,qB=new d,M5=new d,wSe=new d,iwt=new F,owt=new F,rwt=new F,swt=new F,awt=new gn;function tee(e,t,n,i){let o=e._scene,r=o.camera,s=F.clone(n.startPosition,iwt),a=F.clone(n.endPosition,owt),c=i.cartesianToCartographic(r.positionWC,HSe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=d.clone(e._panLastWorldPosition,eee),!l(e._globe)&&!F.equalsEpsilon(s,e._panLastMousePosition)&&(u=y_(e,s,eee)),!l(e._globe)&&l(u))){let h=d.subtract(u,r.positionWC,qB),m=d.multiplyByScalar(r.directionWC,d.dot(r.directionWC,h),qB),g=d.magnitude(m),A=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,swt),_=F.subtract(a,s,rwt),C=d.multiplyByScalar(r.rightWC,_.x*A.x,qB),y=d.normalize(r.positionWC,RSe),E=r.getPickRay(a,awt).direction,I=d.subtract(E,d.projectVector(E,r.rightWC,M5),M5),x=d.angleBetween(I,r.directionWC),S=1;l(r.frustum.fov)&&(S=Math.max(Math.tan(x),.1));let w=Math.abs(d.dot(r.directionWC,y)),v=-_.y*A.y*2/Math.sqrt(S)*(1-w),P=d.multiplyByScalar(E,v,M5);w=Math.abs(d.dot(r.upWC,y));let N=d.multiplyByScalar(r.upWC,-_.y*(1-w)*A.y,wSe);f=d.add(u,C,BSe),f=d.add(f,P,f),f=d.add(f,N,f),d.clone(f,e._panLastWorldPosition),F.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(s,i,eee),f=r.pickEllipsoid(a,i,BSe)),!l(u)||!l(f)){e._rotating=!0,Gf(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let h=r.constrainedAxis,m=d.mostOrthogonalAxis(h,R5);d.cross(m,h,m),d.normalize(m,m);let g=d.cross(h,m,qB),A=d.magnitude(u),_=d.dot(h,u),C=Math.acos(_/A),y=d.multiplyByScalar(h,_,M5);d.subtract(u,y,y),d.normalize(y,y);let E=d.magnitude(f),I=d.dot(h,f),x=Math.acos(I/E),S=d.multiplyByScalar(h,I,wSe);d.subtract(f,S,S),d.normalize(S,S);let w=Math.acos(d.dot(y,m));d.dot(y,g)<0&&(w=D.TWO_PI-w);let v=Math.acos(d.dot(S,m));d.dot(S,g)<0&&(v=D.TWO_PI-v);let P=w-v,N;d.equalsEpsilon(h,r.position,D.EPSILON2)?N=r.right:N=d.cross(h,r.position,R5);let L=d.cross(h,N,R5),p=d.dot(L,d.subtract(u,h,qB)),b=d.dot(L,d.subtract(f,h,qB)),T;p>0&&b>0?T=x-C:p>0&&b<=0?d.dot(r.position,h)>0?T=-C-x:T=C+x:T=C-x,r.rotateRight(P),r.rotateUp(T)}else{d.normalize(u,u),d.normalize(f,f);let h=d.dot(u,f),m=d.cross(u,f,R5);if(h<1&&!d.equalsEpsilon(m,d.ZERO,D.EPSILON14)){let g=Math.acos(h);r.rotate(m,g)}}}var cwt=new d,lwt=new he,DSe=0;function YSe(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,u;c?u=t:(u=GSe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,zSe),h,m=o.cartesianToCartographic(s.position,lwt).height,g=Math.abs(DSe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:m<e._minimumPickingTerrainHeight)&&(h=y_(e,u,VSe));let _;if(l(h)&&(_=d.distance(f.origin,h),DSe=_),c){let y=NSe(e,f,m);l(_)?_=Math.min(_,y):_=y}l(_)||(_=m);let C=d.normalize(s.position,cwt);ree(e,t,n,e.zoomFactor,_,d.dot(C,s.direction))}var WSe=new F,F5=new gn,l3=new d,uwt=new d,jSe=new M,fwt=new M,qSe=new M,dwt=new Qe,hwt=new X,aee=new he,cee=new d;function Awt(e,t,n){let o=e._scene.camera;if(!M.equals(o.transform,M.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),F.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,cee);zf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,aee);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,pwt(e,t,n)):gwt(e,t,n)}var mwt=new he;function pwt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,mwt).height;if(a-s-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=WSe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,F5),h,m=ci.rayEllipsoid(f,i);if(l(m))h=gn.getPoint(f,m.start,l3);else if(a>e._minimumTrackBallHeight){let E=ci.grazingAltitudeLocation(f,i);if(!l(E))return;let I=i.cartesianToCartographic(E,aee);I.height=0,h=i.cartographicToCartesian(I,l3)}else{e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(r.position,cee);zf(e,t,n,E),F.clone(t,e._tiltCenterMousePosition);return}let g=It.eastNorthUpToFixedFrame(h,i,jSe),A=e._globe,_=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let C=M.clone(r.transform,qSe);r._setTransform(g),Gf(e,t,n,d.UNIT_Z),r._setTransform(C),e._globe=A,e._ellipsoid=_;let y=_.maximumRadius;e._rotateFactor=1/y,e._rotateRateRangeAdjustment=y}function gwt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(F.equals(t,e._tiltCenterMousePosition))a=d.clone(e._tiltCenter,l3);else{if(a=y_(e,t,l3),!l(a)){if(c=r.getPickRay(t,F5),u=ci.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,aee).height<=e._minimumTrackBallHeight){e._looking=!0;let b=e._ellipsoid.geodeticSurfaceNormal(r.position,cee);zf(e,t,n,b),F.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,u.start,l3)}s&&(l(c)||(c=r.getPickRay(t,F5)),LSe(e,c,a,a)),F.clone(t,e._tiltCenterMousePosition),d.clone(a,e._tiltCenter)}let f=o.canvas,h=WSe;h.x=f.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,F5);let m=d.magnitude(a),g=d.fromElements(m,m,m,iee),A=te.fromCartesian3(g,oee);if(u=ci.rayEllipsoid(c,A),!l(u))return;let _=d.magnitude(c.origin)>m?u.start:u.stop,C=gn.getPoint(c,_,uwt),y=It.eastNorthUpToFixedFrame(a,i,jSe),E=It.eastNorthUpToFixedFrame(C,A,fwt),I=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=d.UNIT_Z,w=M.clone(r.transform,qSe);r._setTransform(E);let v=d.cross(C,r.positionWC,O5);if(d.dot(r.rightWC,v)<0){let p=n.startPosition.y-n.endPosition.y;(s&&p<0||!s&&p>0)&&(S=void 0);let b=r.constrainedAxis;r.constrainedAxis=void 0,Gf(e,t,n,S,!0,!1),r.constrainedAxis=b}else Gf(e,t,n,S,!0,!1);if(r._setTransform(y),Gf(e,t,n,S,!1,!0),l(r.constrainedAxis)){let p=d.cross(r.direction,r.constrainedAxis,O5);d.equalsEpsilon(p,d.ZERO,D.EPSILON6)||(d.dot(p,r.right)<0&&d.negate(p,p),d.cross(p,r.direction,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.up,r.up),d.normalize(r.right,r.right))}r._setTransform(w),e._globe=I,e._ellipsoid=x;let N=x.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let L=d.clone(r.positionWC,O5);if(e.enableCollisionDetection&&lee(e,!0),!d.equals(r.positionWC,L)){r._setTransform(E),r.worldToCameraCoordinatesPoint(L,L);let p=d.magnitudeSquared(L);d.magnitudeSquared(r.position)>p&&(d.normalize(r.position,r.position),d.multiplyByScalar(r.position,Math.sqrt(p),r.position));let b=d.angleBetween(L,r.position),T=d.cross(L,r.position,L);d.normalize(T,T);let B=Qe.fromAxisAngle(T,b,dwt),R=X.fromQuaternion(B,hwt);X.multiplyByVector(R,r.direction,r.direction),X.multiplyByVector(R,r.up,r.up),d.cross(r.direction,r.up,r.right),d.cross(r.right,r.direction,r.up),r._setTransform(w)}}var _wt=new F,Cwt=new F,vSe=new gn,PSe=new gn,ywt=new d,Ewt=new d;function zf(e,t,n,i){let r=e._scene.camera,s=_wt;s.x=n.startPosition.x,s.y=0;let a=Cwt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,vSe),u=r.getPickRay(a,PSe),f=0,h,m;r.frustum instanceof fn?(h=c.origin,m=u.origin,d.add(r.direction,h,h),d.add(r.direction,m,m),d.subtract(h,r.position,h),d.subtract(m,r.position,m),d.normalize(h,h),d.normalize(m,m)):(h=c.direction,m=u.direction);let g=d.dot(h,m);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let A=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(A)?r.look(A,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,vSe),u=r.getPickRay(a,PSe),f=0,r.frustum instanceof fn?(h=c.origin,m=u.origin,d.add(r.direction,h,h),d.add(r.direction,m,m),d.subtract(h,r.position,h),d.subtract(m,r.position,m),d.normalize(h,h),d.normalize(m,m)):(h=c.direction,m=u.direction),g=d.dot(h,m),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??A,l(i)){let _=r.direction,C=d.negate(i,ywt),y=d.equalsEpsilon(_,i,D.EPSILON2),E=d.equalsEpsilon(_,C,D.EPSILON2);if(!y&&!E){g=d.dot(_,i);let I=D.acosClamped(g);f>0&&f>I&&(f=I-D.EPSILON4),g=d.dot(_,C),I=D.acosClamped(g),f<0&&-f>I&&(f=-I+D.EPSILON4);let x=d.cross(i,_,Ewt);r.look(x,f)}else(y&&f<0||E&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function Iwt(e){Xl(e,e.enableRotate,e.rotateEventTypes,nwt,e.inertiaSpin,"_lastInertiaSpinMovement"),Xl(e,e.enableZoom,e.zoomEventTypes,YSe,e.inertiaZoom,"_lastInertiaZoomMovement"),Xl(e,e.enableTilt,e.tiltEventTypes,Awt,e.inertiaSpin,"_lastInertiaTiltMovement"),Xl(e,e.enableLook,e.lookEventTypes,zf)}var bwt=new M,xwt=new he;function lee(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===oe.SCENE2D||i===oe.MORPHING)return;let o=n.camera,r=n.ellipsoid??te.WGS84,s=n.mapProjection,a,c;M.equals(o.transform,M.IDENTITY)||(a=M.clone(o.transform,bwt),c=d.magnitude(o.position),o._setTransform(M.IDENTITY));let u=xwt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let m=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,A=g/e._lastGlobeHeight;u.height<m&&(t||Math.abs(A)<=.1)&&(u.height=m,i===oe.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(A)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}l(a)&&(o._setTransform(a),f&&(d.normalize(o.position,o.position),d.negate(o.position,o.direction),d.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),d.normalize(o.direction,o.direction),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up)))}u3.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===oe.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Twt=new d,Swt=new d;u3.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??te.default):(this._globe=void 0,this._ellipsoid=te.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=d.clone(t.positionWC,Twt),c=d.clone(t.directionWC,Swt);if(i===oe.SCENE2D?xBt(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=d.UNIT_Z,qBt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,Iwt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!d.equals(a,t.positionWC)||!d.equals(c,t.directionWC);lee(this,u)}this._aggregator.reset()};u3.prototype.isDestroyed=function(){return!1};u3.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),de(this)};var f3=u3;var d3=`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 h3=`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 E_(){this._sceneFramebuffer=new lb;let e=.125,t=new Array(6);t[0]=new vo({fragmentShader:Ou,textureScale:e,forcePowerOfTwo:!0,sampleMode:kf.LINEAR});let n=t[1]=new vo({fragmentShader:h3,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new F,t[2]=new vo({fragmentShader:Yy,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 vo({fragmentShader:Yy,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 vo({fragmentShader:Ou,sampleMode:kf.LINEAR}),this._uCenter=new F,this._uRadius=void 0,t[5]=new vo({fragmentShader:d3,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Fu({stages:t});let o=new pb(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}E_.prototype.get=function(e){return this._stages.get(e)};E_.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 Bwt=new se,KSe=new F,wwt=new F,JSe=new M;function Dwt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=M.computeViewportTransformation(n,0,1,JSe),u=M.multiplyByPoint(r,o,Bwt),f=It.pointToGLWindowCoordinates(s,c,o,KSe);u.x+=D.SOLAR_RADIUS;let h=It.pointToGLWindowCoordinates(a,c,u,u),m=F.magnitude(F.subtract(h,f,h))*30*2,g=wwt;g.x=m,g.y=m,e._uCenter=F.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let A=t.drawingBufferWidth,_=t.drawingBufferHeight,C=e._stages,y=C.get(0),E=y.outputTexture.width,I=y.outputTexture.height,x=new Xe;x.width=E,x.height=I,c=M.computeViewportTransformation(x,0,1,JSe),f=It.pointToGLWindowCoordinates(s,c,o,KSe),g.x*=E/A,g.y*=I/_;let S=y.scissorRectangle;S.x=Math.max(f.x-g.x*.5,0),S.y=Math.max(f.y-g.y*.5,0),S.width=Math.min(g.x,A),S.height=Math.min(g.y,_);for(let w=1;w<4;++w)Xe.clone(S,C.get(w).scissorRectangle)}E_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};E_.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),Dwt(this,t,n),o};E_.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)};E_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Ou,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};E_.prototype.isDestroyed=function(){return!1};E_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),de(this)};var A3=E_;function XSe(){this._cachedShowFrustumsShaders={}}function vwt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Pwt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=We.replaceMain(f,"czm_Debug_main");let h=/out_FragData_(\d+)/g,m;for(;(m=h.exec(f))!==null;)r.indexOf(m[1])===-1&&r.push(m[1]);return f});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 u=vwt(i);return sn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var m3=new G;function Rwt(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=G.fromRandom()),t._debugColor):G.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(m3.red=t.debugOverlappingFrustums&1?1:0,m3.green=t.debugOverlappingFrustums&2?1:0,m3.blue=t.debugOverlappingFrustums&4?1:0,m3.alpha=1,m3):G.WHITE}),n}var Mwt=new et;XSe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=Pwt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=et.shallowClone(t,Mwt);r.shaderProgram=o,r.uniformMap=Rwt(e,t),r.execute(e.context,n)};var p3=XSe;function Eb(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new $t}Eb.fromKeyframeNode=function(e,t,n,i){let o=new Eb(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=Nwt(e,s,n),o._orientedBoundingBox=Owt(e,r,n,o._orientedBoundingBox),o};function Nwt(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],u=_t.getComponentCount(o[a]),f=r[a].slice(n*u,(n+1)*u);s[c]=f}return s}var ZSe=new d,Lwt=new d;function Owt(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),u=a-c*o.x,f=d.fromElements(u,c,s,ZSe),h=d.divideComponents(d.subtract(f,e._paddingBefore,ZSe),e.dimensions,Lwt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(Eb.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()}}});Eb.prototype.hasProperty=function(e){return l(this._metadata[e])};Eb.prototype.getNames=function(){return Object.keys(this._metadata)};Eb.prototype.getProperty=function(e){return this._metadata[e]};var g3=Eb;function Fwt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,pe.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,pe.FRAGMENT);for(let p=0;p<c;p++){let b=i[p],T=k5(o[p]),B=`PropertyStatistics_${b}`,R=`PropertyStatistics_${b}`;n.addStruct(B,R,pe.FRAGMENT),n.addStructField(B,T,"min"),n.addStructField(B,T,"max")}let f="MetadataStatistics",h="MetadataStatistics",m="metadataStatistics";n.addStruct(f,h,pe.FRAGMENT);for(let p=0;p<c;p++){let b=i[p],T=`PropertyStatistics_${b}`,B=b;n.addStructField(f,T,B)}let g="Metadata",A="Metadata",_="metadata";n.addStruct(g,A,pe.FRAGMENT);for(let p=0;p<c;p++){let b=k5(o[p]);n.addStructField(g,b,i[p])}let C="Attributes",y="Attributes",E="attributes";n.addStruct(C,y,pe.FRAGMENT),n.addStructField(C,"vec3","positionEC"),n.addStructField(C,"vec3","normalEC");let I="Voxel",x="Voxel",S="voxel";n.addStruct(I,x,pe.FRAGMENT),n.addStructField(I,"vec3","viewDirUv"),n.addStructField(I,"float","travelDistance"),n.addStructField(I,"int","stepCount"),n.addStructField(I,"int","tileIndex"),n.addStructField(I,"int","sampleIndex"),n.addStructField(I,"float","distanceToDepthBuffer");let w="FragmentInput";n.addStruct(w,"FragmentInput",pe.FRAGMENT),n.addStructField(w,h,m),n.addStructField(w,A,_),n.addStructField(w,y,E),n.addStructField(w,x,S);let P="Properties",N="Properties",L="properties";n.addStruct(P,N,pe.FRAGMENT);for(let p=0;p<c;p++){let b=k5(o[p]);n.addStructField(P,b,i[p])}{let p="clearProperties";n.addFunction(p,`${N} clearProperties()`,pe.FRAGMENT),n.addFunctionLines(p,[`${N} ${L};`]);for(let b=0;b<c;b++){let T=k5(o[b],r[b]);n.addFunctionLines(p,[`${L}.${i[b]} = ${T}(0.0);`])}n.addFunctionLines(p,[`return ${L};`])}{let p="sumProperties";n.addFunction(p,`${N} sumProperties(${N} propertiesA, ${N} propertiesB)`,pe.FRAGMENT),n.addFunctionLines(p,[`${N} ${L};`]);for(let b=0;b<c;b++){let T=i[b];n.addFunctionLines(p,[`${L}.${T} = propertiesA.${T} + propertiesB.${T};`])}n.addFunctionLines(p,[`return ${L};`])}{let p="scaleProperties";n.addFunction(p,`${N} scaleProperties(${N} ${L}, float scale)`,pe.FRAGMENT),n.addFunctionLines(p,[`${N} scaledProperties = ${L};`]);for(let b=0;b<c;b++)n.addFunctionLines(p,[`scaledProperties.${i[b]} *= scale;`]);n.addFunctionLines(p,["return scaledProperties;"])}{let p="mixProperties";n.addFunction(p,`${N} mixProperties(${N} propertiesA, ${N} propertiesB, float mixFactor)`,pe.FRAGMENT),n.addFunctionLines(p,[`${N} ${L};`]);for(let b=0;b<c;b++){let T=i[b];n.addFunctionLines(p,[`${L}.${T} = mix(propertiesA.${T}, propertiesB.${T}, mixFactor);`])}n.addFunctionLines(p,[`return ${L};`])}{let p="copyPropertiesToMetadata";n.addFunction(p,`void copyPropertiesToMetadata(in ${N} ${L}, inout ${A} ${_})`,pe.FRAGMENT);for(let b=0;b<c;b++){let T=i[b];n.addFunctionLines(p,[`${_}.${T} = ${L}.${T};`])}}if(u){let p="setStatistics";n.addFunction(p,`void setStatistics(inout ${h} ${m})`,pe.FRAGMENT);for(let b=0;b<c;b++){let T=i[b],B=o[b],R=_t.getComponentCount(B);for(let O=0;O<R;O++){let U=kwt(B,O),k=s[b][O],z=a[b][O];!l(k)||!l(z)||n.addFunctionLines(p,[`${m}.${T}.min${U} = ${$Se(k)};`,`${m}.${T}.max${U} = ${$Se(z)};`])}}}{let p="getPropertiesFromMegatextureAtUv";n.addFunction(p,`${N} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,pe.FRAGMENT),n.addFunctionLines(p,[`${N} ${L};`]);for(let b=0;b<c;b++){let T=o[b],B=r[b],R=Qwt(T,B);n.addFunctionLines(p,[`properties.${i[b]} = texture(u_megatextureTextures[${b}], texcoord)${R};`])}n.addFunctionLines(p,[`return ${L};`])}}function k5(e){if(e===_t.SCALAR)return"float";if(e===_t.VEC2)return"vec2";if(e===_t.VEC3)return"vec3";if(e===_t.VEC4)return"vec4"}function Qwt(e){if(e===_t.SCALAR)return".r";if(e===_t.VEC2)return".ra";if(e===_t.VEC3)return".rgb";if(e===_t.VEC4)return""}function $Se(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function kwt(e,t){return e===_t.SCALAR?"":`[${t}]`}var _3=Fwt;function OA(e){let{planes:t,modelMatrix:n=M.IDENTITY,unionClippingRegions:i=!1}=e??V.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=M.clone(n),this.planeAdded=new _e,this.planeRemoved=new _e,this._unionClippingRegions=i,this._testIntersection=i?eBe:tBe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let o=0;o<t.length;++o)this.add(t[o])}function eBe(e){return e===qt.OUTSIDE}function tBe(e){return e===qt.INSIDE}Object.defineProperties(OA.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?eBe:tBe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});OA.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};OA.prototype.get=function(e){return this._planes[e]};function nBe(e,t){for(let n=0;n<e.length;++n)if(rn.equals(e[n],t))return n;return-1}OA.prototype.contains=function(e){return nBe(this._planes,e)!==-1};OA.prototype.remove=function(e){let t=this._planes,n=nBe(t,e);if(n===-1)return!1;e instanceof zs&&(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 zs&&(r.index=o)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};OA.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof zs&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var Uwt=new rn(d.fromElements(1,0,0),0);function Gwt(e,t){let n=e._float32View,i=e._planes,o=0;for(let r=0;r<i.length;++r){let{normal:s,distance:a}=Vwt(i[r],t,Uwt);n[o]=s.x,n[o+1]=s.y,n[o+2]=s.z,n[o+3]=a,o+=4}}var uee=new se,zwt=new d;function Vwt(e,t,n){let{normal:i,distance:o}=e,r=se.fromElements(i.x,i.y,i.z,o,uee),s=M.multiplyByVector(t,r,uee),a=d.fromCartesian4(s,zwt);return s=se.divideByScalar(s,d.magnitude(a),uee),rn.fromCartesian4(s,n)}function iBe(e,t){return t.x=Math.min(e,Ft.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var Hwt=new F;OA.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=iBe(i,Hwt);s.y*=2,n=new Bt({context:e.context,width:s.x,height:s.y,pixelFormat:qe.RGBA,pixelDatatype:Ge.FLOAT,sampler:Jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:o,height:r}=n;Gwt(this,t),n.copyFrom({source:{width:o,height:r,arrayBufferView:this._float32View}})};OA.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=iBe(o,n);return r.y*=2,r};OA.prototype.isDestroyed=function(){return!1};OA.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),de(this)};var I_=OA;var C3=`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 y3=`// 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 E3=`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 I3=`/* 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 = intMod(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 b3=`// 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 x3=`// 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 KB=`// 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 T3=`// 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 S3=`// 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 B3=`// 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 Ib=`// 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 w3=`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 D3=`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 v3=`/* 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 P3=`// 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
};
// Integer mod: For WebGL1 only
int intMod(in int a, in int b) {
return a - (b * (a / b));
}
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 = intMod(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 = intMod(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 = float(u_inputDimensions.y) - inputCoordinate.z;
inputCoordinate.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(intMod(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 R3=`// See Octree.glsl for the definitions of SampleData and intMod
/* Megatexture defines (set in Scene/VoxelRenderResources.js)
#define SAMPLE_COUNT ###
#define NEAREST_SAMPLING
#define PADDING
*/
uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions
uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions
uniform vec2 u_megatextureVoxelSizeUv;
uniform vec2 u_megatextureSliceSizeUv;
uniform vec2 u_megatextureTileSizeUv;
// Integer min, max, clamp: For WebGL1 only
int intMin(int a, int b) {
return a <= b ? a : b;
}
int intMax(int a, int b) {
return a >= b ? a : b;
}
int intClamp(int v, int minVal, int maxVal) {
return intMin(intMax(v, minVal), maxVal);
}
vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)
{
int indexX = intMod(index, dimensions.x);
int indexY = index / dimensions.x;
return vec2(indexX, indexY) * uvScale;
}
/*
How is 3D data stored in a 2D megatexture?
In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total).
The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and
the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1).
Note that there could be empty space in the megatexture because it's a power of two.
0 1 2 3
+---+---+---+---+
| | | | | 3
+---+---+---+---+
| | | | | 2
+-------+-------+
|010|110|011|111| 1
|--- ---|--- ---|
|000|100|001|101| 0
+-------+-------+
When doing linear interpolation the megatexture needs to be sampled twice: once for
the Z slice above the voxel coordinate and once for the slice below. The two slices
are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is
halfway between two Z slices so the interpolation factor is 0.5. Below is a side view
of the 3D voxel grid with voxel coordinates on the left side.
2 +---+
|001|
1 +-z-+
|000|
0 +---+
When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice.
*/
Properties getPropertiesFromMegatexture(in SampleData sampleData) {
int tileIndex = sampleData.megatextureIndex;
vec3 voxelCoord = sampleData.inputCoordinate;
#if defined(NEAREST_SAMPLING)
// Round to the center of the nearest voxel
voxelCoord = floor(voxelCoord) + vec3(0.5);
#endif
// Tile location
vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);
// Slice location
float slice = voxelCoord.z - 0.5;
int sliceIndex = int(floor(slice));
int sliceIndex0 = intClamp(sliceIndex, 0, u_inputDimensions.z - 1);
vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
// Voxel location
vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;
// Final location in the megatexture
vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;
#if defined(NEAREST_SAMPLING)
return getPropertiesFromMegatextureAtUv(uv0);
#else
float sliceLerp = fract(slice);
int sliceIndex1 = intMin(sliceIndex + 1, u_inputDimensions.z - 1);
vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;
Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);
Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);
return mixProperties(properties0, properties1, sliceLerp);
#endif
}
// 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 Ywt={Z_UP:0,Y_UP:1},nh=Object.freeze(Ywt);function Wwt(e){let t=new xp;this.shaderBuilder=t;let n=e._customShader,i=St(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let A in o)if(o.hasOwnProperty(A)){let _=o[A];t.addUniform(_.type,A,pe.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",pe.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([E3]),e.provider.metadataOrder===nh.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,pe.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,pe.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,pe.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,pe.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",P3,C3,R3,I3,x3,b3]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,pe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,pe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,pe.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,pe.FRAGMENT),u==="BOX"?t.addFragmentLines([w3,T3,Ib]):u==="CYLINDER"?t.addFragmentLines([D3,KB,S3,Ib]):u==="ELLIPSOID"&&t.addFragmentLines([v3,KB,B3,Ib]),t.addFragmentLines([y3]);let f=e._shape,h=f.shaderDefines;for(let A in h)if(h.hasOwnProperty(A)){let _=h[A];l(_)&&(_=_===!0?void 0:_,t.addDefine(A,_,pe.FRAGMENT))}let m=f.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",m,pe.FRAGMENT),s===1?m+=1:r.unionClippingRegions?m+=2:m+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",m,pe.FRAGMENT),m+=1),t.addDefine("INTERSECTION_COUNT",m,pe.FRAGMENT),(!d.equals(e.paddingBefore,d.ZERO)||!d.equals(e.paddingAfter,d.ZERO))&&t.addDefine("PADDING",void 0,pe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,pe.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,pe.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,pe.FRAGMENT)}var M3=Wwt;var oBe=new F;function jwt(e,t){let n=new M3(e);_3(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(r>0){let I="getClippingPlane",x=`vec4 ${I}(highp sampler2D packedPlanes, int planeNumber)`,S=cs.getTextureResolution(o,t,oBe),w=rBe(S);i.addFunction(I,x,pe.FRAGMENT),i.addFunctionLines(I,[w])}if(a>0){let I="getBoundPlane",x=`vec4 ${I}(highp sampler2D packedPlanes, int planeNumber)`,S=I_.getTextureResolution(s,t,oBe),w=rBe(S);i.addFunction(I,x,pe.FRAGMENT),i.addFunctionLines(I,[w])}let c=i.clone();c.addDefine("PICKING",void 0,pe.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,pe.FRAGMENT);let f=i.buildShaderProgram(t),h=c.buildShaderProgram(t),m=u.buildShaderProgram(t),g=ze.fromCache({cull:{enabled:!0,face:Ni.BACK},depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND}),A=t.getViewportQuadVertexArray(),_=e._depthTest,C=new et({vertexArray:A,primitiveType:Pe.TRIANGLES,renderState:g,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:we.VOXELS,executeInClosestFrustum:!0,owner:this,cull:_,occlude:_}),y=et.shallowClone(C,new et);y.shaderProgram=h,y.pickOnly=!0;let E=et.shallowClone(C,new et);if(E.shaderProgram=m,E.pickOnly=!0,l(e._drawCommand)){let I=e._drawCommand;I.shaderProgram=I.shaderProgram&&I.shaderProgram.destroy()}if(l(e._drawCommandPick)){let I=e._drawCommandPick;I.shaderProgram=I.shaderProgram&&I.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let I=e._drawCommandPickVoxel;I.shaderProgram=I.shaderProgram&&I.shaderProgram.destroy()}e._drawCommand=C,e._drawCommandPick=y,e._drawCommandPickVoxel=E}function rBe(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 N3=jwt;var qwt={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"},JB=Object.freeze(qwt);function XB(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}XB.prototype.getTexture=function(e){return this._textures[e]};function Kwt(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})}XB.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):Kwt(this,e,t)};function Jwt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?U5(o,r,n):Xwt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function U5(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?aBe(e,n):new Bt({context:n,source:t,sampler:o});return sBe(o)&&r.generateMipmap(),r}function Xwt(e,t,n){let{typedArray:i,sampler:o}=e,r=sBe(o),s=o.wrapS===En.REPEAT||o.wrapS===En.MIRRORED_REPEAT||o.wrapT===En.REPEAT||o.wrapT===En.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(D.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===Ge.UNSIGNED_BYTE){let h=b2(i,a,c),m=fC(h);return U5({sampler:o},m,n)}}else{let h=fC(t);return U5(e,h,n)}else return U5(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."),aBe(e,n)}function sBe(e){return[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function aBe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Bt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}XB.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];Jwt(this,o,t)}n.length=0};XB.prototype.isDestroyed=function(){return!1};XB.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 de(this)};var L3=XB;function O3(e){e=e??V.EMPTY_OBJECT,this.mode=e.mode??dg.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??V.EMPTY_OBJECT,this.varyings=e.varyings??V.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??RC.INHERIT,this._textureManager=new L3,this._defaultTexture=void 0,this.uniformMap=Zwt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},tDt(this),nDt(this)}function Zwt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===JB.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=$wt(e,i)):n[i]=eDt(e,i)}return n}function $wt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function eDt(e,t){return function(){return e.uniforms[t].value}}function bb(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function tDt(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,bb(r,t,o),o=e.usedVariablesVertex.featureIdSet,bb(r,n,o),o=e.usedVariablesVertex.metadataSet,bb(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,bb(s,t,o),o=e.usedVariablesFragment.featureIdSet,bb(s,n,o),o=e.usedVariablesFragment.metadataSet,bb(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;bb(s,a,c)}}function cBe(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 al(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${cBe(t)} is not available in the ${i} shader. Did you mean ${cBe(n)} instead?`;throw new Ae(o)}}function nDt(e){let t=e.usedVariablesVertex.attributeSet;al(t,"position","positionMC","vertex"),al(t,"normal","normalMC","vertex"),al(t,"tangent","tangentMC","vertex"),al(t,"bitangent","bitangentMC","vertex"),al(t,"positionWC","positionMC","vertex"),al(t,"positionEC","positionMC","vertex"),al(t,"normalEC","normalMC","vertex"),al(t,"tangentEC","tangentMC","vertex"),al(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;al(n,"position","positionEC","fragment"),al(n,"normal","normalEC","fragment"),al(n,"tangent","tangentEC","fragment"),al(n,"bitangent","bitangentEC","fragment"),al(n,"normalMC","normalEC","fragment"),al(n,"tangentMC","tangentEC","fragment"),al(n,"bitangentMC","bitangentEC","fragment")}O3.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===JB.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};O3.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};O3.prototype.isDestroyed=function(){return!1};O3.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),de(this)};var xb=O3;function b_(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(b_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});b_.fromMetadataArray=function(e){return new b_({metadata:e})};b_.fromGltf=async function(e){let t=new sf({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new b_({loader:t})};b_.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=iDt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function iDt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=a,u=new Array(o.length);for(let f=0;f<e.length;f++){let h=c[o[f]].attribute,m=e.find(C=>C.name===h);if(!l(m))continue;let g=kt.toComponentDatatype(s[f]),A=_t.getComponentCount(r[f]),_=m.count*A;u[f]=q.createArrayBufferView(g,m.typedArray.buffer,m.typedArray.byteOffset+m.byteOffset,_)}return u}b_.prototype.isDestroyed=function(){return!1};b_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),de(this)};var Tb=b_;function cl(){this._orientedBoundingBox=new $t,this._boundingSphere=new le,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=cl.DefaultMinBounds.clone(),this._maxBounds=cl.DefaultMaxBounds.clone(),this._renderMinBounds=cl.DefaultMinBounds.clone(),this._renderMaxBounds=cl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=cl,n=[new zs(d.negate(d.UNIT_X,new d),e.x),new zs(d.negate(d.UNIT_Y,new d),e.y),new zs(d.negate(d.UNIT_Z,new d),e.z),new zs(d.UNIT_X,-t.x),new zs(d.UNIT_Y,-t.y),new zs(d.UNIT_Z,-t.z)];this._renderBoundPlanes=new I_({planes:n}),this._shaderUniforms={boxEcToXyz:new X,boxLocalToShapeUvScale:new d,boxLocalToShapeUvTranslate:new d},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(cl.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 oDt=new d,rDt=new d,sDt=new X,aDt=new d,cDt=new d;cl.prototype.update=function(e,t,n,i,o){i=i??t.clone(aDt),o=o??n.clone(cDt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let r=d.clamp(t,i,o,this._renderMinBounds),s=d.clamp(n,i,o,this._renderMaxBounds),a=M.getScale(e,rDt);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=M.clone(e,this._shapeTransform),this._orientedBoundingBox=hee(r,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let _ in f)f.hasOwnProperty(_)&&(f[_]=void 0);let h=0;f.BOX_INTERSECTION_INDEX=h,h+=1;let m=t,g=n,A=d.fromElements(fee(m.x,g.x),fee(m.y,g.y),fee(m.z,g.z),u.boxLocalToShapeUvScale);return u.boxLocalToShapeUvTranslate=d.negate(d.multiplyComponents(A,m,u.boxLocalToShapeUvTranslate),u.boxLocalToShapeUvTranslate),this._shaderMaximumIntersectionsLength=h,!0};function fee(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var lDt=new M;cl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,lDt),i=M.getMatrix3(n,t.boxEcToXyz),o=e.context.uniformState.inverseViewRotation;X.multiply(i,o,t.boxEcToXyz)};cl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n,boxLocalToShapeUvTranslate:i}=this._shaderUniforms;return d.add(d.multiplyComponents(e,n,t),i,t)};var G5=new d,dee=new d;cl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=d.fromElements(D.lerp(r.x,s.x,a*t),D.lerp(r.y,s.y,a*n),D.lerp(r.z,s.z,a*i),G5),u=d.fromElements(D.lerp(r.x,s.x,a*(t+1)),D.lerp(r.y,s.y,a*(n+1)),D.lerp(r.z,s.z,a*(i+1)),dee);return hee(c,u,this._shapeTransform,o)};var lBe=new d;cl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,lBe),s=d.multiplyByScalar(r,o,lBe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,G5),o,G5),c=d.add(a,s,dee),u=this._minBounds,f=this._maxBounds,h=d.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),G5),m=d.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),dee);return hee(h,m,this._shapeTransform,i)};cl.DefaultMinBounds=Object.freeze(new d(-1,-1,-1));cl.DefaultMaxBounds=Object.freeze(new d(1,1,1));var uBe=new d;function hee(e,t,n,i){let o=cl.DefaultMinBounds,r=cl.DefaultMaxBounds;if(d.equals(e,o)&&d.equals(t,r))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,uBe),c=d.midpoint(e,t,oDt);i.center=M.multiplyByPoint(n,c,i.center),a=d.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),uBe);let u=M.getRotation(n,sDt);i.halfAxes=X.setScale(u,a,i.halfAxes)}return i}var Sb=cl;function Vf(){this._orientedBoundingBox=new $t,this._boundingSphere=new le,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=Vf.DefaultMinBounds.clone(),this._maxBounds=Vf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Vf,n=[new zs(d.negate(d.UNIT_Z,new d),e.z),new zs(d.UNIT_Z,-t.z)];this._renderBoundPlanes=new I_({planes:n}),this._shaderUniforms={cameraShapePosition:new d,cylinderEcToRadialTangentUp:new X,cylinderRenderRadiusMinMax:new F,cylinderRenderAngleMinMax:new F,cylinderLocalToShapeUvRadius:new F,cylinderLocalToShapeUvAngle:new F,cylinderLocalToShapeUvHeight:new F,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(Vf.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 uDt=new d,fDt=new d,dDt=new d,hDt=new d,ADt=new d,mDt=new M,pDt=new d,fBe=new F;Vf.prototype.update=function(e,t,n,i,o){i=i??t.clone(fDt),o=o??n.clone(dDt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=Vf,a=s.y-r.y,c=.5*a,u=D.EPSILON10,f=D.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=D.negativePiToPi(t.y),n.y=D.negativePiToPi(n.y),i.y=D.negativePiToPi(i.y),o.y=D.negativePiToPi(o.y);let h=d.maximumByComponent(t,i,hDt),m=d.minimumByComponent(n,o,ADt),g=M.getScale(e,uDt);if(m.x===0||h.x>m.x||h.z>m.z||D.equalsEpsilon(g.x,0,void 0,u)||D.equalsEpsilon(g.y,0,void 0,u)||D.equalsEpsilon(g.z,0,void 0,u))return!1;let A=this._renderBoundPlanes;A.get(0).distance=h.z,A.get(1).distance=-m.z,this._shapeTransform=M.clone(e,this._shapeTransform),this._orientedBoundingBox=pee(h,m,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let _=n.y<t.y,C=n.y-t.y+_*a,y=m.y<h.y,E=m.y-h.y+y*a,I=E>=c-f&&E<a-f,x=E>f&&E<c-f,S=E<=f,w=I||x||S,v=this._shaderUniforms,P=this._shaderDefines;for(let Q in P)P.hasOwnProperty(Q)&&(P[Q]=void 0);let N=0;P.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=N,N+=1,C<a-f&&(P.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),h.x!==r.x&&(P.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,P.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=N,N+=1),v.cylinderRenderRadiusMinMax=F.fromElements(h.x,m.x,v.cylinderRenderRadiusMinMax),h.x===m.x&&(P.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,p=0,b=1;L!==0&&(p=1/L,b=-t.x*p),v.cylinderLocalToShapeUvRadius=F.fromElements(p,b,v.cylinderLocalToShapeUvRadius);let T=n.z-t.z,B=0,R=1;T!==0&&(B=1/T,R=-t.z*B),v.cylinderLocalToShapeUvHeight=F.fromElements(B,R,v.cylinderLocalToShapeUvHeight),w&&(P.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,P.CYLINDER_INTERSECTION_INDEX_ANGLE=N,I?(P.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,N+=1):x?(P.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,N+=2):S&&(P.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,N+=2),v.cylinderRenderAngleMinMax=F.fromElements(h.y,m.y,v.cylinderRenderAngleMinMax));let O=(t.y-r.y)/a,U=(n.y-r.y)/a,k=1-C/a,z=(U+.5*k)%1;if(v.cylinderShapeUvAngleRangeOrigin=z,C<=f)v.cylinderLocalToShapeUvAngle=F.fromElements(0,1,v.cylinderLocalToShapeUvAngle);else{let Q=a/C,H=O-z,W=-Q*(H-Math.floor(H));v.cylinderLocalToShapeUvAngle=F.fromElements(Q,W,v.cylinderLocalToShapeUvAngle)}return this._shaderMaximumIntersectionsLength=N,!0};var gDt=new X,_Dt=new X,CDt=new M;Vf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,mDt),i=M.multiplyByPoint(n,e.camera.positionWC,pDt);t.cameraShapePosition=d.fromElements(F.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=F.normalize(F.fromCartesian3(i,fBe),fBe),r=X.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],gDt),s=e.context.uniformState.inverseView,a=M.multiplyTransformation(n,s,CDt),c=M.getMatrix3(a,_Dt);t.cylinderEcToRadialTangentUp=X.multiply(r,c,t.cylinderEcToRadialTangentUp)};Vf.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,d.fromElements(n,i,o,t)};var z5=new d,mee=new d;Vf.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=d.fromElements(D.lerp(r.x,s.x,t*a),D.lerp(r.y,s.y,n*a),D.lerp(r.z,s.z,i*a),z5),u=d.fromElements(D.lerp(r.x,s.x,(t+1)*a),D.lerp(r.y,s.y,(n+1)*a),D.lerp(r.z,s.z,(i+1)*a),mee);return pee(c,u,this._shapeTransform,o)};var dBe=new d;Vf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,dBe),s=d.multiplyByScalar(r,o,dBe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,z5),o,z5),c=d.add(a,s,mee),u=this._minBounds,f=this._maxBounds,h=d.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),z5),m=d.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),mee);return pee(h,m,this._shapeTransform,i)};Vf.DefaultMinBounds=Object.freeze(new d(0,-D.PI,-1));Vf.DefaultMaxBounds=Object.freeze(new d(1,+D.PI,1));var yDt=5,EDt=new Array(yDt),IDt=new d,bDt=new X,xDt=new M,TDt=new M,SDt=new M,Aee=new M,BDt=new d,wDt=new d,DDt=new d,ABe=new Array(8);for(let e=0;e<8;e++)ABe[e]=new d;function hBe(e,t,n){return Math.abs(se.dot(e,t))<n}function vDt(e){let t=M.getColumn(e,0,BDt),n=M.getColumn(e,1,wDt),i=M.getColumn(e,2,DDt),o=D.EPSILON4;return hBe(t,n,o)&&hBe(n,i,o)}function PDt(e,t){let n=ABe;d.fromElements(-.5,-.5,-.5,n[0]),d.fromElements(-.5,-.5,.5,n[1]),d.fromElements(-.5,.5,-.5,n[2]),d.fromElements(-.5,.5,.5,n[3]),d.fromElements(.5,-.5,-.5,n[4]),d.fromElements(.5,-.5,.5,n[5]),d.fromElements(.5,.5,-.5,n[6]),d.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return $t.fromPoints(n,t)}var RDt=new d;function pee(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+D.TWO_PI:t.y,c=e.z,u=t.z,f=a-s,h=s+f*.5,m=EDt,g=0;m[g++]=s,m[g++]=a,m[g++]=h,f>D.PI&&(m[g++]=h-D.PI_OVER_TWO,m[g++]=h+D.PI_OVER_TWO);let A=Number.POSITIVE_INFINITY,_=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,y=Number.NEGATIVE_INFINITY;for(let O=0;O<g;++O){let U=m[O]-h,k=Math.cos(U),z=Math.sin(U),Q=k*o,H=z*o,W=k*r,Z=z*r;A=Math.min(A,Q,W),_=Math.min(_,H,Z),C=Math.max(C,Q,W),y=Math.max(y,H,Z)}let E=C-A,I=y-_,x=u-c,S=(A+C)*.5,w=(_+y)*.5,v=(c+u)*.5,P=d.fromElements(S,w,v,IDt),N=X.fromRotationZ(h,bDt),L=d.fromElements(E,I,x,RDt),p=M.fromScale(L,SDt),b=M.fromRotation(N,TDt),T=M.fromTranslation(P,xDt),B=M.multiplyTransformation(b,M.multiplyTransformation(T,p,Aee),Aee),R=M.multiplyTransformation(n,B,Aee);return vDt(R)?$t.fromTransformation(R,i):PDt(R,i)}var Bb=Vf;function ih(){this._orientedBoundingBox=new $t,this._boundingSphere=new le,this._boundTransform=new M,this._shapeTransform=new M,this._rectangle=new ce,this._minimumHeight=ih.DefaultMinBounds.z,this._maximumHeight=ih.DefaultMaxBounds.z,this._ellipsoid=new te,this._translation=new d,this._rotation=new X,this._shaderUniforms={cameraPositionCartographic:new d,ellipsoidEcToEastNorthUp:new X,ellipsoidRadii:new d,eccentricitySquared:0,evoluteScale:new F,ellipsoidCurvatureAtLatitude:new F,ellipsoidInverseRadiiSquared:new d,ellipsoidRenderLongitudeMinMax:new F,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new d,ellipsoidLocalToShapeUvLongitude:new F,ellipsoidLocalToShapeUvLatitude:new F,ellipsoidRenderLatitudeSinMinMax:new F,ellipsoidInverseHeightDifference:0,clipMinMaxHeight:new F},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(ih.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 MDt=new d,NDt=new d,LDt=new d,ODt=new d,FDt=new d,QDt=new d,kDt=new d,UDt=new d,mBe=new d,pBe=new d,GDt=new ce;ih.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=ih;i=i??r,o=o??s;let a=D.EPSILON10,c=D.EPSILON3,u=D.EPSILON10,f=D.EPSILON10,h=D.EPSILON3,m=M.getScale(e,UDt),g=d.clone(r,MDt);g.z=-d.minimumComponent(m);let A=d.clamp(t,g,s,NDt),_=d.clamp(n,g,s,LDt),C=d.clamp(i,g,s,ODt),y=d.clamp(o,g,s,FDt),E=d.maximumByComponent(A,C,QDt),I=d.minimumByComponent(_,y,kDt),x=d.add(m,d.fromElements(_.z,_.z,_.z,mBe),mBe),S=d.add(m,d.fromElements(I.z,I.z,I.z,pBe),pBe);if(E.y>I.y||E.y===s.y||I.y===r.y||E.z>I.z||D.equalsEpsilon(S,d.ZERO,void 0,a))return!1;this._rectangle=ce.fromRadians(A.x,A.y,_.x,_.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=te.fromCartesian3(m,this._ellipsoid),this._minimumHeight=A.z,this._maximumHeight=_.z;let w=ce.fromRadians(E.x,E.y,I.x,I.y,GDt);this._orientedBoundingBox=gee(w,E.z,I.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=M.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let v=s.x-r.x,P=.5*v,N=I.x<E.x,L=I.x-E.x+N*v,p=L<=u,b=L>=P-u&&L<v-u,T=L>u&&L<P-u,B=p||b||T,R=_.x<A.x,O=_.x-A.x+R*v,U=O>P+u&&O<v-u,k=O>=P-u&&O<=P+u,z=O<P-u,Q=U||k||z,H=I.y<-h,W=I.y>=-h&&I.y<=+h,Z=I.y>+h&&I.y<s.y-f,Y=H||W||Z,$=E.y>r.y+f&&E.y<-h,K=E.y>=-h&&E.y<=+h,fe=E.y>+h,ge=$||K||fe,ne=Y||ge,Ce=_.y-A.y,ye=_.y<-h,De=_.y>=-h&&_.y<=+h,be=_.y>+h&&_.y<s.y-f,Ne=ye||De||be,ke=A.y>r.y+f&&A.y<-h,Ue=A.y>=-h&&A.y<=+h,He=A.y>+h,Ye=Ne||(ke||Ue||He),nt=this._shaderUniforms,Ct=this._shaderDefines;for(let Mn in Ct)Ct.hasOwnProperty(Mn)&&(Ct[Mn]=void 0);nt.ellipsoidRadii=d.clone(x,nt.ellipsoidRadii);let{x:Wt,z:Qn}=nt.ellipsoidRadii,on=Qn/Wt;nt.eccentricitySquared=1-on*on,nt.evoluteScale=F.fromElements((Wt*Wt-Qn*Qn)/Wt,(Qn*Qn-Wt*Wt)/Qn,nt.evoluteScale),nt.ellipsoidInverseRadiiSquared=d.divideComponents(d.ONE,d.multiplyComponents(nt.ellipsoidRadii,nt.ellipsoidRadii,nt.ellipsoidInverseRadiiSquared),nt.ellipsoidInverseRadiiSquared);let lt=0;Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=lt,lt+=1,Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=lt,lt+=1,nt.clipMinMaxHeight=F.fromElements(E.z-_.z,I.z-_.z,nt.clipMinMaxHeight);let Nt=_.z-A.z;if(nt.ellipsoidInverseHeightDifference=1/Nt,A.z===_.z&&(nt.ellipsoidInverseHeightDifference=0),B&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=lt,b?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,lt+=1):T?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,lt+=2):p&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,lt+=2),nt.ellipsoidRenderLongitudeMinMax=F.fromElements(E.x,I.x,nt.ellipsoidRenderLongitudeMinMax)),Q){Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let Mn=(A.x-r.x)/v,at=(_.x-r.x)/v,fi=1-O/v,ro=(at+.5*fi)%1;if(nt.ellipsoidShapeUvLongitudeRangeOrigin=ro,_.x<A.x&&(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),O<=u)nt.ellipsoidLocalToShapeUvLongitude=F.fromElements(0,1,nt.ellipsoidLocalToShapeUvLongitude);else{let ii=v/O,so=Mn-ro,ao=-ii*(so-Math.floor(so));nt.ellipsoidLocalToShapeUvLongitude=F.fromElements(ii,ao,nt.ellipsoidLocalToShapeUvLongitude)}}if(B){let Mn=D.equalsEpsilon(E.x,r.x,void 0,c),at=D.equalsEpsilon(I.x,s.x,void 0,c);Mn&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),at&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let fi=(A.x-r.x)/v,ro=(_.x-r.x)/v,Ao=(I.x-r.x)/v,ii=1-L/v,so=(Ao+.5*ii)%1;nt.ellipsoidShapeUvLongitudeMinMaxMid=d.fromElements(fi,ro,so,nt.ellipsoidShapeUvLongitudeMinMaxMid)}if(ne&&(ge&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=lt,$?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,lt+=1):K?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,lt+=1):fe&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,lt+=2)),Y&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=lt,H?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,lt+=2):W?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,lt+=1):Z&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,lt+=1)),nt.ellipsoidRenderLatitudeSinMinMax=F.fromElements(Math.sin(E.y),Math.sin(I.y),nt.ellipsoidRenderLatitudeSinMinMax)),Ye)if(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Ce<f)nt.ellipsoidLocalToShapeUvLatitude=F.fromElements(0,1,nt.ellipsoidLocalToShapeUvLatitude);else{let at=(s.y-r.y)/Ce,fi=(r.y-A.y)/Ce;nt.ellipsoidLocalToShapeUvLatitude=F.fromElements(at,fi,nt.ellipsoidLocalToShapeUvLatitude)}return this._shaderMaximumIntersectionsLength=lt,!0};var zDt=new he,VDt=new d,HDt=new M,gBe=new X;ih.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,zDt);d.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=d.fromRadians(o.longitude,o.latitude,0,n,VDt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let s=It.eastNorthUpToFixedFrame(r,n,HDt),a=M.getRotation(s,gBe),c=e.context.uniformState.viewRotation,u=X.multiply(c,a,gBe);t.ellipsoidEcToEastNorthUp=X.transpose(u,t.ellipsoidEcToEastNorthUp)};var xBe=new ce;ih.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,u=(n+1)*r,f=i*r,h=(i+1)*r,m=ce.subsection(this._rectangle,s,c,a,u,xBe),g=D.lerp(this._minimumHeight,this._maximumHeight,f),A=D.lerp(this._minimumHeight,this._maximumHeight,h);return gee(m,g,A,this._ellipsoid,this._translation,this._rotation,o)};var YDt=new F,WDt=new F,F3=new F,_Be=new F,CBe=new F,Q3=new F;function jDt(e,t,n,i){let o=F.abs(e,YDt),r=F.fromElements(1/t.x,1/t.y,WDt),s=F.fromElements(Math.SQRT1_2,Math.SQRT1_2,F3),a=F.multiplyComponents(t,s,_Be),c=F.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,CBe);for(let u=0;u<3;++u){let f=F.magnitude(F.subtract(a,c,Q3)),h=F.normalize(F.subtract(o,c,Q3),Q3),m=F.multiplyByScalar(h,f,Q3);s=F.multiplyComponents(F.add(m,c,F3),r,F3),s=F.normalize(F.clamp(s,F.ZERO,F.ONE,F3),F3),a=F.multiplyComponents(t,s,_Be),c=F.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,CBe)}return d.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,F.magnitude(F.subtract(a,c,Q3)),i)}var qDt=new F,yBe=new F,KDt=new d,EBe=new F;ih.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:u}=this._shaderUniforms,f=Math.hypot(e.x,e.y),h=F.fromElements(f,e.z,yBe),m=jDt(h,F.fromElements(i.x,i.z,qDt),o,KDt),g=F.normalize(F.fromElements(m.x*r.x,m.y*r.z,EBe),EBe),A=Math.atan2(g.y,g.x),_=F.magnitude(h)<F.magnitude(m)?-1:1,C=F.subtract(h,m,yBe),y=_*F.magnitude(C),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:E,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:I}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(E)&&(n-=a,n=n-Math.floor(n),n=n*c.x+c.y),A=(A+Math.PI/2)/Math.PI,l(I)&&(A=A*u.x+u.y),y=1+y*s,d.fromElements(n,A,y,t)};var IBe=new d,bBe=new d,JDt=new d;ih.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,IBe),s=d.multiplyByScalar(r,o,IBe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,bBe),o,bBe),c=d.add(a,s,JDt),u=ce.subsection(this._rectangle,a.x,a.y,c.x,c.y,xBe),f=D.lerp(this._minimumHeight,this._maximumHeight,a.z),h=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return gee(u,f,h,this._ellipsoid,this._translation,this._rotation,i)};function gee(e,t,n,i,o,r,s){return s=$t.fromRectangle(e,t,n,i,s),s.center=d.add(s.center,o,s.center),s.halfAxes=X.multiply(s.halfAxes,r,s.halfAxes),s}ih.DefaultMinBounds=Object.freeze(new d(-D.PI,-D.PI_OVER_TWO,-te.WGS84.minimumRadius));ih.DefaultMaxBounds=Object.freeze(new d(D.PI,D.PI_OVER_TWO,10*te.WGS84.maximumRadius));var wb=ih;var Hf={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Hf.getMinBounds=function(e){switch(e){case Hf.BOX:return Sb.DefaultMinBounds;case Hf.ELLIPSOID:return wb.DefaultMinBounds;case Hf.CYLINDER:return Bb.DefaultMinBounds}};Hf.getMaxBounds=function(e){switch(e){case Hf.BOX:return Sb.DefaultMaxBounds;case Hf.ELLIPSOID:return wb.DefaultMaxBounds;case Hf.CYLINDER:return Bb.DefaultMaxBounds}};Hf.getShapeConstructor=function(e){switch(e){case Hf.BOX:return Sb;case Hf.ELLIPSOID:return wb;case Hf.CYLINDER:return Bb}};var lc=Object.freeze(Hf);var _ee=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function k3(e,t){this.spatialNode=e,this.keyframe=t,this.state=_ee.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}k3.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=_ee.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};k3.priorityComparator=function(e,t){return e.priority-t.priority};k3.searchComparator=function(e,t){return e.keyframe-t.keyframe};k3.LoadState=_ee;var Oo=k3;function Wy(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32),i===kt.FLOAT32&&!e.floatingPointTexture)throw new ue("Floating point texture not supported");let s=XDt(i),a=ZDt(n,e.webgl2),c=kt.getSizeInBytes(i),u=$Dt(o,n,c),f=Math.ceil(Math.sqrt(t.x)),h=Math.ceil(t.z/f),m=f*t.x,g=h*t.y,A=Math.floor(u/m),_=Math.floor(u/g);if(A===0||_===0)throw new ue("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*n*u**2,this.voxelCountPerTile=d.clone(t,new d),this.maximumTileCount=A*_,this.regionCountPerMegatexture=new F(A,_),this.voxelCountPerRegion=new F(m,g),this.sliceCountPerRegion=new F(f,h),this.voxelSizeUv=new F(1/u,1/u),this.sliceSizeUv=new F(t.x/u,t.y/u),this.regionSizeUv=new F(m/u,g/u),this.texture=new Bt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u,height:u,sampler:new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:mi.LINEAR})});let C=kt.toComponentDatatype(i);this.tileVoxelDataTemp=q.createTypedArray(C,m*g*n),this.nodes=new Array(this.maximumTileCount);for(let y=0;y<this.maximumTileCount;y++)this.nodes[y]=new evt(y);for(let y=0;y<this.maximumTileCount;y++){let E=this.nodes[y];E.previousNode=y>0?this.nodes[y-1]:void 0,E.nextNode=y<this.maximumTileCount-1?this.nodes[y+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function XDt(e){if(e===kt.FLOAT32||e===kt.FLOAT64)return Ge.FLOAT;if(e===kt.UINT8)return Ge.UNSIGNED_BYTE}function ZDt(e,t){if(e===1)return t?qe.RED:qe.LUMINANCE;if(e===2)return t?qe.RG:qe.LUMINANCE_ALPHA;if(e===3)return qe.RGB;if(e===4)return qe.RGBA}function $Dt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(Ft.maximumTextureSize,D.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function evt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Wy.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};Wy.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--};Wy.prototype.isFull=function(){return this.emptyList===void 0};Wy.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32);let o=kt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=D.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let m=Math.floor(f/c),g=Math.floor(f/u);if(m*g>=e)break;f*=2}return f*f*n*o};Wy.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,{tileVoxelDataTemp:i,voxelCountPerTile:o,sliceCountPerRegion:r,voxelCountPerRegion:s,channelCount:a,regionCountPerMegatexture:c}=this;for(let g=0;g<o.z;g++){let A=g%r.x*o.x,_=Math.floor(g/r.x)*o.y;for(let C=0;C<o.y;C++){let y=tvt(o,C,g),E=(_+C)*s.x+A;for(let I=0;I<o.x;I++){let x=y+I,S=E+I;for(let w=0;w<a;w++)i[S*a+w]=n[x*a+w]}}}let u=e%c.x*s.x,f=Math.floor(e/c.x)*s.y,m={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:u,yOffset:f};this.texture.copyFrom(m)};function tvt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}Wy.prototype.isDestroyed=function(){return!1};Wy.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),de(this)};var ZB=Wy;function oh(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=d.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new $t,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var nvt=new d;oh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=X.getScale(this.orientedBoundingBox.halfAxes,nvt),n=2*d.maximumComponent(t);this.approximateVoxelSize=n/d.minimumComponent(this.dimensions)};oh.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,u=r+1,f=a+1,h=t+1,m=[[h,r,s,a],[h,u,s,a],[h,r,c,a],[h,u,c,a],[h,r,s,f],[h,u,s,f],[h,r,c,f],[h,u,c,f]];this.children=m.map(([g,A,_,C])=>new oh(g,A,_,C,this,e,this.dimensions))};oh.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};oh.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var TBe={keyframe:0};function U3(e,t){return TBe.keyframe=e,go(t,TBe,Oo.searchComparator)}oh.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 m=ivt(i,h),g=h[m],A=o===i||i<g.keyframe?m:Math.min(m+1,h.length-1),_=h[A],C=i-g.keyframe,y=SBe(n-t.level,C);y<a&&(a=y,r=g);let E=_.keyframe-o,I=SBe(n-t.level,E);if(I<c&&(c=I,s=_),C===0&&E===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:D.clamp((e-u)/(f-u),0,1)};function ivt(e,t){let n=U3(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function SBe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}oh.prototype.isVisited=function(e){return this.visitedFrameNumber===e};oh.prototype.createKeyframeNode=function(e){let t=U3(e,this.keyframeNodes);if(t<0){t=~t;let n=new Oo(this,e);this.keyframeNodes.splice(t,0,n)}};oh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=U3(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=U3(n,this.renderableKeyframeNodes);if(o<0)throw new Ae("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};oh.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=U3(e.keyframe,i);if(o>=0)throw new Ae("Keyframe already renderable");o=~o,i.splice(o,0,e)};oh.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 G3=oh;function jy(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:c,componentTypes:u,metadataOrder:f}=o,h=d.add(r,s,new d);if(d.add(h,a,h),f===nh.Y_UP){let I=h.y;h.y=h.z,h.z=I}!l(i)&&l(o.maximumTileCount)&&(i=pvt(o.maximumTileCount,h,c,u)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(c.length);for(let I=0;I<c.length;I++){let x=c[I],S=_t.getComponentCount(x),w=u[I];this.megatextures[I]=new ZB(t,h,S,w,i),this.textureMemoryByteLength+=this.megatextures[I].textureMemoryByteLength}let m=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let g=e._shape;this.rootNode=new G3(0,0,0,0,void 0,g,r),this._priorityQueue=new l_({maximumLength:m,comparator:Oo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(m),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(m),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let A=this._binaryTreeKeyframeWeighting;A[0]=0,A[n-1]=0,Cee(A,1,n-2,0);let _=9,C=2048,y=Math.floor(C/_),E=Math.ceil(m/y);this.internalNodeTexture=new Bt({context:t,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,flipY:!1,width:C,height:E,sampler:new Jt({minificationFilter:Kt.NEAREST,magnificationFilter:mi.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new F(1/C,1/E),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new F}jy.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function Cee(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,Cee(e,t,o-1,i+1),Cee(e,o+1,n,i+1)}jy.simultaneousRequestCountMaximum=50;jy.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,u=c>0,f=a>1,h=(u?2:1)*(f?2:1);this._sampleCount=h;let m=h>=2;if(m&&!l(this.leafNodeTexture)){let I=Math.floor(512),x=Math.ceil(s/I);this.leafNodeTexture=new Bt({context:r,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,flipY:!1,width:1024,height:x,sampler:new Jt({minificationFilter:Kt.NEAREST,magnificationFilter:mi.NEAREST})}),this.leafNodeTexelSizeUv=F.fromElements(1/1024,1/x,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=I}else!m&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,a-1),n&&BBe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Oi();svt(this,e),avt(this,e);let A=Oi();dvt(this,h,c);let _=Oi(),C=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||C){let y=A-g,E=_-A,I=_-g;fvt(this,e,y,E,I)}};jy.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};jy.prototype.isDestroyed=function(){return!1};jy.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(),de(this)};function BBe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];BBe(e,i)}}function ovt(e,t){if(e._simultaneousRequestCount>=jy.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Oo.LoadState.PROCESSING:Oo.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=Oo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Oo.LoadState.RECEIVING,u.then(s).catch(a))}function rvt(e){return e/(1+e)}function svt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),wBe(e.rootNode,Gs.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 avt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(cvt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let u=0;u<s;u++){let f=r[u];if(!(f.state===Oo.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Oo.LoadState.UNLOADED&&ovt(e,f),f.state===Oo.LoadState.PROCESSING)){let{content:h}=f;if(h.update(e._primitive,t),!h.ready)continue;if(!lvt(h.metadata,e)){f.content=void 0,f.state=Oo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let m=0;if(n.isFull()){m=i-1-a,a++;let g=o[m];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else m=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Oo.LoadState.LOADED,o[m]=f,e._primitive.tileLoad.raiseEvent()}}}function cvt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function lvt(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:u}=r,f=a*c*u,h=e[o],m=f*s;if(h.length!==m)return!1}return!0}function wBe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:u}=o,h=r.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(c,h),t=e.visibility(i,t),t===Gs.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let m=n._primitive,g=m._shape,A=m.screenSpaceError,_=n._priorityQueue,C=n._keyframeCount,y=D.clamp(Math.floor(n._keyframeLocation),0,C-2),E=y+1;if(C===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==C)for(let v=0;v<C;v++)e.createKeyframeNode(v);let{screenSpaceError:I,keyframeNodes:x}=e,S=rvt(I),w=!1;for(let v=0;v<x.length;v++){let P=x[v];P.priority=10*S+uvt(y,P.keyframe,E,n),P.state!==Oo.LoadState.UNAVAILABLE&&P.state!==Oo.LoadState.FAILED&&P.priority!==-Number.MAX_VALUE&&_.insert(P),P.state===Oo.LoadState.LOADED&&(w=!0)}if(I<A||!w){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let v=0;v<8;v++){let P=e.children[v];wBe(P,t,n,i)}}function uvt(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 D.lerp(a,s,.15+.85*s)}function fvt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(Oo.LoadState).length,c=new Array(a),u=new Array(a),f=0;for(let w=0;w<a;w++){let v=new Array(r).fill(0);c[w]=v,u[w]=0}function h(w){let v=w.keyframeNodes;for(let P=0;P<v.length;P++){let N=v[P],L=N.keyframe,p=N.state;c[p][L]+=1,u[p]+=1,f++}if(l(w.children))for(let P=0;P<8;P++){let N=w.children[P];h(N)}}h(s),e._primitive.statistics.numberOfTilesWithContentReady=u[Oo.LoadState.LOADED],e._primitive.statistics.visited=f;let m=u[Oo.LoadState.RECEIVING],g=u[Oo.LoadState.PROCESSING],A=m!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(A&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(m,g),!0}),e._primitive.statistics.numberOfPendingRequests=m,e._primitive.statistics.numberOfTilesProcessing=g,A&&(m===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[Oo.LoadState.LOADED]}`,y=`UNLOADED: ${u[Oo.LoadState.UNLOADED]} | RECEIVING: ${u[Oo.LoadState.RECEIVING]} | PROCESSING: ${u[Oo.LoadState.PROCESSING]} | LOADED: ${u[Oo.LoadState.LOADED]} | FAILED: ${u[Oo.LoadState.FAILED]} | UNAVAILABLE: ${u[Oo.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,E=Math.round(n*100)/100,I=Math.round(i*100)/100,x=Math.round(o*100)/100,S=`LOAD: ${E} | OCT: ${I} | ALL: ${x}`;console.log(`${C} || ${y} || ${S}`)}var V5={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function dvt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function h(g,A,_,C,y){let E=!1;if(l(g.children))for(let I=0;I<8;I++){let x=g.children[I];x.computeSurroundingRenderableKeyframeNodes(o),x.isRenderable(r)&&(E=!0)}if(E){u[y]=V5.INTERNAL<<16|A,u[_]=C,a++,C=A,y=C*9+1;for(let I=0;I<8;I++){let x=g.children[I];A=a,_=A*9+0,h(x,A,_,C,y+I)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let I=c*5,x=g.renderableKeyframeNodePrevious,S=g.level-x.spatialNode.level,w=x.spatialNode.parent,v=l(w)?w.renderableKeyframeNodePrevious:x,P=hvt(g,i,n),N=S,L=1,p=x.megatextureIndex,b=v.megatextureIndex;f[I+0]=P,f[I+1]=N,f[I+2]=L,f[I+3]=p,f[I+4]=b,u[y]=V5.LEAF<<16|c}else{let I=g.renderableKeyframeNodePrevious,S=g.level-I.spatialNode.level===0?V5.LEAF:V5.PACKED_LEAF_FROM_PARENT;u[y]=S<<16|I.megatextureIndex}c++}}let m=e.rootNode;m.computeSurroundingRenderableKeyframeNodes(o),m.isRenderable(r)&&h(m,0,0,0,0),Avt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&mvt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function hvt(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 D.clamp(s,0,1)}function Avt(e,t,n,i){let o=qe.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 m=e[h],g=h*o;for(let A=0;A<o;A++)c[g+A]=m>>>A*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function mvt(e,t,n,i){let o=qe.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)),u=new Uint8Array(a*c*o);for(let m=0;m<s;m++){let g=e[m*r+0],A=e[m*r+1],_=e[m*r+2],C=e[m*r+3],y=e[m*r+4],E=D.clamp(Math.floor(65536*g),0,65535);u[m*8+0]=E>>>0&255,u[m*8+1]=E>>>8&255,u[m*8+2]=A&255,u[m*8+3]=_&255,u[m*8+4]=C>>>0&255,u[m*8+5]=C>>>8&255,u[m*8+6]=y>>>0&255,u[m*8+7]=y>>>8&255}let h={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}function pvt(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=_t.getComponentCount(a);o+=ZB.getApproximateTextureMemoryByteLength(e,t,u,c)}return o}var z3=jy;function sp(e){e=e??V.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??sp.DefaultProvider,this._traversal=void 0,this._statistics=new iA,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new d,this._inputDimensions=new d,this._paddingBefore=new d,this._paddingAfter=new d,this._availableLevels=1,this._minBounds=new d,this._minBoundsOld=new d,this._maxBounds=new d,this._maxBoundsOld=new d,this._minClippingBounds=new d,this._minClippingBoundsOld=new d,this._maxClippingBounds=new d,this._maxClippingBoundsOld=new d,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrixOld=M.clone(this._modelMatrix),this._customShader=e.customShader??sp.DefaultCustomShader,this._customShaderCompilationEvent=new _e,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionLocalToWorld=new M,this._transformPositionWorldToLocal=new M,this._transformPlaneLocalToView=new M,this._transformDirectionWorldToLocal=new X,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Zh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new F,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new F,megatextureTextures:[],megatextureSliceDimensions:new F,megatextureTileDimensions:new F,megatextureVoxelSizeUv:new F,megatextureSliceSizeUv:new F,megatextureTileSizeUv:new F,dimensions:new d,inputDimensions:new d,paddingBefore:new d,paddingAfter:new d,transformPositionViewToLocal:new M,transformDirectionViewToLocal:new X,cameraPositionLocal:new d,cameraDirectionLocal:new d,cameraTileCoordinates:new se,cameraTileUv:new d,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,renderBoundPlanesTexture:void 0,stepSize:0,pickColor:new G},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 _e,this.tileVisible=new _e,this.tileFailed=new _e,this.tileUnload=new _e,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e;let i=this._provider;gvt(this,i)}function gvt(e,t){let{shape:n,minBounds:i=lc.getMinBounds(n),maxBounds:o=lc.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),vBe(e);let r=lc.getShapeConstructor(n);e._shape=new r,e._shapeVisible=PBe(e)}Object.defineProperties(sp.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=M.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&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=D.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=d.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=d.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=d.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=d.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.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=sp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var _vt=new se,Cvt=new se,yvt=new M,Evt=new M,Ivt=new d,bvt=new se;sp.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){Dvt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=vBe(this),r=wvt(this,e);if((o||r)&&(this._shapeVisible=PBe(this),kvt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=Uvt(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&&qvt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Gvt(this,e)&&(this._shaderDirty=!0);let f=a.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=F.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(N3(this,i),this._shaderDirty=!1);let h=i.uniformState.viewProjection,{orientedBoundingBox:m}=this._shape,g=Hvt(m,h,Cvt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=se.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let _=i.uniformState.inverseView,C=M.multiplyTransformation(this._transformPositionWorldToLocal,_,n.transformPositionViewToLocal);this._transformPlaneLocalToView=M.transpose(C,this._transformPlaneLocalToView);let y=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=X.multiply(this._transformDirectionWorldToLocal,y,n.transformDirectionViewToLocal),n.cameraPositionLocal=M.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=X.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let E=Tvt(this,n.cameraPositionLocal,bvt);n.cameraTileCoordinates=se.fromElements(Math.floor(E.x),Math.floor(E.y),Math.floor(E.z),E.w,n.cameraTileCoordinates),n.cameraTileUv=d.fromElements(E.x-Math.floor(E.x),E.y-Math.floor(E.y),E.z-Math.floor(E.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,xvt(this,e);let I=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;I.boundingVolume=this._shape.boundingSphere,e.commandList.push(I)};function xvt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function Tvt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,Ivt),o=e._availableLevels,r=2**(o-1);return se.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var Svt=new d,yee=new d,Bvt=new he;function wvt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function Dvt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=G.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ve(o,!0);let s=e._uniformMap;for(let c in r)if(r.hasOwnProperty(c)){let u=`u_${c}`;s[u]=function(){return r[c]}}if(e._dimensions=d.clone(t.dimensions,e._dimensions),i.dimensions=d.clone(e._dimensions,i.dimensions),e._paddingBefore=d.clone(t.paddingBefore??d.ZERO,e._paddingBefore),i.paddingBefore=d.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=d.clone(t.paddingAfter??d.ZERO,e._paddingAfter),i.paddingAfter=d.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=d.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=d.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===nh.Y_UP){let c=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=c}i.inputDimensions=d.clone(e._inputDimensions,i.inputDimensions),e._availableLevels=t.availableLevels??1;let a=t.keyframeCount??1;e._traversal=new z3(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,Qvt(e._traversal,i)}function vBe(e){return V3(e,"_modelMatrix","_modelMatrixOld")+V3(e,"_minBounds","_minBoundsOld")+V3(e,"_maxBounds","_maxBoundsOld")+V3(e,"_minClippingBounds","_minClippingBoundsOld")+V3(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function V3(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var vvt=new d,Pvt=new d,Rvt=new d,Mvt=new d,Nvt=new M,Lvt=new M;function PBe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=d.clone(e._minBounds,vvt),o=d.clone(e._maxBounds,Pvt),r=d.clone(e._minClippingBounds,Rvt),s=d.clone(e._maxClippingBounds,Mvt),a=M.clone(e._modelMatrix,Nvt);if(e.shape===lc.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 A=d.fromElements(1,1,t,Svt);M.multiplyByScale(a,A,a),M.multiplyByTranslation(a,Fvt(e),a)}let c=e._provider,u=c.shapeTransform??M.IDENTITY,f=c.globalTransform??M.IDENTITY,h=M.multiplyTransformation(f,a,Lvt);M.multiplyTransformation(h,u,h);let m=e._shape;return m.update(h,i,o,r,s)?(e._transformPositionLocalToWorld=M.clone(m.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=M.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=M.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var Ovt=new d;function Fvt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=M.IDENTITY,globalTransform:o=M.IDENTITY}=e._provider,r=M.getTranslation(i,yee),s=M.multiplyByPoint(e._modelMatrix,r,yee),a=M.multiplyByPoint(o,s,yee),u=te.WGS84.cartesianToCartographic(a,Bvt),f=0;l(u)&&(f=u.height);let h=Eo.getHeight(f,t,n);return d.fromElements(0,0,(h-f)/t,Ovt)}function Qvt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=F.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=F.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=F.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=F.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=F.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=F.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function kvt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Ve(t,!0)),n}function Uvt(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 Gvt(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=M.transpose(M.multiplyTransformation(M.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)}sp.prototype.isDestroyed=function(){return!1};sp.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(),de(this)};var DBe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),zvt=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),Vvt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function Hvt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,yvt),o=M.multiply(t,i,Evt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=Vvt,h=DBe.length;for(u=0;u<h;u++)M.multiplyByVector(o,DBe[u],f[u]);for(u=0;u<h;u++){let m=f[u];if(m.z>=-m.w){let g=m.x/m.w,A=m.y/m.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,A),c=Math.max(c,A)}else for(let g=0;g<3;g++){let A=zvt[u*3+g],_=f[A];if(_.z>=-_.w){let C=m.z+m.w,y=_.z+_.w,E=C/(C-y),I=se.lerp(m,_,E,_vt),x=I.x/I.w,S=I.y/I.w;r=Math.min(r,x),s=Math.max(s,x),a=Math.min(a,S),c=Math.max(c,S)}}}return r=D.clamp(r,-1,1),a=D.clamp(a,-1,1),s=D.clamp(s,-1,1),c=D.clamp(c,-1,1),n=se.fromElements(r,a,s,c,n),n}var Eee=3e7,Yvt=new d(Eee,0,0),Wvt=new d(0,Eee,0),jvt=new d(0,0,Eee);function qvt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,h){i.add({positions:[c,u],width:h,material:uo.fromType("Color",{color:f})})}function r(c,u,f){let h=c.computeCorners();o(h[0],h[1],u,f),o(h[2],h[3],u,f),o(h[4],h[5],u,f),o(h[6],h[7],u,f),o(h[0],h[2],u,f),o(h[4],h[6],u,f),o(h[1],h[3],u,f),o(h[5],h[7],u,f),o(h[0],h[4],u,f),o(h[2],h[6],u,f),o(h[1],h[5],u,f),o(h[3],h[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,h=Math.max(1,5/Math.pow(2,u)),g=[G.RED,G.LIME,G.BLUE][u%3];if(r(c.orientedBoundingBox,g,h),l(c.children))for(let A=0;A<8;A++)s(c.children[A])}r(e._shape.orientedBoundingBox,G.WHITE,5),s(n.rootNode);let a=10;o(d.ZERO,Yvt,G.RED,a),o(d.ZERO,Wvt,G.LIME,a),o(d.ZERO,jvt,G.BLUE,a),i.update(t)}sp.DefaultCustomShader=new xb({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
{
material.diffuse = vec3(1.0);
material.alpha = 1.0;
}`});function RBe(){this.ready=!0,this.shape=lc.BOX,this.dimensions=new d(1,1,1),this.names=["data"],this.types=[_t.SCALAR],this.componentTypes=[kt.FLOAT32],this.maximumTileCount=1}RBe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new Tb({metadata:[new Float32Array(1)]});return Promise.resolve(n)};sp.DefaultProvider=new RBe;var qy=sp;function Kvt(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 H3=Kvt;function Jvt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var Y3=Jvt;function Xvt(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 W3=Xvt;var Y5=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??V.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof kP;if(o)this._context=e.contextOptions.createSceneContext(t);else{let u=Ve(e.contextOptions);this._context=new bE(t,u)}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=jn(),this._jobScheduler=new Ik,this._frameState=new yk(r,new Ak(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new Uw(r),this._ellipsoid=e.ellipsoid??te.default,this._globe=void 0,this._globeTranslucencyState=new Ek,this._primitives=new Hl({countReferences:o}),this._groundPrimitives=new Hl({countReferences:o}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new Cb,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new gk(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ai({color:new G,stencil:0,owner:this}),this._depthClearCommand=new ai({depth:1,owner:this}),this._stencilClearCommand=new ai({stencil:0}),this._classificationStencilClearCommand=new ai({stencil:0,renderState:ze.fromCache({stencilMask:Yt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new a3(this),this._preUpdate=new _e,this._postUpdate=new _e,this._renderError=new _e,this._preRender=new _e,this._postRender=new _e,this._minimumDisableDepthTestDistance=0,this._debugInspector=new p3,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _e,this.morphComplete=new _e,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=G.clone(G.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Gi(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 yI,this.fog=new Ck,this.fog.enabled=te.WGS84.equals(this._ellipsoid),te.WGS84.equals(this._ellipsoid)||(bo.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new bo(this),this.shadowMap=new g_({context:r,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=G.clone(G.WHITE),this._actualInvertClassificationColor=G.clone(this._invertClassificationColor),this._invertClassification=new YB,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new r3,this._brdfLutGenerator=new ck,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new f3(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Lu.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=Nc.requestCompletedEvent.addEventListener(Y5(this)),this._removeTaskProcessorListenerCallback=qn.taskCompletedEvent.addEventListener(Y5(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Xe(0,0,r.drawingBufferWidth,r.drawingBufferHeight),c=new bo(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new bo(this),this.preloadFlightCullingVolume=void 0,this._picking=new Fk(this),this._defaultView=new db(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 bp,this._enableEdgeVisibility=!1,QBe(this,0,J.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function Zvt(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(Y5(e))),n.push(t.terrainProviderChanged.addEventListener(Y5(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.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 Ft.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ft.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 Ph.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,Zvt(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===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.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 bo(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new _k(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,Ft.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}}});_i.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 $vt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function MBe(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=$m.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=$m.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=$m.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=$m.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=g_.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===we.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))}_i.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,u=l(t.logDepth),f=l(t.hdr),h=l(t.originalCommand),m=o&&!u,g=c&&!f,A=(!o||!c)&&!h,_=n.pickingMetadata&&$vt(e,n);if(e.dirty=e.dirty||m||g||A||_,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:C,shadowMaps:y}=i;C&&e.castShadows&&(t.shadows=g_.createCastDerivedCommand(y,e,s,r,t.shadows)),(u||m)&&(t.logDepth=$m.createLogDepthCommand(e,r,t.logDepth),MBe(this,t.logDepth.command,s)),(h||A)&&MBe(this,e,s)};var ePt=new Zd({pass:nr.RENDER}),Iee=new Zd({pass:nr.PRELOAD}),bee=new Zd({pass:nr.PRELOAD_FLIGHT}),tPt=new Zd({pass:nr.REQUEST_RENDER_MODE_DEFER_CHECK}),NBe=new le,xee;function nPt(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return NBe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,xee=_2.fromBoundingSphere(NBe,e.camera.positionWC,xee),xee}_i.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function QBe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=J.clone(n,i.time)}_i.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=nPt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof fn||this.camera.frustum instanceof rs),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=G.clone(this.invertClassificationColor,this._actualInvertClassificationColor),YB.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};_i.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===qt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var H5=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);H5=M.inverseTransformation(H5,H5);function iPt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=d.clone(s.center);if(o.mode!==oe.SCENE3D){a=M.multiplyByPoint(H5,a,a);let A=o.mapProjection,_=A.unproject(a);a=A.ellipsoid.cartographicToCartesian(_)}let c,u,{radius:f}=s;l(f)?(c=va.createGeometry(new va({radii:new d(f,f,f),vertexFormat:hn.FLAT_VERTEX_FORMAT})),u=M.fromTranslation(a)):(c=mc.createGeometry(mc.fromDimensions({dimensions:new d(2,2,2),vertexFormat:hn.FLAT_VERTEX_FORMAT})),u=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new Ln({geometryInstances:new Rt({geometry:Un.toWireframe(c),modelMatrix:u,attributes:{color:new Xt(1,0,0,1)}}),appearance:new hn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,m=o.commandList=[];t._debugVolume.update(o),e=m[0],o.useLogDepth&&(e=$m.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 rh(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ai){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&iPt(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 LBe(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 kBe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var oPt=new d;function OBe(e,t){let n=d.subtract(e,t,oPt),i=Math.max(0,d.magnitude(n));return i*i}function rPt(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return OBe(o.center,n)-OBe(i.center,n)}function sPt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function aPt(e,t,n,i,o){Xm(i,kBe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function cPt(e,t,n,i,o){Xm(i,sPt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function lPt(e,t,n){e.context.uniformState.updatePass(we.VOXELS);let i=n.commands[we.VOXELS];i.length=n.indices[we.VOXELS],Xm(i,kBe,e.camera.positionWC);for(let o=0;o<i.length;++o)rh(i[o],e,t)}function uPt(e,t,n){e.context.uniformState.updatePass(we.GAUSSIAN_SPLATS);let i=n.commands[we.GAUSSIAN_SPLATS];i.length=n.indices[we.GAUSSIAN_SPLATS],Xm(i,rPt,e.camera.positionWC);for(let o=0;o<i.length;++o)rh(i[o],e,t)}var fPt=new ki,dPt=new Kl,hPt=new fn,APt=new rs;function mPt(e){let{frustum:t}=e;return l(t.fov)?t.clone(fPt):l(t.infiniteProjectionMatrix)?t.clone(dPt):l(t.width)?t.clone(hPt):t.clone(APt)}function pPt(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?aPt:cPt}function gPt(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 u=pPt(e);o.uniformState.updatePass(we.TRANSLUCENT);let f=n.commands[we.TRANSLUCENT];f.length=n.indices[we.TRANSLUCENT],u(e,rh,t,f,c)}function _Pt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[we.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[we.TRANSLUCENT];i.executeTranslucentCommands(e,rh,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,rh,t,n)}function CPt(e,t,n){e.context.uniformState.updatePass(we.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[we.CESIUM_3D_TILE_EDGES],r=n.indices[we.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new G(0,0,0,0)).execute(e.context,t);for(let s=0;s<r;++s)rh(o[s],e,t);t.framebuffer=i}function See(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=mPt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||yPt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:h,useGlobeDepthFramebuffer:m,useInvertClassification:g,usePostProcessSelected:A}=e._environmentState,{globeDepth:_,globeTranslucencyFramebuffer:C,sceneFramebuffer:y,frustumCommandsList:E}=e._view,I=E.length,x=e._globeTranslucencyState,S=e._depthClearCommand,w=e._stencilClearCommand,v=e._classificationStencilClearCommand,P=e._depthPlane,N=n.position.z;function L(b,T){r.updatePass(T);let B=b.commands[T],R=b.indices[T];for(let O=0;O<R;++O)rh(B[O],e,t);return R}function p(b,T){r.updatePass(T);let B=b.commands[T],R=b.indices[T];for(let O=0;O<R;++O)LBe(B[O],e,t)}for(let b=0;b<I;++b){let T=I-b-1,B=E[T];e.mode===oe.SCENE2D?(n.position.z=N-B.near+1,s.far=Math.max(1,B.far-B.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=T!==0?B.near*e.opaqueFrustumNearOffset:B.near,s.far=B.far,r.updateFrustum(s)),S.execute(i,t),i.stencilBuffer&&w.execute(i,t),x.translucent?(r.updatePass(we.GLOBE),x.executeGlobeCommands(B,rh,C,e,t)):L(B,we.GLOBE),m&&_.executeCopyDepth(i,t),f||(x.translucent?(r.updatePass(we.TERRAIN_CLASSIFICATION),x.executeGlobeClassificationCommands(B,rh,C,e,t)):L(B,we.TERRAIN_CLASSIFICATION)),u&&(S.execute(i,t),h&&P.execute(i,t));let R;if(CPt(e,t,B),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let U=e._view.edgeFramebuffer.colorTexture;l(U)?e.context.uniformState.edgeColorTexture=U:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let k=e._view.edgeFramebuffer.idTexture;l(k)?e.context.uniformState.edgeIdTexture=k:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let z=e._view.edgeFramebuffer.depthTexture;l(z)?e.context.uniformState.edgeDepthTexture=z: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||f)R=L(B,we.CESIUM_3D_TILE),R>0&&(m&&(_.prepareColorTextures(i,u),_.executeUpdateDepth(i,t,_.depthStencilTexture)),f||(R=L(B,we.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let U=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,R=L(B,we.CESIUM_3D_TILE),m&&(e._invertClassification.prepareTextures(i),_.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),R=L(B,we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=U,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),R>0&&i.stencilBuffer&&v.execute(i,t),R=L(B,we.CESIUM_3D_TILE_CLASSIFICATION)}if(R>0&&i.stencilBuffer&&w.execute(i,t),lPt(e,t,B),L(B,we.OPAQUE),uPt(e,t,B),T!==0&&e.mode!==oe.SCENE2D&&(s.near=B.near,r.updateFrustum(s)),gPt(e,t,B),_Pt(e,t,B),i.depthTexture&&e.useDepthPicking&&(m||f)){let U=e._picking.getPickDepth(e,T);U.update(i,_.depthStencilTexture),U.executeCopyDepth(i,t)}if(c||!A)continue;let O=t.framebuffer;t.framebuffer=y.getIdFramebuffer(),s.near=T!==0?B.near*e.opaqueFrustumNearOffset:B.near,s.far=B.far,r.updateFrustum(s),x.translucent?(r.updatePass(we.GLOBE),x.executeGlobeCommands(B,LBe,C,e,t)):p(B,we.GLOBE),u&&(S.framebuffer=t.framebuffer,S.execute(i,t),S.framebuffer=void 0),u&&h&&P.execute(i,t),p(B,we.CESIUM_3D_TILE),p(B,we.OPAQUE),p(B,we.TRANSLUCENT),t.framebuffer=O}}function yPt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(we.ENVIRONMENT),l(i.skyBoxCommand)&&rh(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&rh(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 UBe(e){e.context.uniformState.updatePass(we.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 EPt(e,t){e.context.uniformState.updatePass(we.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function IPt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[we.GLOBE,we.CESIUM_3D_TILE,we.OPAQUE,we.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let h=s-1;h>=0;--h){let m=r[h].cullingVolume;if(e.isVisible(m,u))r[h].commandList.push(u),f=!0;else if(f)break}}}}function GBe(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:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;IPt(e,n,c);for(let f=0;f<u.length;++f){let h=c.passes[f],{camera:m,commandList:g}=h;s.updateCamera(m),c.updatePass(r,f);for(let A=0;A<g.length;++A){let _=g[A];s.updatePass(_.pass);let C=_.derivedCommands.shadows.castCommands[a];rh(C,e,h.passState)}}}}var bPt=new d;_i.prototype.updateAndExecuteCommands=function(e,t){OPt(this,e,t),this._environmentState.useWebVR?xPt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===Lu.ROTATE?Ky(!0,this,e):MPt(this,e)};function xPt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;zBe(e),n.createPotentiallyVisibleSet(e),UBe(e),r||GBe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=bo.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,h=d.multiplyByScalar(a.right,f*.5,bPt);i.frustum.aspectRatio=s.width/s.height;let m=.5*f*c/u;d.add(a.position,h,i.position),i.frustum.xOffset=m,See(e,t),s.x=s.width,d.subtract(a.position,h,i.position),i.frustum.xOffset=-m,See(e,t),bo.clone(a,i)}var TPt=new he(Math.PI,D.PI_OVER_TWO),SPt=new d,BPt=new d,wPt=new M,DPt=new M,vPt=new d,PPt=new d,RPt=new Xe;function MPt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=Xe.clone(r,RPt);t.viewport=s;let a=TPt,c=SPt;e.mapProjection.project(a,c);let f=d.clone(i.position,BPt),h=M.clone(i.transform,DPt),m=i.frustum.clone();i._setTransform(M.IDENTITY);let g=M.computeViewportTransformation(s,0,1,wPt),A=i.frustum.projectionMatrix,_=i.positionWC.y,C=d.fromElements(D.sign(_)*c.x-_,0,-i.positionWC.x,vPt),y=It.pointToGLWindowCoordinates(A,g,C,PPt);y.x=Math.floor(y.x);let E=s.x,I=s.width;if(_===0||y.x<=E||y.x>=E+I)Ky(!0,e,t);else if(Math.abs(E+I*.5-y.x)<1)s.width=y.x-s.x,i.position.x*=D.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ky(!0,e,t),s.x=y.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),Ky(!1,e,t);else if(y.x>E+I*.5){s.width=y.x-E;let x=i.frustum.right;i.frustum.right=c.x-_,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ky(!0,e,t),s.x=y.x,s.width=E+I-y.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=x-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ky(!1,e,t)}else{s.x=y.x,s.width=E+I-y.x;let x=i.frustum.left;i.frustum.left=-c.x-_,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ky(!0,e,t),s.x=E,s.width=y.x-E,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=x-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ky(!1,e,t)}i._setTransform(h),d.clone(f,i.position),i.frustum=m.clone(),t.viewport=r}function Ky(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),zBe(t),i.createPotentiallyVisibleSet(t),e&&(UBe(t),o||GBe(t)),See(t,n)}var FBe=new Gs;_i.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!==oe.SCENE2D&&t.camera.frustum instanceof fn||!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(tg.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let y=r.dynamicLighting;s.setDynamicLighting(y),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 u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=u&&this.mode===oe.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,m=e.cullingVolume,g=FBe.planes;for(let C=0;C<5;++C)g[C]=m.planes[C];m=FBe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(m,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(m,n.moonCommand,h);let A=this.specularEnvironmentMaps,_=this._specularEnvironmentCubeMap;l(A)&&_?.url!==A?(_=_&&_.destroy(),this._specularEnvironmentCubeMap=new Ph(A)):!l(A)&&l(_)&&(_.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function NPt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Zm({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 LPt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.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 zBe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),NPt(e),LPt(e),e._globe&&e._globe.render(t)}function OPt(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 u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new A3: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 f=e._clearColorCommand;G.clone(n,f.color),f.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 m=s.oit,g=r.useOIT=!c&&l(m)&&m.isSupported();g&&(m.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),m.clear(i,t,n),r.useOIT=m.isSupported());let A=e.postProcessStages,_=r.usePostProcess=!c&&(e._hdr||A.length>0||A.ambientOcclusion.enabled||A.fxaa.enabled||A.bloom.enabled);r.usePostProcessSelected=!1,_&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),A.update(i,o.useLogDepth,e._hdr),A.clear(i),_=r.usePostProcess=A.ready,r.usePostProcessSelected=_&&A.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:_&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.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 E;if(o.invertClassificationColor.alpha===1&&h&&(E=s.globeDepth.framebuffer),l(E)||i.depthTexture){if(e._invertClassification.previousFramebuffer=E,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let I=e._invertClassification.unclassifiedCommand,x=I.derivedCommands;x.oit=m.createDerivedCommands(I,i,x.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}_i.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:u}=n,f=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,m=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?h.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=f);let A=this.postProcessStages,_=g.getColorTexture(0),C=m.getColorTexture(0),y=(f??h).getDepthStencilTexture();A.execute(t,_,y,C),A.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function FPt(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 QPt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function VBe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Hl){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=VBe(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}_i.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===$e.CLAMP_TO_TERRAIN||t===$e.RELATIVE_TO_TERRAIN,i=t===$e.CLAMP_TO_3D_TILE||t===$e.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=VBe(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 Tee=new he;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=g=>{he.clone(e,Tee);let A;l(g)&&(A=g.height),l(A)||(A=this.getHeight(e,n)),l(A)&&(Tee.height=A,t(Tee))},r=n===$e.CLAMP_TO_TERRAIN||n===$e.RELATIVE_TO_TERRAIN,s=n===$e.CLAMP_TO_3D_TILE||n===$e.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let c={},u=g=>{if(r||g.isDestroyed()||!g.isCesium3DTileset)return;let A=g.updateHeight(e,o,i);c[g.id]=A};if(!r){let g=this.primitives.length;for(let A=0;A<g;++A){let _=this.primitives.get(A);u(_)}}let f=this.primitives.primitiveAdded.addEventListener(u),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={},f(),h()}};function kPt(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===oe.SCENE2D||n===oe.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}_i.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=QPt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=kPt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function UPt(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 A_({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 GPt(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 zPt(e){e.primitives.postPassesUpdate(e._frameState),Nc.update()}var VPt=new G;function HPt(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=ePt;let r=e.backgroundColor??G.BLACK;e._hdr&&(r=G.clone(r,VPt),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 bp?d.negate(i.sunDirectionWC,e._shadowMapCamera.direction):d.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=Xe.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,EPt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function Db(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function YPt(e){return e._picking.updateMostDetailedRayPicks(e)}_i.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===oe.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=D.incrementWrap(t.frameNumber,15e6,1);QBe(this,o,e),t.newFrame=!0}Db(this,GPt),this.primitives.show&&(Db(this,YPt),Db(this,WPt),Db(this,jPt),i||Db(this,qPt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),Db(this,HPt)),UPt(this,i),Db(this,zPt),FPt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(Ft.minimumAliasedLineWidth,Math.min(e,Ft.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof qy))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 g3.fromKeyframeNode(o,s,c,a)};_i.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=H3(s,t,n,i);if(!l(a))return;let c=W3(r,n,i);if(!l(c))return;let u=new Y3(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function WPt(e){let t=e._frameState;Iee.camera=t.camera,Iee.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Iee)}function jPt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;bee.camera=e.preloadFlightCamera,bee.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,bee)}function qPt(e){e.primitives.updateForPass(e._frameState,tPt)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return to.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function KPt(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()})}_i.prototype.setTerrain=function(e){return KPt(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.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),de(this)};var j3=_i;function $B(e){e=e??te.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=d.multiplyByScalar(e.radii,t,new d);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new et({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(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 d;let i=new d;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($B.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});$B.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Bee=new M;$B.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==oe.SCENE3D&&n!==oe.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,d.ZERO,Bee),o=M.multiplyTransformation(i,eo.Y_UP_TO_Z_UP,Bee),r=M.multiply(this._scaleMatrix,o,Bee);M.clone(r,this._modelMatrix);let s=e.context,a=JPt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let m=va.createGeometry(new va({radii:new d(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Re.POSITION_ONLY}));f.vertexArray=oi.fromGeometry({context:s,geometry:m,attributeLocations:Un.createAttributeLocations(m),bufferUsage:Oe.STATIC_DRAW}),f.renderState=ze.fromCache({cull:{enabled:!0,face:Ni.FRONT},blending:dn.ALPHA_BLEND,depthMask:!1})}let h=a|u<<2|c<<3;if(h!==this._flags){this._flags=h;let m=[];a&&m.push("COLOR_CORRECT"),u&&m.push("PER_FRAGMENT_ATMOSPHERE"),c&&m.push("GLOBE_TRANSLUCENT");let g=new We({defines:m,sources:[kh,OB,k2]}),A=new We({defines:m,sources:[kh,OB,Q2]});this._spSkyAtmosphere=sn.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:A}),f.shaderProgram=this._spSkyAtmosphere}return f};function JPt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}$B.prototype.isDestroyed=function(){return!1};$B.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),de(this)};var q3=$B;function tw(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new et({modelMatrix:M.clone(M.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}tw.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.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"?zP(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 Kr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=mc.createGeometry(mc.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Re.POSITION_ONLY})),c=this._attributeLocations=Un.createAttributeLocations(a);s.vertexArray=oi.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Oe.STATIC_DRAW}),s.renderState=ze.fromCache({blending:dn.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new We({defines:[t?"HDR":""],sources:[U2]});s.shaderProgram=sn.fromCache({context:r,vertexShaderSource:G2,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};tw.prototype.isDestroyed=function(){return!1};tw.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(),de(this)};function ew(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}tw.createEarthSkyBox=function(){return new tw({sources:{positiveX:ew("px"),negativeX:ew("mx"),positiveY:ew("py"),negativeY:ew("my"),positiveZ:ew("pz"),negativeZ:ew("mz")}})};var K3=tw;function X3(){this.show=!0,this._drawCommand=new et({primitiveType:Pe.TRIANGLES,boundingVolume:new le,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new le,this._boundingVolume2D=new le,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(X3.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var XPt=new F,ZPt=new F,$Pt=new se,J3=new se;X3.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.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 x=Math.max(r,s);x=Math.pow(2,Math.ceil(Math.log(x)/Math.log(2))-2),x=Math.max(1,x);let S=n?o.halfFloatingPointTexture?Ge.HALF_FLOAT:Ge.FLOAT:Ge.UNSIGNED_BYTE;this._texture=new Bt({context:o,width:x,height:x,pixelFormat:qe.RGBA,pixelDatatype:S}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let w=this,v={u_radiusTS:function(){return w._radiusTS}};this._commands.computeCommand=new hl({fragmentShaderSource:V2,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){w._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let x={direction:0},S=new Uint8Array(8);S[0]=0,S[1]=0,S[2]=255,S[3]=0,S[4]=255,S[5]=255,S[6]=0,S[7]=255;let w=ut.createVertexBuffer({context:o,typedArray:S,usage:Oe.STATIC_DRAW}),v=[{index:x.direction,vertexBuffer:w,componentsPerAttribute:2,normalize:!0,componentDatatype:q.UNSIGNED_BYTE}],P=ut.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Oe.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});a.vertexArray=new oi({context:o,attributes:v,indexBuffer:P}),a.shaderProgram=sn.fromCache({context:o,vertexShaderSource:H2,fragmentShaderSource:z2,attributeLocations:x}),a.renderState=ze.fromCache({blending:dn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,h=this._boundingVolume2D;d.clone(c,f.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,f.radius=D.SOLAR_RADIUS+D.SOLAR_RADIUS*this._glowLengthTS,h.radius=f.radius,i===oe.SCENE3D?le.clone(f,a.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,a.boundingVolume);let m=to.computeActualEllipsoidPosition(e,c,J3),g=d.magnitude(d.subtract(m,e.camera.position,J3)),A=o.uniformState.projection,_=$Pt;_.x=0,_.y=0,_.z=-g,_.w=1;let C=M.multiplyByVector(A,_,J3),y=to.clipToGLWindowCoordinates(t.viewport,C,XPt);_.x=D.SOLAR_RADIUS;let E=M.multiplyByVector(A,_,J3),I=to.clipToGLWindowCoordinates(t.viewport,E,ZPt);return this._size=F.magnitude(F.subtract(I,y,J3)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};X3.prototype.isDestroyed=function(){return!1};X3.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(),de(this)};var Z3=X3;var WBe=mr(SG(),1);function eRt(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 $3=eRt;var tRt={modifyFragmentShader:function(t){return t=We.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}}},nw=tRt;var vb={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function eU(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=G.clone(G.DARKGRAY),this._highlightColor=G.clone(G.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=vb.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??we.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=Tn.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??Lr.NONE,this._splittingEnabled=!1,this._error=void 0,nRt(this,e)}Object.defineProperties(eU.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return G.clone(this._highlightColor)},set:function(e){this._highlightColor=G.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function nRt(e,t){let n=OI.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=Nh.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=vb.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=G.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 iRt=new d,oRt=new d,rRt=new d,HBe,W5;function sRt(e){if(!l(W5)){HBe=new WBe.default(0),W5=new Array(e);for(let t=0;t<e;++t)W5[t]=HBe.random()}return W5}function aRt(e){let n=e.length/3,i=Math.min(n,20),o=sRt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=d.fromElements(r,r,r,iRt),c=d.fromElements(s,s,s,oRt);for(let f=0;f<i;++f){let h=Math.floor(o[f]*n),m=d.unpack(e,h*3,rRt);d.minimumByComponent(a,m,a),d.maximumByComponent(c,m,c)}let u=le.fromCornerPoints(a,c);return u.radius+=D.EPSILON2,u}function YBe(e,t){let n=q.fromTypedArray(e);return n===q.INT||n===q.UNSIGNED_INT||n===q.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 cRt=new se,lRt=new se,uRt=new G,jBe=0,j5=1,Ree=2,qBe=3,fRt=4,wee=new M,dRt=new M;function hRt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),h=e._isQuantized,m=e._isQuantizedDraco,g=e._isOctEncoded16P,A=e._isOctEncodedDraco,_=e._quantizedRange,C=e._octEncodedRange,y=e._isRGB565,E=e._isTranslucent,I=e._hasColors,x=e._hasNormals,S=e._hasBatchIds,w,v,P=[],N={};if(e._styleableShaderAttributes=N,f){let k=fRt;for(let z in u)if(u.hasOwnProperty(z)){let Q=u[z],H=YBe(Q.typedArray,z);w=Q.componentCount,v=q.fromTypedArray(H);let W=ut.createVertexBuffer({context:n,typedArray:H,usage:Oe.STATIC_DRAW});e._geometryByteLength+=W.sizeInBytes;let Z={index:k,vertexBuffer:W,componentsPerAttribute:w,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(Z),N[z]={location:k,componentCount:w},++k}}let L=ut.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Oe.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let p;I&&(p=ut.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=p.sizeInBytes);let b;x&&(b=ut.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let T;S&&(c.typedArray=YBe(c.typedArray,"batchIds"),T=ut.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=T.sizeInBytes);let B=[];if(h?v=q.UNSIGNED_SHORT:m?v=_<=255?q.UNSIGNED_BYTE:q.UNSIGNED_SHORT:v=q.FLOAT,B.push({index:jBe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||m?e._boundingSphere=le.fromCornerPoints(d.ZERO,e._quantizedVolumeScale):e._boundingSphere=aRt(r.typedArray)),I)if(y)B.push({index:j5,vertexBuffer:p,componentsPerAttribute:1,componentDatatype:q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=E?4:3;B.push({index:j5,vertexBuffer:p,componentsPerAttribute:k,componentDatatype:q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}x&&(g?(w=2,v=q.UNSIGNED_BYTE):A?(w=2,v=C<=255?q.UNSIGNED_BYTE:q.UNSIGNED_SHORT):(w=3,v=q.FLOAT),B.push({index:Ree,vertexBuffer:b,componentsPerAttribute:w,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),S&&B.push({index:qBe,vertexBuffer:T,componentsPerAttribute:1,componentDatatype:q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(B=B.concat(P));let R=new oi({context:n,attributes:B}),O={depthTest:{enabled:!0}},U={depthTest:{enabled:!0},depthMask:!1,blending:dn.ALPHA_BLEND};e._opaquePass===we.CESIUM_3D_TILE&&(O.stencilTest=Yt.setCesium3DTileBit(),O.stencilMask=Yt.CESIUM_3D_TILE_MASK,U.stencilTest=Yt.setCesium3DTileBit(),U.stencilMask=Yt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(O),e._translucentRenderState=ze.fromCache(U),e._drawCommand=new et({boundingVolume:new le,cull:e._cull,modelMatrix:new M,primitiveType:Pe.POINTS,vertexArray:R,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:E?e._translucentRenderState:e._opaqueRenderState,pass:E?we.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function ARt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=cRt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===oe.SCENE2D||c instanceof fn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}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 G.TRANSPARENT;let c=G.clone(a.edgeColor,uRt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return M.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;M.multiply(n.uniformState.view3D,c,wee);let u=M.multiply(wee,a.modelMatrix,wee);return M.inverseTranspose(u,dRt)}};nw.addUniforms(e,s),(i||o||r)&&(s=St(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=lRt;if(l(e._quantizedVolumeScale)){let c=d.clone(e._quantizedVolumeScale,a);d.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function Dee(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 vee(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 Pee(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 mRt={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 pRt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,h=e._isOctEncodedDraco,m=e._isRGB565,g=e._isTranslucent,A=e._hasColors,_=e._hasNormals,C=e._hasBatchIds,y=e._backFaceCulling,E=e._normalShading,I=e._drawCommand.vertexArray,x=e.clippingPlanes,S=e._attenuation,w,v,P,N=g,L=Ve(mRt),p={},b=e._styleableShaderAttributes;for(o in b)b.hasOwnProperty(o)&&(r=b[o],L[o]=`czm_3dtiles_property_${r.location}`,p[r.location]=r);if(a){let ne={translucent:!1},Ce="(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)";w=n.getColorShaderFunction(`getColorFromStyle${Ce}`,L,ne),v=n.getShowShaderFunction(`getShowFromStyle${Ce}`,L,ne),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${Ce}`,L,ne),l(w)&&ne.translucent&&(N=!0)}e._styleTranslucent=N;let T=l(w),B=l(v),R=l(P),O=e.isClipped,U=[],k=[];T&&(Dee(w,U),vee(w,k)),B&&(Dee(v,U),vee(v,k)),R&&(Dee(P,U),vee(P,k));let z=k.indexOf("COLOR")>=0,Q=k.indexOf("NORMAL")>=0;if(Q&&!_)throw new ue("Style references the NORMAL semantic but the point cloud does not have normals");for(o in b)if(b.hasOwnProperty(o)){r=b[o];let ne=U.indexOf(r.location)>=0,Ce=Pee(I,r.location);Ce.enabled=ne}let H=A&&(!T||z);if(A){let ne=Pee(I,j5);ne.enabled=H}let W=_&&(E||y||Q);if(_){let ne=Pee(I,Ree);ne.enabled=W}let Z={a_position:jBe};H&&(Z.a_color=j5),W&&(Z.a_normal=Ree),C&&(Z.a_batchId=qBe);let Y="",$=U.length;for(i=0;i<$;++i){let ne=U[i];r=p[ne];let Ce=r.componentCount,ye=`czm_3dtiles_property_${ne}`,De;Ce===1?De="float":De=`vec${Ce}`,Y+=`in ${De} ${ye};
`,Z[ye]=r.location}ARt(e,t);let K=`in vec3 a_position;
out vec4 v_color;
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
uniform vec4 u_constantColor;
uniform vec4 u_highlightColor;
`;K+=`float u_pointSize;
float tiles3d_tileset_time;
`,S&&(K+=`float u_geometricError;
float u_depthMultiplier;
`),K+=Y,H&&(g?K+=`in vec4 a_color;
`:m?K+=`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;
`:K+=`in vec3 a_color;
`),W&&(f||h?K+=`in vec2 a_normal;
`:K+=`in vec3 a_normal;
`),C&&(K+=`in float a_batchId;
`),(c||u||h)&&(K+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
`),T&&(K+=w),B&&(K+=v),R&&(K+=P),K+=`void main()
{
u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
`,S&&(K+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
`),H?g?K+=` vec4 color = a_color;
`:m?K+=` 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);
`:K+=` vec4 color = vec4(a_color, 1.0);
`:K+=` vec4 color = u_constantColor;
`,c||u?K+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
`:K+=` vec3 position = a_position;
`,K+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
`,W?(f?K+=` vec3 normal = czm_octDecode(a_normal);
`:h?K+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
`:K+=` vec3 normal = a_normal;
`,K+=` vec3 normalEC = czm_normal * normal;
`):K+=` vec3 normal = vec3(1.0);
`,T&&(K+=` color = getColorFromStyle(position, position_absolute, color, normal);
`),B&&(K+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
`),R?K+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
`:S?K+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
float depth = -positionEC.z;
gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
`:K+=` gl_PointSize = u_pointSize;
`,K+=` color = color * u_highlightColor;
`,W&&E&&(K+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
diffuseStrength = max(diffuseStrength, 0.4);
color.xyz *= diffuseStrength * czm_lightColor;
`),K+=` v_color = color;
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
`,W&&y&&(K+=` float visible = step(-normalEC.z, 0.0);
gl_Position *= visible;
gl_PointSize *= visible;
`),B&&(K+=` gl_Position.w *= float(show);
gl_PointSize *= float(show);
`),K+=`}
`;let fe=`in vec4 v_color;
`;O&&(fe+=`uniform highp sampler2D u_clippingPlanes;
uniform mat4 u_clippingPlanesMatrix;
uniform vec4 u_clippingPlanesEdgeStyle;
`,fe+=`
`,fe+=nb(x,s),fe+=`
`),fe+=`void main()
{
out_FragColor = czm_gammaCorrect(v_color);
`,O&&(fe+=$3("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),fe+=`}
`,e.splitDirection!==Lr.NONE&&(fe=nw.modifyFragmentShader(fe)),l(e._vertexShaderLoaded)&&(K=e._vertexShaderLoaded(K)),l(e._fragmentShaderLoaded)&&(fe=e._fragmentShaderLoaded(fe));let ge=e._drawCommand;l(ge.shaderProgram)&&ge.shaderProgram.destroy(),ge.shaderProgram=sn.fromCache({context:s,vertexShaderSource:K,fragmentShaderSource:fe,attributeLocations:Z});try{ge.shaderProgram._bind()}catch{throw new ue("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function gRt(e,t){if(e._decodingState===vb.READY)return!1;if(e._decodingState===vb.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=qp.decodePointCloud(i,t);l(o)&&(e._decodingState=vb.DECODING,o.then(function(r){e._decodingState=vb.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,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(s)&&l(r.POSITION.data.quantization),m=l(u)&&l(r.NORMAL.data.quantization);if(h){let C=r.POSITION.data.quantization,y=C.range;e._quantizedVolumeScale=d.fromElements(y,y,y),e._quantizedVolumeOffset=d.unpack(C.minValues),e._quantizedRange=(1<<C.quantizationBits)-1,e._isQuantizedDraco=!0}m&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,A=i.batchTableProperties;for(let C in A)if(A.hasOwnProperty(C)){let y=r[C];l(g)||(g={}),g[C]={typedArray:y.array,componentCount:y.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let _=c??a;l(_)&&(n.colors={typedArray:_}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=vb.FAILED,e._error=r}))}return!0}var _Rt=new se,CRt=new d;eU.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(gRt(this,t))return;let i=!1,o=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(hRt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){M.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,u),l(this._rtcCenter)&&M.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&M.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==oe.SCENE3D){let h=e.mapProjection,m=M.getColumn(u,3,_Rt);se.equals(m,se.UNIT_W)||It.basisTo2D(h,u,u)}let f=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,f),this._cull){let h=f.center;M.multiplyByPoint(u,h,h);let m=M.getScale(u,CRt);f.radius*=d.maximumComponent(m)}}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!==Lr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&pRt(this,e,this._style),this._drawCommand.castShadows=Tn.castShadows(this.shadows),this._drawCommand.receiveShadows=Tn.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?we.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};eU.prototype.isDestroyed=function(){return!1};eU.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),de(this)};var tU=eU;function Rb(e){e=e??V.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.shadows=e.shadows??Tn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new fm(e.shading),this.style=e.style,this.frameFailed=new _e,this.frameChanged=new _e,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new rg,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(Rb.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function yRt(e){return`uniform vec4 czm_pickColor;
${e}`}function ERt(e){return function(t){return St(t,{czm_pickColor:function(){return e._pickId.color}})}}function IRt(){return"czm_pickColor"}Rb.prototype.makeStyleDirty=function(){this._styleDirty=!0};Rb.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var bRt=new J;function Nee(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function Pb(e,t){return e._intervals.indexOf(t.start)}function xRt(e,t){let n=e._intervals,i=e._clock,o=Nee(e);if(o===0)return;let r=e._getAverageLoadTime(),s=J.addSeconds(i.currentTime,r*o,bRt),a=n.indexOf(s),c=Pb(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function TRt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function SRt(e,t,n){let i=Nee(e),o=Pb(e,t),r=Pb(e,n);return i>=0?o>=r:o<=r}function JBe(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 BRt(e,t,n){let i=Pb(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?M.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Oi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Be.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new tU({arrayBuffer:u,cull:!0,fragmentShaderLoaded:yRt,uniformMapLoaded:ERt(e),pickIdLoaded:IRt})}).catch(JBe(e,c))}return r}function wRt(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 DRt(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(XBe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Oi()-t.timestamp)/1e3;wRt(e,a)}}t.touchedFrameNumber=i.frameNumber}var vRt=new M;function PRt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function RRt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var MRt=new fm;function XBe(e,t,n,i){let o=e.shading??MRt,r=t.pointCloud,s=t.transform??M.IDENTITY;r.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,vRt),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=PRt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=RRt(e);try{r.update(i)}catch(a){JBe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Mee(e,t,n,i){let o=BRt(e,t,i);DRt(e,o,n,i)}function NRt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function ZBe(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 LRt(e,t){let n=Pb(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function KBe(e,t,n,i,o){return l(n)?n.ready?!0:(Mee(e,t,i,o),n.ready):!1}function ORt(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,f=Pb(e,n),h=Pb(e,t);if(f>=h){for(r=f;r>=h;--r)if(s=c.get(r),a=u[r],KBe(e,s,a,i,o))return s}else for(r=f;r<=h;++r)if(s=c.get(r),a=u[r],KBe(e,s,a,i,o))return s;return t}function FRt(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 iw={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};Rb.prototype.update=function(e){if(e.mode===oe.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)&&FRt(this,o,s),iw.timeSinceLoad=t,iw.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,h=this._previousInterval,m=this._nextInterval,g=TRt(this);if(!l(g))return;let A=!1,_=Nee(this),C=_===0;_!==this._clockMultiplier&&(A=!0,this._clockMultiplier=_),(!l(h)||C)&&(h=g),(!l(m)||A||SRt(this,g,m))&&(m=xRt(this,g)),h=ORt(this,h,g,iw,e);let y=LRt(this,h);l(y)||(Mee(this,h,iw,e),y=this._lastRenderedFrame),l(y)&&XBe(this,y,iw,e),l(m)&&Mee(this,m,iw,e);let E=this;l(y)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(y)&&y!==this._lastRenderedFrame&&E.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return E.frameChanged.raiseEvent(E),!0}),this._previousInterval=h,this._nextInterval=m,this._lastRenderedFrame=y;let I=this._totalMemoryUsageInBytes,x=this.maximumMemoryUsage*1024*1024;I>x&&ZBe(this,NRt(e));let w=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&w>0&&c.update(e,f,a,this.boundingSphere)};Rb.prototype.isDestroyed=function(){return!1};Rb.prototype.destroy=function(){return ZBe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),de(this)};var ow=Rb;function twe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function QRt(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 nwe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function iwe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=nwe(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 owe(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 Zo(e,t){e=On(e),t=t??V.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=zt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=zt.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)?On(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?On(t.creditViewport):n,f=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=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,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 _e,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new lA,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),iwe(this);try{let m=t.ellipsoid??te.default,g=new j3({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:m,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=d.UNIT_Z,nwe(this),owe(this);let A=t.globe;l(A)||(A=new ik(m)),A!==!1&&(g.globe=A,g.globe.shadows=t.terrainShadows??Tn.RECEIVE_ONLY);let _=t.skyBox;!l(_)&&te.WGS84.equals(m)&&(_=K3.createEarthSkyBox()),_!==!1&&(g.skyBox=_,g.sun=new Z3,te.WGS84.equals(m)&&(g.moon=new sk));let C=t.skyAtmosphere;!l(C)&&te.WGS84.equals(m)&&(C=new q3(m),C.show=t.globe!==!1&&A.show),C!==!1&&(g.skyAtmosphere=C);let y=t.baseLayer;t.globe!==!1&&y!==!1&&(l(y)||(y=ds.fromWorldImagery()),g.imageryLayers.add(y)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new Ff(i),l(t.sceneMode)&&(t.sceneMode===oe.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===oe.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let E=this;this._onRenderError=function(P,N){E._useDefaultRenderLoop=!1,E._renderLoopRunning=!1,E._showRenderLoopErrors&&E.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,N)},g.renderError.addEventListener(this._onRenderError);let I=t.dataSources,x=!1;l(I)||(I=new mF,x=!0);let S=new iQ({scene:g,dataSourceCollection:I}),w=new kr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=I,this._destroyDataSourceCollection=x,this._dataSourceDisplay=S,this._eventHelper=w,this._canAnimateUpdateCallback=this._updateCanAnimate,w.add(this._clock.onTick,Zo.prototype._onTick,this),w.add(g.morphStart,Zo.prototype._clearTrackedObject,this),w.add(I.dataSourceAdded,Zo.prototype._onDataSourceAdded,this),w.add(I.dataSourceRemoved,Zo.prototype._onDataSourceRemoved,this),w.add(g.postRender,Zo.prototype._postRender,this);let v=I.length;for(let P=0;P<v;P++)this._dataSourceAdded(I,I.get(P));this._dataSourceAdded(void 0,S.defaultDataSource),w.add(I.dataSourceAdded,Zo.prototype._dataSourceAdded,this),w.add(I.dataSourceRemoved,Zo.prototype._dataSourceRemoved,this)}catch(m){throw f&&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:',m),m}}Object.defineProperties(Zo.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&&QRt(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,Lee(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===oe.COLUMBUS_VIEW||n===oe.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===oe.COLUMBUS_VIEW||n===oe.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(M.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,twe(this.clock,e))}}});Zo.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 u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let A=hm(n);u||(typeof n=="string"&&(n=new Error(n)),t=hm({name:n.name,message:n.message}),A=n.stack),typeof console<"u"&&console.error(`${e}
${t}
${A}`);let _=document.createElement("div");_.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...")),_.appendChild(C),_.onclick=function(y){_.removeChild(C),_.appendChild(document.createTextNode(A)),_.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",_.onclick=void 0},a.appendChild(_)}g.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let m=document.createElement("button");m.setAttribute("type","button"),m.className="cesium-button",m.appendChild(document.createTextNode("OK")),m.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},h.appendChild(m),i.appendChild(o)};Zo.prototype.isDestroyed=function(){return!1};Zo.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()),de(this)};Zo.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,iwe(this),owe(this),this._scene.requestRender())};Zo.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Zo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Zo.prototype._onEntityCollectionChanged,this)};Zo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Zo.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Zo.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var kRt=new le;Zo.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??kRt)===mt.DONE&&i.update(t)}};Zo.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)}};Zo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Zo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&twe(this.clock,e)};Zo.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Zo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Zo.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}};Zo.prototype.zoomTo=function(e,t){return rwe(this,e,{offset:t},!1)};Zo.prototype.flyTo=function(e,t){return rwe(this,e,t,!0)};function rwe(e,t,n,i){Lee(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 tb(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof Ys||r instanceof ow||r instanceof qy){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 nU(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Lee(e){let t=e._zoomPromise;l(t)&&(nU(e),e._completeZoom(!1))}Zo.prototype._postRender=function(){URt(this),GRt(this)};var $Be=new le;function URt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){l(o.offset)||(o.offset=new zd(0,-.5,f.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(f,o.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),nU(e)}if(t instanceof ow){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),f()});return}if(t instanceof Ys||t instanceof qy){s(t.boundingSphere);return}if(t instanceof he){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)),nU(e);return}let a=t,c=[];for(let f=0,h=a.length;f<h;f++){let m=e._dataSourceDisplay.getBoundingSphere(a[f],!1,$Be);if(m===mt.PENDING)return;m!==mt.FAILED&&c.push(le.clone($Be))}if(c.length===0){Lee(e);return}e.trackedEntity=void 0;let u=le.fromBoundingSpheres(c);e._zoomIsFlight?(nU(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(M.IDENTITY),nU(e),e._completeZoom(!0))}var ewe=new le;function GRt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=j.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,ewe);if(r===mt.PENDING)return;let s=o.mode;(s===oe.COLUMBUS_VIEW||s===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===oe.COLUMBUS_VIEW||s===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==mt.FAILED?ewe:void 0;e._entityView=new rQ(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var iU=Zo;var zRt=new d(1,1,1);function Oee(e){e=e??zRt,this._dimensions=d.clone(e)}Object.defineProperties(Oee.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){d.clone(e,this._dimensions)}}});var VRt=new d;Oee.prototype.emit=function(e){let t=this._dimensions,n=d.multiplyByScalar(t,.5,VRt),i=D.randomBetween(-n.x,n.x),o=D.randomBetween(-n.y,n.y),r=D.randomBetween(-n.z,n.z);e.position=d.fromElements(i,o,r,e.position),e.velocity=d.normalize(e.position,e.velocity)};var Fee=Oee;function ap(){this.featurePropertiesDirty=!1}Object.defineProperties(ap.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()}}});ap.prototype.hasProperty=function(e,t){Ae.throwInstantiationError()};ap.prototype.getFeature=function(e){Ae.throwInstantiationError()};ap.prototype.applyDebugSettings=function(e,t){Ae.throwInstantiationError()};ap.prototype.applyStyle=function(e){Ae.throwInstantiationError()};ap.prototype.update=function(e,t){Ae.throwInstantiationError()};ap.prototype.pick=function(e,t,n){Ae.throwInstantiationError()};ap.prototype.isDestroyed=function(){Ae.throwInstantiationError()};ap.prototype.destroy=function(){Ae.throwInstantiationError()};var Qee=ap;function rw(e,t){this._conditionsExpression=Ve(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,YRt(this,t)}Object.defineProperties(rw.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function HRt(e,t){this.condition=e,this.expression=t}function YRt(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 HRt(new fd(a,t),new fd(c,t)))}e._runtimeConditions=n}rw.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)}};rw.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)}};rw.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],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u})
{
return ${f};
}
`}return r=`${i} ${e}
{
${r} return ${i}(1.0);
}
`,r};rw.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];ei(e,o.condition.getVariables()),ei(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var oU=rw;function Jy(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,WRt(this,e)}function WRt(e,t){t=Ve(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??V.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new fd(o[r],i))}e._meta=n,e._ready=!0}function vr(e,t){let n=(e._style??V.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new fd(String(t));if(typeof t=="string")return new fd(t,n);if(l(t.conditions))return new oU(t,n)}else return;return t}function Pr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ve(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Jy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=vr(this,e),this._style.show=Pr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=vr(this,e),this._style.color=Pr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=vr(this,e),this._style.pointSize=Pr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=vr(this,e),this._style.pointOutlineColor=Pr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=vr(this,e),this._style.pointOutlineWidth=Pr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=vr(this,e),this._style.labelColor=Pr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=vr(this,e),this._style.labelOutlineColor=Pr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=vr(this,e),this._style.labelOutlineWidth=Pr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=vr(this,e),this._style.font=Pr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=vr(this,e),this._style.labelStyle=Pr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=vr(this,e),this._style.labelText=Pr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=vr(this,e),this._style.backgroundColor=Pr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=vr(this,e),this._style.backgroundPadding=Pr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=vr(this,e),this._style.backgroundEnabled=Pr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=vr(this,e),this._style.scaleByDistance=Pr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=vr(this,e),this._style.translucencyByDistance=Pr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=vr(this,e),this._style.distanceDisplayCondition=Pr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=vr(this,e),this._style.heightOffset=Pr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=vr(this,e),this._style.anchorLineEnabled=Pr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=vr(this,e),this._style.anchorLineColor=Pr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=vr(this,e),this._style.image=Pr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=vr(this,e),this._style.disableDepthTestDistance=Pr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=vr(this,e),this._style.horizontalOrigin=Pr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=vr(this,e),this._style.verticalOrigin=Pr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=vr(this,e),this._style.labelHorizontalOrigin=Pr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=vr(this,e),this._style.labelVerticalOrigin=Pr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Jy.fromUrl=function(e){return Be.createIfNeeded(e).fetchJson(e).then(function(n){return new Jy(n)})};Jy.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)};Jy.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)};Jy.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)};Jy.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&ei(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&ei(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&ei(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Mb=Jy;function rU(e){e=e??V.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new l_({comparator:rU.comparator})}rU.prototype.addSubtree=function(e){let t=new jRt(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()};rU.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}};rU.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 jRt(e,t){this.subtree=e,this.stamp=t}var sU=rU;function aU(e){e=e??V.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=d.ZERO.clone(),paddingAfter:c=d.ZERO.clone(),globalTransform:u=M.IDENTITY.clone(),shapeTransform:f=M.IDENTITY.clone(),minBounds:h,maxBounds:m,minimumValues:g,maximumValues:A,maximumTileCount:_}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=h,this._maxBounds=m,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===lc.ELLIPSOID?nh.Z_UP:nh.Y_UP,this._minimumValues=g,this._maximumValues=A,this._maximumTileCount=_,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new sU}Object.defineProperties(aU.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}}});aU.fromUrl=async function(e){let t=Be.createIfNeeded(e),n=await t.fetchJson();KRt(n);let i=nMt(n,t);await i.load();let{root:o}=n,r=Ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new $I({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,u=iMt(s,c);Object.assign(u,JRt(o)),l(o.transform)?u.globalTransform=M.unpack(o.transform):u.globalTransform=M.clone(M.IDENTITY),u.dimensions=d.unpack(a.dimensions),u.maximumTileCount=qRt(s),l(a.padding)&&(u.paddingBefore=d.unpack(a.padding.before),u.paddingAfter=d.unpack(a.padding.after));let f=new aU(u),h=new bm(t,o,i.schema);return f._implicitTileset=h,f._availableLevels=h.availableLevels,Di.unload(i),f};function qRt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(md.TILESET_TILE_COUNT)}function KRt(e){let t=e.root;if(!l(t.content))throw new ue("Root must have content");if(!Ii(t.content,"3DTILES_content_voxels"))throw new ue("Root tile content must have 3DTILES_content_voxels extension");if(!Ii(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ue("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!Ii(e,"3DTILES_metadata"))throw new ue("Tileset must have a metadata schema")}function JRt(e){let t=e.boundingVolume;if(l(t.box))return eMt(t.box);if(l(t.region))return XRt(t.region);if(Ii(t,"3DTILES_bounding_volume_cylinder"))return tMt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ue("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function XRt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=M.fromScale(te.WGS84.radii),c=new d(t,n,r),u=new d(i,o,s);return{shape:lc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var ZRt=new d,$Rt=new X;function eMt(e){let t=$t.unpack(e),n=X.getScale(t.halfAxes,ZRt),i=X.getRotation(t.halfAxes,$Rt);return{shape:lc.BOX,minBounds:d.negate(n,new d),maxBounds:d.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function tMt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-D.PI,maxAngle:r=D.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],u=.5*i+s[2],f=M.fromTranslationQuaternionRotationScale(d.unpack(s),Qe.unpack(a),d.ONE);return{shape:lc.CYLINDER,minBounds:d.fromElements(t,o,c),maxBounds:d.fromElements(n,r,u),shapeTransform:f}}function nMt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Di.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Di.getSchemaLoader({schema:i})}function iMt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([g,A])=>{let{type:_,componentType:C}=A,y=o?.properties[g].min,E=o?.properties[g].max,I=_t.getComponentCount(_),x=swe(y,I),S=swe(E,I);return{id:g,type:_,componentType:C,minValue:x,maxValue:S}}),a=s.map(g=>g.id),c=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),h=s.map(g=>g.maxValue),m=f.some(l);return{className:t,names:a,types:c,componentTypes:u,minimumValues:m?f:void 0,maximumValues:m?h:void 0}}function swe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function oMt(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=Bg(a);return o=await Zp.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}aU.prototype.requestData=async function(e){e=e??V.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 xm({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),c=a.isSubtreeRoot()&&a.level>0,u=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),h=await oMt(this,u);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:A,baseResource:_}=s,C=A[0].getDerivedResource({templateValues:a.getTemplateValues()}),y=_.getDerivedResource({url:C.url});return Tb.fromGltf(y)};var kee=aU;function Uee(e){e=e??1,this._radius=e??1}Object.defineProperties(Uee.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Uee.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=d.fromElements(i,o,r,e.position),e.velocity=d.clone(d.UNIT_Z,e.velocity)};var cU=Uee;var Gee={CUMULUS:0};Gee.validate=function(e){return e===Gee.CUMULUS};var sw=Object.freeze(Gee);function FA(e,t){if(e=e??V.EMPTY_OBJECT,this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=d.clone(e.maximumSize),this._scale=new F(this._maximumSize.x,this._maximumSize.y);else{this._scale=F.clone(e.scale??new F(20,12));let n=new d(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=d.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=G.clone(e.color??G.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var rMt=FA.SHOW_INDEX=0,sMt=FA.POSITION_INDEX=1,aMt=FA.SCALE_INDEX=2,cMt=FA.MAXIMUM_SIZE_INDEX=3,lMt=FA.SLICE_INDEX=4,uMt=FA.BRIGHTNESS_INDEX=5,fMt=FA.COLOR_INDEX=6;FA.NUMBER_OF_PROPERTIES=7;function Nb(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(FA.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Nb(this,rMt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),Nb(this,sMt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;F.equals(t,e)||(F.clone(e,t),Nb(this,aMt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;d.equals(t,e)||(d.clone(e,t),Nb(this,cMt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;G.equals(t,e)||(G.clone(e,t),Nb(this,fMt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,Nb(this,lMt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,Nb(this,uMt))}}});FA.prototype._destroy=function(){this._cloudCollection=void 0};var Yf=FA;var Wf,q5=new d,dMt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},hMt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},AMt=Yf.SHOW_INDEX,mMt=Yf.POSITION_INDEX,pMt=Yf.SCALE_INDEX,gMt=Yf.MAXIMUM_SIZE_INDEX,_Mt=Yf.SLICE_INDEX,CMt=Yf.BRIGHTNESS_INDEX,yMt=Yf.NUMBER_OF_PROPERTIES,EMt=Yf.COLOR_INDEX;function QA(e){e=e??V.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(yMt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=d.clone(e.noiseOffset??d.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:awe(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 awe(e){return function(){return q5.x=e._textureSliceWidth,q5.y=e._noiseTextureRows,q5.z=1/e._noiseTextureRows,q5}}Object.defineProperties(QA.prototype,{length:{get:function(){return Vee(this),this._clouds.length}}});function cwe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}QA.prototype.add=function(e){e=e??V.EMPTY_OBJECT;let t=e.cloudType??sw.CUMULUS,n;return t===sw.CUMULUS&&(n=new Yf(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};QA.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};QA.prototype.removeAll=function(){cwe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function Vee(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}}QA.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};QA.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};QA.prototype.get=function(e){return Vee(this),this._clouds[e]};var IMt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),bMt=new Uint16Array([0,1,2,0,2,3]);function xMt(e){let t=ut.createVertexBuffer({context:e,typedArray:IMt,usage:Oe.STATIC_DRAW}),n=ut.createIndexBuffer({context:e,typedArray:bMt,usage:Oe.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:q.FLOAT}];return new oi({context:e,attributes:i,indexBuffer:n})}var Hee;function TMt(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=ut.createIndexBuffer({context:e,typedArray:o,usage:Oe.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function SMt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=ut.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Oe.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function BMt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=ut.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Oe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function wMt(e,t,n){let i=[{index:Wf.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Oe.STATIC_DRAW},{index:Wf.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Oe.STATIC_DRAW},{index:Wf.packedAttribute0,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Oe.STATIC_DRAW},{index:Wf.packedAttribute1,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Oe.STATIC_DRAW},{index:Wf.color,componentsPerAttribute:4,componentDatatype:q.UNSIGNED_BYTE,normalize:!0,usage:Oe.STATIC_DRAW}];n&&i.push({index:Wf.direction,componentsPerAttribute:2,componentDatatype:q.FLOAT,vertexBuffer:BMt(e)});let o=n?t:4*t;return new Tp(e,i,o,n)}var zee=new $n;function lwe(e,t,n,i){let o,r=n[Wf.positionHighAndScaleX],s=n[Wf.positionLowAndScaleY],a=i.position;$n.fromCartesian(a,zee);let c=i.scale,u=zee.high,f=zee.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,f.x,f.y,f.z,c.y),s(o+1,f.x,f.y,f.z,c.y),s(o+2,f.x,f.y,f.z,c.y),s(o+3,f.x,f.y,f.z,c.y))}function uwe(e,t,n,i){let o,r=n[Wf.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 fwe(e,t,n,i){let o,r=n[Wf.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 dwe(e,t,n,i){let o,r=n[Wf.color],s=i.color,a=G.floatToByte(s.red),c=G.floatToByte(s.green),u=G.floatToByte(s.blue),f=G.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,f)):(o=i._index*4,r(o+0,a,c,u,f),r(o+1,a,c,u,f),r(o+2,a,c,u,f),r(o+3,a,c,u,f))}function DMt(e,t,n,i){lwe(e,t,n,i),uwe(e,t,n,i),fwe(e,t,n,i),dwe(e,t,n,i)}function vMt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=xMt(a),o._spNoise=sn.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Bt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ge.UNSIGNED_BYTE,pixelFormat:qe.RGBA,sampler:new Jt({wrapS:En.REPEAT,wrapT:En.REPEAT,minificationFilter:Kt.NEAREST,magnificationFilter:mi.NEAREST})});let f=new hl({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:awe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function PMt(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=wMt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];DMt(e,t,s,c)}n._vaf.commit(Hee(i))}}var RMt=[];function MMt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=RMt;u.length=0,(c[mMt]||c[pMt])&&u.push(lwe),(c[AMt]||c[CMt])&&u.push(uwe),(c[gMt]||c[_Mt])&&u.push(fwe),c[EMt]&&u.push(dwe);let f=u.length,h=i._vaf.writers,m,g,A;if(a/r>.1){for(m=0;m<a;++m)for(g=s[m],g._dirty=!1,A=0;A<f;++A)u[A](e,t,h,g);i._vaf.commit(Hee(n))}else{for(m=0;m<a;++m){for(g=s[m],g._dirty=!1,A=0;A<f;++A)u[A](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 NMt(e,t,n,i){let o=t.context,r=e,s=new We({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new We({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=sn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Wf}),r._rs=ze.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!1,blending:dn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function LMt(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 u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new et),f.pass=we.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}QA.prototype.update=function(e){if(Vee(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&vMt(this,e,v2,D2),this._instanced=e.context.instancedArrays,Wf=this._instanced?hMt:dMt,Hee=this._instanced?SMt:TMt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?PMt(this,e):r>0&&MMt(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)&&NMt(this,e,w2,B2),LMt(this,e))};QA.prototype.isDestroyed=function(){return!1};QA.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(),cwe(this._clouds),de(this)};var Yee=QA;var OMt=D.toRadians(30);function Wee(e){this._angle=e??OMt}Object.defineProperties(Wee.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});Wee.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=d.fromElements(o,r,s,e.velocity),d.normalize(e.velocity,e.velocity),e.position=d.clone(d.ZERO,e.position)};var jee=Wee;function lU(e){e=e??V.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=yo.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(lU.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}}});lU.prototype.getFragmentShaderSource=yo.prototype.getFragmentShaderSource;lU.prototype.isTranslucent=yo.prototype.isTranslucent;lU.prototype.getRenderState=yo.prototype.getRenderState;var qee=lU;function K5(e){e=e??V.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=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}K5.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.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 Rt({geometry:new Zg({positions:[d.ZERO,d.UNIT_X],width:this.width,vertexFormat:Bs.VERTEX_FORMAT,colors:[G.RED,G.RED],arcType:an.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Rt({geometry:new Zg({positions:[d.ZERO,d.UNIT_Y],width:this.width,vertexFormat:Bs.VERTEX_FORMAT,colors:[G.GREEN,G.GREEN],arcType:an.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Rt({geometry:new Zg({positions:[d.ZERO,d.UNIT_Z],width:this.width,vertexFormat:Bs.VERTEX_FORMAT,colors:[G.BLUE,G.BLUE],arcType:an.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new Ln({geometryInstances:[t,n,i],appearance:new Bs,asynchronous:!1})}this._primitive.update(e)}};K5.prototype.isDestroyed=function(){return!1};K5.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var uU=K5;function FMt(e){this.direction=d.clone(e.direction),this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??1}var Kee=FMt;var fU=`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 dU=`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 Lb(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:uo.fromType(uo.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??dU,this._fragmentShaderSource=e.fragmentShaderSource??fU,this._renderState=yo.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(Lb.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 Lb.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});Lb.VERTEX_FORMAT=Re.POSITION_AND_ST;Lb.prototype.getFragmentShaderSource=yo.prototype.getFragmentShaderSource;Lb.prototype.isTranslucent=yo.prototype.isTranslucent;Lb.prototype.getRenderState=yo.prototype.getRenderState;var Jee=Lb;function Qu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??Qu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??Qu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??Qu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??Qu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??Qu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new _e,this._nominalFrameRate=new _e,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){QMt(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(){kMt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Qu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Qu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Qu({scene:e})),e._frameRateMonitor};Object.defineProperties(Qu.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}}});Qu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Qu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Qu.prototype.isDestroyed=function(){return!1};Qu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),de(this)};function QMt(e,t){if(e._pauseCount>0)return;let n=Oi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/ri.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/ri.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/ri.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 kMt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var hU=Qu;var hwe=mr(dZ(),1);function Xee(){this._image=new Image}Xee.prototype.isReady=function(){return!0};Xee.prototype.shouldDiscardImage=function(e){return e===this._image};function Ob(e){e=e??V.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 Vi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new pt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Xee),this._errorEvent=new _e}Object.defineProperties(Ob.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}}});Ob.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ue(`The server ${e.url} doesn't have imagery`);let n=new Ob(t);return n._metadata=e,n};Ob.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]}};Ob.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=f_.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new pr({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=UMt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){I2(r.key,u);let f=new Uint8Array(u),h,m=r.protoImagery;if((!l(m)||!m)&&(h=GMt(f)),!l(h)&&(!l(m)||m)){let g=zMt(f);h=g.imageType,f=g.imageData}return!l(h)||!l(f)?o:Kp({uint8Array:f,format:h,flipY:!0})})};Ob.prototype.pickFeatures=function(e,t,n,i,o){};function UMt(e,t,n,i,o,r){let s=f_.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 GMt(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 zMt(e){let t=hwe.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 ue("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 Zee=Ob;var VMt=new G(1,1,1,.4),HMt=new G(0,1,0,.05),YMt=new G(0,.5,0,.2);function Fb(e){e=e??V.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 Vi({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??VMt,this._glowColor=e.glowColor??HMt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??YMt,this._errorEvent=new _e,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(Fb.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}}});Fb.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()};Fb.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};Fb.prototype.getTileCredits=function(e,t,n){};Fb.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};Fb.prototype.pickFeatures=function(e,t,n,i,o){};var $ee=Fb;function kA(){}kA._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);kA._decodeTaskProcessor=new qn("decodeI3S",kA._maxDecodingConcurrency);kA._promise=void 0;async function WMt(){if(await kA._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return kA._decodeTaskProcessor;throw new ue("I3S decoder could not be initialized.")}kA.decode=async function(e,t,n,i,o){return l(kA._promise)||(kA._promise=WMt()),kA._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let h=X.fromRotationX(-D.PI_OVER_TWO),m=new X;X.multiply(h,a,m);let g=he.fromDegrees(c,u,f),A=te.WGS84.cartographicToCartesian(g),_={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:te.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:A,parentRotation:m,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(_)})};var AU=kA;function ete(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(ete.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});ete.prototype.load=async function(){return this._data=await UA.loadJson(this._resource),this._data};var mU=ete;function x_(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(x_.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 J5(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 jMt(e){return e==="String"?1:J5(e)}async function qMt(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)}x_.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=qMt(this).catch(function(e){console.error(e)}),this._loadPromise)};x_.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}};x_.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};x_.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 u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};x_.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=J5(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=J5(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};x_.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=jMt(i.valueType)}if(e.byteLength<t)throw new ue(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};x_.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ue(`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=J5(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new ue(`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 ue(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ue(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var pU=x_;function gU(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(gU.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});gU.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var KMt=new d,JMt=new d,XMt=new d,ZMt=new d,$Mt=new d;function tte(e,t,n,i){let o=d.subtract(i,n,KMt),r=d.cross(o,d.subtract(e,n,JMt),ZMt),s=d.cross(o,d.subtract(t,n,XMt),$Mt);return d.dot(r,s)>=0}var eNt=new d,tNt=new d,nNt=new d,iNt=new d,oNt=new d,rNt=new d,sNt=new d,aNt=new d,cNt=new d,lNt=new d;gU.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new d(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,X.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,h;l(f)?h=f.length:h=u.length/3;for(let m=0;m<h;m++){let g,A,_;l(f)?(g=f[m],A=f[m+1],_=f[m+2]):(g=m*3,A=m*3+1,_=m*3+2);let C=d.fromElements(u[g*3],u[g*3+1],u[g*3+2],eNt),y=d.fromElements(u[A*3],u[A*3+1],u[A*3+2],tNt),E=new d(u[_*3],u[_*3+1],u[_*3+2],nNt);if(!tte(i,C,y,E)||!tte(i,y,C,E)||!tte(i,E,C,y))continue;let I=d.subtract(y,C,iNt),x=d.subtract(E,C,oNt),S=d.cross(I,x,rNt);if(d.magnitude(S)===0)continue;let w=d.normalize(S,sNt),v=d.subtract(i,C,aNt),P=Math.abs(d.dot(v,w));if(P<o){o=P,r=m;let N=d.magnitudeSquared(d.subtract(i,C,v)),L=d.magnitudeSquared(d.subtract(i,y,cNt)),p=d.magnitudeSquared(d.subtract(i,E,lNt));N<L&&N<p?(a=g,c=C,s=N):L<p?(a=A,c=y,s=L):(a=_,c=E,s=p)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:d.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function Awe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(eb(e[i])):t.push(e[i]);return t}gU.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let I=this._parent._data.mesh.material.definition;if(I>=0&&I<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[I],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let x="0";if(l(this._layer._data.textureSetDefinitions))for(let S=0;S<this._layer._data.textureSetDefinitions.length;S++){let w=this._layer._data.textureSetDefinitions[S];for(let v=0;v<w.formats.length;v++){let P=w.formats[v];if(P.format==="jpg"){x=P.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/${x}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=Awe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=Awe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!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 m=[],g=[],A=[];u&&(m=[{sampler:0,source:0}],g=[{uri:h}],A=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let _=[],C=n.length;for(let E=0;E<C;E++){let I=n[E].primitives,x=I.length;for(let S=0;S<x;S++){let w=I[S];if(l(w.material)){for(;w.material>=_.length;){let P=Ve(c,!0);_.push(P)}let v=_[w.material];l(w.extra)&&w.extra.isTransparent?l(v.alphaMode)||(v.alphaMode="BLEND"):v.alphaMode==="BLEND"&&(v.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:_,textures:m,images:g,samplers:A,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var aw=gU;function ll(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(ll.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}}});ll.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Rd(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await UA.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 mwe(e,t){let n=new pU(e,t);return e._fields[t.name]=n,n.load()}ll.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(mwe(this,i))}return Promise.all(t)};ll.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 mwe(this,o)}return Promise.resolve()};ll.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)};ll.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};ll.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 ll(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};ll.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new aw(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 aw(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};ll.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new mU(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};ll.prototype._clearGeometryData=function(){this._geometryData=[]};ll.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=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let y=0;y<this._dataProvider._geoidDataList.length;y++){let E=this._dataProvider._geoidDataList[y],I=E.projection.project(n);if(I.x>E.nativeExtent.west&&I.x<E.nativeExtent.east&&I.y>E.nativeExtent.south&&I.y<E.nativeExtent.north){n.height+=hNt(I.x,I.y,E);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=te.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=te.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 y=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/y}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let y=this._data.lodThreshold;s=r/y}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let y=0;y<this._data.lodSelection.length;y++)this._data.lodSelection[y].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[y].maxError);s===1/0&&(s=1e5);let a=s*16,c=new hc(0,0,0),u=It.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Qe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=X.fromQuaternion(u),h=X.inverse(f,new X),m=new M(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),g=M.inverse(m,new M),A=M.clone(m);l(this._parent._globalTransform)&&M.multiply(m,this._parent._inverseGlobalTransform,A),this._globalTransform=m,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let _=[];for(let y=0;y<this._children.length;y++)_.push(this._children[y]._create3DTileDefinition());return{children:_,refine:"REPLACE",boundingVolume:i,transform:[A[0],A[4],A[8],A[12],A[1],A[5],A[9],A[13],A[2],A[6],A[10],A[14],A[3],A[7],A[11],A[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};ll.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};ll.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 AU.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 uNt(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 fNt(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 pwe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await uNt(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(!fNt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}ll.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=pwe(this,t);e.push(n)}return Promise.all(e)};Rd.prototype._hookedRequestContent=Rd.prototype.requestContent;Rd.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 Be({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(()=>{pwe(e._i3sNode,n)})),e._isLoading=!1,t})}};function dNt(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 X5(e,t,n,i){let o=e+t*n;return i[o]}function hNt(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,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=X5(s,a,n.width,n.buffer),h=X5(c,a,n.width,n.buffer),m=X5(s,u,n.width,n.buffer),g=X5(c,u,n.width,n.buffer),A=dNt(o,r,f,h,m,g);return A=A*n.scale+n.offset,A}Object.defineProperties(Rd.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var cw=ll;function Z5(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(Z5.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function nte(e,t){let n=[];for(let i=0;i<e.length;i++){let o=G.byteToFloat(e[i]);i<3?n.push(eb(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function lw(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=nte(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=nte(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=nte(a.color,a.transparency)))}break}}return n}function ANt(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=lw(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let h=0;h<u.length;h++){let m=u[h];h===u.length-1?f[m]=s:(l(f[m])||(f[m]={}),f=f[m])}}}}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]=lw(o.symbol,t)}return n}}function mNt(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(lw(r.symbol,t)))}return i.symbols.push(void 0),i}}Z5.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=lw(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=lw(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=ANt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=lw(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=mNt(i,n))}};function gwe(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?gwe(s,t,n,i):s}}function pNt(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 gNt(e,t,n){let i=t[n],o=pNt(e.ranges,i);return e.symbols[o]}Z5.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=>gwe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>gNt(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 _U=Z5;function ku(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 Be({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(ku.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}}});ku.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ue(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new _U(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()};ku.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 u=0;u<c.length;u++)s.push(c[u])}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)}};ku.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]}}};ku.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 cw(this,t,!0)}else this._rootNode=new cw(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};ku.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]})};ku._fetchJson=function(e){return e.fetchJson()};ku.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=ku._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]};ku.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};ku.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)?Ve(e):{},e.outlineColor=G.fromCartesian4(se.fromArray(o))),this._tileset=await Ys.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()})};ku.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};ku.prototype.filterByAttributes=function(e){this._filters=l(e)?Ve(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var Qb=ku;function $5(e,t){this._dataProvider=e,this._resource=new Be({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties($5.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}}});$5.prototype.load=async function(){return this._data=await UA.loadJson(this._resource),this._data};$5.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 CU=$5;function yU(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(yU.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}}});yU._fromData=async function(e,t,n,i){let o=new yU(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 u=yU._fromData(e,t,r[c],o);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Be({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await UA.loadJson(o._resource),c=new Qb(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 EU=yU;var ywe=mr(_we(),1);function Ks(e){e=e??V.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??V.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(Ks.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}}});Ks.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return de(this)};Ks.prototype.isDestroyed=function(){return!1};Ks.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Ks.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Ks.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Ks.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 _Nt(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 Cwe(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=_Nt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=EU._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 CU(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ce.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 Qb(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.`)}Ks.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=Be.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Ks.loadJson(n),o=new Ks(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=Cwe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await Cwe(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};Ks._fetchJson=function(e){return e.fetchJson()};Ks.loadJson=async function(e){let t=await Ks._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 ue(t.error)}return t};Ks.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 ue(`Failed to load binary: ${e.url}`);return t};Ks.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 CNt=new F;function yNt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let h=c.x;h<=u.x;h++)for(let m=c.y;m<=u.y;m++){let g=F.fromElements(h,m,CNt),A=g.toString();if(!o.hasOwnProperty(A)){let _={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[A]=_,i.push(_)}}let f=[];for(let h=0;h<i.length;++h){let m=i[h],g=m.terrainProvider.requestTileGeometry(m.x,m.y,m.level);f.push(g)}return Promise.all(f).then(function(h){let m=[];for(let g=0;g<h.length;g++){let A={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},_=h[g],C="Geographic";n._projection instanceof ui&&(C="WebMercator");let y={projectionType:C,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(A.x,A.y,A.level),height:_._height,width:_._width,scale:_._structure.heightScale,offset:_._structure.heightOffset};if(_._encoding===jd.LERC){let E=ywe.default.decode(_._buffer);y.buffer=E.pixels[0]}else y.buffer=_._buffer;m.push(y)}return m})}async function ENt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await yNt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Ks.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=ENt(this),this._geoidDataPromise)};Ks.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};Ks.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Ks.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[]};Ks.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 UA=Ks;var IU={};IU.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await fa.getExports(e,t);if(i.length>0&&i.every(c=>c.status===fa.ExportStatus.Invalid))throw new ue(`All exports for this iModel are Invalid: ${e}`);let o=i.find(c=>c.status===fa.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 Be({url:s});return Ys.fromUrl(a,n)};IU.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:o}){if(!l(n)||!l(i)){let c=await fa.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![fa.RealityDataType.Cesium3DTiles,fa.RealityDataType.PNTS,fa.RealityDataType.RealityMesh3DTiles,fa.RealityDataType.Terrain3DTiles].includes(n))throw new ue(`Reality data type is not a mesh type: ${n}`);let s=await fa.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...o};return Ys.fromUrl(s,a)};IU.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await fa.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![fa.RealityDataType.KML,fa.RealityDataType.GeoJSON].includes(n))throw new ue(`Reality data type is not a data source type: ${n}`);let r=await fa.getRealityDataURL(e,t,i);return n===fa.RealityDataType.GeoJSON?Ay.load(r):Q0.load(r)};IU.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,o=`${fa.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new Be({url:o,headers:{Authorization:fa._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return Ay.load(r)};var ite=IU;function Ewe(){}Object.defineProperties(Ewe.prototype,{color:{get:Ae.throwInstantiationError},intensity:{get:Ae.throwInstantiationError}});var ote=Ewe;var INt=/\/$/,Iwe=new pt('&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 uw(e){e=e??V.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=Be.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();INt.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 pt(c))):c=Iwe,this._resource=i,this._imageryProvider=new Vs({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(uw.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}}});uw.prototype.getTileCredits=function(e,t,n){};uw.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};uw.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};uw._defaultCredit=Iwe;var rte=uw;function ste(e){}ste.prototype.isReady=function(){return!0};ste.prototype.shouldDiscardImage=function(e){return!1};var ate=ste;var bNt=new pt("MapQuest, Open Street Map and contributors, CC-BY-SA");function t9(e){e=e??V.EMPTY_OBJECT;let t=Be.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Rs({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(ce.southwest(a),r),u=n.positionToTileXY(ce.northeast(a),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),h=e.credit??bNt;typeof h=="string"&&(h=new pt(h)),Vs.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(t9.prototype=Object.create(Vs.prototype),t9.prototype.constructor=t9);var T_=t9;var xNt=new F(1,1);function cte(e){e=e??V.EMPTY_OBJECT,this.mass=e.mass??1,this.position=d.clone(e.position??d.ZERO),this.velocity=d.clone(e.velocity??d.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=G.clone(e.startColor??G.WHITE),this.endColor=G.clone(e.endColor??G.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=F.clone(e.imageSize??xNt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(cte.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var bwe=new d;cte.prototype.update=function(e,t){return d.multiplyByScalar(this.velocity,e,bwe),d.add(this.position,bwe,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 fw=cte;function xwe(e){e=e??V.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(xwe.prototype,{complete:{get:function(){return this._complete}}});var lte=xwe;function Twe(e){}Twe.prototype.emit=function(e){Ae.throwInstantiationError()};var ute=Twe;var Swe=new F(1,1);function bU(e){e=e??V.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 cU(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._emitterModelMatrix=M.clone(e.emitterModelMatrix??M.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=G.clone(e.color??e.startColor??G.WHITE),this._endColor=G.clone(e.color??e.endColor??G.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=F.clone(e.imageSize??e.minimumImageSize??Swe),this._maximumImageSize=F.clone(e.imageSize??e.maximumImageSize??Swe),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 _e,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(bU.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||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){G.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){G.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 TNt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let m=0;m<h;++m)i+=o[m].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let h=0;h<f;++h){let m=new fw;m._billboard=r.add({image:s,show:!1}),u.push(m)}e._particleEstimate=a}function SNt(e){let t=e._particlePool.pop();return l(t)||(t=new fw),t}function BNt(e,t){e._particlePool.push(t)}function wNt(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 u=n[c];i.remove(u._billboard)}n.length=a}function DNt(e){l(e._billboard)&&(e._billboard.show=!1)}function Bwe(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=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new G(i,o,r,s),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function vNt(e,t){t.startColor=G.clone(e._startColor,t.startColor),t.endColor=G.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);d.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function PNt(e,t){if(e._isComplete)return 0;t=D.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+=D.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var n9=new d;bU.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new ff),this._updateParticlePool&&(TNt(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)?Bwe(this,s):(DNt(s),BNt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=PNt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=SNt(this),this._emitter.emit(s),d.add(s.position,s.velocity,n9),M.multiplyByPoint(u,n9,n9),s.position=M.multiplyByPoint(u,s.position,s.position),d.subtract(n9,s.position,s.velocity),d.normalize(s.velocity,s.velocity),vNt(this,s),Bwe(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=D.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&wNt(this)};bU.prototype.isDestroyed=function(){return!1};bU.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),de(this)};var fte=bU;function jf(){Ae.throwInstantiationError()}jf.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(jf.prototype,{quadtree:{get:Ae.throwInstantiationError,set:Ae.throwInstantiationError},tilingScheme:{get:Ae.throwInstantiationError},errorEvent:{get:Ae.throwInstantiationError}});jf.prototype.update=Ae.throwInstantiationError;jf.prototype.beginUpdate=Ae.throwInstantiationError;jf.prototype.endUpdate=Ae.throwInstantiationError;jf.prototype.getLevelMaximumGeometricError=Ae.throwInstantiationError;jf.prototype.loadTile=Ae.throwInstantiationError;jf.prototype.computeTileVisibility=Ae.throwInstantiationError;jf.prototype.showTileThisFrame=Ae.throwInstantiationError;jf.prototype.computeDistanceToTile=Ae.throwInstantiationError;jf.prototype.isDestroyed=Ae.throwInstantiationError;jf.prototype.destroy=Ae.throwInstantiationError;var dte=jf;function hte(e){e=e??1,this._radius=e??1}Object.defineProperties(hte.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});hte.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.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=d.fromElements(o,r,s,e.position),e.velocity=d.normalize(e.position,e.velocity)};var Ate=hte;function xU(){}xU.prototype.evaluate=function(e,t){Ae.throwInstantiationError()};xU.prototype.evaluateColor=function(e,t){Ae.throwInstantiationError()};xU.prototype.getShaderFunction=function(e,t,n,i){Ae.throwInstantiationError()};xU.prototype.getVariables=function(){Ae.throwInstantiationError()};var mte=xU;function dw(e){this._ready=!1,this._provider=void 0,this._errorEvent=new _e,this._readyEvent=new _e,MNt(this,e)}Object.defineProperties(dw.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}}});dw.fromWorldTerrain=function(e){return new dw(Z0(e))};dw.fromWorldBathymetry=function(e){return new dw(E2(e))};function RNt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function MNt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){RNt(e._errorEvent,i)}}var TU=dw;function hw(){}hw.prototype.boundingVolume=void 0;hw.prototype.boundingSphere=void 0;hw.prototype.distanceToCamera=function(e){Ae.throwInstantiationError()};hw.prototype.intersectPlane=function(e){Ae.throwInstantiationError()};hw.prototype.createDebugVolume=function(e){Ae.throwInstantiationError()};var pte=hw;function SU(e){e=e??V.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Vi({ellipsoid:e.ellipsoid}),this._color=e.color??G.YELLOW,this._errorEvent=new _e,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(SU.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}}});SU.prototype.getTileCredits=function(e,t,n){};SU.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)};SU.prototype.pickFeatures=function(e,t,n,i,o){};var BU=SU;function gte(e){Ae.throwInstantiationError()}gte.prototype.isReady=Ae.throwInstantiationError;gte.prototype.shouldDiscardImage=Ae.throwInstantiationError;var _te=gte;var NNt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},Cte=Object.freeze(NNt);function i9(e,t){this.show=!0,l(e)||(e=new Xe),this.rectangle=Xe.clone(e),l(t)||(t=uo.fromType(uo.ColorType,{color:new G(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}i9.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Xe.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending:dn.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 We({sources:[this._material.shaderSource,Y2]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=we.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};i9.prototype.isDestroyed=function(){return!1};i9.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),de(this)};var yte=i9;function Ete(){Ae.throwInstantiationError()}Object.defineProperties(Ete.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}});Ete.prototype.requestData=function(e){Ae.throwInstantiationError()};var Ite=Ete;function S_(){Ae.throwInstantiationError()}Object.defineProperties(S_.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}});S_.prototype.update=Ae.throwInstantiationError;S_.prototype.updateViewTransforms=Ae.throwInstantiationError;S_.prototype.convertLocalToShapeUvSpace=Ae.throwInstantiationError;S_.prototype.computeOrientedBoundingBoxForTile=Ae.throwInstantiationError;S_.prototype.computeOrientedBoundingBoxForSample=Ae.throwInstantiationError;S_.DefaultMinBounds=Ae.throwInstantiationError;S_.DefaultMaxBounds=Ae.throwInstantiationError;var bte=S_;var LNt=new G,ONt=new G,FNt=new G,QNt=new G,wwe=new se,wU=new Uint8Array(4);function Dwe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return G.lerp(t.color,n.color,o,i)}function o9(e,t){return{height:e,color:G.clone(t)}}function vwe(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?G.equals(t.color,i[n-1].color):!1,a=r?G.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?G.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function kNt(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],A=D.clamp(g.height,Uu._minimumHeight,Uu._maximumHeight),_=G.clone(g.color,LNt);_.red*=_.alpha,_.green*=_.alpha,_.blue*=_.alpha,c.push(o9(A,_))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],A=c[n+1];u=u&&g.height<=A.height,f=f&&g.height>=A.height}f?c=c.reverse():u||Xm(c,function(g,A){return D.sign(g.height-A.height)});let h=r.extendDownwards??!1,m=r.extendUpwards??!1;c.length===1&&!h&&!m&&(h=!0,m=!0),h&&c.splice(0,0,o9(Uu._minimumHeight,c[0].color)),m&&c.splice(c.length,0,o9(Uu._maximumHeight,c[c.length-1].color)),c=vwe(c),i.push(c)}return i}function UNt(e){let t=kNt(e),n=[],i=[],o;function r(u,f){n.push(o9(u,f))}function s(u,f,h){let m=G.multiplyByScalar(h,1-f.alpha,QNt);m=G.add(m,f,m),r(u,m)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,h=0;i=n,n=[];let m=u.length,g=i.length;for(;f<m||h<g;){let A=f<m?u[f]:void 0,_=f>0?u[f-1]:void 0,C=f<m-1?u[f+1]:void 0,y=h<g?i[h]:void 0,E=h>0?i[h-1]:void 0,I=h<g-1?i[h+1]:void 0;if(l(A)&&l(y)&&A.height===y.height){let x=l(I)&&y.height===I.height,S=!l(E),w=!l(I),v=l(C)&&A.height===C.height,P=!l(_),N=!l(C);x?v?(s(A.height,A.color,y.color),s(A.height,C.color,I.color)):P?(r(A.height,y.color),s(A.height,A.color,I.color)):N?(s(A.height,A.color,y.color),r(A.height,I.color)):(s(A.height,A.color,y.color),s(A.height,A.color,I.color)):S?v?(r(A.height,A.color),s(A.height,C.color,y.color)):N?(r(A.height,A.color),r(A.height,y.color)):(P||r(A.height,A.color),s(A.height,A.color,y.color)):w?v?(s(A.height,A.color,y.color),r(A.height,C.color)):P?(r(A.height,y.color),r(A.height,A.color)):N?s(A.height,A.color,y.color):(s(A.height,A.color,y.color),r(A.height,A.color)):v?(s(A.height,A.color,y.color),s(A.height,C.color,y.color)):P?(r(A.height,y.color),s(A.height,A.color,y.color)):N?(s(A.height,A.color,y.color),r(A.height,y.color)):s(A.height,A.color,y.color),f+=v?2:1,h+=x?2:1}else if(l(A)&&l(y)&&l(E)&&A.height<y.height){let x=Dwe(A.height,E,y,FNt);l(_)?l(C)?s(A.height,A.color,x):(s(A.height,A.color,x),r(A.height,x)):(r(A.height,x),s(A.height,A.color,x)),f++}else if(l(y)&&l(A)&&l(_)&&y.height<A.height){let x=Dwe(y.height,_,A,ONt);l(E)?l(I)?s(y.height,x,y.color):(s(y.height,x,y.color),r(y.height,x)):(r(y.height,x),s(y.height,x,y.color)),h++}else l(A)&&(!l(y)||A.height<y.height)?(l(y)&&!l(E)&&!l(C)?(r(A.height,A.color),r(A.height,Uu._emptyColor),r(y.height,Uu._emptyColor)):(!l(y)&&l(E)&&!l(_)&&(r(E.height,Uu._emptyColor),r(A.height,Uu._emptyColor)),r(A.height,A.color)),f++):l(y)&&(!l(A)||y.height<A.height)&&(r(y.height,y.color),h++)}}return vwe(n)}function Uu(e){let{scene:t,layers:n}=e??V.EMPTY_OBJECT,{context:i}=t,o=UNt(n),r=o.length,s,a,c;if(!Uu._useFloatTexture(i)){a=Ge.UNSIGNED_BYTE,c=qe.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,wwe),se.pack(wwe,s,g*4)}else{a=Ge.FLOAT,c=i.webgl2?qe.RED:qe.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let f=Bt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:Kt.NEAREST,magnificationFilter:mi.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(wU),h[g*4+0]=wU[0],h[g*4+1]=wU[1],h[g*4+2]=wU[2],h[g*4+3]=wU[3];let m=Bt.create({context:i,pixelFormat:qe.RGBA,pixelDatatype:Ge.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new Jt({wrapS:En.CLAMP_TO_EDGE,wrapT:En.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:mi.LINEAR})});return uo.fromType("ElevationBand",{heights:f,colors:m})}Uu._useFloatTexture=function(e){return e.floatingPointTexture};Uu._maximumHeight=5906376425472;Uu._minimumHeight=-5906376425472;Uu._emptyColor=new G(0,0,0,0);var xte=Uu;async function GNt(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??V.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??yd.defaultApiKey;if(!l(n))return zNt(t);let i,o=yd.getDefaultCredit();l(o)&&(i=[o]);let r=new Be({url:`${yd.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Ys.fromUrl(r,t)}var Pwe={};async function zNt(e){let i=Pwe[2275207];l(i)||(i=ss.fromAssetId(2275207),Pwe[2275207]=i);let o=await i;return Ys.fromUrl(o,e)}var Tte=GNt;async function VNt(e){let t=await Ys.fromIonAssetId(96188,e);e=e??V.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??G.WHITE).toCssColorString();n=new Mb({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Ste=VNt;function HNt(e){e=e??V.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=M.clone(e.modelMatrix??M.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Rt({geometry:Un.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Xt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Rt({geometry:Un.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Xt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Rt({geometry:Un.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Xt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Ln({asynchronous:!1,geometryInstances:t,appearance:new hn({flat:!0,translucent:!1})})}var Bte=HNt;var wte=`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);
}
`;function YNt(e){e=e??V.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??qe.RGBA,this.pixelDatatype=e.pixelDatatype??Ge.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=Be.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?En.REPEAT:En.CLAMP_TO_EDGE;this.sampler=new Jt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Dte=YNt;var WNt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},vte=Object.freeze(WNt);var jNt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},Pte=Object.freeze(jNt);function qNt(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: ${hm(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 Rte=qNt;globalThis.CESIUM_VERSION="1.136.0";var DU;typeof ko<"u"&&(DU=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(p,b){return p===null||typeof p in _?p===b:!1}function u(p,b){var T;return function(){T||(T=A.a.setTimeout(function(){T=e,p()},b))}}function f(p,b){var T;return function(){clearTimeout(T),T=A.a.setTimeout(p,b)}}function h(p,b){b&&b!=="change"?b==="beforeChange"?this.pc(p):this.gb(p,b):this.qc(p)}function m(p,b){b!==null&&b.s&&b.s()}function g(p,b){var T=this.qd,B=T[x];B.ra||(this.Qb&&this.mb[b]?(T.uc(b,p,this.mb[b]),this.mb[b]=null,--this.Qb):B.I[b]||T.uc(b,p,B.J?{da:p}:T.$c(p)),p.Ja&&p.gd())}var A=typeof s<"u"?s:{};A.b=function(p,b){for(var T=p.split("."),B=A,R=0;R<T.length-1;R++)B=B[T[R]];B[T[T.length-1]]=b},A.L=function(p,b,T){p[b]=T},A.version="3.5.1",A.b("version",A.version),A.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},A.a=(function(){function p(Y,$){for(var K in Y)R.call(Y,K)&&$(K,Y[K])}function b(Y,$){if($)for(var K in $)R.call($,K)&&(Y[K]=$[K]);return Y}function T(Y,$){return Y.__proto__=$,Y}function B(Y,$,K,fe){var ge=Y[$].match(W)||[];A.a.D(K.match(W),function(ne){A.a.Na(ge,ne,fe)}),Y[$]=ge.join(" ")}var R=Object.prototype.hasOwnProperty,O={__proto__:[]}instanceof Array,U=typeof Symbol=="function",k={},z={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),p(k,function(Y,$){if($.length)for(var K=0,fe=$.length;K<fe;K++)z[$[K]]=Y});var Q={propertychange:!0},H=n&&(function(){for(var Y=3,$=n.createElement("div"),K=$.getElementsByTagName("i");$.innerHTML="<!--[if gt IE "+ ++Y+"]><i></i><![endif]-->",K[0];);return 4<Y?Y:e})(),W=/\S+/g,Z;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(Y,$,K){for(var fe=0,ge=Y.length;fe<ge;fe++)$.call(K,Y[fe],fe,Y)},A:typeof Array.prototype.indexOf=="function"?function(Y,$){return Array.prototype.indexOf.call(Y,$)}:function(Y,$){for(var K=0,fe=Y.length;K<fe;K++)if(Y[K]===$)return K;return-1},Lb:function(Y,$,K){for(var fe=0,ge=Y.length;fe<ge;fe++)if($.call(K,Y[fe],fe,Y))return Y[fe];return e},Pa:function(Y,$){var K=A.a.A(Y,$);0<K?Y.splice(K,1):K===0&&Y.shift()},wc:function(Y){var $=[];return Y&&A.a.D(Y,function(K){0>A.a.A($,K)&&$.push(K)}),$},Mb:function(Y,$,K){var fe=[];if(Y)for(var ge=0,ne=Y.length;ge<ne;ge++)fe.push($.call(K,Y[ge],ge));return fe},jb:function(Y,$,K){var fe=[];if(Y)for(var ge=0,ne=Y.length;ge<ne;ge++)$.call(K,Y[ge],ge)&&fe.push(Y[ge]);return fe},Nb:function(Y,$){if($ instanceof Array)Y.push.apply(Y,$);else for(var K=0,fe=$.length;K<fe;K++)Y.push($[K]);return Y},Na:function(Y,$,K){var fe=A.a.A(A.a.bc(Y),$);0>fe?K&&Y.push($):K||Y.splice(fe,1)},Ba:O,extend:b,setPrototypeOf:T,Ab:O?T:b,P:p,Ga:function(Y,$,K){if(!Y)return Y;var fe={},ge;for(ge in Y)R.call(Y,ge)&&(fe[ge]=$.call(K,Y[ge],ge,Y));return fe},Tb:function(Y){for(;Y.firstChild;)A.removeNode(Y.firstChild)},Yb:function(Y){Y=A.a.la(Y);for(var $=(Y[0]&&Y[0].ownerDocument||n).createElement("div"),K=0,fe=Y.length;K<fe;K++)$.appendChild(A.oa(Y[K]));return $},Ca:function(Y,$){for(var K=0,fe=Y.length,ge=[];K<fe;K++){var ne=Y[K].cloneNode(!0);ge.push($?A.oa(ne):ne)}return ge},va:function(Y,$){if(A.a.Tb(Y),$)for(var K=0,fe=$.length;K<fe;K++)Y.appendChild($[K])},Xc:function(Y,$){var K=Y.nodeType?[Y]:Y;if(0<K.length){for(var fe=K[0],ge=fe.parentNode,ne=0,Ce=$.length;ne<Ce;ne++)ge.insertBefore($[ne],fe);for(ne=0,Ce=K.length;ne<Ce;ne++)A.removeNode(K[ne])}},Ua:function(Y,$){if(Y.length){for($=$.nodeType===8&&$.parentNode||$;Y.length&&Y[0].parentNode!==$;)Y.splice(0,1);for(;1<Y.length&&Y[Y.length-1].parentNode!==$;)Y.length--;if(1<Y.length){var K=Y[0],fe=Y[Y.length-1];for(Y.length=0;K!==fe;)Y.push(K),K=K.nextSibling;Y.push(fe)}}return Y},Zc:function(Y,$){7>H?Y.setAttribute("selected",$):Y.selected=$},Db:function(Y){return Y===null||Y===e?"":Y.trim?Y.trim():Y.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(Y,$){return Y=Y||"",$.length>Y.length?!1:Y.substring(0,$.length)===$},vd:function(Y,$){if(Y===$)return!0;if(Y.nodeType===11)return!1;if($.contains)return $.contains(Y.nodeType!==1?Y.parentNode:Y);if($.compareDocumentPosition)return($.compareDocumentPosition(Y)&16)==16;for(;Y&&Y!=$;)Y=Y.parentNode;return!!Y},Sb:function(Y){return A.a.vd(Y,Y.ownerDocument.documentElement)},kd:function(Y){return!!A.a.Lb(Y,A.a.Sb)},R:function(Y){return Y&&Y.tagName&&Y.tagName.toLowerCase()},Ac:function(Y){return A.onError?function(){try{return Y.apply(this,arguments)}catch($){throw A.onError&&A.onError($),$}}:Y},setTimeout:function(Y,$){return setTimeout(A.a.Ac(Y),$)},Gc:function(Y){setTimeout(function(){throw A.onError&&A.onError(Y),Y},0)},B:function(Y,$,K){var fe=A.a.Ac(K);if(K=Q[$],A.options.useOnlyNativeEvents||K||!o)if(K||typeof Y.addEventListener!="function")if(typeof Y.attachEvent<"u"){var ge=function(Ce){fe.call(Y,Ce)},ne="on"+$;Y.attachEvent(ne,ge),A.a.K.za(Y,function(){Y.detachEvent(ne,ge)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else Y.addEventListener($,fe,!1);else Z||(Z=typeof o(Y).on=="function"?"on":"bind"),o(Y)[Z]($,fe)},Fb:function(Y,$){if(!Y||!Y.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var K;if(A.a.R(Y)==="input"&&Y.type&&$.toLowerCase()=="click"?(K=Y.type,K=K=="checkbox"||K=="radio"):K=!1,A.options.useOnlyNativeEvents||!o||K)if(typeof n.createEvent=="function")if(typeof Y.dispatchEvent=="function")K=n.createEvent(z[$]||"HTMLEvents"),K.initEvent($,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,Y),Y.dispatchEvent(K);else throw Error("The supplied element doesn't support dispatchEvent");else if(K&&Y.click)Y.click();else if(typeof Y.fireEvent<"u")Y.fireEvent("on"+$);else throw Error("Browser doesn't support triggering events");else o(Y).trigger($)},f:function(Y){return A.O(Y)?Y():Y},bc:function(Y){return A.O(Y)?Y.v():Y},Eb:function(Y,$,K){var fe;$&&(typeof Y.classList=="object"?(fe=Y.classList[K?"add":"remove"],A.a.D($.match(W),function(ge){fe.call(Y.classList,ge)})):typeof Y.className.baseVal=="string"?B(Y.className,"baseVal",$,K):B(Y,"className",$,K))},Bb:function(Y,$){var K=A.a.f($);(K===null||K===e)&&(K="");var fe=A.h.firstChild(Y);!fe||fe.nodeType!=3||A.h.nextSibling(fe)?A.h.va(Y,[Y.ownerDocument.createTextNode(K)]):fe.data=K,A.a.Ad(Y)},Yc:function(Y,$){if(Y.name=$,7>=H)try{var K=Y.name.replace(/[&<>'"]/g,function(fe){return"&#"+fe.charCodeAt(0)+";"});Y.mergeAttributes(n.createElement("<input name='"+K+"'/>"),!1)}catch{}},Ad:function(Y){9<=H&&(Y=Y.nodeType==1?Y:Y.parentNode,Y.style&&(Y.style.zoom=Y.style.zoom))},wd:function(Y){if(H){var $=Y.style.width;Y.style.width=0,Y.style.width=$}},Pd:function(Y,$){Y=A.a.f(Y),$=A.a.f($);for(var K=[],fe=Y;fe<=$;fe++)K.push(fe);return K},la:function(Y){for(var $=[],K=0,fe=Y.length;K<fe;K++)$.push(Y[K]);return $},Da:function(Y){return U?Symbol(Y):Y},Zd:H===6,$d:H===7,W:H,Lc:function(Y,$){for(var K=A.a.la(Y.getElementsByTagName("input")).concat(A.a.la(Y.getElementsByTagName("textarea"))),fe=typeof $=="string"?function(Ce){return Ce.name===$}:function(Ce){return $.test(Ce.name)},ge=[],ne=K.length-1;0<=ne;ne--)fe(K[ne])&&ge.push(K[ne]);return ge},Nd:function(Y){return typeof Y=="string"&&(Y=A.a.Db(Y))?r&&r.parse?r.parse(Y):new Function("return "+Y)():null},hc:function(Y,$,K){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(A.a.f(Y),$,K)},Od:function(Y,$,K){K=K||{};var fe=K.params||{},ge=K.includeFields||this.Jc,ne=Y;if(typeof Y=="object"&&A.a.R(Y)==="form")for(var ne=Y.action,Ce=ge.length-1;0<=Ce;Ce--)for(var ye=A.a.Lc(Y,ge[Ce]),De=ye.length-1;0<=De;De--)fe[ye[De].name]=ye[De].value;$=A.a.f($);var be=n.createElement("form");be.style.display="none",be.action=ne,be.method="post";for(var Ne in $)Y=n.createElement("input"),Y.type="hidden",Y.name=Ne,Y.value=A.a.hc(A.a.f($[Ne])),be.appendChild(Y);p(fe,function(ke,Ue){var He=n.createElement("input");He.type="hidden",He.name=ke,He.value=Ue,be.appendChild(He)}),n.body.appendChild(be),K.submitter?K.submitter(be):be.submit(),setTimeout(function(){be.parentNode.removeChild(be)},0)}}})(),A.b("utils",A.a),A.b("utils.arrayForEach",A.a.D),A.b("utils.arrayFirst",A.a.Lb),A.b("utils.arrayFilter",A.a.jb),A.b("utils.arrayGetDistinctValues",A.a.wc),A.b("utils.arrayIndexOf",A.a.A),A.b("utils.arrayMap",A.a.Mb),A.b("utils.arrayPushAll",A.a.Nb),A.b("utils.arrayRemoveItem",A.a.Pa),A.b("utils.cloneNodes",A.a.Ca),A.b("utils.createSymbolOrString",A.a.Da),A.b("utils.extend",A.a.extend),A.b("utils.fieldsIncludedWithJsonPost",A.a.Jc),A.b("utils.getFormFields",A.a.Lc),A.b("utils.objectMap",A.a.Ga),A.b("utils.peekObservable",A.a.bc),A.b("utils.postJson",A.a.Od),A.b("utils.parseJson",A.a.Nd),A.b("utils.registerEventHandler",A.a.B),A.b("utils.stringifyJson",A.a.hc),A.b("utils.range",A.a.Pd),A.b("utils.toggleDomNodeCssClass",A.a.Eb),A.b("utils.triggerEvent",A.a.Fb),A.b("utils.unwrapObservable",A.a.f),A.b("utils.objectForEach",A.a.P),A.b("utils.addOrRemoveItem",A.a.Na),A.b("utils.setTextContent",A.a.Bb),A.b("unwrap",A.a.f),Function.prototype.bind||(Function.prototype.bind=function(p){var b=this;if(arguments.length===1)return function(){return b.apply(p,arguments)};var T=Array.prototype.slice.call(arguments,1);return function(){var B=T.slice(0);return B.push.apply(B,arguments),b.apply(p,B)}}),A.a.g=new function(){var p=0,b="__ko__"+new Date().getTime(),T={},B,R;return A.a.W?(B=function(O,U){var k=O[b];if(!k||k==="null"||!T[k]){if(!U)return e;k=O[b]="ko"+p++,T[k]={}}return T[k]},R=function(O){var U=O[b];return U?(delete T[U],O[b]=null,!0):!1}):(B=function(O,U){var k=O[b];return!k&&U&&(k=O[b]={}),k},R=function(O){return O[b]?(delete O[b],!0):!1}),{get:function(O,U){var k=B(O,!1);return k&&k[U]},set:function(O,U,k){(O=B(O,k!==e))&&(O[U]=k)},Ub:function(O,U,k){return O=B(O,!0),O[U]||(O[U]=k)},clear:R,Z:function(){return p+++b}}},A.b("utils.domData",A.a.g),A.b("utils.domData.clear",A.a.g.clear),A.a.K=new function(){function p(U,k){var z=A.a.g.get(U,B);return z===e&&k&&(z=[],A.a.g.set(U,B,z)),z}function b(U){var k=p(U,!1);if(k)for(var k=k.slice(0),z=0;z<k.length;z++)k[z](U);A.a.g.clear(U),A.a.K.cleanExternalData(U),O[U.nodeType]&&T(U.childNodes,!0)}function T(U,k){for(var z=[],Q,H=0;H<U.length;H++)if((!k||U[H].nodeType===8)&&(b(z[z.length]=Q=U[H]),U[H]!==Q))for(;H--&&A.a.A(z,U[H])==-1;);}var B=A.a.g.Z(),R={1:!0,8:!0,9:!0},O={1:!0,9:!0};return{za:function(U,k){if(typeof k!="function")throw Error("Callback must be a function");p(U,!0).push(k)},yb:function(U,k){var z=p(U,!1);z&&(A.a.Pa(z,k),z.length==0&&A.a.g.set(U,B,e))},oa:function(U){return A.u.G(function(){R[U.nodeType]&&(b(U),O[U.nodeType]&&T(U.getElementsByTagName("*")))}),U},removeNode:function(U){A.oa(U),U.parentNode&&U.parentNode.removeChild(U)},cleanExternalData:function(U){o&&typeof o.cleanData=="function"&&o.cleanData([U])}}},A.oa=A.a.K.oa,A.removeNode=A.a.K.removeNode,A.b("cleanNode",A.oa),A.b("removeNode",A.removeNode),A.b("utils.domNodeDisposal",A.a.K),A.b("utils.domNodeDisposal.addDisposeCallback",A.a.K.za),A.b("utils.domNodeDisposal.removeDisposeCallback",A.a.K.yb),(function(){var p=[0,"",""],b=[1,"<table>","</table>"],T=[3,"<table><tbody><tr>","</tr></tbody></table>"],B=[1,"<select multiple='multiple'>","</select>"],R={thead:b,tbody:b,tfoot:b,tr:[2,"<table><tbody>","</tbody></table>"],td:T,th:T,option:B,optgroup:B},O=8>=A.a.W;A.a.ua=function(U,k){var z;if(o){if(o.parseHTML)z=o.parseHTML(U,k)||[];else if((z=o.clean([U],k))&&z[0]){for(var Q=z[0];Q.parentNode&&Q.parentNode.nodeType!==11;)Q=Q.parentNode;Q.parentNode&&Q.parentNode.removeChild(Q)}}else{(z=k)||(z=n);var Q=z.parentWindow||z.defaultView||t,H=A.a.Db(U).toLowerCase(),W=z.createElement("div"),Z;for(Z=(H=H.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&R[H[1]]||p,H=Z[0],Z="ignored<div>"+Z[1]+U+Z[2]+"</div>",typeof Q.innerShiv=="function"?W.appendChild(Q.innerShiv(Z)):(O&&z.body.appendChild(W),W.innerHTML=Z,O&&W.parentNode.removeChild(W));H--;)W=W.lastChild;z=A.a.la(W.lastChild.childNodes)}return z},A.a.Md=function(U,k){var z=A.a.ua(U,k);return z.length&&z[0].parentElement||A.a.Yb(z)},A.a.fc=function(U,k){if(A.a.Tb(U),k=A.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),o)o(U).html(k);else for(var z=A.a.ua(k,U.ownerDocument),Q=0;Q<z.length;Q++)U.appendChild(z[Q])}})(),A.b("utils.parseHtmlFragment",A.a.ua),A.b("utils.setHtml",A.a.fc),A.aa=(function(){function p(T,B){if(T){if(T.nodeType==8){var R=A.aa.Uc(T.nodeValue);R!=null&&B.push({ud:T,Kd:R})}else if(T.nodeType==1)for(var R=0,O=T.childNodes,U=O.length;R<U;R++)p(O[R],B)}}var b={};return{Xb:function(T){if(typeof T!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var B=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return b[B]=T,"<!--[ko_memo:"+B+"]-->"},bd:function(T,B){var R=b[T];if(R===e)throw Error("Couldn't find any memo with ID "+T+". Perhaps it's already been unmemoized.");try{return R.apply(null,B||[]),!0}finally{delete b[T]}},cd:function(T,B){var R=[];p(T,R);for(var O=0,U=R.length;O<U;O++){var k=R[O].ud,z=[k];B&&A.a.Nb(z,B),A.aa.bd(R[O].Kd,z),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(T){return(T=T.match(/^\[ko_memo\:(.*?)\]$/))?T[1]:null}}})(),A.b("memoization",A.aa),A.b("memoization.memoize",A.aa.Xb),A.b("memoization.unmemoize",A.aa.bd),A.b("memoization.parseMemoText",A.aa.Uc),A.b("memoization.unmemoizeDomNodeAndDescendants",A.aa.cd),A.na=(function(){function p(){if(R){for(var k=R,z=0,Q;U<R;)if(Q=B[U++]){if(U>k){if(5e3<=++z){U=R,A.a.Gc(Error("'Too much recursion' after processing "+z+" task groups."));break}k=R}try{Q()}catch(H){A.a.Gc(H)}}}}function b(){p(),U=R=B.length=0}var T,B=[],R=0,O=1,U=0;return t.MutationObserver?T=(function(k){var z=n.createElement("div");return new MutationObserver(k).observe(z,{attributes:!0}),function(){z.classList.toggle("foo")}})(b):T=n&&"onreadystatechange"in n.createElement("script")?function(k){var z=n.createElement("script");z.onreadystatechange=function(){z.onreadystatechange=null,n.documentElement.removeChild(z),z=null,k()},n.documentElement.appendChild(z)}:function(k){setTimeout(k,0)},{scheduler:T,zb:function(k){return R||A.na.scheduler(b),B[R++]=k,O++},cancel:function(k){k=k-(O-R),k>=U&&k<R&&(B[k]=null)},resetForTesting:function(){var k=R-U;return U=R=B.length=0,k},Sd:p}})(),A.b("tasks",A.na),A.b("tasks.schedule",A.na.zb),A.b("tasks.runEarly",A.na.Sd),A.Ta={throttle:function(p,b){p.throttleEvaluation=b;var T=null;return A.$({read:p,write:function(B){clearTimeout(T),T=A.a.setTimeout(function(){p(B)},b)}})},rateLimit:function(p,b){var T,B,R;typeof b=="number"?T=b:(T=b.timeout,B=b.method),p.Hb=!1,R=typeof B=="function"?B:B=="notifyWhenChangesStop"?f:u,p.ub(function(O){return R(O,T,b)})},deferred:function(p,b){if(b!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");p.Hb||(p.Hb=!0,p.ub(function(T){var B,R=!1;return function(){if(!R){A.na.cancel(B),B=A.na.zb(T);try{R=!0,p.notifySubscribers(e,"dirty")}finally{R=!1}}}}))},notify:function(p,b){p.equalityComparer=b=="always"?null:c}};var _={undefined:1,boolean:1,number:1,string:1};A.b("extenders",A.Ta),A.ic=function(p,b,T){this.da=p,this.lc=b,this.mc=T,this.Ib=!1,this.fb=this.Jb=null,A.L(this,"dispose",this.s),A.L(this,"disposeWhenNodeIsRemoved",this.l)},A.ic.prototype.s=function(){this.Ib||(this.fb&&A.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},A.ic.prototype.l=function(p){this.Jb=p,A.a.K.za(p,this.fb=this.s.bind(this))},A.T=function(){A.a.Ab(this,C),C.qb(this)};var C={qb:function(p){p.U={change:[]},p.sc=1},subscribe:function(p,b,T){var B=this;T=T||"change";var R=new A.ic(B,b?p.bind(b):p,function(){A.a.Pa(B.U[T],R),B.hb&&B.hb(T)});return B.Qa&&B.Qa(T),B.U[T]||(B.U[T]=[]),B.U[T].push(R),R},notifySubscribers:function(p,b){if(b=b||"change",b==="change"&&this.Gb(),this.Wa(b)){var T=b==="change"&&this.ed||this.U[b].slice(0);try{A.u.xc();for(var B=0,R;R=T[B];++B)R.Ib||R.lc(p)}finally{A.u.end()}}},ob:function(){return this.sc},Dd:function(p){return this.ob()!==p},Gb:function(){++this.sc},ub:function(p){var b=this,T=A.O(b),B,R,O,U,k;b.gb||(b.gb=b.notifySubscribers,b.notifySubscribers=h);var z=p(function(){b.Ja=!1,T&&U===b&&(U=b.nc?b.nc():b());var Q=R||k&&b.sb(O,U);k=R=B=!1,Q&&b.gb(O=U)});b.qc=function(Q,H){H&&b.Ja||(k=!H),b.ed=b.U.change.slice(0),b.Ja=B=!0,U=Q,z()},b.pc=function(Q){B||(O=Q,b.gb(Q,"beforeChange"))},b.rc=function(){k=!0},b.gd=function(){b.sb(O,b.v(!0))&&(R=!0)}},Wa:function(p){return this.U[p]&&this.U[p].length},Bd:function(p){if(p)return this.U[p]&&this.U[p].length||0;var b=0;return A.a.P(this.U,function(T,B){T!=="dirty"&&(b+=B.length)}),b},sb:function(p,b){return!this.equalityComparer||!this.equalityComparer(p,b)},toString:function(){return"[object Object]"},extend:function(p){var b=this;return p&&A.a.P(p,function(T,B){var R=A.Ta[T];typeof R=="function"&&(b=R(b,B)||b)}),b}};A.L(C,"init",C.qb),A.L(C,"subscribe",C.subscribe),A.L(C,"extend",C.extend),A.L(C,"getSubscriptionsCount",C.Bd),A.a.Ba&&A.a.setPrototypeOf(C,Function.prototype),A.T.fn=C,A.Qc=function(p){return p!=null&&typeof p.subscribe=="function"&&typeof p.notifySubscribers=="function"},A.b("subscribable",A.T),A.b("isSubscribable",A.Qc),A.S=A.u=(function(){function p(O){T.push(B),B=O}function b(){B=T.pop()}var T=[],B,R=0;return{xc:p,end:b,cc:function(O){if(B){if(!A.Qc(O))throw Error("Only subscribable things can act as dependencies");B.od.call(B.pd,O,O.fd||(O.fd=++R))}},G:function(O,U,k){try{return p(),O.apply(U,k||[])}finally{b()}},qa:function(){if(B)return B.o.qa()},Va:function(){if(B)return B.o.Va()},Ya:function(){if(B)return B.Ya},o:function(){if(B)return B.o}}})(),A.b("computedContext",A.S),A.b("computedContext.getDependenciesCount",A.S.qa),A.b("computedContext.getDependencies",A.S.Va),A.b("computedContext.isInitial",A.S.Ya),A.b("computedContext.registerDependency",A.S.cc),A.b("ignoreDependencies",A.Yd=A.u.G);var y=A.a.Da("_latestValue");A.ta=function(p){function b(){return 0<arguments.length?(b.sb(b[y],arguments[0])&&(b.ya(),b[y]=arguments[0],b.xa()),this):(A.u.cc(b),b[y])}return b[y]=p,A.a.Ba||A.a.extend(b,A.T.fn),A.T.fn.qb(b),A.a.Ab(b,E),A.options.deferUpdates&&A.Ta.deferred(b,!0),b};var E={equalityComparer:c,v:function(){return this[y]},xa:function(){this.notifySubscribers(this[y],"spectate"),this.notifySubscribers(this[y])},ya:function(){this.notifySubscribers(this[y],"beforeChange")}};A.a.Ba&&A.a.setPrototypeOf(E,A.T.fn);var I=A.ta.Ma="__ko_proto__";E[I]=A.ta,A.O=function(p){if((p=typeof p=="function"&&p[I])&&p!==E[I]&&p!==A.o.fn[I])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!p},A.Za=function(p){return typeof p=="function"&&(p[I]===E[I]||p[I]===A.o.fn[I]&&p.Nc)},A.b("observable",A.ta),A.b("isObservable",A.O),A.b("isWriteableObservable",A.Za),A.b("isWritableObservable",A.Za),A.b("observable.fn",E),A.L(E,"peek",E.v),A.L(E,"valueHasMutated",E.xa),A.L(E,"valueWillMutate",E.ya),A.Ha=function(p){if(p=p||[],typeof p!="object"||!("length"in p))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return p=A.ta(p),A.a.Ab(p,A.Ha.fn),p.extend({trackArrayChanges:!0})},A.Ha.fn={remove:function(p){for(var b=this.v(),T=[],B=typeof p!="function"||A.O(p)?function(U){return U===p}:p,R=0;R<b.length;R++){var O=b[R];if(B(O)){if(T.length===0&&this.ya(),b[R]!==O)throw Error("Array modified during remove; cannot remove item");T.push(O),b.splice(R,1),R--}}return T.length&&this.xa(),T},removeAll:function(p){if(p===e){var b=this.v(),T=b.slice(0);return this.ya(),b.splice(0,b.length),this.xa(),T}return p?this.remove(function(B){return 0<=A.a.A(p,B)}):[]},destroy:function(p){var b=this.v(),T=typeof p!="function"||A.O(p)?function(O){return O===p}:p;this.ya();for(var B=b.length-1;0<=B;B--){var R=b[B];T(R)&&(R._destroy=!0)}this.xa()},destroyAll:function(p){return p===e?this.destroy(function(){return!0}):p?this.destroy(function(b){return 0<=A.a.A(p,b)}):[]},indexOf:function(p){var b=this();return A.a.A(b,p)},replace:function(p,b){var T=this.indexOf(p);0<=T&&(this.ya(),this.v()[T]=b,this.xa())},sorted:function(p){var b=this().slice(0);return p?b.sort(p):b.sort()},reversed:function(){return this().slice(0).reverse()}},A.a.Ba&&A.a.setPrototypeOf(A.Ha.fn,A.ta.fn),A.a.D("pop push reverse shift sort splice unshift".split(" "),function(p){A.Ha.fn[p]=function(){var b=this.v();this.ya(),this.zc(b,p,arguments);var T=b[p].apply(b,arguments);return this.xa(),T===b?this:T}}),A.a.D(["slice"],function(p){A.Ha.fn[p]=function(){var b=this();return b[p].apply(b,arguments)}}),A.Pc=function(p){return A.O(p)&&typeof p.remove=="function"&&typeof p.push=="function"},A.b("observableArray",A.Ha),A.b("isObservableArray",A.Pc),A.Ta.trackArrayChanges=function(p,b){function T(){function W(){if(k){var Z=[].concat(p.v()||[]),Y;p.Wa("arrayChange")&&((!R||1<k)&&(R=A.a.Pb(z,Z,p.Ob)),Y=R),z=Z,R=null,k=0,Y&&Y.length&&p.notifySubscribers(Y,"arrayChange")}}B?W():(B=!0,U=p.subscribe(function(){++k},null,"spectate"),z=[].concat(p.v()||[]),R=null,O=p.subscribe(W))}if(p.Ob={},b&&typeof b=="object"&&A.a.extend(p.Ob,b),p.Ob.sparse=!0,!p.zc){var B=!1,R=null,O,U,k=0,z,Q=p.Qa,H=p.hb;p.Qa=function(W){Q&&Q.call(p,W),W==="arrayChange"&&T()},p.hb=function(W){H&&H.call(p,W),W!=="arrayChange"||p.Wa("arrayChange")||(O&&O.s(),U&&U.s(),U=O=null,B=!1,z=e)},p.zc=function(W,Z,Y){function $(be,Ne,ke){return K[K.length]={status:be,value:Ne,index:ke}}if(B&&!k){var K=[],fe=W.length,ge=Y.length,ne=0;switch(Z){case"push":ne=fe;case"unshift":for(Z=0;Z<ge;Z++)$("added",Y[Z],ne+Z);break;case"pop":ne=fe-1;case"shift":fe&&$("deleted",W[ne],ne);break;case"splice":Z=Math.min(Math.max(0,0>Y[0]?fe+Y[0]:Y[0]),fe);for(var fe=ge===1?fe:Math.min(Z+(Y[1]||0),fe),ge=Z+ge-2,ne=Math.max(fe,ge),Ce=[],ye=[],De=2;Z<ne;++Z,++De)Z<fe&&ye.push($("deleted",W[Z],Z)),Z<ge&&Ce.push($("added",Y[De],Z));A.a.Kc(ye,Ce);break;default:return}R=K}}}};var x=A.a.Da("_state");A.o=A.$=function(p,b,T){function B(){if(0<arguments.length){if(typeof R=="function")R.apply(O.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 O.ra||A.u.cc(B),(O.ka||O.J&&B.Xa())&&B.ha(),O.X}if(typeof p=="object"?T=p:(T=T||{},p&&(T.read=p)),typeof T.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var R=T.write,O={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:T.read,nb:b||T.owner,l:T.disposeWhenNodeIsRemoved||T.l||null,Sa:T.disposeWhen||T.Sa,Rb:null,I:{},V:0,Ic:null};return B[x]=O,B.Nc=typeof R=="function",A.a.Ba||A.a.extend(B,A.T.fn),A.T.fn.qb(B),A.a.Ab(B,S),T.pure?(O.wb=!0,O.J=!0,A.a.extend(B,w)):T.deferEvaluation&&A.a.extend(B,v),A.options.deferUpdates&&A.Ta.deferred(B,!0),O.l&&(O.jc=!0,O.l.nodeType||(O.l=null)),O.J||T.deferEvaluation||B.ha(),O.l&&B.ja()&&A.a.K.za(O.l,O.Rb=function(){B.s()}),B};var S={equalityComparer:c,qa:function(){return this[x].V},Va:function(){var p=[];return A.a.P(this[x].I,function(b,T){p[T.Ka]=T.da}),p},Vb:function(p){if(!this[x].V)return!1;var b=this.Va();return A.a.A(b,p)!==-1?!0:!!A.a.Lb(b,function(T){return T.Vb&&T.Vb(p)})},uc:function(p,b,T){if(this[x].wb&&b===this)throw Error("A 'pure' computed must not be called recursively");this[x].I[p]=T,T.Ka=this[x].V++,T.La=b.ob()},Xa:function(){var p,b,T=this[x].I;for(p in T)if(Object.prototype.hasOwnProperty.call(T,p)&&(b=T[p],this.Ia&&b.da.Ja||b.da.Dd(b.La)))return!0},Jd:function(){this.Ia&&!this[x].rb&&this.Ia(!1)},ja:function(){var p=this[x];return p.ka||0<p.V},Rd:function(){this.Ja?this[x].ka&&(this[x].sa=!0):this.Hc()},$c:function(p){if(p.Hb){var b=p.subscribe(this.Jd,this,"dirty"),T=p.subscribe(this.Rd,this);return{da:p,s:function(){b.s(),T.s()}}}return p.subscribe(this.Hc,this)},Hc:function(){var p=this,b=p.throttleEvaluation;b&&0<=b?(clearTimeout(this[x].Ic),this[x].Ic=A.a.setTimeout(function(){p.ha(!0)},b)):p.Ia?p.Ia(!0):p.ha(!0)},ha:function(p){var b=this[x],T=b.Sa,B=!1;if(!b.rb&&!b.ra){if(b.l&&!A.a.Sb(b.l)||T&&T()){if(!b.jc){this.s();return}}else b.jc=!1;b.rb=!0;try{B=this.zd(p)}finally{b.rb=!1}return B}},zd:function(p){var b=this[x],B=!1,T=b.wb?e:!b.V,B={qd:this,mb:b.I,Qb:b.V};A.u.xc({pd:B,od:g,o:this,Ya:T}),b.I={},b.V=0;var R=this.yd(b,B);return b.V?B=this.sb(b.X,R):(this.s(),B=!0),B&&(b.J?this.Gb():this.notifySubscribers(b.X,"beforeChange"),b.X=R,this.notifySubscribers(b.X,"spectate"),!b.J&&p&&this.notifySubscribers(b.X),this.rc&&this.rc()),T&&this.notifySubscribers(b.X,"awake"),B},yd:function(p,b){try{var T=p.Wc;return p.nb?T.call(p.nb):T()}finally{A.u.end(),b.Qb&&!p.J&&A.a.P(b.mb,m),p.sa=p.ka=!1}},v:function(p){var b=this[x];return(b.ka&&(p||!b.V)||b.J&&this.Xa())&&this.ha(),b.X},ub:function(p){A.T.fn.ub.call(this,p),this.nc=function(){return this[x].J||(this[x].sa?this.ha():this[x].ka=!1),this[x].X},this.Ia=function(b){this.pc(this[x].X),this[x].ka=!0,b&&(this[x].sa=!0),this.qc(this,!b)}},s:function(){var p=this[x];!p.J&&p.I&&A.a.P(p.I,function(b,T){T.s&&T.s()}),p.l&&p.Rb&&A.a.K.yb(p.l,p.Rb),p.I=e,p.V=0,p.ra=!0,p.sa=!1,p.ka=!1,p.J=!1,p.l=e,p.Sa=e,p.Wc=e,this.Nc||(p.nb=e)}},w={Qa:function(p){var b=this,T=b[x];if(!T.ra&&T.J&&p=="change"){if(T.J=!1,T.sa||b.Xa())T.I=null,T.V=0,b.ha()&&b.Gb();else{var B=[];A.a.P(T.I,function(R,O){B[O.Ka]=R}),A.a.D(B,function(R,O){var U=T.I[R],k=b.$c(U.da);k.Ka=O,k.La=U.La,T.I[R]=k}),b.Xa()&&b.ha()&&b.Gb()}T.ra||b.notifySubscribers(T.X,"awake")}},hb:function(p){var b=this[x];b.ra||p!="change"||this.Wa("change")||(A.a.P(b.I,function(T,B){B.s&&(b.I[T]={da:B.da,Ka:B.Ka,La:B.La},B.s())}),b.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var p=this[x];return p.J&&(p.sa||this.Xa())&&this.ha(),A.T.fn.ob.call(this)}},v={Qa:function(p){p!="change"&&p!="beforeChange"||this.v()}};A.a.Ba&&A.a.setPrototypeOf(S,A.T.fn);var P=A.ta.Ma;S[P]=A.o,A.Oc=function(p){return typeof p=="function"&&p[P]===S[P]},A.Fd=function(p){return A.Oc(p)&&p[x]&&p[x].wb},A.b("computed",A.o),A.b("dependentObservable",A.o),A.b("isComputed",A.Oc),A.b("isPureComputed",A.Fd),A.b("computed.fn",S),A.L(S,"peek",S.v),A.L(S,"dispose",S.s),A.L(S,"isActive",S.ja),A.L(S,"getDependenciesCount",S.qa),A.L(S,"getDependencies",S.Va),A.xb=function(p,b){return typeof p=="function"?A.o(p,b,{pure:!0}):(p=A.a.extend({},p),p.pure=!0,A.o(p,b))},A.b("pureComputed",A.xb),(function(){function p(B,R,O){if(O=O||new T,B=R(B),typeof B!="object"||B===null||B===e||B instanceof RegExp||B instanceof Date||B instanceof String||B instanceof Number||B instanceof Boolean)return B;var U=B instanceof Array?[]:{};return O.save(B,U),b(B,function(k){var z=R(B[k]);switch(typeof z){case"boolean":case"number":case"string":case"function":U[k]=z;break;case"object":case"undefined":var Q=O.get(z);U[k]=Q!==e?Q:p(z,R,O)}}),U}function b(B,R){if(B instanceof Array){for(var O=0;O<B.length;O++)R(O);typeof B.toJSON=="function"&&R("toJSON")}else for(O in B)R(O)}function T(){this.keys=[],this.values=[]}A.ad=function(B){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return p(B,function(R){for(var O=0;A.O(R)&&10>O;O++)R=R();return R})},A.toJSON=function(B,R,O){return B=A.ad(B),A.a.hc(B,R,O)},T.prototype={constructor:T,save:function(B,R){var O=A.a.A(this.keys,B);0<=O?this.values[O]=R:(this.keys.push(B),this.values.push(R))},get:function(B){return B=A.a.A(this.keys,B),0<=B?this.values[B]:e}}})(),A.b("toJS",A.ad),A.b("toJSON",A.toJSON),A.Wd=function(p,b,T){function B(R){var O=A.xb(p,T).extend({ma:"always"}),U=O.subscribe(function(k){k&&(U.s(),R(k))});return O.notifySubscribers(O.v()),U}return typeof Promise!="function"||b?B(b.bind(T)):new Promise(B)},A.b("when",A.Wd),(function(){A.w={M:function(p){switch(A.a.R(p)){case"option":return p.__ko__hasDomDataOptionValue__===!0?A.a.g.get(p,A.c.options.$b):7>=A.a.W?p.getAttributeNode("value")&&p.getAttributeNode("value").specified?p.value:p.text:p.value;case"select":return 0<=p.selectedIndex?A.w.M(p.options[p.selectedIndex]):e;default:return p.value}},cb:function(p,b,T){switch(A.a.R(p)){case"option":typeof b=="string"?(A.a.g.set(p,A.c.options.$b,e),"__ko__hasDomDataOptionValue__"in p&&delete p.__ko__hasDomDataOptionValue__,p.value=b):(A.a.g.set(p,A.c.options.$b,b),p.__ko__hasDomDataOptionValue__=!0,p.value=typeof b=="number"?b:"");break;case"select":(b===""||b===null)&&(b=e);for(var B=-1,R=0,O=p.options.length,U;R<O;++R)if(U=A.w.M(p.options[R]),U==b||U===""&&b===e){B=R;break}(T||0<=B||b===e&&1<p.size)&&(p.selectedIndex=B,A.a.W===6&&A.a.setTimeout(function(){p.selectedIndex=B},0));break;default:(b===null||b===e)&&(b=""),p.value=b}}}})(),A.b("selectExtensions",A.w),A.b("selectExtensions.readValue",A.w.M),A.b("selectExtensions.writeValue",A.w.cb),A.m=(function(){function p(k){k=A.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=`
,`;var z=[],Q=k.match(B),H,W=[],Z=0;if(1<Q.length){for(var Y=0,$;$=Q[Y];++Y){var K=$.charCodeAt(0);if(K===44){if(0>=Z){z.push(H&&W.length?{key:H,value:W.join("")}:{unknown:H||W.join("")}),H=Z=0,W=[];continue}}else if(K===58){if(!Z&&!H&&W.length===1){H=W.pop();continue}}else{if(K===47&&1<$.length&&($.charCodeAt(1)===47||$.charCodeAt(1)===42))continue;K===47&&Y&&1<$.length?(K=Q[Y-1].match(R))&&!O[K[0]]&&(k=k.substr(k.indexOf($)+1),Q=k.match(B),Y=-1,$="/"):K===40||K===123||K===91?++Z:K===41||K===125||K===93?--Z:H||W.length||K!==34&&K!==39||($=$.slice(1,-1))}W.push($)}if(0<Z)throw Error("Unbalanced parentheses, braces, or brackets")}return z}var b=["true","false","null","undefined"],T=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,B=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),R=/[\])"'A-Za-z0-9_$]+$/,O={in:1,return:1,typeof:1},U={};return{Ra:[],wa:U,ac:p,vb:function(k,z){function Q(K,fe){var ge;if(!Y){var ne=A.getBindingHandler(K);if(ne&&ne.preprocess&&!(fe=ne.preprocess(fe,K,Q)))return;(ne=U[K])&&(ge=fe,0<=A.a.A(b,ge)?ge=!1:(ne=ge.match(T),ge=ne===null?!1:ne[1]?"Object("+ne[1]+")"+ne[2]:ge),ne=ge),ne&&W.push("'"+(typeof U[K]=="string"?U[K]:K)+"':function(_z){"+ge+"=_z}")}Z&&(fe="function(){return "+fe+" }"),H.push("'"+K+"':"+fe)}z=z||{};var H=[],W=[],Z=z.valueAccessors,Y=z.bindingParams,$=typeof k=="string"?p(k):k;return A.a.D($,function(K){Q(K.key||K.unknown,K.value)}),W.length&&Q("_ko_property_writers","{"+W.join(",")+" }"),H.join(",")},Id:function(k,z){for(var Q=0;Q<k.length;Q++)if(k[Q].key==z)return!0;return!1},eb:function(k,z,Q,H,W){k&&A.O(k)?!A.Za(k)||W&&k.v()===H||k(H):(k=z.get("_ko_property_writers"))&&k[Q]&&k[Q](H)}}})(),A.b("expressionRewriting",A.m),A.b("expressionRewriting.bindingRewriteValidators",A.m.Ra),A.b("expressionRewriting.parseObjectLiteral",A.m.ac),A.b("expressionRewriting.preProcessBindings",A.m.vb),A.b("expressionRewriting._twoWayBindings",A.m.wa),A.b("jsonExpressionRewriting",A.m),A.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",A.m.vb),(function(){function p(Q){return Q.nodeType==8&&O.test(R?Q.text:Q.nodeValue)}function b(Q){return Q.nodeType==8&&U.test(R?Q.text:Q.nodeValue)}function T(Q,H){for(var W=Q,Z=1,Y=[];W=W.nextSibling;){if(b(W)&&(A.a.g.set(W,z,!0),Z--,Z===0))return Y;Y.push(W),p(W)&&Z++}if(!H)throw Error("Cannot find closing comment tag to match: "+Q.nodeValue);return null}function B(Q,H){var W=T(Q,H);return W?0<W.length?W[W.length-1].nextSibling:Q.nextSibling:null}var R=n&&n.createComment("test").text==="<!--test-->",O=R?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,U=R?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},z="__ko_matchedEndComment__";A.h={ea:{},childNodes:function(Q){return p(Q)?T(Q):Q.childNodes},Ea:function(Q){if(p(Q)){Q=A.h.childNodes(Q);for(var H=0,W=Q.length;H<W;H++)A.removeNode(Q[H])}else A.a.Tb(Q)},va:function(Q,H){if(p(Q)){A.h.Ea(Q);for(var W=Q.nextSibling,Z=0,Y=H.length;Z<Y;Z++)W.parentNode.insertBefore(H[Z],W)}else A.a.va(Q,H)},Vc:function(Q,H){var W;p(Q)?(W=Q.nextSibling,Q=Q.parentNode):W=Q.firstChild,W?H!==W&&Q.insertBefore(H,W):Q.appendChild(H)},Wb:function(Q,H,W){W?(W=W.nextSibling,p(Q)&&(Q=Q.parentNode),W?H!==W&&Q.insertBefore(H,W):Q.appendChild(H)):A.h.Vc(Q,H)},firstChild:function(Q){if(p(Q))return!Q.nextSibling||b(Q.nextSibling)?null:Q.nextSibling;if(Q.firstChild&&b(Q.firstChild))throw Error("Found invalid end comment, as the first child of "+Q);return Q.firstChild},nextSibling:function(Q){if(p(Q)&&(Q=B(Q)),Q.nextSibling&&b(Q.nextSibling)){var H=Q.nextSibling;if(b(H)&&!A.a.g.get(H,z))throw Error("Found end comment without a matching opening comment, as child of "+Q);return null}return Q.nextSibling},Cd:p,Vd:function(Q){return(Q=(R?Q.text:Q.nodeValue).match(O))?Q[1]:null},Sc:function(Q){if(k[A.a.R(Q)]){var H=Q.firstChild;if(H)do if(H.nodeType===1){var W;W=H.firstChild;var Z=null;if(W)do if(Z)Z.push(W);else if(p(W)){var Y=B(W,!0);Y?W=Y:Z=[W]}else b(W)&&(Z=[W]);while(W=W.nextSibling);if(W=Z)for(Z=H.nextSibling,Y=0;Y<W.length;Y++)Z?Q.insertBefore(W[Y],Z):Q.appendChild(W[Y])}while(H=H.nextSibling)}}}})(),A.b("virtualElements",A.h),A.b("virtualElements.allowedBindings",A.h.ea),A.b("virtualElements.emptyNode",A.h.Ea),A.b("virtualElements.insertAfter",A.h.Wb),A.b("virtualElements.prepend",A.h.Vc),A.b("virtualElements.setDomNodeChildren",A.h.va),(function(){A.ga=function(){this.nd={}},A.a.extend(A.ga.prototype,{nodeHasBindings:function(p){switch(p.nodeType){case 1:return p.getAttribute("data-bind")!=null||A.j.getComponentNameForNode(p);case 8:return A.h.Cd(p);default:return!1}},getBindings:function(p,b){var T=this.getBindingsString(p,b),T=T?this.parseBindingsString(T,b,p):null;return A.j.tc(T,p,b,!1)},getBindingAccessors:function(p,b){var T=this.getBindingsString(p,b),T=T?this.parseBindingsString(T,b,p,{valueAccessors:!0}):null;return A.j.tc(T,p,b,!0)},getBindingsString:function(p){switch(p.nodeType){case 1:return p.getAttribute("data-bind");case 8:return A.h.Vd(p);default:return null}},parseBindingsString:function(p,b,T,B){try{var R=this.nd,O=p+(B&&B.valueAccessors||""),U;if(!(U=R[O])){var k,z="with($context){with($data||{}){return{"+A.m.vb(p,B)+"}}}";k=new Function("$context","$element",z),U=R[O]=k}return U(b,T)}catch(Q){throw Q.message=`Unable to parse bindings.
Bindings value: `+p+`
Message: `+Q.message,Q}}}),A.ga.instance=new A.ga})(),A.b("bindingProvider",A.ga),(function(){function p(ne){var Ce=(ne=A.a.g.get(ne,ge))&&ne.N;Ce&&(ne.N=null,Ce.Tc())}function b(ne,Ce,ye){this.node=ne,this.yc=Ce,this.kb=[],this.H=!1,Ce.N||A.a.K.za(ne,p),ye&&ye.N&&(ye.N.kb.push(ne),this.Kb=ye)}function T(ne){return function(){return ne}}function B(ne){return ne()}function R(ne){return A.a.Ga(A.u.G(ne),function(Ce,ye){return function(){return ne()[ye]}})}function O(ne,Ce,ye){return typeof ne=="function"?R(ne.bind(null,Ce,ye)):A.a.Ga(ne,T)}function U(ne,Ce){return R(this.getBindings.bind(this,ne,Ce))}function k(ne,Ce){var ye=A.h.firstChild(Ce);if(ye){var De,be=A.ga.instance,Ne=be.preprocessNode;if(Ne){for(;De=ye;)ye=A.h.nextSibling(De),Ne.call(be,De);ye=A.h.firstChild(Ce)}for(;De=ye;)ye=A.h.nextSibling(De),z(ne,De)}A.i.ma(Ce,A.i.H)}function z(ne,Ce){var ye=ne,De=Ce.nodeType===1;De&&A.h.Sc(Ce),(De||A.ga.instance.nodeHasBindings(Ce))&&(ye=H(Ce,null,ne).bindingContextForDescendants),ye&&!K[A.a.R(Ce)]&&k(ye,Ce)}function Q(ne){var Ce=[],ye={},De=[];return A.a.P(ne,function be(Ne){if(!ye[Ne]){var ke=A.getBindingHandler(Ne);ke&&(ke.after&&(De.push(Ne),A.a.D(ke.after,function(Ue){if(ne[Ue]){if(A.a.A(De,Ue)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+De.join(", "));be(Ue)}}),De.length--),Ce.push({key:Ne,Mc:ke})),ye[Ne]=!0}}),Ce}function H(ne,Ce,ye){var De=A.a.g.Ub(ne,ge,{}),be=De.hd;if(!Ce){if(be)throw Error("You cannot apply bindings multiple times to the same element.");De.hd=!0}be||(De.context=ye),De.Zb||(De.Zb={});var Ne;if(Ce&&typeof Ce!="function")Ne=Ce;else{var ke=A.ga.instance,Ue=ke.getBindingAccessors||U,He=A.$(function(){return(Ne=Ce?Ce(ye,ne):Ue.call(ke,ne,ye))&&(ye[Z]&&ye[Z](),ye[$]&&ye[$]()),Ne},null,{l:ne});Ne&&He.ja()||(He=null)}var Et=ye,Ye;if(Ne){var nt=function(){return A.a.Ga(He?He():Ne,B)},Ct=He?function(Wt){return function(){return B(He()[Wt])}}:function(Wt){return Ne[Wt]};nt.get=function(Wt){return Ne[Wt]&&B(Ct(Wt))},nt.has=function(Wt){return Wt in Ne},A.i.H in Ne&&A.i.subscribe(ne,A.i.H,function(){var Wt=(0,Ne[A.i.H])();if(Wt){var Qn=A.h.childNodes(ne);Qn.length&&Wt(Qn,A.Ec(Qn[0]))}}),A.i.pa in Ne&&(Et=A.i.Cb(ne,ye),A.i.subscribe(ne,A.i.pa,function(){var Wt=(0,Ne[A.i.pa])();Wt&&A.h.firstChild(ne)&&Wt(ne)})),De=Q(Ne),A.a.D(De,function(Wt){var Qn=Wt.Mc.init,on=Wt.Mc.update,lt=Wt.key;if(ne.nodeType===8&&!A.h.ea[lt])throw Error("The binding '"+lt+"' cannot be used with virtual elements");try{typeof Qn=="function"&&A.u.G(function(){var Nt=Qn(ne,Ct(lt),nt,Et.$data,Et);if(Nt&&Nt.controlsDescendantBindings){if(Ye!==e)throw Error("Multiple bindings ("+Ye+" and "+lt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Ye=lt}}),typeof on=="function"&&A.$(function(){on(ne,Ct(lt),nt,Et.$data,Et)},null,{l:ne})}catch(Nt){throw Nt.message='Unable to process binding "'+lt+": "+Ne[lt]+`"
Message: `+Nt.message,Nt}})}return De=Ye===e,{shouldBindDescendants:De,bindingContextForDescendants:De&&Et}}function W(ne,Ce){return ne&&ne instanceof A.fa?ne:new A.fa(ne,e,e,Ce)}var Z=A.a.Da("_subscribable"),Y=A.a.Da("_ancestorBindingInfo"),$=A.a.Da("_dataDependency");A.c={};var K={script:!0,textarea:!0,template:!0};A.getBindingHandler=function(ne){return A.c[ne]};var fe={};A.fa=function(ne,Ce,ye,De,be){function Ne(){var Ct=Et?He():He,Wt=A.a.f(Ct);return Ce?(A.a.extend(ke,Ce),Y in Ce&&(ke[Y]=Ce[Y])):(ke.$parents=[],ke.$root=Wt,ke.ko=A),ke[Z]=Ye,Ue?Wt=ke.$data:(ke.$rawData=Ct,ke.$data=Wt),ye&&(ke[ye]=Wt),De&&De(ke,Ce,Wt),Ce&&Ce[Z]&&!A.S.o().Vb(Ce[Z])&&Ce[Z](),nt&&(ke[$]=nt),ke.$data}var ke=this,Ue=ne===fe,He=Ue?e:ne,Et=typeof He=="function"&&!A.O(He),Ye,nt=be&&be.dataDependency;be&&be.exportDependencies?Ne():(Ye=A.xb(Ne),Ye.v(),Ye.ja()?Ye.equalityComparer=null:ke[Z]=e)},A.fa.prototype.createChildContext=function(ne,Ce,ye,De){if(!De&&Ce&&typeof Ce=="object"&&(De=Ce,Ce=De.as,ye=De.extend),Ce&&De&&De.noChildContext){var be=typeof ne=="function"&&!A.O(ne);return new A.fa(fe,this,null,function(Ne){ye&&ye(Ne),Ne[Ce]=be?ne():ne},De)}return new A.fa(ne,this,Ce,function(Ne,ke){Ne.$parentContext=ke,Ne.$parent=ke.$data,Ne.$parents=(ke.$parents||[]).slice(0),Ne.$parents.unshift(Ne.$parent),ye&&ye(Ne)},De)},A.fa.prototype.extend=function(ne,Ce){return new A.fa(fe,this,null,function(ye){A.a.extend(ye,typeof ne=="function"?ne(ye):ne)},Ce)};var ge=A.a.g.Z();b.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},b.prototype.sd=function(ne){A.a.Pa(this.kb,ne),!this.kb.length&&this.H&&this.Cc()},b.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,A.a.K.yb(this.node,p),A.i.ma(this.node,A.i.pa),this.Tc())},A.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ne,Ce,ye,De,be){var Ne=A.a.g.Ub(ne,ge,{});return Ne.Fa||(Ne.Fa=new A.T),be&&be.notifyImmediately&&Ne.Zb[Ce]&&A.u.G(ye,De,[ne]),Ne.Fa.subscribe(ye,De,Ce)},ma:function(ne,Ce){var ye=A.a.g.get(ne,ge);if(ye&&(ye.Zb[Ce]=!0,ye.Fa&&ye.Fa.notifySubscribers(ne,Ce),Ce==A.i.H)){if(ye.N)ye.N.Cc();else if(ye.N===e&&ye.Fa&&ye.Fa.Wa(A.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ne,Ce){var ye=A.a.g.Ub(ne,ge,{});return ye.N||(ye.N=new b(ne,ye,Ce[Y])),Ce[Y]==ye?Ce:Ce.extend(function(De){De[Y]=ye})}},A.Td=function(ne){return(ne=A.a.g.get(ne,ge))&&ne.context},A.ib=function(ne,Ce,ye){return ne.nodeType===1&&A.h.Sc(ne),H(ne,Ce,W(ye))},A.ld=function(ne,Ce,ye){return ye=W(ye),A.ib(ne,O(Ce,ye,ne),ye)},A.Oa=function(ne,Ce){Ce.nodeType!==1&&Ce.nodeType!==8||k(W(ne),Ce)},A.vc=function(ne,Ce,ye){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(Ce=n.body,!Ce)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!Ce||Ce.nodeType!==1&&Ce.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");z(W(ne,ye),Ce)},A.Dc=function(ne){return!ne||ne.nodeType!==1&&ne.nodeType!==8?e:A.Td(ne)},A.Ec=function(ne){return(ne=A.Dc(ne))?ne.$data:e},A.b("bindingHandlers",A.c),A.b("bindingEvent",A.i),A.b("bindingEvent.subscribe",A.i.subscribe),A.b("bindingEvent.startPossiblyAsyncContentBinding",A.i.Cb),A.b("applyBindings",A.vc),A.b("applyBindingsToDescendants",A.Oa),A.b("applyBindingAccessorsToNode",A.ib),A.b("applyBindingsToNode",A.ld),A.b("contextFor",A.Dc),A.b("dataFor",A.Ec)})(),(function(p){function b(U,k){var z=Object.prototype.hasOwnProperty.call(R,U)?R[U]:p,Q;z?z.subscribe(k):(z=R[U]=new A.T,z.subscribe(k),T(U,function(H,W){var Z=!(!W||!W.synchronous);O[U]={definition:H,Gd:Z},delete R[U],Q||Z?z.notifySubscribers(H):A.na.zb(function(){z.notifySubscribers(H)})}),Q=!0)}function T(U,k){B("getConfig",[U],function(z){z?B("loadComponent",[U,z],function(Q){k(Q,z)}):k(null,null)})}function B(U,k,z,Q){Q||(Q=A.j.loaders.slice(0));var H=Q.shift();if(H){var W=H[U];if(W){var Z=!1;if(W.apply(H,k.concat(function(Y){Z?z(null):Y!==null?z(Y):B(U,k,z,Q)}))!==p&&(Z=!0,!H.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else B(U,k,z,Q)}else z(null)}var R={},O={};A.j={get:function(U,k){var z=Object.prototype.hasOwnProperty.call(O,U)?O[U]:p;z?z.Gd?A.u.G(function(){k(z.definition)}):A.na.zb(function(){k(z.definition)}):b(U,k)},Bc:function(U){delete O[U]},oc:B},A.j.loaders=[],A.b("components",A.j),A.b("components.get",A.j.get),A.b("components.clearCachedDefinition",A.j.Bc)})(),(function(){function p(z,Q,H,W){function Z(){--$===0&&W(Y)}var Y={},$=2,K=H.template;H=H.viewModel,K?R(Q,K,function(fe){A.j.oc("loadTemplate",[z,fe],function(ge){Y.template=ge,Z()})}):Z(),H?R(Q,H,function(fe){A.j.oc("loadViewModel",[z,fe],function(ge){Y[k]=ge,Z()})}):Z()}function b(z,Q,H){if(typeof Q=="function")H(function(Z){return new Q(Z)});else if(typeof Q[k]=="function")H(Q[k]);else if("instance"in Q){var W=Q.instance;H(function(){return W})}else"viewModel"in Q?b(z,Q.viewModel,H):z("Unknown viewModel value: "+Q)}function T(z){switch(A.a.R(z)){case"script":return A.a.ua(z.text);case"textarea":return A.a.ua(z.value);case"template":if(B(z.content))return A.a.Ca(z.content.childNodes)}return A.a.Ca(z.childNodes)}function B(z){return t.DocumentFragment?z instanceof DocumentFragment:z&&z.nodeType===11}function R(z,Q,H){typeof Q.require=="string"?a||t.require?(a||t.require)([Q.require],function(W){W&&typeof W=="object"&&W.Xd&&W.default&&(W=W.default),H(W)}):z("Uses require, but no AMD loader is present"):H(Q)}function O(z){return function(Q){throw Error("Component '"+z+"': "+Q)}}var U={};A.j.register=function(z,Q){if(!Q)throw Error("Invalid configuration for "+z);if(A.j.tb(z))throw Error("Component "+z+" is already registered");U[z]=Q},A.j.tb=function(z){return Object.prototype.hasOwnProperty.call(U,z)},A.j.unregister=function(z){delete U[z],A.j.Bc(z)},A.j.Fc={getConfig:function(z,Q){Q(A.j.tb(z)?U[z]:null)},loadComponent:function(z,Q,H){var W=O(z);R(W,Q,function(Z){p(z,W,Z,H)})},loadTemplate:function(z,Q,H){if(z=O(z),typeof Q=="string")H(A.a.ua(Q));else if(Q instanceof Array)H(Q);else if(B(Q))H(A.a.la(Q.childNodes));else if(Q.element)if(Q=Q.element,t.HTMLElement?Q instanceof HTMLElement:Q&&Q.tagName&&Q.nodeType===1)H(T(Q));else if(typeof Q=="string"){var W=n.getElementById(Q);W?H(T(W)):z("Cannot find element with ID "+Q)}else z("Unknown element type: "+Q);else z("Unknown template value: "+Q)},loadViewModel:function(z,Q,H){b(O(z),Q,H)}};var k="createViewModel";A.b("components.register",A.j.register),A.b("components.isRegistered",A.j.tb),A.b("components.unregister",A.j.unregister),A.b("components.defaultLoader",A.j.Fc),A.j.loaders.push(A.j.Fc),A.j.dd=U})(),(function(){function p(T,B){var R=T.getAttribute("params");if(R){var R=b.parseBindingsString(R,B,T,{valueAccessors:!0,bindingParams:!0}),R=A.a.Ga(R,function(k){return A.o(k,null,{l:T})}),O=A.a.Ga(R,function(k){var z=k.v();return k.ja()?A.o({read:function(){return A.a.f(k())},write:A.Za(z)&&function(Q){k()(Q)},l:T}):z});return Object.prototype.hasOwnProperty.call(O,"$raw")||(O.$raw=R),O}return{$raw:{}}}A.j.getComponentNameForNode=function(T){var B=A.a.R(T);if(A.j.tb(B)&&(B.indexOf("-")!=-1||""+T=="[object HTMLUnknownElement]"||8>=A.a.W&&T.tagName===B))return B},A.j.tc=function(T,B,R,O){if(B.nodeType===1){var U=A.j.getComponentNameForNode(B);if(U){if(T=T||{},T.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:U,params:p(B,R)};T.component=O?function(){return k}:k}}return T};var b=new A.ga;9>A.a.W&&(A.j.register=(function(T){return function(B){return T.apply(this,arguments)}})(A.j.register),n.createDocumentFragment=(function(T){return function(){var B=T(),R=A.j.dd,O;for(O in R);return B}})(n.createDocumentFragment))})(),(function(){function p(B,R,O){if(R=R.template,!R)throw Error("Component '"+B+"' has no template");B=A.a.Ca(R),A.h.va(O,B)}function b(B,R,O){var U=B.createViewModel;return U?U.call(B,R,O):R}var T=0;A.c.component={init:function(B,R,O,U,k){function z(){var Y=Q&&Q.dispose;typeof Y=="function"&&Y.call(Q),W&&W.s(),H=Q=W=null}var Q,H,W,Z=A.a.la(A.h.childNodes(B));return A.h.Ea(B),A.a.K.za(B,z),A.o(function(){var Y=A.a.f(R()),$,K;if(typeof Y=="string"?$=Y:($=A.a.f(Y.name),K=A.a.f(Y.params)),!$)throw Error("No component name specified");var fe=A.i.Cb(B,k),ge=H=++T;A.j.get($,function(ne){if(H===ge){if(z(),!ne)throw Error("Unknown component '"+$+"'");p($,ne,B);var Ce=b(ne,K,{element:B,templateNodes:Z});ne=fe.createChildContext(Ce,{extend:function(ye){ye.$component=Ce,ye.$componentTemplateNodes=Z}}),Ce&&Ce.koDescendantsComplete&&(W=A.i.subscribe(B,A.i.pa,Ce.koDescendantsComplete,Ce)),Q=Ce,A.Oa(ne,B)}})},null,{l:B}),{controlsDescendantBindings:!0}}},A.h.ea.component=!0})();var N={class:"className",for:"htmlFor"};A.c.attr={update:function(p,b){var T=A.a.f(b())||{};A.a.P(T,function(B,R){R=A.a.f(R);var O=B.indexOf(":"),O="lookupNamespaceURI"in p&&0<O&&p.lookupNamespaceURI(B.substr(0,O)),U=R===!1||R===null||R===e;U?O?p.removeAttributeNS(O,B):p.removeAttribute(B):R=R.toString(),8>=A.a.W&&B in N?(B=N[B],U?p.removeAttribute(B):p[B]=R):U||(O?p.setAttributeNS(O,B,R):p.setAttribute(B,R)),B==="name"&&A.a.Yc(p,U?"":R)})}},(function(){A.c.checked={after:["value","attr"],init:function(p,b,T){function B(){var Y=p.checked,$=O();if(!A.S.Ya()&&(Y||!k&&!A.S.qa())){var K=A.u.G(b);if(Q){var fe=H?K.v():K,ge=Z;Z=$,ge!==$?Y&&(A.a.Na(fe,$,!0),A.a.Na(fe,ge,!1)):A.a.Na(fe,$,Y),H&&A.Za(K)&&K(fe)}else U&&($===e?$=Y:Y||($=e)),A.m.eb(K,T,"checked",$,!0)}}function R(){var Y=A.a.f(b()),$=O();Q?(p.checked=0<=A.a.A(Y,$),Z=$):p.checked=U&&$===e?!!Y:O()===Y}var O=A.xb(function(){if(T.has("checkedValue"))return A.a.f(T.get("checkedValue"));if(W)return T.has("value")?A.a.f(T.get("value")):p.value}),U=p.type=="checkbox",k=p.type=="radio";if(U||k){var z=b(),Q=U&&A.a.f(z)instanceof Array,H=!(Q&&z.push&&z.splice),W=k||Q,Z=Q?O():e;k&&!p.name&&A.c.uniqueName.init(p,function(){return!0}),A.o(B,null,{l:p}),A.a.B(p,"click",B),A.o(R,null,{l:p}),z=e}}},A.m.wa.checked=!0,A.c.checkedValue={update:function(p,b){p.value=A.a.f(b())}}})(),A.c.class={update:function(p,b){var T=A.a.Db(A.a.f(b()));A.a.Eb(p,p.__ko__cssValue,!1),p.__ko__cssValue=T,A.a.Eb(p,T,!0)}},A.c.css={update:function(p,b){var T=A.a.f(b());T!==null&&typeof T=="object"?A.a.P(T,function(B,R){R=A.a.f(R),A.a.Eb(p,B,R)}):A.c.class.update(p,b)}},A.c.enable={update:function(p,b){var T=A.a.f(b());T&&p.disabled?p.removeAttribute("disabled"):T||p.disabled||(p.disabled=!0)}},A.c.disable={update:function(p,b){A.c.enable.update(p,function(){return!A.a.f(b())})}},A.c.event={init:function(p,b,T,B,R){var O=b()||{};A.a.P(O,function(U){typeof U=="string"&&A.a.B(p,U,function(k){var z,Q=b()[U];if(Q){try{var H=A.a.la(arguments);B=R.$data,H.unshift(B),z=Q.apply(B,H)}finally{z!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}T.get(U+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},A.c.foreach={Rc:function(p){return function(){var b=p(),T=A.a.bc(b);return!T||typeof T.length=="number"?{foreach:b,templateEngine:A.ba.Ma}:(A.a.f(b),{foreach:T.data,as:T.as,noChildContext:T.noChildContext,includeDestroyed:T.includeDestroyed,afterAdd:T.afterAdd,beforeRemove:T.beforeRemove,afterRender:T.afterRender,beforeMove:T.beforeMove,afterMove:T.afterMove,templateEngine:A.ba.Ma})}},init:function(p,b){return A.c.template.init(p,A.c.foreach.Rc(b))},update:function(p,b,T,B,R){return A.c.template.update(p,A.c.foreach.Rc(b),T,B,R)}},A.m.Ra.foreach=!1,A.h.ea.foreach=!0,A.c.hasfocus={init:function(p,b,T){function B(U){p.__ko_hasfocusUpdating=!0;var k=p.ownerDocument;if("activeElement"in k){var z;try{z=k.activeElement}catch{z=k.body}U=z===p}k=b(),A.m.eb(k,T,"hasfocus",U,!0),p.__ko_hasfocusLastValue=U,p.__ko_hasfocusUpdating=!1}var R=B.bind(null,!0),O=B.bind(null,!1);A.a.B(p,"focus",R),A.a.B(p,"focusin",R),A.a.B(p,"blur",O),A.a.B(p,"focusout",O),p.__ko_hasfocusLastValue=!1},update:function(p,b){var T=!!A.a.f(b());p.__ko_hasfocusUpdating||p.__ko_hasfocusLastValue===T||(T?p.focus():p.blur(),!T&&p.__ko_hasfocusLastValue&&p.ownerDocument.body.focus(),A.u.G(A.a.Fb,null,[p,T?"focusin":"focusout"]))}},A.m.wa.hasfocus=!0,A.c.hasFocus=A.c.hasfocus,A.m.wa.hasFocus="hasfocus",A.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(p,b){A.a.fc(p,b())}},(function(){function p(b,T,B){A.c[b]={init:function(R,O,U,k,z){var Q,H,W={},Z,Y,$;if(T){k=U.get("as");var K=U.get("noChildContext");$=!(k&&K),W={as:k,noChildContext:K,exportDependencies:$}}return Y=(Z=U.get("completeOn")=="render")||U.has(A.i.pa),A.o(function(){var fe=A.a.f(O()),ge=!B!=!fe,ne=!H,Ce;($||ge!==Q)&&(Y&&(z=A.i.Cb(R,z)),ge&&((!T||$)&&(W.dataDependency=A.S.o()),Ce=T?z.createChildContext(typeof fe=="function"?fe:O,W):A.S.qa()?z.extend(null,W):z),ne&&A.S.qa()&&(H=A.a.Ca(A.h.childNodes(R),!0)),ge?(ne||A.h.va(R,A.a.Ca(H)),A.Oa(Ce,R)):(A.h.Ea(R),Z||A.i.ma(R,A.i.H)),Q=ge)},null,{l:R}),{controlsDescendantBindings:!0}}},A.m.Ra[b]=!1,A.h.ea[b]=!0}p("if"),p("ifnot",!1,!0),p("with",!0)})(),A.c.let={init:function(p,b,T,B,R){return b=R.extend(b),A.Oa(b,p),{controlsDescendantBindings:!0}}},A.h.ea.let=!0;var L={};A.c.options={init:function(p){if(A.a.R(p)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<p.length;)p.remove(0);return{controlsDescendantBindings:!0}},update:function(p,b,T){function B(){return A.a.jb(p.options,function(K){return K.selected})}function R(K,fe,ge){var ne=typeof fe;return ne=="function"?fe(K):ne=="string"?K[fe]:ge}function O(K,fe){if(Y&&Q)A.i.ma(p,A.i.H);else if(Z.length){var ge=0<=A.a.A(Z,A.w.M(fe[0]));A.a.Zc(fe[0],ge),Y&&!ge&&A.u.G(A.a.Fb,null,[p,"change"])}}var U=p.multiple,k=p.length!=0&&U?p.scrollTop:null,z=A.a.f(b()),Q=T.get("valueAllowUnset")&&T.has("value"),H=T.get("optionsIncludeDestroyed");b={};var W,Z=[];Q||(U?Z=A.a.Mb(B(),A.w.M):0<=p.selectedIndex&&Z.push(A.w.M(p.options[p.selectedIndex]))),z&&(typeof z.length>"u"&&(z=[z]),W=A.a.jb(z,function(K){return H||K===e||K===null||!A.a.f(K._destroy)}),T.has("optionsCaption")&&(z=A.a.f(T.get("optionsCaption")),z!==null&&z!==e&&W.unshift(L)));var Y=!1;if(b.beforeRemove=function(K){p.removeChild(K)},z=O,T.has("optionsAfterRender")&&typeof T.get("optionsAfterRender")=="function"&&(z=function(K,fe){O(0,fe),A.u.G(T.get("optionsAfterRender"),null,[fe[0],K!==L?K:e])}),A.a.ec(p,W,function(K,fe,ge){return ge.length&&(Z=!Q&&ge[0].selected?[A.w.M(ge[0])]:[],Y=!0),fe=p.ownerDocument.createElement("option"),K===L?(A.a.Bb(fe,T.get("optionsCaption")),A.w.cb(fe,e)):(ge=R(K,T.get("optionsValue"),K),A.w.cb(fe,A.a.f(ge)),K=R(K,T.get("optionsText"),ge),A.a.Bb(fe,K)),[fe]},b,z),!Q){var $;U?$=Z.length&&B().length<Z.length:$=Z.length&&0<=p.selectedIndex?A.w.M(p.options[p.selectedIndex])!==Z[0]:Z.length||0<=p.selectedIndex,$&&A.u.G(A.a.Fb,null,[p,"change"])}(Q||A.S.Ya())&&A.i.ma(p,A.i.H),A.a.wd(p),k&&20<Math.abs(k-p.scrollTop)&&(p.scrollTop=k)}},A.c.options.$b=A.a.g.Z(),A.c.selectedOptions={init:function(p,b,T){function B(){var U=b(),k=[];A.a.D(p.getElementsByTagName("option"),function(z){z.selected&&k.push(A.w.M(z))}),A.m.eb(U,T,"selectedOptions",k)}function R(){var U=A.a.f(b()),k=p.scrollTop;U&&typeof U.length=="number"&&A.a.D(p.getElementsByTagName("option"),function(z){var Q=0<=A.a.A(U,A.w.M(z));z.selected!=Q&&A.a.Zc(z,Q)}),p.scrollTop=k}if(A.a.R(p)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var O;A.i.subscribe(p,A.i.H,function(){O?B():(A.a.B(p,"change",B),O=A.o(R,null,{l:p}))},null,{notifyImmediately:!0})},update:function(){}},A.m.wa.selectedOptions=!0,A.c.style={update:function(p,b){var T=A.a.f(b()||{});A.a.P(T,function(B,R){if(R=A.a.f(R),(R===null||R===e||R===!1)&&(R=""),o)o(p).css(B,R);else if(/^--/.test(B))p.style.setProperty(B,R);else{B=B.replace(/-(\w)/g,function(U,k){return k.toUpperCase()});var O=p.style[B];p.style[B]=R,R===O||p.style[B]!=O||isNaN(R)||(p.style[B]=R+"px")}})}},A.c.submit={init:function(p,b,T,B,R){if(typeof b()!="function")throw Error("The value for a submit binding must be a function");A.a.B(p,"submit",function(O){var U,k=b();try{U=k.call(R.$data,p)}finally{U!==!0&&(O.preventDefault?O.preventDefault():O.returnValue=!1)}})}},A.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(p,b){A.a.Bb(p,b())}},A.h.ea.text=!0,(function(){if(t&&t.navigator){var p=function(W){if(W)return parseFloat(W[1])},b=t.navigator.userAgent,T,B,R,O,U;(T=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(U=p(b.match(/Edge\/([^ ]+)$/)))||p(b.match(/Chrome\/([^ ]+)/))||(B=p(b.match(/Version\/([^ ]+) Safari/)))||(R=p(b.match(/Firefox\/([^ ]+)/)))||(O=A.a.W||p(b.match(/MSIE ([^ ]+)/)))||(O=p(b.match(/rv:([^ )]+)/)))}if(8<=O&&10>O)var k=A.a.g.Z(),z=A.a.g.Z(),Q=function(W){var Z=this.activeElement;(Z=Z&&A.a.g.get(Z,z))&&Z(W)},H=function(W,Z){var Y=W.ownerDocument;A.a.g.get(Y,k)||(A.a.g.set(Y,k,!0),A.a.B(Y,"selectionchange",Q)),A.a.g.set(W,z,Z)};A.c.textInput={init:function(W,Z,Y){function $(Ne,ke){A.a.B(W,Ne,ke)}function K(){var Ne=A.a.f(Z());(Ne===null||Ne===e)&&(Ne=""),ye!==e&&Ne===ye?A.a.setTimeout(K,4):W.value!==Ne&&(be=!0,W.value=Ne,be=!1,ne=W.value)}function fe(){Ce||(ye=W.value,Ce=A.a.setTimeout(ge,4))}function ge(){clearTimeout(Ce),ye=Ce=e;var Ne=W.value;ne!==Ne&&(ne=Ne,A.m.eb(Z(),Y,"textInput",Ne))}var ne=W.value,Ce,ye,De=A.a.W==9?fe:ge,be=!1;O&&$("keypress",ge),11>O&&$("propertychange",function(Ne){be||Ne.propertyName!=="value"||De(Ne)}),O==8&&($("keyup",ge),$("keydown",ge)),H&&(H(W,De),$("dragend",fe)),(!O||9<=O)&&$("input",De),5>B&&A.a.R(W)==="textarea"?($("keydown",fe),$("paste",fe),$("cut",fe)):11>T?$("keydown",fe):4>R?($("DOMAutoComplete",ge),$("dragdrop",ge),$("drop",ge)):U&&W.type==="number"&&$("keydown",fe),$("change",ge),$("blur",ge),A.o(K,null,{l:W})}},A.m.wa.textInput=!0,A.c.textinput={preprocess:function(W,Z,Y){Y("textInput",W)}}})(),A.c.uniqueName={init:function(p,b){if(b()){var T="ko_unique_"+ ++A.c.uniqueName.rd;A.a.Yc(p,T)}}},A.c.uniqueName.rd=0,A.c.using={init:function(p,b,T,B,R){var O;return T.has("as")&&(O={as:T.get("as"),noChildContext:T.get("noChildContext")}),b=R.createChildContext(b,O),A.Oa(b,p),{controlsDescendantBindings:!0}}},A.h.ea.using=!0,A.c.value={init:function(p,b,T){var B=A.a.R(p),R=B=="input";if(!R||p.type!="checkbox"&&p.type!="radio"){var O=[],U=T.get("valueUpdate"),k=!1,z=null;U&&(typeof U=="string"?O=[U]:O=A.a.wc(U),A.a.Pa(O,"change"));var Q=function(){z=null,k=!1;var Z=b(),Y=A.w.M(p);A.m.eb(Z,T,"value",Y)};!A.a.W||!R||p.type!="text"||p.autocomplete=="off"||p.form&&p.form.autocomplete=="off"||A.a.A(O,"propertychange")!=-1||(A.a.B(p,"propertychange",function(){k=!0}),A.a.B(p,"focus",function(){k=!1}),A.a.B(p,"blur",function(){k&&Q()})),A.a.D(O,function(Z){var Y=Q;A.a.Ud(Z,"after")&&(Y=function(){z=A.w.M(p),A.a.setTimeout(Q,0)},Z=Z.substring(5)),A.a.B(p,Z,Y)});var H;if(H=R&&p.type=="file"?function(){var Z=A.a.f(b());Z===null||Z===e||Z===""?p.value="":A.u.G(Q)}:function(){var Z=A.a.f(b()),Y=A.w.M(p);z!==null&&Z===z?A.a.setTimeout(H,0):(Z!==Y||Y===e)&&(B==="select"?(Y=T.get("valueAllowUnset"),A.w.cb(p,Z,Y),Y||Z===A.w.M(p)||A.u.G(Q)):A.w.cb(p,Z))},B==="select"){var W;A.i.subscribe(p,A.i.H,function(){W?T.get("valueAllowUnset")?H():Q():(A.a.B(p,"change",Q),W=A.o(H,null,{l:p}))},null,{notifyImmediately:!0})}else A.a.B(p,"change",Q),A.o(H,null,{l:p})}else A.ib(p,{checkedValue:b})},update:function(){}},A.m.wa.value=!0,A.c.visible={update:function(p,b){var T=A.a.f(b()),B=p.style.display!="none";T&&!B?p.style.display="":!T&&B&&(p.style.display="none")}},A.c.hidden={update:function(p,b){A.c.visible.update(p,function(){return!A.a.f(b())})}},(function(p){A.c[p]={init:function(b,T,B,R,O){return A.c.event.init.call(this,b,function(){var U={};return U[p]=T(),U},B,R,O)}}})("click"),A.ca=function(){},A.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},A.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},A.ca.prototype.makeTemplateSource=function(p,b){if(typeof p=="string"){b=b||n;var T=b.getElementById(p);if(!T)throw Error("Cannot find template with ID "+p);return new A.C.F(T)}if(p.nodeType==1||p.nodeType==8)return new A.C.ia(p);throw Error("Unknown template type: "+p)},A.ca.prototype.renderTemplate=function(p,b,T,B){return p=this.makeTemplateSource(p,B),this.renderTemplateSource(p,b,T,B)},A.ca.prototype.isTemplateRewritten=function(p,b){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(p,b).data("isRewritten")},A.ca.prototype.rewriteTemplate=function(p,b,T){p=this.makeTemplateSource(p,T),b=b(p.text()),p.text(b),p.data("isRewritten",!0)},A.b("templateEngine",A.ca),A.kc=(function(){function p(B,R,O,U){B=A.m.ac(B);for(var k=A.m.Ra,z=0;z<B.length;z++){var Q=B[z].key;if(Object.prototype.hasOwnProperty.call(k,Q)){var H=k[Q];if(typeof H=="function"){if(Q=H(B[z].value))throw Error(Q)}else if(!H)throw Error("This template engine does not support the '"+Q+"' binding within its templates")}}return O="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+A.m.vb(B,{valueAccessors:!0})+" } })()},'"+O.toLowerCase()+"')",U.createJavaScriptEvaluatorBlock(O)+R}var b=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,T=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(B,R,O){R.isTemplateRewritten(B,O)||R.rewriteTemplate(B,function(U){return A.kc.Ld(U,R)},O)},Ld:function(B,R){return B.replace(b,function(O,U,k,z,Q){return p(Q,U,k,R)}).replace(T,function(O,U){return p(U,"<!-- ko -->","#comment",R)})},md:function(B,R){return A.aa.Xb(function(O,U){var k=O.nextSibling;k&&k.nodeName.toLowerCase()===R&&A.ib(k,B,U)})}}})(),A.b("__tr_ambtns",A.kc.md),(function(){A.C={},A.C.F=function(T){if(this.F=T){var B=A.a.R(T);this.ab=B==="script"?1:B==="textarea"?2:B=="template"&&T.content&&T.content.nodeType===11?3:4}},A.C.F.prototype.text=function(){var T=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[T];var B=arguments[0];T==="innerHTML"?A.a.fc(this.F,B):this.F[T]=B};var p=A.a.g.Z()+"_";A.C.F.prototype.data=function(T){if(arguments.length===1)return A.a.g.get(this.F,p+T);A.a.g.set(this.F,p+T,arguments[1])};var b=A.a.g.Z();A.C.F.prototype.nodes=function(){var T=this.F;if(arguments.length==0){var B=A.a.g.get(T,b)||{},R=B.lb||(this.ab===3?T.content:this.ab===4?T:e);if(!R||B.jd){var O=this.text();O&&O!==B.bb&&(R=A.a.Md(O,T.ownerDocument),A.a.g.set(T,b,{lb:R,bb:O,jd:!0}))}return R}B=arguments[0],this.ab!==e&&this.text(""),A.a.g.set(T,b,{lb:B})},A.C.ia=function(T){this.F=T},A.C.ia.prototype=new A.C.F,A.C.ia.prototype.constructor=A.C.ia,A.C.ia.prototype.text=function(){if(arguments.length==0){var T=A.a.g.get(this.F,b)||{};return T.bb===e&&T.lb&&(T.bb=T.lb.innerHTML),T.bb}A.a.g.set(this.F,b,{bb:arguments[0]})},A.b("templateSources",A.C),A.b("templateSources.domElement",A.C.F),A.b("templateSources.anonymousTemplate",A.C.ia)})(),(function(){function p(z,Q,H){var W;for(Q=A.h.nextSibling(Q);z&&(W=z)!==Q;)z=A.h.nextSibling(W),H(W,z)}function b(z,Q){if(z.length){var H=z[0],W=z[z.length-1],Z=H.parentNode,Y=A.ga.instance,$=Y.preprocessNode;if($){if(p(H,W,function(K,fe){var ge=K.previousSibling,ne=$.call(Y,K);ne&&(K===H&&(H=ne[0]||fe),K===W&&(W=ne[ne.length-1]||ge))}),z.length=0,!H)return;H===W?z.push(H):(z.push(H,W),A.a.Ua(z,Z))}p(H,W,function(K){K.nodeType!==1&&K.nodeType!==8||A.vc(Q,K)}),p(H,W,function(K){K.nodeType!==1&&K.nodeType!==8||A.aa.cd(K,[Q])}),A.a.Ua(z,Z)}}function T(z){return z.nodeType?z:0<z.length?z[0]:null}function B(z,Q,H,W,Z){Z=Z||{};var Y=(z&&T(z)||H||{}).ownerDocument,$=Z.templateEngine||O;if(A.kc.xd(H,$,Y),H=$.renderTemplate(H,W,Z,Y),typeof H.length!="number"||0<H.length&&typeof H[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(Y=!1,Q){case"replaceChildren":A.h.va(z,H),Y=!0;break;case"replaceNode":A.a.Xc(z,H),Y=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+Q)}return Y&&(b(H,W),Z.afterRender&&A.u.G(Z.afterRender,null,[H,W[Z.as||"$data"]]),Q=="replaceChildren"&&A.i.ma(z,A.i.H)),H}function R(z,Q,H){return A.O(z)?z():typeof z=="function"?z(Q,H):z}var O;A.gc=function(z){if(z!=e&&!(z instanceof A.ca))throw Error("templateEngine must inherit from ko.templateEngine");O=z},A.dc=function(z,Q,H,W,Z){if(H=H||{},(H.templateEngine||O)==e)throw Error("Set a template engine before calling renderTemplate");if(Z=Z||"replaceChildren",W){var Y=T(W);return A.$(function(){var K=Q&&Q instanceof A.fa?Q:new A.fa(Q,null,null,null,{exportDependencies:!0}),$=R(z,K.$data,K),K=B(W,Z,$,K,H);Z=="replaceNode"&&(W=K,Y=T(W))},null,{Sa:function(){return!Y||!A.a.Sb(Y)},l:Y&&Z=="replaceNode"?Y.parentNode:Y})}return A.aa.Xb(function($){A.dc(z,Q,H,$,"replaceNode")})},A.Qd=function(z,Q,H,W,Z){function Y(ye,De){A.u.G(A.a.ec,null,[W,ye,K,H,$,De]),A.i.ma(W,A.i.H)}function $(ye,De){b(De,fe),H.afterRender&&H.afterRender(De,ye),fe=null}function K(ye,De){fe=Z.createChildContext(ye,{as:ge,noChildContext:H.noChildContext,extend:function(Ne){Ne.$index=De,ge&&(Ne[ge+"Index"]=De)}});var be=R(z,ye,fe);return B(W,"ignoreTargetNode",be,fe,H)}var fe,ge=H.as,ne=H.includeDestroyed===!1||A.options.foreachHidesDestroyed&&!H.includeDestroyed;if(ne||H.beforeRemove||!A.Pc(Q))return A.$(function(){var ye=A.a.f(Q)||[];typeof ye.length>"u"&&(ye=[ye]),ne&&(ye=A.a.jb(ye,function(De){return De===e||De===null||!A.a.f(De._destroy)})),Y(ye)},null,{l:W});Y(Q.v());var Ce=Q.subscribe(function(ye){Y(Q(),ye)},null,"arrayChange");return Ce.l(W),Ce};var U=A.a.g.Z(),k=A.a.g.Z();A.c.template={init:function(z,Q){var H=A.a.f(Q());if(typeof H=="string"||"name"in H)A.h.Ea(z);else if("nodes"in H){if(H=H.nodes||[],A.O(H))throw Error('The "nodes" option must be a plain, non-observable array.');var W=H[0]&&H[0].parentNode;W&&A.a.g.get(W,k)||(W=A.a.Yb(H),A.a.g.set(W,k,!0)),new A.C.ia(z).nodes(W)}else if(H=A.h.childNodes(z),0<H.length)W=A.a.Yb(H),new A.C.ia(z).nodes(W);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(z,Q,H,W,Z){var Y=Q();Q=A.a.f(Y),H=!0,W=null,typeof Q=="string"?Q={}:(Y="name"in Q?Q.name:z,"if"in Q&&(H=A.a.f(Q.if)),H&&"ifnot"in Q&&(H=!A.a.f(Q.ifnot)),H&&!Y&&(H=!1)),"foreach"in Q?W=A.Qd(Y,H&&Q.foreach||[],Q,z,Z):H?(H=Z,"data"in Q&&(H=Z.createChildContext(Q.data,{as:Q.as,noChildContext:Q.noChildContext,exportDependencies:!0})),W=A.dc(Y,H,Q,z)):A.h.Ea(z),Z=W,(Q=A.a.g.get(z,U))&&typeof Q.s=="function"&&Q.s(),A.a.g.set(z,U,!Z||Z.ja&&!Z.ja()?e:Z)}},A.m.Ra.template=function(z){return z=A.m.ac(z),z.length==1&&z[0].unknown||A.m.Id(z,"name")?null:"This template engine does not support anonymous templates nested within its templates"},A.h.ea.template=!0})(),A.b("setTemplateEngine",A.gc),A.b("renderTemplate",A.dc),A.a.Kc=function(p,b,T){if(p.length&&b.length){var B,R,O,U,k;for(B=R=0;(!T||B<T)&&(U=p[R]);++R){for(O=0;k=b[O];++O)if(U.value===k.value){U.moved=k.index,k.moved=U.index,b.splice(O,1),B=O=0;break}B+=O}}},A.a.Pb=(function(){function p(b,T,B,R,O){var U=Math.min,k=Math.max,z=[],Q,H=b.length,W,Z=T.length,Y=Z-H||1,$=H+Z+1,K,fe,ge;for(Q=0;Q<=H;Q++)for(fe=K,z.push(K=[]),ge=U(Z,Q+Y),W=k(0,Q-1);W<=ge;W++)K[W]=W?Q?b[Q-1]===T[W-1]?fe[W-1]:U(fe[W]||$,K[W-1]||$)+1:W+1:Q+1;for(U=[],k=[],Y=[],Q=H,W=Z;Q||W;)Z=z[Q][W]-1,W&&Z===z[Q][W-1]?k.push(U[U.length]={status:B,value:T[--W],index:W}):Q&&Z===z[Q-1][W]?Y.push(U[U.length]={status:R,value:b[--Q],index:Q}):(--W,--Q,O.sparse||U.push({status:"retained",value:T[W]}));return A.a.Kc(Y,k,!O.dontLimitMoves&&10*H),U.reverse()}return function(b,T,B){return B=typeof B=="boolean"?{dontLimitMoves:B}:B||{},b=b||[],T=T||[],b.length<T.length?p(b,T,"added","deleted",B):p(T,b,"deleted","added",B)}})(),A.b("utils.compareArrays",A.a.Pb),(function(){function p(B,R,O,U,k){var z=[],Q=A.$(function(){var H=R(O,k,A.a.Ua(z,B))||[];0<z.length&&(A.a.Xc(z,H),U&&A.u.G(U,null,[O,H,k])),z.length=0,A.a.Nb(z,H)},null,{l:B,Sa:function(){return!A.a.kd(z)}});return{Y:z,$:Q.ja()?Q:e}}var b=A.a.g.Z(),T=A.a.g.Z();A.a.ec=function(B,R,O,U,k,z){function Q(Wt){be={Aa:Wt,pb:A.ta(fe++)},$.push(be),Y||De.push(be)}function H(Wt){be=Z[Wt],fe!==be.pb.v()&&ye.push(be),be.pb(fe++),A.a.Ua(be.Y,B),$.push(be)}function W(Wt,Qn){if(Wt)for(var on=0,lt=Qn.length;on<lt;on++)A.a.D(Qn[on].Y,function(Nt){Wt(Nt,on,Qn[on].Aa)})}R=R||[],typeof R.length>"u"&&(R=[R]),U=U||{};var Z=A.a.g.get(B,b),Y=!Z,$=[],K=0,fe=0,ge=[],ne=[],Ce=[],ye=[],De=[],be,Ne=0;if(Y)A.a.D(R,Q);else{if(!z||Z&&Z._countWaitingForRemove){var ke=A.a.Mb(Z,function(Wt){return Wt.Aa});z=A.a.Pb(ke,R,{dontLimitMoves:U.dontLimitMoves,sparse:!0})}for(var ke=0,Ue,He,Et;Ue=z[ke];ke++)switch(He=Ue.moved,Et=Ue.index,Ue.status){case"deleted":for(;K<Et;)H(K++);He===e&&(be=Z[K],be.$&&(be.$.s(),be.$=e),A.a.Ua(be.Y,B).length&&(U.beforeRemove&&($.push(be),Ne++,be.Aa===T?be=null:Ce.push(be)),be&&ge.push.apply(ge,be.Y))),K++;break;case"added":for(;fe<Et;)H(K++);He!==e?(ne.push($.length),H(He)):Q(Ue.value)}for(;fe<R.length;)H(K++);$._countWaitingForRemove=Ne}A.a.g.set(B,b,$),W(U.beforeMove,ye),A.a.D(ge,U.beforeRemove?A.oa:A.removeNode);var Ye,nt,Ct;try{Ct=B.ownerDocument.activeElement}catch{}if(ne.length)for(;(ke=ne.shift())!=e;){for(be=$[ke],Ye=e;ke;)if((nt=$[--ke].Y)&&nt.length){Ye=nt[nt.length-1];break}for(R=0;K=be.Y[R];Ye=K,R++)A.h.Wb(B,K,Ye)}for(ke=0;be=$[ke];ke++){for(be.Y||A.a.extend(be,p(B,O,be.Aa,k,be.pb)),R=0;K=be.Y[R];Ye=K,R++)A.h.Wb(B,K,Ye);!be.Ed&&k&&(k(be.Aa,be.Y,be.pb),be.Ed=!0,Ye=be.Y[be.Y.length-1])}for(Ct&&B.ownerDocument.activeElement!=Ct&&Ct.focus(),W(U.beforeRemove,Ce),ke=0;ke<Ce.length;++ke)Ce[ke].Aa=T;W(U.afterMove,ye),W(U.afterAdd,De)}})(),A.b("utils.setDomNodeChildrenFromArrayMapping",A.a.ec),A.ba=function(){this.allowTemplateRewriting=!1},A.ba.prototype=new A.ca,A.ba.prototype.constructor=A.ba,A.ba.prototype.renderTemplateSource=function(p,b,T,B){return(b=!(9>A.a.W)&&p.nodes?p.nodes():null)?A.a.la(b.cloneNode(!0).childNodes):(p=p.text(),A.a.ua(p,B))},A.ba.Ma=new A.ba,A.gc(A.ba.Ma),A.b("nativeTemplateEngine",A.ba),(function(){A.$a=function(){var b=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(T,B,R,O){if(O=O||n,R=R||{},2>b)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var U=T.data("precompiled");return U||(U=T.text()||"",U=o.template(null,"{{ko_with $item.koBindingContext}}"+U+"{{/ko_with}}"),T.data("precompiled",U)),T=[B.$data],B=o.extend({koBindingContext:B},R.templateOptions),B=o.tmpl(U,T,B),B.appendTo(O.createElement("div")),o.fragments={},B},this.createJavaScriptEvaluatorBlock=function(T){return"{{ko_code ((function() { return "+T+" })()) }}"},this.addTemplate=function(T,B){n.write("<script type='text/html' id='"+T+"'>"+B+"</script>")},0<b&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},A.$a.prototype=new A.ca,A.$a.prototype.constructor=A.$a;var p=new A.$a;0<p.Hd&&A.gc(p),A.b("jqueryTmplTemplateEngine",A.$a)})()})})()})()})();var KNt=ko;typeof window<"u"?(ko=window.ko,typeof DU<"u"?window.ko=DU:delete window.ko):(ko=global.ko,typeof DU<"u"?global.ko=DU:delete global.ko);var kb=KNt;/**
* @license
* Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
* Copyright (c) Steve Sanderson
* MIT license
*/var Mte="__knockoutObservables",Nte="__knockoutSubscribable";function Rwe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=Mwe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Mte||o===Nte)&&!(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&&XNt(n,a)}}),e}function Mwe(e,t){var n=e[Mte];return!n&&t&&(n={},Object.defineProperty(e,Mte,{value:n})),n}function JNt(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),Rwe.call(i,e,[t]),e}function XNt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=ZNt(e,t,i))})}function ZNt(e,t,n){var i=$Nt(e,n);return i.subscribe(t)}function $Nt(e,t){var n=t[Nte];if(!n){n=new e.subscribable,Object.defineProperty(t,Nte,{value:n});var i={};eLt(t,n,i),tLt(e,t,n,i)}return n}function eLt(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 tLt(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 Nwe(e,t){if(!e)return null;var n=Mwe(e,!1);return n&&n[t]||null}function nLt(e,t){var n=Nwe(e,t);n&&n.valueHasMutated()}function iLt(e){e.track=Rwe,e.getObservable=Nwe,e.valueHasMutated=nLt,e.defineProperty=JNt}var vU={attachToKo:iLt};var Lwe="http://www.w3.org/2000/svg",Owe="cesium-svgPath-svg",oLt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(Lwe,"svg:svg");i.setAttribute("class",Owe);let o=document.createElementNS(Lwe,"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",`${Owe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},PU=oLt;vU.attachToKo(kb);PU.register(kb);var xe=kb;function RU(e){l(e)||(e=new lA),this._clock=e,this._eventHelper=new kr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=xe.observable(J.now()),this.systemTime.equalityComparer=J.equals,this.startTime=xe.observable(e.startTime),this.startTime.equalityComparer=J.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=xe.observable(e.stopTime),this.stopTime.equalityComparer=J.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=xe.observable(e.currentTime),this.currentTime.equalityComparer=J.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=xe.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=xe.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=xe.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=xe.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=xe.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),xe.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(RU.prototype,{clock:{get:function(){return this._clock}}});RU.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};RU.prototype.isDestroyed=function(){return!1};RU.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var MU=RU;function rLt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,Ae.throwInstantiationError()}var Lte=rLt;var Aw={};Aw.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};Aw.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};Aw.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 u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};Aw.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};Aw.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 Gu=Aw;function Fwe(e,t){this._command=e,t=t??V.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",xe.track(this,["toggled","tooltip"])}Object.defineProperties(Fwe.prototype,{command:{get:function(){return this._command}}});var Xy=Fwe;function sLt(e,t){t=t??!0;let n=new _e,i=new _e;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,xe.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Dn=sLt;function aLt(e,t,n,i,o){return n.call(i,e[t]),xe.getObservable(e,t).subscribe(n,i,o)}var uc=aLt;var Ub="http://www.w3.org/2000/svg",Uwe="http://www.w3.org/1999/xlink",r9,NU=G.fromCssColorString("rgba(247,250,255,0.384)"),s9=G.fromCssColorString("rgba(143,191,255,0.216)"),Ote=G.fromCssColorString("rgba(153,197,255,0.098)"),a9=G.fromCssColorString("rgba(255,255,255,0.086)"),cLt=G.fromCssColorString("rgba(255,255,255,0.267)"),lLt=G.fromCssColorString("rgba(255,255,255,0)"),Qwe=G.fromCssColorString("rgba(66,67,68,0.3)"),kwe=G.fromCssColorString("rgba(0,0,0,0.5)");function Zy(e){return G.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var LU={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 GA(e){let t=document.createElementNS(Ub,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(GA(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(Uwe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Fte(e,t,n){let i=document.createElementNS(Ub,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(Ub,"tspan");return o.textContent=n,i.appendChild(o),i}function uLt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var c9=new G;function Os(e,t){let n=t.alpha,i=1-n;return c9.red=e.red*i+t.red*n,c9.green=e.green*i+t.green*n,c9.blue=e.blue*i+t.blue*n,c9.toCssColorString()}function Qte(e,t,n){let i=LU[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 GA(o)}function fLt(e,t,n){let i=LU[n],o=LU.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 GA(r)}function dLt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&r9!==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,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-a.left,m=u-r-a.top,g=Math.atan2(m,h)*180/Math.PI+90;g>180&&(g-=360);let A=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(r9=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<A?n.slower():g>A&&n.faster(),t.preventDefault()}else e===r9&&(r9=void 0),n.shuttleRingDragging=!1}function B_(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=[uc(t,"toggled",this.setToggled,this),uc(t,"tooltip",this.setTooltip,this),uc(t.command,"canExecute",this.setEnabled,this)]}B_.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();de(this)};B_.prototype.isDestroyed=function(){return!1};B_.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")}};B_.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")))};B_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function mw(e,t){e=On(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(Ub,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",Uwe);let s=document.createElementNS(Ub,"g");this._topG=s,this._realtimeSVG=new B_(fLt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new B_(Qte(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new B_(Qte(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new B_(Qte(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(Ub,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=GA({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=LU.animation_pathSwooshFX,f=LU.animation_pathPointer,h=GA({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=GA({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let m=GA({tagName:"g",transform:"translate(100,100)"});this._knobOuter=GA({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,A=GA({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=Fte(0,-24,""),this._knobTime=Fte(0,-7,""),this._knobStatus=Fte(0,-41,"");let _=GA({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),C=document.createElementNS(Ub,"g");C.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(C),s.appendChild(m),s.appendChild(a),C.appendChild(c),C.appendChild(h),C.appendChild(this._shuttleRingPointer),m.appendChild(this._knobOuter),m.appendChild(A),m.appendChild(this._knobDate),m.appendChild(this._knobTime),m.appendChild(this._knobStatus),m.appendChild(_),r.appendChild(s),e.appendChild(r);let y=this;function E(v){dLt(y,v)}this._mouseCallback=E,c.addEventListener("mousedown",E,!0),c.addEventListener("touchstart",E,!0),h.addEventListener("mousedown",E,!0),h.addEventListener("touchstart",E,!0),n.addEventListener("mousemove",E,!0),n.addEventListener("touchmove",E,!0),n.addEventListener("mouseup",E,!0),n.addEventListener("touchend",E,!0),n.addEventListener("touchcancel",E,!0),this._shuttleRingPointer.addEventListener("mousedown",E,!0),this._shuttleRingPointer.addEventListener("touchstart",E,!0),this._knobOuter.addEventListener("mousedown",E,!0),this._knobOuter.addEventListener("touchstart",E,!0);let I=this._knobTime.childNodes[0],x=this._knobDate.childNodes[0],S=this._knobStatus.childNodes[0],w;this._subscriptions=[uc(t.pauseViewModel,"toggled",function(v){w!==v&&(w=v,w?y._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):y._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),uc(t,"shuttleRingAngle",function(v){uLt(y._shuttleRingPointer,y._knobOuter,v)}),uc(t,"dateLabel",function(v){x.textContent!==v&&(x.textContent=v)}),uc(t,"timeLabel",function(v){I.textContent!==v&&(I.textContent=v)}),uc(t,"multiplierLabel",function(v){S.textContent!==v&&(S.textContent=v)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(mw.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});mw.prototype.isDestroyed=function(){return!1};mw.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 de(this)};mw.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};mw.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=Zy(this._themeNormal),n=Zy(this._themeHover),i=Zy(this._themeSelect),o=Zy(this._themeDisabled),r=Zy(this._themeKnob),s=Zy(this._themePointer),a=Zy(this._themeSwoosh),c=Zy(this._themeSwooshHover),u=GA({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Os(t,NU)},{tagName:"stop",offset:"12%","stop-color":Os(t,s9)},{tagName:"stop",offset:"46%","stop-color":Os(t,Ote)},{tagName:"stop",offset:"81%","stop-color":Os(t,a9)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Os(n,NU)},{tagName:"stop",offset:"12%","stop-color":Os(n,s9)},{tagName:"stop",offset:"46%","stop-color":Os(n,Ote)},{tagName:"stop",offset:"81%","stop-color":Os(n,a9)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Os(i,NU)},{tagName:"stop",offset:"12%","stop-color":Os(i,s9)},{tagName:"stop",offset:"46%","stop-color":Os(i,Ote)},{tagName:"stop",offset:"81%","stop-color":Os(i,a9)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Os(o,cLt)},{tagName:"stop",offset:"75%","stop-color":Os(o,lLt)}]},{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":Os(s,kwe)},{tagName:"stop",offset:"100%","stop-color":Os(s,kwe)}]},{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":Os(r,NU)},{tagName:"stop",offset:"60%","stop-color":Os(r,Qwe)},{tagName:"stop",offset:"85%","stop-color":Os(r,s9)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Os(r,Qwe)},{tagName:"stop",offset:"60%","stop-color":Os(r,NU)},{tagName:"stop",offset:"85%","stop-color":Os(r,a9)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var OU=mw;var hLt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],$y=15,pw=105;function Gwe(e,t){return e-t}function kte(e,t){let n=go(t,e,Gwe);return n<0?~n:n}function ALt(e,t){if(Math.abs(e)<=$y)return e/$y;let n=$y,i=pw,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 mLt(e,t,n){if(n.clockStep===No.SYSTEM_CLOCK)return $y;if(Math.abs(e)<=1)return e*$y;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=$y,r=pw,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 sh(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=sh.defaultDateFormatter,this._timeFormatter=sh.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,xe.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(sh.defaultTicks),this.timeLabel=void 0,xe.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,xe.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,xe.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===No.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,xe.defineProperty(this,"shuttleRingAngle",{get:function(){return mLt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,pw),-pw);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=No.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===pw){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=ALt(s,a);if(t.snapToTicks)u=a[kte(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let h=f.toFixed(0).length-2,m=Math.pow(10,h);u=Math.round(u/m)*m|0}else f>$y?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,xe.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===_s.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,h=!1;if(a===_s.LOOP_STOP)h=J.greaterThan(u,f)||u.equals(f)&&c>0;else{let m=s.stopTime;h=J.greaterThan(u,f)&&J.lessThan(u,m)||u.equals(f)&&c>0||u.equals(m)&&c<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,xe.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===_s.UNBOUNDED)return!0;let c=s.systemTime;return J.greaterThanOrEquals(c,s.startTime)&&J.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,xe.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Dn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Xy(n,{toggled:xe.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Dn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Xy(i,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Dn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Xy(o,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==No.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Dn(function(){t._clockViewModel.clockStep=No.SYSTEM_CLOCK},xe.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Xy(r,{toggled:xe.computed(function(){return e.clockStep===No.SYSTEM_CLOCK}),tooltip:xe.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Dn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=kte(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Dn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=kte(c,a)+1;u<a.length&&(s.multiplier=a[u])})}sh.defaultDateFormatter=function(e,t){let n=J.toGregorianDate(e);return`${hLt[n.month-1]} ${n.day} ${n.year}`};sh.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];sh.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`};sh.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};sh.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(Gwe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);ei(s,r),this._allShuttleRingTicks=s};Object.defineProperties(sh.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}}});sh._maxShuttleRingAngle=pw;sh._realtimeShuttleRingAngle=$y;var FU=sh;function zwe(e){e=e??V.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??V.EMPTY_ARRAY,i=e.terrainProviderViewModels??V.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,xe.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=xe.getObservable(this,"imageryProviderViewModels"),r=xe.pureComputed(function(){let h=o(),m={},g;for(g=0;g<h.length;g++){let C=h[g],y=C.category;l(m[y])?m[y].push(C):m[y]=[C]}let A=Object.keys(m),_=[];for(g=0;g<A.length;g++){let C=A[g];_.push({name:C,providers:m[C]})}return _});this._imageryProviders=r;let s=xe.getObservable(this,"terrainProviderViewModels"),a=xe.pureComputed(function(){let h=s(),m={},g;for(g=0;g<h.length;g++){let C=h[g],y=C.category;l(m[y])?m[y].push(C):m[y]=[C]}let A=Object.keys(m),_=[];for(g=0;g<A.length;g++){let C=A[g];_.push({name:C,providers:m[C]})}return _});this._terrainProviders=a,this.buttonTooltip=void 0,xe.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,m=this.selectedTerrain,g=l(h)?h.name:void 0,A=l(m)?m.name:void 0;return l(g)&&l(A)?`${g}
${A}`:l(g)?g:A}),this.buttonImageUrl=void 0,xe.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=xe.observable();this._currentImageryLayers=[],xe.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let m,g=this._currentImageryLayers,A=g.length,_=this._globe.imageryLayers,C=!1;for(m=0;m<A;m++){let y=_.length;for(let E=0;E<y;E++){let I=_.get(E);if(I===g[m]){_.remove(I),C=!0;break}}}if(l(h)){let y=h.creationCommand();if(Array.isArray(y)){let E=y.length;for(this._currentImageryLayers=[],m=E-1;m>=0;m--){let I=ds.fromProviderAsync(y[m]);_.add(I,0),this._currentImageryLayers.push(I)}}else{this._currentImageryLayers=[];let E=ds.fromProviderAsync(y);if(E.name=h.name,C)_.add(E,0);else{let I=_.get(0);l(I)&&_.remove(I),_.add(E,0)}this._currentImageryLayers.push(E)}}c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=xe.observable();xe.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(h){if(u()===h){this.dropDownVisible=!1;return}let m;if(l(h)&&(m=h.creationCommand()),l(m)&&!l(m.then))this._globe.depthTestAgainstTerrain=!(m instanceof qm),this._globe.terrainProvider=m;else if(l(m)){let g=!1,A=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,A()}),C=new TU(m).readyEvent.addEventListener(y=>{g||(this._globe.depthTestAgainstTerrain=!(y instanceof qm),this._globe.terrainProvider=y,C())})}u(h),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Dn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(zwe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var QU=zwe;function l9(e,t){e=On(e);let n=new QU(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 u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);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; }'),f.appendChild(h);let m=document.createElement("img");m.className="cesium-baseLayerPicker-itemIcon",m.setAttribute("data-bind","attr: { src: iconUrl }"),m.setAttribute("draggable","false"),h.appendChild(m);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),h.appendChild(g);let A=document.createElement("div");A.className="cesium-baseLayerPicker-sectionTitle",A.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),A.innerHTML="Terrain",r.appendChild(A);let _=document.createElement("div");_.className="cesium-baseLayerPicker-section",_.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(_);let C=document.createElement("div");C.className="cesium-baseLayerPicker-category",_.appendChild(C);let y=document.createElement("div");y.className="cesium-baseLayerPicker-categoryTitle",y.setAttribute("data-bind","text: name"),C.appendChild(y);let E=document.createElement("div");E.className="cesium-baseLayerPicker-choices",E.setAttribute("data-bind","foreach: providers"),C.appendChild(E);let I=document.createElement("div");I.className="cesium-baseLayerPicker-item",I.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),E.appendChild(I);let x=document.createElement("img");x.className="cesium-baseLayerPicker-itemIcon",x.setAttribute("data-bind","attr: { src: iconUrl }"),x.setAttribute("draggable","false"),I.appendChild(x);let S=document.createElement("div");S.className="cesium-baseLayerPicker-itemLabel",S.setAttribute("data-bind","text: name"),I.appendChild(S),xe.applyBindings(n,i),xe.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(w){i.contains(w.target)||r.contains(w.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(l9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});l9.prototype.isDestroyed=function(){return!1};l9.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._element),xe.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),de(this)};var kU=l9;function Vwe(e){let t=e.creationFunction;l(t.canExecute)||(t=Dn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",xe.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(Vwe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var or=Vwe;function pLt(){let e=[],t=devicePixelRatio>=2;return e.push(new or({name:"Bing Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return gg({style:pg.AERIAL})}})),e.push(new or({name:"Bing Maps Aerial with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return gg({style:pg.AERIAL_WITH_LABELS})}})),e.push(new or({name:"Bing Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return gg({style:pg.ROAD})}})),e.push(new or({name:"ArcGIS World Imagery",iconUrl:Zt("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 Ag.fromBasemapType(Wh.SATELLITE,{enablePickFeatures:!1})}})),e.push(new or({name:"ArcGIS World Hillshade",iconUrl:Zt("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 Ag.fromBasemapType(Wh.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new or({name:"Esri World Ocean",iconUrl:Zt("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 Ag.fromBasemapType(Wh.OCEANS,{enablePickFeatures:!1})}})),e.push(new or({name:"Open\xADStreet\xADMap",iconUrl:Zt("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 T_({url:"https://tile.openstreetmap.org/"})}})),e.push(new or({name:"Stadia x Stamen Watercolor",iconUrl:Zt("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 T_({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:Zt("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 T_({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:Zt("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 T_({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:Zt("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 T_({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:Zt("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:Zt("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:Zt("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:Zt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return LC.fromUrl(Zt("Assets/Textures/NaturalEarthII"))}})),e.push(new or({name:"Google Maps Satellite",iconUrl:Zt("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:Zt("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:Zt("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:Zt("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:Zt("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:Zt("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 UU=pLt;function gLt(){let e=[];return e.push(new or({name:"WGS84 Ellipsoid",iconUrl:Zt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new qm({ellipsoid:te.WGS84})}})),e.push(new or({name:"Cesium World Terrain",iconUrl:Zt("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 Z0({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var GU=gLt;function _Lt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Ys&&(e.tileset=n.primitive),e.pickActive=!1}}function Ywe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Ys&&(e.tileset=i.primitive)},Sn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Sn.MOUSE_MOVE),e.picking=e.picking)}var CLt={maximumFractionDigits:3};function zU(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,CLt):Math.round(t).toLocaleString()}function VU(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>${zU(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${zU(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${zU(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function Wwe(){let e=Di.statistics;return`
<ul class="cesium-cesiumInspector-statistics">
<li><strong>Geometry Memory (MB): </strong>${zU(e.geometryByteLength)}</li>
<li><strong>Texture Memory (MB): </strong>${zU(e.texturesByteLength)}</li>
</ul>
`}var yLt=[{text:"Highlight",value:hu.HIGHLIGHT},{text:"Replace",value:hu.REPLACE},{text:"Mix",value:hu.MIX}],Hwe=new G(1,1,0,.4),ELt=new G,u9=new G;function fc(e,t){let n=this,i=e.canvas;this._eventHandler=new Ff(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new A_({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,xe.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=xe.observable({}),this.properties=[],xe.defineProperty(this,"properties",function(){let Q=[],H=n._properties();for(let W in H)H.hasOwnProperty(W)&&Q.push(W);return Q});let o=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(Q){o(Q),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=Q)}}),this.dynamicScreenSpaceError=!1;let r=xe.observable();xe.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(Q){r(Q),l(n._tileset)&&(n._tileset.colorBlendMode=Q,n._scene.requestRender())}}),this.colorBlendMode=hu.HIGHLIGHT;let s=xe.observable(),a=xe.observable();xe.defineProperty(this,"picking",{get:function(){return a()},set:function(Q){a(Q),Q?n._eventHandler.setInputAction(function(H){let W=e.pick(H.endPosition);if(W instanceof Ia?(n.feature=W,n.tile=W.content.tile):l(W)&&l(W.content)?(n.feature=void 0,n.tile=W.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(W)&&l(W.content)){let Z;e.pickPositionSupported&&(Z=e.pickPosition(H.endPosition),l(Z)&&(n._tileset.debugPickPosition=Z)),n._tileset.debugPickedTile=W.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Sn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Sn.MOUSE_MOVE))}}),this.picking=!0;let c=xe.observable();xe.defineProperty(this,"colorize",{get:function(){return c()},set:function(Q){c(Q),l(n._tileset)&&(n._tileset.debugColorizeTiles=Q,n._scene.requestRender())}}),this.colorize=!1;let u=xe.observable();xe.defineProperty(this,"wireframe",{get:function(){return u()},set:function(Q){u(Q),l(n._tileset)&&(n._tileset.debugWireframe=Q,n._scene.requestRender())}}),this.wireframe=!1;let f=xe.observable();xe.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(Q){f(Q),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=Q,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=xe.observable();xe.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(Q){h(Q),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=Q,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let m=xe.observable();xe.defineProperty(this,"showRequestVolumes",{get:function(){return m()},set:function(Q){m(Q),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=Q,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=xe.observable();xe.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(Q){g(Q),l(n._tileset)&&(n._tileset.debugFreezeFrame=Q,n._scene.debugShowFrustumPlanes=Q,n._scene.requestRender())}}),this.freezeFrame=!1,xe.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(Q){s(Q),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=Q,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let A=xe.observable();xe.defineProperty(this,"showGeometricError",{get:function(){return A()},set:function(Q){A(Q),l(n._tileset)&&(n._tileset.debugShowGeometricError=Q,n._scene.requestRender())}}),this.showGeometricError=!1;let _=xe.observable();xe.defineProperty(this,"showRenderingStatistics",{get:function(){return _()},set:function(Q){_(Q),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=Q,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let C=xe.observable();xe.defineProperty(this,"showMemoryUsage",{get:function(){return C()},set:function(Q){C(Q),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=Q,n._scene.requestRender())}}),this.showMemoryUsage=!1;let y=xe.observable();xe.defineProperty(this,"showUrl",{get:function(){return y()},set:function(Q){y(Q),l(n._tileset)&&(n._tileset.debugShowUrl=Q,n._scene.requestRender())}}),this.showUrl=!1;let E=xe.observable();xe.defineProperty(this,"maximumScreenSpaceError",{get:function(){return E()},set:function(Q){Q=Number(Q),isNaN(Q)||(E(Q),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=Q))}}),this.maximumScreenSpaceError=16;let I=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return I()},set:function(Q){Q=Number(Q),isNaN(Q)||(I(Q),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=Q))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,xe.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(I(),1/6)},set:function(Q){let H=Math.pow(Q,6);I(H),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=H)}});let x=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return x()},set:function(Q){Q=Number(Q),isNaN(Q)||(x(Q),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=Q))}}),this.dynamicScreenSpaceErrorFactor=24;let S=_Lt(this),w=xe.observable();xe.defineProperty(this,"pickActive",{get:function(){return w()},set:function(Q){w(Q),Q?n._eventHandler.setInputAction(S,Sn.LEFT_CLICK):n._eventHandler.removeInputAction(Sn.LEFT_CLICK)}});let v=xe.observable();xe.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(Q){v(Q),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=Q)}}),this.pointCloudShading=!1;let P=xe.observable();xe.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(Q){Q=Number(Q),isNaN(Q)||(P(Q),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=Q))}}),this.geometricErrorScale=1;let N=xe.observable();xe.defineProperty(this,"maximumAttenuation",{get:function(){return N()},set:function(Q){Q=Number(Q),isNaN(Q)||(N(Q),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=Q===0?void 0:Q))}}),this.maximumAttenuation=0;let L=xe.observable();xe.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(Q){Q=Number(Q),isNaN(Q)||(L(Q),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=Q===0?void 0:Q))}}),this.baseResolution=0;let p=xe.observable();xe.defineProperty(this,"eyeDomeLighting",{get:function(){return p()},set:function(Q){p(Q),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=Q)}}),this.eyeDomeLighting=!1;let b=xe.observable();xe.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return b()},set:function(Q){Q=Number(Q),isNaN(Q)||(b(Q),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=Q))}}),this.eyeDomeLightingStrength=1;let T=xe.observable();xe.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return T()},set:function(Q){Q=Number(Q),isNaN(Q)||(T(Q),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=Q))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let B=xe.observable();xe.defineProperty(this,"skipLevelOfDetail",{get:function(){return B()},set:function(Q){B(Q),l(n._tileset)&&(n._tileset.skipLevelOfDetail=Q)}}),this.skipLevelOfDetail=!0;let R=xe.observable();xe.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return R()},set:function(Q){Q=Number(Q),isNaN(Q)||(R(Q),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=Q))}}),this.skipScreenSpaceErrorFactor=16;let O=xe.observable();xe.defineProperty(this,"baseScreenSpaceError",{get:function(){return O()},set:function(Q){Q=Number(Q),isNaN(Q)||(O(Q),l(n._tileset)&&(n._tileset.baseScreenSpaceError=Q))}}),this.baseScreenSpaceError=1024;let U=xe.observable();xe.defineProperty(this,"skipLevels",{get:function(){return U()},set:function(Q){Q=Number(Q),isNaN(Q)||(U(Q),l(n._tileset)&&(n._tileset.skipLevels=Q))}}),this.skipLevels=1;let k=xe.observable();xe.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(Q){k(Q),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=Q)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let z=xe.observable();xe.defineProperty(this,"loadSiblings",{get:function(){return z()},set:function(Q){z(Q),l(n._tileset)&&(n._tileset.loadSiblings=Q)}}),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)||Ywe(this,!0)}Object.defineProperties(fc.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 yLt}},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=VU(e,!1),this._pickStatisticsText=VU(e,!0),this._resourceCacheStatisticsText=Wwe(),Ywe(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,ELt):G.WHITE:t.color=u9,this._scene.requestRender()),l(e)&&(G.clone(e.color,u9),e.color=Hwe,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()&&!Ute(t.content)&&(t.color=u9,this._scene.requestRender()),l(e)&&!Ute(e.content)&&(G.clone(e.color,u9),e.color=Hwe,this._scene.requestRender()),this._tile=e}}});function Ute(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(!Ute(t[i]))return!1;return!0}return!1}fc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};fc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};fc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};fc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};fc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};fc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};fc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};fc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};fc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};fc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};fc.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 Mb(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};fc.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,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(`
`);n.value=n.value.slice(0,i)+f+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};fc.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=VU(e,!1),this._pickStatisticsText=VU(e,!0),this._resourceCacheStatisticsText=Wwe())};fc.prototype.isDestroyed=function(){return!1};fc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),de(this)};fc.getStatistics=VU;var HU=fc;function f9(e,t){e=On(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new HU(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=Gu.createSection,c=Gu.createCheckbox,u=Gu.createRangeInput,f=Gu.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),m=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),A=a(s,"Logging","loggingVisible","toggleLogging"),_=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),C=a(s,"Style","styleVisible","toggleStyle"),y=a(s,"Optimization","optimizationVisible","toggleOptimization"),E=document.createElement("div");E.className="field-group";let I=document.createElement("label");I.className="field-label",I.appendChild(document.createTextNode("Properties: "));let x=document.createElement("div");x.setAttribute("data-bind","text: properties"),E.appendChild(I),E.appendChild(x),h.appendChild(E),h.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(f("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),m.appendChild(c("Colorize","colorize"));let S=m.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),w=document.createElement("p");w.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),w.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),w.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",S.appendChild(w),m.appendChild(c("Bounding Volumes","showBoundingVolumes")),m.appendChild(c("Content Volumes","showContentBoundingVolumes")),m.appendChild(c("Request Volumes","showRequestVolumes")),m.appendChild(c("Point Cloud Shading","pointCloudShading"));let v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),v.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),v.appendChild(u("Base Resolution","baseResolution",0,1,.01)),v.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),m.appendChild(v);let P=document.createElement("div");P.setAttribute("data-bind","visible: eyeDomeLighting"),P.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),v.appendChild(P),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let N=document.createElement("div");N.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(N);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(L),A.appendChild(c("Performance","performance")),A.appendChild(i),A.appendChild(c("Statistics","showStatistics"));let p=document.createElement("div");p.className="cesium-3dTilesInspector-statistics",p.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),A.appendChild(p),A.appendChild(c("Pick Statistics","showPickStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),A.appendChild(b),A.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let T=document.createElement("div");T.className="cesium-3dTilesInspector-statistics",T.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),A.appendChild(T);let B=document.createElement("div");C.appendChild(B),B.appendChild(document.createTextNode("Color Blend Mode: "));let R=document.createElement("select");R.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),B.appendChild(R);let O=document.createElement("textarea");O.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),B.className="cesium-cesiumInspector-styleEditor",B.appendChild(O);let U=f("Compile (Ctrl+Enter)","compileStyle");B.appendChild(U);let k=document.createElement("div");k.className="cesium-cesiumInspector-error",k.setAttribute("data-bind","text: editorError"),B.appendChild(k),_.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),_.appendChild(c("Geometric Error","showGeometricError")),_.appendChild(c("Rendering Statistics","showRenderingStatistics")),_.appendChild(c("Memory Usage (MB)","showMemoryUsage")),_.appendChild(c("Url","showUrl")),y.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let z=document.createElement("div");z.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),y.appendChild(z);let Q=document.createElement("div");Q.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),y.appendChild(Q);let H=document.createElement("div");H.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),y.appendChild(H),y.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),y.appendChild(c("Load siblings of visible tiles","loadSiblings")),xe.applyBindings(o,n)}Object.defineProperties(f9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});f9.prototype.isDestroyed=function(){return!1};f9.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var YU=f9;function ILt(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 Gte(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var bLt=new gn,xLt=new d;function WU(e,t){let n=this,i=e.canvas,o=new Ff(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="",xe.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=Dn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Dn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Dn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Dn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=xe.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=xe.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=xe.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new A_({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Dn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=xe.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Dn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new uU({modelMatrix:u}),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=xe.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Dn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=xe.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=xe.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=xe.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Dn(function(){let u=n.depthFrustum+1;return n.depthFrustum=Gte(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Dn(function(){let u=n.depthFrustum-1;return n.depthFrustum=Gte(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=xe.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Dn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new BU({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=xe.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=xe.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Dn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Dn(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=xe.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Dn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=xe.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)});function c(u){let f,h=r.ellipsoid,m=n._scene.camera.getPickRay(u.position,bLt),g=r.pick(m,n._scene,xLt);if(l(g)){let A=h.cartesianToCartographic(g),_=r._surface.tileProvider._tilesToRenderByTextureCount;for(let C=0;!f&&C<_.length;++C){let y=_[C];if(l(y))for(let E=0;!f&&E<y.length;++E){let I=y[E];ce.contains(I.rectangle,A)&&(f=I)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Dn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=xe.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(WU.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 Dn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Dn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Dn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Dn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Dn(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}}});WU.prototype._update=function(){this.frustums&&(this.frustumStatisticText=ILt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Gte(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}`};WU.prototype.isDestroyed=function(){return!1};WU.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(),de(this)};var jU=WU;function d9(e,t){e=On(e);let n=document.createElement("div"),i=new jU(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=Gu.createSection,c=Gu.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(h),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let m=document.createElement("div");m.className="cesium-cesiumInspector-shaderCache",m.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(m);let g=document.createElement("div");u.appendChild(g);let A=document.createElement("span");A.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),g.appendChild(A);let _=document.createElement("span");_.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(_);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 y=document.createElement("input");y.type="button",y.value="+",y.className="cesium-cesiumInspector-pickButton",y.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(y);let E=a(s,"Primitives","primitivesVisible","togglePrimitives"),I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",E.appendChild(I);let x=document.createElement("input");x.type="button",x.value="Pick a primitive",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let S=document.createElement("div");S.className="cesium-cesiumInspector-center",S.appendChild(x),I.appendChild(S),I.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),I.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),I.appendChild(this._primitiveOnly);let w=a(s,"Terrain","terrainVisible","toggleTerrain"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",w.appendChild(v);let P=document.createElement("input");P.type="button",P.value="Pick a tile",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),S=document.createElement("div"),S.appendChild(P),S.className="cesium-cesiumInspector-center",v.appendChild(S);let N=document.createElement("div");v.appendChild(N);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let p=document.createElement("input");p.type="button",p.value="NW",p.className="cesium-cesiumInspector-pickButton",p.setAttribute("data-bind","click: selectNW");let b=document.createElement("input");b.type="button",b.value="NE",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNE");let T=document.createElement("input");T.type="button",T.value="SW",T.className="cesium-cesiumInspector-pickButton",T.setAttribute("data-bind","click: selectSW");let B=document.createElement("input");B.type="button",B.value="SE",B.className="cesium-cesiumInspector-pickButton",B.setAttribute("data-bind","click: selectSE");let R=document.createElement("div");R.className="cesium-cesiumInspector-tileText",N.className="cesium-cesiumInspector-frustumStatistics",N.appendChild(R),N.setAttribute("data-bind","visible: hasPickedTile"),R.setAttribute("data-bind","html: tileText");let O=document.createElement("div");O.className="cesium-cesiumInspector-relativeText",O.textContent="Select relative:",N.appendChild(O);let U=document.createElement("table"),k=document.createElement("tr"),z=document.createElement("tr"),Q=document.createElement("td");Q.appendChild(L);let H=document.createElement("td");H.appendChild(p);let W=document.createElement("td");W.appendChild(b),k.appendChild(Q),k.appendChild(H),k.appendChild(W);let Z=document.createElement("td"),Y=document.createElement("td");Y.appendChild(T);let $=document.createElement("td");$.appendChild(B),z.appendChild(Z),z.appendChild(Y),z.appendChild($),U.appendChild(k),U.appendChild(z),N.appendChild(U),v.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(c("Show only selected","filterTile","hasPickedTile")),w.appendChild(c("Wireframe","wireframe")),w.appendChild(c("Suspend LOD update","suspendUpdates")),w.appendChild(c("Show tile coordinates","tileCoordinates")),xe.applyBindings(i,this._element)}Object.defineProperties(d9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});d9.prototype.isDestroyed=function(){return!1};d9.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var qU=d9;function h9(e,t){l(t)||(t=document.body),t=On(t);let n=this,i=xe.observable(Yr.fullscreen),o=xe.observable(Yr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,xe.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,xe.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Yr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Dn(function(){Yr.fullscreen?Yr.exitFullscreen():Yr.requestFullscreen(n._fullscreenElement)},xe.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=On(e)??r.body,this._callback=function(){i(Yr.fullscreen)},r.addEventListener(Yr.changeEventName,this._callback)}Object.defineProperties(h9.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});h9.prototype.isDestroyed=function(){return!1};h9.prototype.destroy=function(){document.removeEventListener(Yr.changeEventName,this._callback),de(this)};var KU=h9;var TLt="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",SLt="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 A9(e,t){e=On(e);let n=new KU(t,e);n._exitFullScreenPath=SLt,n._enterFullScreenPath=TLt;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),xe.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(A9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});A9.prototype.isDestroyed=function(){return!1};A9.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var JU=A9;var jwe=1e3;function ah(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new K0({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 _e,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=Kwe,this._handleArrowUp=qwe;let t=this;this._suggestionsVisible=xe.pureComputed(function(){let o=xe.getObservable(t,"_suggestions")().length>0,r=xe.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Dn(function(i){if(i=i??Ry.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)RLt(t);else return vLt(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?qwe(t):r?Kwe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;Zwe(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??ah.flyToDestination,this._focusTextbox=!1,xe.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=xe.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){ah._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,xe.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,xe.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,xe.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(ah.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}}});ah.prototype.destroy=function(){this._suggestionSubscription.dispose()};function qwe(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],ah._adjustSuggestionsScroll(e,n)}function Kwe(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],ah._adjustSuggestionsScroll(e,i)}function BLt(e,t){let n=l(t)?t.availability:void 0;return l(n)?$0(t,[e]).then(function(i){return e=i[0],e.height+=jwe,e}):(e.height+=jwe,Promise.resolve(e))}function wLt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ce?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=ce.center(t):a=tb(t,n):t=i.cartesianToCartographic(t),l(a)||(a=BLt(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:M.IDENTITY})})}async function DLt(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 vLt(e,t,n){let i=e._searchText;if(Xwe(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 DLt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Vte(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=Jwe(e,wB.getCreditsFromResult(s[0]));l(a)||zte(e,t[o].credit);return}e._searchText=`${i} (not found)`}function zte(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function Jwe(e,t){return l(t)&&t.forEach(n=>zte(e,n)),t}function Vte(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function PLt(e,t){let n=On(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 RLt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function Xwe(e){return/^\s*$/.test(e)}function Zwe(e){xe.getObservable(e,"_suggestions").removeAll()}async function MLt(e){if(!e.autoComplete)return;let t=e._searchText;if(Zwe(e),Vte(e),!Xwe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Ry.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=wB.getCreditsFromResult(r);o=o&&!l(s),Jwe(e,s)}),o&&zte(e,n.credit)}if(e._suggestions.length>=5)return}}ah.flyToDestination=wLt;ah._updateSearchSuggestions=MLt;ah._adjustSuggestionsScroll=PLt;ah.prototype.isDestroyed=function(){return!1};ah.prototype.destroy=function(){return Vte(this),de(this)};var XU=ah;var NLt="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",LLt="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 m9(e){let t=On(e.container),n=new XU(e);n._startSearchPath=NLt,n._stopSearchPath=LLt;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),xe.applyBindings(n,i),xe.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},zt.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(m9.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});m9.prototype.isDestroyed=function(){return!1};m9.prototype.destroy=function(){let e=this._container;return zt.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(),xe.cleanNode(this._form),xe.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),de(this)};var ZU=m9;function $we(e,t){this._scene=e,this._duration=t;let n=this;this._command=Dn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",xe.track(this,["tooltip"])}Object.defineProperties($we.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 $U=$we;function p9(e,t,n){e=On(e);let i=new $U(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),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(p9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});p9.prototype.isDestroyed=function(){return!1};p9.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var eG=p9;function OLt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function tDe(e,t){xe.track(e);for(let n=0;n<e.sublayers.length;n++)tDe(e.sublayers[n],t)}function g9(e){return e.modelName==="FullModel"}function nDe(e){return e.modelName==="Overview"}function iDe(e){return nDe(e)||g9(e)}function eDe(e,t){if(iDe(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:xe.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function FLt(e,t){if(iDe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");g9(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function QLt(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 kLt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:xe.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:xe.observable(!0),index:-1}],currentLayer:xe.observable(),expandClickHandler:OLt,setOptionDisable:function(i,o){xe.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){FLt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){tDe(n[i],this.viewModel);let o=eDe(n[i],this.viewModel);l(o)&&(nDe(o)||!l(this.viewModel.defaultLayer)&&g9(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=eDe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=g9(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return QLt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var tG=kLt;function ULt(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 tG(t);xe.track(o),xe.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var Hte=ULt;function oDe(){this.showInstructions=!1;let e=this;this._command=Dn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Dn(function(){e._touch=!1}),this._showTouch=Dn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",xe.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(oDe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var nG=oDe;function _9(e){let t=On(e.container),n=new nG,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=Zt("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 u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Zt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);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="${Zt("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="${Zt("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="${Zt("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 m=document.createElement("div");m.className="cesium-touch-navigation-help cesium-navigation-help-instructions",m.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),m.innerHTML=` <table> <tr> <td><img src="${Zt("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="${Zt("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="${Zt("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="${Zt("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(m),xe.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(_9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_9.prototype.isDestroyed=function(){return!1};_9.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var iG=_9;function Yte(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,xe.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Dn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=hU.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(Yte.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Yte.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),de(this)};var oG=Yte;function C9(e){let t=On(e.container),n=new oG(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),xe.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(C9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});C9.prototype.isDestroyed=function(){return!1};C9.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var rG=C9;function y9(e){this._scene=e,this._orthographic=e.camera.frustum instanceof fn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,xe.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;xe.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Dn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new kr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof fn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Dn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Dn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(y9.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}}});y9.prototype.isDestroyed=function(){return!1};y9.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var sG=y9;var GLt="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",zLt="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 E9(e,t){e=On(e);let n=new sG(t);n._perspectivePath=GLt,n._orthographicPath=zLt;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),xe.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(E9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});E9.prototype.isDestroyed=function(){return!1};E9.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var aG=E9;var VLt="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",HLt="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 Wte(){this._cameraClicked=new _e,this._closeClicked=new _e,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",xe.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,xe.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?HLt:VLt}}),xe.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Wte.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Wte.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var cG=Wte;function I9(e){e=On(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 cG;xe.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,u=c.createElement("link");u.href=Zt("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=uc(s,"description",function(h){r.style.height="5px",f.innerHTML=h;let m=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let _=window.getComputedStyle(g);if(_!==null){let C=_["background-color"],y=G.fromCssColorString(C);l(y)&&y.alpha!==0&&(m=_["background-color"])}}t.style["background-color"]=m;let A=f.getBoundingClientRect().height;r.style.height=`${A}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(I9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});I9.prototype.isDestroyed=function(){return!1};I9.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),de(this)};var lG=I9;var YLt=new F,b9="-1000px";function uG(e,t,n){this._scene=e,this._screenPositionX=b9,this._screenPositionY=b9,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,xe.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,xe.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),xe.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return to.worldToWindowCoordinates(e,i,o)}}uG.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,YLt);if(!l(e))this._screenPositionX=b9,this._screenPositionY=b9;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`}}};uG.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:ys.EXPONENTIAL_OUT})};uG.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:ys.EXPONENTIAL_OUT})};Object.defineProperties(uG.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var fG=uG;function x9(e,t){e=On(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 fG(t,this._element,this._container);this._viewModel=c,xe.applyBindings(this._viewModel,this._element)}Object.defineProperties(x9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});x9.prototype.isDestroyed=function(){return!1};x9.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),de(this)};var dG=x9;function T9(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new kr,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",xe.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,xe.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Dn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Dn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Dn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Dn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(T9.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}}});T9.prototype.isDestroyed=function(){return!1};T9.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var hG=T9;var WLt="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",jLt="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",qLt="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 S9(e,t,n){e=On(e);let i=new hG(t,n);i._globePath=WLt,i._flatMapPath=jLt,i._columbusViewPath=qLt;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),xe.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(S9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});S9.prototype.isDestroyed=function(){return!1};S9.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var AG=S9;function Gb(e,t,n){this._color=e,this._height=t,this._base=n??0}Gb.prototype.getHeight=function(){return this._height};Gb.prototype.getBase=function(){return this._base};Gb.prototype.getStartTime=function(){return this._start};Gb.prototype.getStopTime=function(){return this._stop};Gb.prototype.setRange=function(e,t){this._start=e,this._stop=t};Gb.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 mG=Gb;function rDe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new G(.5,.5,.5,1),this.backgroundColor=i||new G(0,0,0,0)}rDe.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 u=J.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new J);!l(a)&&J.greaterThanOrEquals(u,n)?a=s:!l(c)&&J.greaterThanOrEquals(u,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 pG=rDe;var jte=1e12,ch={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Zl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},eE=[.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],KLt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function $l(e,t){e=On(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=ch.none,this._touchMode=Zl.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=JLt(this),this._onMouseUp=XLt(this),this._onMouseMove=ZLt(this),this._onMouseWheel=$Lt(this),this._onTouchStart=eOt(this),this._onTouchMove=nOt(this),this._onTouchEnd=tOt(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()}$l.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};$l.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};$l.prototype.isDestroyed=function(){return!1};$l.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),de(this)};$l.prototype.addHighlightRange=function(e,t,n){let i=new mG(e,t,n);return this._highlightRanges.push(i),this.resize(),i};$l.prototype.addTrack=function(e,t,n,i){let o=new pG(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};$l.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=J.secondsDifference(t,e),this._clock&&this._clock.clockRange!==_s.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)};$l.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 qte(e){return e<10?`0${e.toString()}`:e.toString()}$l.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`${KLt[t.month-1]} ${t.day} ${t.year} ${qte(t.hour)}:${qte(t.minute)}:${qte(t.second)}${i}`};$l.prototype.smallestTicInPixels=7;$l.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,u=1e-10,f=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 m=this._timeBarEle.clientWidth;m<10&&(m=10);let g=this._startJulian,A=Math.min(h/m*1e-5,.4),_,C=J.toGregorianDate(g);h>31536e4?_=J.fromDate(new Date(Date.UTC(Math.floor(C.year/100)*100,0))):h>31536e3?_=J.fromDate(new Date(Date.UTC(Math.floor(C.year/10)*10,0))):h>86400?_=J.fromDate(new Date(Date.UTC(C.year,0))):_=J.fromDate(new Date(Date.UTC(C.year,C.month,C.day)));let y=J.secondsDifference(this._startJulian,J.addSeconds(_,A,new J)),E=y+h;this._epochJulian=_;function I(Q){return Math.floor(y/Q)*Q}function x(Q,H){return Math.ceil(Q/H+.5)*H}function S(Q){return(Q-y)/h}function w(Q,H){return Q-H*Math.round(Q/H)}this._rulerEle.innerHTML=this.makeLabel(J.addSeconds(this._endJulian,-a,new J));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let P=f;f-=u;let N={startTime:y,startJulian:g,epochJulian:_,duration:h,timeBarWidth:m,getAlpha:S};this._highlightRanges.forEach(function(Q){s+=Q.render(N)});let L=0,p=0,b=0,T=v/m;T>1&&(T=1),T*=this._timeBarSecondsSpan;let B=-1,R=-1,O=eE.length,U;for(U=0;U<O;++U){let Q=eE[U];if(++B,L=Q,Q>T&&Q>f)break;R<0&&m*(Q/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(R=B)}if(B>0){for(;B>0;)if(--B,Math.abs(w(L,eE[B]))<1e-5){eE[B]>=f&&(p=eE[B]);break}if(R>=0)for(;R<B;){if(Math.abs(w(p,eE[R]))<1e-5&&eE[R]>=f){b=eE[R];break}++R}}f=P,f>u&&b<1e-5&&Math.abs(f-L)>u&&(b=f,f<=L+u&&(p=0));let k=-999999,z;if(m*(b/this._timeBarSecondsSpan)>=3)for(o=I(b);o<=E;o=x(o,b))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(m*S(o)).toString()}px;"></span>`;if(m*(p/this._timeBarSecondsSpan)>=3)for(o=I(p);o<=E;o=x(o,p))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(m*S(o)).toString()}px;"></span>`;if(m*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,E+=L,o=I(L);let Q=J.computeTaiMinusUtc(_);for(;o<=E;){let H=J.addSeconds(g,o-y,new J);if(L>2.1){let $=J.computeTaiMinusUtc(H);Math.abs($-Q)>.1&&(o+=$-Q,H=J.addSeconds(g,o-y,new J))}let W=Math.round(m*S(o)),Z=this.makeLabel(H);this._rulerEle.innerHTML=Z,z=this._rulerEle.offsetWidth,z<10&&(z=v);let Y=W-(z/2-1);Y>k?(k=Y+z+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${W.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${Y.toString()}px;">${Z}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${W.toString()}px;"></span>`,o=x(o,L)}}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),N.y=0,this._trackList.forEach(function(Q){Q.render(r._context,N),N.y+=Q.height})};$l.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)))};$l.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 JLt(e){return function(t){e._mouseMode!==ch.touchOnly&&(t.button===0?(e._mouseMode=ch.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=ch.zoom:e._mouseMode=ch.slide)),t.preventDefault()}}function XLt(e){return function(t){e._mouseMode=ch.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function ZLt(e){return function(t){let n;if(e._mouseMode===ch.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===ch.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===ch.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function $Lt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;jte=Math.max(Math.min(Math.abs(n),jte),1),n/=jte,e.zoomFrom(Math.pow(1.05,-n))}}function eOt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=ch.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=Zl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Zl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Zl.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=Zl.ignore}}function tOt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Zl.singleTap?(e._touchMode=Zl.scrub,e._onTouchMove(t)):e._touchMode===Zl.scrub&&e._onTouchMove(t),e._mouseMode=ch.touchOnly,n!==1?e._touchMode=n>0?Zl.ignore:Zl.none:e._touchMode===Zl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function nOt(e){return function(t){let n,i,o,r,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Zl.singleTap&&(e._touchMode=Zl.slideZoom),e._mouseMode=ch.touchOnly,e._touchMode===Zl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Zl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,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))}}$l.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 gG=$l;var aDe=mr(sDe(),1);function iOt(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 cDe(){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 oOt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(cDe(),e._locked=!1),e._noSleep.disable(),Yr.exitFullscreen(),n(!1)):(Yr.fullscreen||Yr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=iOt("landscape")),t.useWebVR=!0,n(!0)))}function B9(e,t){let n=this,i=xe.observable(Yr.enabled),o=xe.observable(!1);this.isVRMode=void 0,xe.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,xe.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Yr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=xe.observable(!1);this._isOrthographic=void 0,xe.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new kr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof fn)}),this._locked=!1,this._noSleep=new aDe.default,this._command=Dn(function(){oOt(n,e,o,r)},xe.getObservable(this,"isVREnabled")),this._vrElement=On(t)??document.body,this._callback=function(){!Yr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(cDe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Yr.changeEventName,this._callback)}Object.defineProperties(B9.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});B9.prototype.isDestroyed=function(){return!1};B9.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Yr.changeEventName,this._callback),de(this)};var CG=B9;var rOt="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",sOt="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 w9(e,t,n){e=On(e);let i=new CG(t,n);i._exitVRPath=sOt,i._enterVRPath=rOt;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),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(w9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});w9.prototype.isDestroyed=function(){return!1};w9.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var yG=w9;var lDe=new le;function dDe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function aOt(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 cOt(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 uDe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof Er)return i;if(n instanceof Ia)return new Er({name:cOt(n),description:aOt(n),feature:n})}if(l(e.scene.globe))return fOt(e,t.position)}var lOt=new J;function Jte(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,D.EPSILON2,lOt)),e.updateFromClock(),e.zoomTo(i,o)}}}var uOt=new d;function fOt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new Er({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=fDe();return}let a=s[0],c=new Er({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,uOt);c.position=new El(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=fDe())}),r}function fDe(){return new Er({id:"None",description:"No features found."})}function dOt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,h=e._selectionIndicator,m=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=m),l(i)&&(i.container.style.visibility=m),l(o)&&(o.container.style.visibility=m),l(r)&&(r.container.style.visibility=m),l(s)&&(s.container.style.visibility=m),l(a)&&(a.container.style.visibility=m),l(c)&&(c.container.style.visibility=m),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=m),l(f)&&(f.container.style.visibility=m),l(h)&&(h.container.style.visibility=m),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function ho(e,t){e=On(e),t=t??V.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,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new lA,u=new MU(c),f=!0);let h=new iU(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}),m=h.scene,g=new kr;g.add(c.onTick,ho.prototype._onTick,this);let A;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let H=document.createElement("div");H.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(H),A=new dG(H,m)}let _;if(!l(t.infoBox)||t.infoBox!==!1){let H=document.createElement("div");H.className="cesium-viewer-infoBoxContainer",o.appendChild(H),_=new lG(H);let W=_.viewModel;g.add(W.cameraClicked,ho.prototype._onInfoBoxCameraClicked,this),g.add(W.closeClicked,ho.prototype._onInfoBoxClockClicked,this)}let C=document.createElement("div");C.className="cesium-viewer-toolbar",o.appendChild(C);let y;if(!l(t.geocoder)||t.geocoder!==!1){let H=document.createElement("div");H.className="cesium-viewer-geocoderContainer",C.appendChild(H);let W;typeof t.geocoder=="string"?W=[new K0({scene:m,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(W=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),y=new ZU({container:H,geocoderServices:W,scene:m}),g.add(y.viewModel.search.beforeExecute,ho.prototype._clearObjects,this)}let E;(!l(t.homeButton)||t.homeButton!==!1)&&(E=new eG(C,m),l(y)&&g.add(E.viewModel.command.afterExecute,function(){let H=y.viewModel;H.searchText="",H.isSearchInProgress&&H.search()}),g.add(E.viewModel.command.beforeExecute,ho.prototype._clearTrackedObject,this));let I;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(I=new AG(C,m));let x;t.projectionPicker&&(x=new aG(C,m));let S,w;if(n){let H=t.imageryProviderViewModels??UU(),W=t.terrainProviderViewModels??GU();S=new kU(C,{globe:m.globe,imageryProviderViewModels:H,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:W,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),w=C.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(S.viewModel.selectedImagery=void 0),m.imageryLayers.removeAll(),m.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(S.viewModel.selectedTerrain=void 0),m.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(m.globe.depthTestAgainstTerrain=!0),m.setTerrain(t.terrain));let v;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let H=!0;try{if(l(window.localStorage)){let W=window.localStorage.getItem("cesium-hasSeenNavHelp");l(W)&&W?H=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}v=new iG({container:C,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??H})}let P;if(!l(t.animation)||t.animation!==!1){let H=document.createElement("div");H.className="cesium-viewer-animationContainer",o.appendChild(H),P=new OU(H,new FU(u))}let N;if(!l(t.timeline)||t.timeline!==!1){let H=document.createElement("div");H.className="cesium-viewer-timelineContainer",o.appendChild(H),N=new gG(H,c),N.addEventListener("settime",dDe,!1),N.zoomTo(c.startTime,c.stopTime)}let L,p,b;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(b=document.createElement("div"),b.className="cesium-viewer-fullscreenContainer",o.appendChild(b),L=new JU(b,t.fullscreenElement),p=uc(L.viewModel,"isFullscreenEnabled",function(H){b.style.display=H?"block":"none",l(N)&&(N.container.style.right=`${b.clientWidth}px`,N.resize())}));let T,B,R;if(t.vrButton){let H=document.createElement("div");H.className="cesium-viewer-vrContainer",o.appendChild(H),T=new yG(H,m,t.fullScreenElement),B=uc(T.viewModel,"isVREnabled",function(W){H.style.display=W?"block":"none",l(L)&&(H.style.right=`${b.clientWidth}px`),l(N)&&(N.container.style.right=`${H.clientWidth}px`,N.resize())}),R=uc(T.viewModel,"isVRMode",function(W){dOt(i,W)})}this._baseLayerPickerDropDown=w,this._fullscreenSubscription=p,this._vrSubscription=B,this._vrModeSubscription=R,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=A,this._infoBox=_,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=C,this._homeButton=E,this._sceneModePicker=I,this._projectionPicker=x,this._baseLayerPicker=S,this._navigationHelpButton=v,this._animation=P,this._timeline=N,this._fullscreenButton=L,this._vrButton=T,this._geocoder=y,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(_)||l(A),this._selectedEntity=void 0,this._selectedEntityChanged=new _e;let O=this._cesiumWidget.dataSources,U=this._cesiumWidget.dataSourceDisplay;g.add(O.dataSourceAdded,ho.prototype._onDataSourceAdded,this),g.add(O.dataSourceRemoved,ho.prototype._onDataSourceRemoved,this),g.add(m.postUpdate,ho.prototype.resize,this);let k=O.length;for(let H=0;H<k;H++)this._dataSourceAdded(O,O.get(H));this._dataSourceAdded(void 0,U.defaultDataSource),g.add(O.dataSourceAdded,ho.prototype._dataSourceAdded,this),g.add(O.dataSourceRemoved,ho.prototype._dataSourceRemoved,this);function z(H){let W=uDe(i,H);l(W)?j.getValueOrUndefined(W.position,i.clock.currentTime)?i.trackedEntity=W:i.zoomTo(W):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function Q(H){i.selectedEntity=uDe(i,H)}h.screenSpaceEventHandler.setInputAction(Q,Sn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(z,Sn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(ho.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,Jte(this._timeline,e))}}});ho.prototype.extend=function(e,t){e(this,t)};ho.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 A=this._geocoder.searchSuggestionsContainer;A.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,h=5,m=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let A=this._lastWidth;u=this._animation.container,n>900?(f=169,A<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(A<600||A>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(A>600||A===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let A=this._fullscreenButton,_=this._vrButton,C=c.container,y=C.style;m=C.clientHeight+3,y.left=`${f}px`;let E=0;l(A)&&(E+=A.container.clientWidth),l(_)&&(E+=_.container.clientWidth),y.right=`${E}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${m}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};ho.prototype.forceResize=function(){this._lastWidth=0,this.resize()};ho.prototype.render=function(){this._cesiumWidget.render()};ho.prototype.isDestroyed=function(){return!1};ho.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Sn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Sn.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",dDe,!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(),de(this)};ho.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(ho.prototype._onEntityCollectionChanged,this)};ho.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(ho.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};ho.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};ho.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,lDe)!==mt.FAILED?n=lDe.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=d.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=j.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};ho.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)}};ho.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)}};ho.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};ho.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};ho.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};ho.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Jte(this.timeline,e)};ho.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Jte(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,ho.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};ho.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};ho.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};ho.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var Xte=ho;function hOt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new YU(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var Zte=hOt;function AOt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new qU(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var $te=AOt;function mOt(e,t){t=t??V.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new _e,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=On(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){hDe(s,u),s=f,ene(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?ene(s,u):hDe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){zb(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=f.dataTransfer.files,m=h.length;for(let g=0;g<m;g++){let A=h[g],_=new FileReader;_.onload=pOt(e,A,c,a),_.onerror=gOt(e,A),_.readAsText(A)}}ene(s,u),e.destroy=T2(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function zb(e){e.stopPropagation(),e.preventDefault()}function hDe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",zb,!1),n.removeEventListener("dragover",zb,!1),n.removeEventListener("dragexit",zb,!1))}function ene(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",zb,!1),e.addEventListener("dragover",zb,!1),e.addEventListener("dragexit",zb,!1)}function pOt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=AF.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=Ay.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=Q0.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=dQ.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 gOt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var tne=mOt;function _Ot(e,t){t=t??V.EMPTY_OBJECT;let n=new rG({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var nne=_Ot;function ADe(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 lh(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(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=xe.observable();return xe.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}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=ADe(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===lc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===lc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===lc.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:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:D.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:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:D.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:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:D.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:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:D.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:-D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:D.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:-D.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:D.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&&cp(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&cp(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&cp(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&cp(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&cp(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&cp(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&cp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&cp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&cp(t)}})}var COt=new d,yOt=new d,EOt=new hc,IOt=new X;function cp(e){let t=d.fromElements(e.translationX,e.translationY,e.translationZ,COt),n=d.fromElements(e.scaleX,e.scaleY,e.scaleZ,yOt),i=EOt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=X.fromHeadingPitchRoll(i,IOt),r=X.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(lh.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=ADe(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,cp(t)}}});lh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};lh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};lh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};lh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};lh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};lh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};lh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new xb({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};lh.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,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(`
`);n.value=n.value.slice(0,i)+f+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};lh.prototype.isDestroyed=function(){return!1};lh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),de(this)};var EG=lh;function D9(e,t){e=On(e);let n=document.createElement("div"),i=new EG(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:u}=Gu,f=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),m=s(r,"Clipping","clippingVisible","toggleClipping"),g=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let A=10,_=10,C=D.PI;h.appendChild(c("Translation X","translationX",-A,+A)),h.appendChild(c("Translation Y","translationY",-A,+A)),h.appendChild(c("Translation Z","translationZ",-A,+A)),h.appendChild(c("Scale X","scaleX",0,+_)),h.appendChild(c("Scale Y","scaleY",0,+_)),h.appendChild(c("Scale Z","scaleZ",0,+_)),h.appendChild(c("Heading","angleX",-C,+C)),h.appendChild(c("Pitch","angleY",-C,+C)),h.appendChild(c("Roll","angleZ",-C,+C)),ine("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",m),ine("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",m),ine("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",m);let y=document.createElement("div");g.appendChild(y);let E=document.createElement("textarea");E.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),y.className="cesium-cesiumInspector-styleEditor",y.appendChild(E);let I=u("Compile (Ctrl+Enter)","compileShader");y.appendChild(I);let x=document.createElement("label");x.style.display="block",x.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),y.appendChild(x),xe.applyBindings(i,n)}Object.defineProperties(D9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});D9.prototype.isDestroyed=function(){return!1};D9.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};function ine(e,t,n,i,o,r,s,a,c,u,f,h,m,g){let A=Gu.createRangeInputWithDynamicMinMax,_=g.appendChild(document.createElement("div"));_.setAttribute("data-bind",`if: ${m}`),_.appendChild(A(e,s)),_.appendChild(A(t,a)),_.appendChild(A(n,c)),_.appendChild(A(i,u)),_.appendChild(A(o,f)),_.appendChild(A(r,h))}var IG=D9;function bOt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new IG(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var one=bOt;globalThis.CESIUM_VERSION="1.136.0";var xOt="1.136.0";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,Azure2DImageryProvider,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardLoadState,BillboardTexture,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,CartesianRectangle,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesTerrainData,Cesium3DTilesTerrainGeometryProcessor,Cesium3DTilesTerrainProvider,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EdgeDetectionPipelineStage,EdgeFramebuffer,EdgeVisibilityPipelineStage,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,Frozen,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GaussianSplat3DTileContent,GaussianSplatPrimitive,GaussianSplatRenderResources,GaussianSplatSorter,GaussianSplatTextureGenerator,GeoJsonDataSource,GeoJsonLoader,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfSpzLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,Google2DImageryProvider,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryConfiguration,ImageryCoverage,ImageryFlags,ImageryInput,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryPipelineStage,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonImageryProviderFactory,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,MappedPositions,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelImagery,ModelImageryMapping,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelPrimitiveImagery,ModelReader,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,SharedContext,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,Sync,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainPicker,TerrainProvider,TerrainQuantization,TerrainState,Texture,Texture3D,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TexturePacker,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoundsCollection,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelMetadataOrder,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersEdgeDetectionStageFS,_shadersEdgeVisibilityStageFS,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersectPlane,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolygonSignedDistanceFS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveGaussianSplatFS,_shadersPrimitiveGaussianSplatVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shadersclipPolygons,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shadersconvertLocalToBoxUv,_shadersconvertLocalToCylinderUv,_shadersconvertLocalToEllipsoidUv,_shaderscosineAndSine,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassCesium3DTileEdges,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGaussianSplats,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackClippingExtents,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addAllToArray,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,barycentricCoordinates,binarySearch,buildModuleUrl,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMeshPrimitives,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas});